diff --git a/src/main/java/tconstruct/armor/ArmorAbilities.java b/src/main/java/tconstruct/armor/ArmorAbilities.java index 58ad71a5..419932a8 100644 --- a/src/main/java/tconstruct/armor/ArmorAbilities.java +++ b/src/main/java/tconstruct/armor/ArmorAbilities.java @@ -3,6 +3,7 @@ package tconstruct.armor; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import tconstruct.armor.items.TravelGear; import tconstruct.armor.player.TPlayerStats; import tconstruct.library.modifier.IModifyable; import cpw.mods.fml.common.Loader; @@ -15,11 +16,16 @@ public class ArmorAbilities boolean morphed; boolean morphLoaded = Loader.isModLoaded("Morph"); + ItemStack prevFeet; + double prevMotionY; + @SubscribeEvent public void playerTick (TickEvent.PlayerTickEvent event) { EntityPlayer player = event.player; TPlayerStats stats = TPlayerStats.get(player); + + // Wall climb if (stats.climbWalls) { double motionX = player.posX - player.lastTickPosX; @@ -30,6 +36,31 @@ public class ArmorAbilities player.fallDistance = 0.0F; } } + + //Feet changes + ItemStack feet = player.getCurrentArmor(0); + if (feet != null) + { + if (feet.getItem() instanceof IModifyable && !player.isSneaking()) + { + NBTTagCompound tag = feet.getTagCompound().getCompoundTag(((IModifyable) feet.getItem()).getBaseTagName()); + int sole = tag.getInteger("Slimy Soles"); + if (sole > 0) + { + if (!player.isSneaking() && player.onGround && prevMotionY < -0.4) + player.motionY = -prevMotionY * (Math.min(0.99, sole * 0.2)); + } + } + prevMotionY = player.motionY; + } + if (feet != prevFeet) + { + if (prevFeet != null && prevFeet.getItem() instanceof TravelGear) + player.stepHeight -= 0.6f; + if (feet != null && feet.getItem() instanceof TravelGear) + player.stepHeight += 0.6f; + prevFeet = feet; + } //TODO: Proper minimap support /*ItemStack stack = player.inventory.getStackInSlot(8); if (stack != null && stack.getItem() instanceof ItemMap) diff --git a/src/main/java/tconstruct/armor/ArmorAbilitiesClient.java b/src/main/java/tconstruct/armor/ArmorAbilitiesClient.java index 53e9bbb0..22fcab05 100644 --- a/src/main/java/tconstruct/armor/ArmorAbilitiesClient.java +++ b/src/main/java/tconstruct/armor/ArmorAbilitiesClient.java @@ -43,8 +43,8 @@ public class ArmorAbilitiesClient player.fallDistance = 0.0f; } - //Feet changes - ItemStack feet = player.getCurrentArmor(0); + //Feet changes - moved to server side + /*ItemStack feet = player.getCurrentArmor(0); if (feet != null) { if (feet.getItem() instanceof TravelGear && player.stepHeight < 1.0f) @@ -70,7 +70,7 @@ public class ArmorAbilitiesClient if (feet != null && feet.getItem() instanceof TravelGear) player.stepHeight += 0.6f; prevFeet = feet; - } + }*/ //Legs or wing changes /*ItemStack legs = player.getCurrentArmor(1); diff --git a/src/main/java/tconstruct/armor/TinkerArmor.java b/src/main/java/tconstruct/armor/TinkerArmor.java index 24f38c31..b589f59a 100644 --- a/src/main/java/tconstruct/armor/TinkerArmor.java +++ b/src/main/java/tconstruct/armor/TinkerArmor.java @@ -160,6 +160,7 @@ public class TinkerArmor public void init (FMLInitializationEvent event) { craftingTableRecipes(); + registerModifiers(); addRecipesForDryingRack(); TConstructRegistry.equipableTab.init(travelGoggles.getDefaultItem()); proxy.initialize();