diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java index 1d94fad25..58f57116e 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java @@ -26,6 +26,7 @@ public class ItemAuraRing extends ItemBauble { @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { + super.onWornTick(stack, player); if(player instanceof EntityPlayer && player.worldObj.getTotalWorldTime() % 2 == 0) ManaItemHandler.dispatchManaExact(stack, (EntityPlayer) player, 1, true); } diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBauble.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBauble.java index 37f194070..a0485c656 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBauble.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBauble.java @@ -90,10 +90,21 @@ public abstract class ItemBauble extends ItemMod implements IBauble { return true; } + @Override + public void onWornTick(ItemStack stack, EntityLivingBase player) { + if(player.ticksExisted == 1) + onEquippedOrLoadedIntoWorld(stack, player); + } + @Override public void onEquipped(ItemStack stack, EntityLivingBase player) { if(!player.worldObj.isRemote) player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1.3F); + onEquippedOrLoadedIntoWorld(stack, player); + } + + public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { + // NO-OP } @Override @@ -101,9 +112,4 @@ public abstract class ItemBauble extends ItemMod implements IBauble { // NO-OP } - @Override - public void onWornTick(ItemStack stack, EntityLivingBase player) { - // NO-OP - } - } diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGreaterAuraRing.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGreaterAuraRing.java index 1f61e49c8..bc941cf43 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGreaterAuraRing.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGreaterAuraRing.java @@ -26,6 +26,7 @@ public class ItemGreaterAuraRing extends ItemBauble { @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { + super.onWornTick(stack, player); if(player instanceof EntityPlayer) ManaItemHandler.dispatchManaExact(stack, (EntityPlayer) player, player.worldObj.getTotalWorldTime() % 3 == 0 ? 2 : 1, true); } diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java index ebcea8890..c4372bd28 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java @@ -39,6 +39,7 @@ public class ItemTinyPlanet extends ItemBauble { @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { + super.onWornTick(stack, player); int range = 8; List entities = player.worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); for(Entity entity : entities) { diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java index 5788d2d9a..d4e07a47c 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java @@ -11,19 +11,64 @@ */ package vazkii.botania.common.item.equipment.bauble; -import vazkii.botania.common.lib.LibItemNames; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import vazkii.botania.common.lib.LibItemNames; import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ItemTravelBelt extends ItemBauble { public ItemTravelBelt() { super(LibItemNames.TRAVEL_BELT); + MinecraftForge.EVENT_BUS.register(this); } @Override public BaubleType getBaubleType(ItemStack itemstack) { return BaubleType.BELT; } + + @Override + public void onWornTick(ItemStack stack, EntityLivingBase entity) { + super.onWornTick(stack, entity); + if(entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) + player.moveFlying(0F, 1F, player.capabilities.isFlying ? 0.035F : 0.07F); + + if(player.isSneaking()) + player.stepHeight = 0.50001F; // Not 0.5F because that is the default + else if(player.stepHeight == 0.50001F) + player.stepHeight = 1F; + } + } + + @SubscribeEvent + public void onPlayerJump(LivingJumpEvent event) { + if(event.entityLiving instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entityLiving; + ItemStack belt = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); + + if(belt != null && belt.getItem() == this) { + player.motionY += 0.2; + player.fallDistance = -1F; + } + } + } + + @Override + public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { + player.stepHeight = 1F; + } + + @Override + public void onUnequipped(ItemStack stack, EntityLivingBase player) { + player.stepHeight = 0.5F; + } } diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 572aae588..11541d7b2 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -710,7 +710,7 @@ botania.page.auraRing2=Upgrading the ring # -- SOUJOURNER'S SASH botania.entry.travelBelt=Soujourner's Sash -botania.page.travelBelt0=(todo) +botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer.
Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. botania.page.travelBelt1=...everell # - MISCLANEOUS diff --git a/resources/assets/botania/textures/items/sojournersstrap_test.png b/resources/assets/botania/textures/items/sojournersstrap_test.png deleted file mode 100644 index 1607ef55c..000000000 Binary files a/resources/assets/botania/textures/items/sojournersstrap_test.png and /dev/null differ diff --git a/resources/assets/botania/textures/items/travelBelt.png b/resources/assets/botania/textures/items/travelBelt.png index 2bc277db2..1607ef55c 100644 Binary files a/resources/assets/botania/textures/items/travelBelt.png and b/resources/assets/botania/textures/items/travelBelt.png differ