diff options
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Proxy.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 3341721cc2..6130be6af7 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;
@@ -1188,6 +1192,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) {
@@ -1263,7 +1276,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.setGameType(GameType.ADVENTURE);
aEvent.player.capabilities.allowEdit = false;
if (this.mAxeWhenAdventure) {
- GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this.");
+ GT_Utility.sendChatToPlayer(aEvent.player, GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_097", "It's dangerous to go alone! Take this.", false));
aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY,
aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null)));
}
@@ -1790,7 +1803,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return new int[]{LOADED,0,-1,-1};
}
-
@SubscribeEvent
public void handleChunkSaveEvent(ChunkDataEvent.Save event) {//ALWAYS SAVE FROM THE HASH MAP DATA
HashMap<ChunkCoordIntPair,int []> chunkData=dimensionWiseChunkData.get(event.world.provider.dimensionId);
|