Skip to content

Commit

Permalink
Version 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
misterplus committed Mar 8, 2020
1 parent 7802158 commit c76a1ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.init.Blocks;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.Loader;
Expand All @@ -34,15 +35,17 @@ public static void onPortalSpawnEvent(BlockEvent.PortalSpawnEvent event) {
@SuppressWarnings("deprecation")
@SubscribeEvent
public static void onRightClickBlock(PlayerInteractEvent.RightClickBlock event) {
if (Loader.isModLoaded("torcherino") && dangerousSettings.disableTorcherino) {
if (Loader.isModLoaded("torcherino") && dangerousSettings.disableTorcherino && !event.getWorld().isRemote) {
IBlockState state = event.getWorld().getBlockState(event.getPos());
Block block = state.getBlock();
if (block instanceof BlockLanterino) {
event.getWorld().setBlockState(event.getPos(), Blocks.LIT_PUMPKIN.getStateFromMeta(block.getMetaFromState(state)));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("message.plustweaks.torcherino"));
event.setCanceled(true);
}
else if (block instanceof BlockTorcherino) {
event.getWorld().setBlockState(event.getPos(), Blocks.TORCH.getStateFromMeta(block.getMetaFromState(state)));
event.getEntityPlayer().sendMessage(new TextComponentTranslation("message.plustweaks.torcherino"));
event.setCanceled(true);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/plustweaks/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message.plustweaks.torcherino=Opps, you broke it
1 change: 1 addition & 0 deletions src/main/resources/assets/plustweaks/lang/zh_cn.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message.plustweaks.torcherino=¿

0 comments on commit c76a1ca

Please sign in to comment.