From a7fcfbd2d006c81342d82ccd3d6f4203658d870c Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Mon, 16 Jul 2018 16:05:13 -0700 Subject: [PATCH] Laputa Array should not be able to move unbreakable blocks (#1360) --- .../bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java index 0a4dcbe5..ce64e7f3 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java @@ -2,6 +2,7 @@ package WayofTime.bloodmagic.alchemyArray; import java.util.Random; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -83,9 +84,10 @@ public class AlchemyArrayEffectLaputa extends AlchemyArrayEffect { BlockPos newPos = pos.add(i, j, k); BlockPos offsetPos = newPos.up(teleportHeightOffset); + IBlockState state = world.getBlockState(newPos); TeleposeEvent event = new TeleposeEvent(world, newPos, world, offsetPos); - if (Utils.swapLocations(event.initalWorld, event.initialBlockPos, event.finalWorld, event.finalBlockPos) && !MinecraftForge.EVENT_BUS.post(event)) + if (state.getBlockHardness(world, newPos) > 0 && !MinecraftForge.EVENT_BUS.post(event) && Utils.swapLocations(event.initalWorld, event.initialBlockPos, event.finalWorld, event.finalBlockPos)) { k++; this.currentPos = new BlockPos(i, j, k);