Soujourner's Strap effect, some changes to base bauble code for it to work propperly too.

This commit is contained in:
Vasco Lavos committed 2014-04-25 22:41:51 +01:00
1 parent 87ef3d9599
commit ec49003ca5
8 files changed
+61 -7

No files matched your search

@@ -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);
}
@@ -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
}
}
@@ -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);
}
@@ -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<Entity> 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) {
@@ -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;
}
}
+1 -1
View File
@@ -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.<br>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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 542 B