diff options
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Proxy.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index fa425d5b5c..bba3c16f31 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -11,6 +11,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.IBlockOnWalkOver; import gregtech.api.interfaces.IProjectileItem; import gregtech.api.interfaces.internal.IGT_Mod; import gregtech.api.interfaces.internal.IThaumcraftCompat; @@ -25,6 +26,7 @@ import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.armor.ModularArmor_Item; import gregtech.common.items.armor.gui.*; +import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -45,6 +47,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; @@ -53,6 +56,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; import net.minecraftforge.event.entity.player.PlayerEvent; @@ -1197,6 +1201,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { e.printStackTrace(GT_Log.err); } } + + @SubscribeEvent + public void onLivingUpdate(LivingUpdateEvent aEvent) { + if (aEvent.entityLiving.onGround) { + int tX = MathHelper.floor_double(aEvent.entityLiving.posX), tY = MathHelper.floor_double(aEvent.entityLiving.boundingBox.minY-0.001F), tZ = MathHelper.floor_double(aEvent.entityLiving.posZ); + Block tBlock = aEvent.entityLiving.worldObj.getBlock(tX, tY, tZ); + if (tBlock instanceof IBlockOnWalkOver) ((IBlockOnWalkOver)tBlock).onWalkOver(aEvent.entityLiving, aEvent.entityLiving.worldObj, tX, tY, tZ); + } + } @SubscribeEvent public void onFluidContainerRegistration(FluidContainerRegistry.FluidContainerRegisterEvent aFluidEvent) { |