mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-23 21:49:50 +00:00
Fixed the Rod of the Skies being able to be used for earlygame infinite flight by item switching
This commit is contained in:
1 parent
aaf540127f
commit
d81839e909
1 file changed
+11
-11
@@ -56,7 +56,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean holding) {
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
ItemStack itemInUse = player.getCurrentEquippedItem();
|
||||
@@ -65,23 +65,23 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
if(damaged && !isFlying(par1ItemStack))
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
|
||||
if(itemInUse != par1ItemStack)
|
||||
int max = FALL_MULTIPLIER * FLY_TIME;
|
||||
if(par1ItemStack.getItemDamage() >= max) {
|
||||
setFlying(par1ItemStack, false);
|
||||
else {
|
||||
int max = FALL_MULTIPLIER * FLY_TIME;
|
||||
if(par1ItemStack.getItemDamage() >= max) {
|
||||
setFlying(par1ItemStack, false);
|
||||
player.stopUsingItem();
|
||||
} else if(isFlying(par1ItemStack)) {
|
||||
player.stopUsingItem();
|
||||
} else if(isFlying(par1ItemStack)) {
|
||||
if(holding) {
|
||||
player.fallDistance = 0F;
|
||||
player.motionY = IManaProficiencyArmor.Helper.hasProficiency(player) ? 1.6 : 1.25;
|
||||
par1ItemStack.setItemDamage(Math.min(max, par1ItemStack.getItemDamage() + FALL_MULTIPLIER));
|
||||
if(par1ItemStack.getItemDamage() == MAX_DAMAGE)
|
||||
setFlying(par1ItemStack, false);
|
||||
|
||||
player.worldObj.playSoundAtEntity(player, "botania:airRod", 0.1F, 0.25F);
|
||||
for(int i = 0; i < 5; i++)
|
||||
Botania.proxy.wispFX(player.worldObj, player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(Math.min(max, par1ItemStack.getItemDamage() + FALL_MULTIPLIER));
|
||||
if(par1ItemStack.getItemDamage() == MAX_DAMAGE)
|
||||
setFlying(par1ItemStack, false);
|
||||
}
|
||||
|
||||
if(damaged)
|
||||
|
||||
Reference in new issue
Block a user