From 0585e703dc94f136dbb4c2bd14d9ac87cd08e281 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 17 Jul 2015 12:47:42 +0200 Subject: [PATCH] Reverted something --- .../event/EntityLivingEvent.java | 23 ------------------- .../actuallyadditions/items/InitItems.java | 5 +--- .../items/ItemWingsOfTheBats.java | 12 +++------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java index 7c9f624f1..2566111bb 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java @@ -1,16 +1,13 @@ package ellpeck.actuallyadditions.event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; import ellpeck.actuallyadditions.config.values.ConfigBoolValues; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.ItemWingsOfTheBats; -import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.PlayerCapabilities; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; @@ -51,15 +48,6 @@ public class EntityLivingEvent{ if(wingsEquipped){ //Allow the Player to fly when he has Wings equipped player.capabilities.allowFlying = true; - - if(((ItemWingsOfTheBats)wings.getItem()).isHastily){ - //Speed Upgrade with hastily Wings - this.setFlySpeed(player, ItemWingsOfTheBats.FLY_SPEED); - } - else{ - //When switching from Hastily to not Hastily immediately, still remove the Speed! - this.setFlySpeed(player, ItemWingsOfTheBats.STANDARD_FLY_SPEED); - } } else{ //Make the Player not winged @@ -71,19 +59,8 @@ public class EntityLivingEvent{ //Enables Fall Damage again (Automatically gets disabled for some reason) player.capabilities.disableDamage = false; } - //Remove the Speed Effect - this.setFlySpeed(player, ItemWingsOfTheBats.STANDARD_FLY_SPEED); } } } } - - private void setFlySpeed(EntityPlayer player, float speed){ - try{ - ReflectionHelper.setPrivateValue(PlayerCapabilities.class, player.capabilities, speed, 5); - } - catch(Exception e){ - ModUtil.LOGGER.fatal("Something went wrong here!", e); - } - } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 72b3a305d..d1352f190 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -97,7 +97,6 @@ public class InitItems{ public static Item itemTeleStaff; public static Item itemWingsOfTheBats; - public static Item itemWingsOfTheBatsHastily; public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); @@ -117,10 +116,8 @@ public class InitItems{ itemTeleStaff = new ItemTeleStaff(); ItemUtil.register(itemTeleStaff); - itemWingsOfTheBats = new ItemWingsOfTheBats(false); + itemWingsOfTheBats = new ItemWingsOfTheBats(); ItemUtil.register(itemWingsOfTheBats); - itemWingsOfTheBatsHastily = new ItemWingsOfTheBats(true); - ItemUtil.register(itemWingsOfTheBatsHastily); itemDrill = new ItemDrill(); ItemUtil.register(itemDrill); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java b/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java index 3abd3b4d8..a4e91a6d9 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java @@ -27,14 +27,8 @@ public class ItemWingsOfTheBats extends Item implements INameableItem{ */ public static ArrayList wingedPlayers = new ArrayList<>(); - public static final float FLY_SPEED = 0.125F; - public static final float STANDARD_FLY_SPEED = 0.05F; - - public boolean isHastily; - - public ItemWingsOfTheBats(boolean isHastily){ + public ItemWingsOfTheBats(){ this.setMaxStackSize(1); - this.isHastily = isHastily; } /** @@ -72,7 +66,7 @@ public class ItemWingsOfTheBats extends Item implements INameableItem{ @Override public EnumRarity getRarity(ItemStack stack){ - return this.isHastily ? EnumRarity.epic : EnumRarity.rare; + return EnumRarity.epic; } @Override @@ -95,7 +89,7 @@ public class ItemWingsOfTheBats extends Item implements INameableItem{ @Override public String getName(){ - return this.isHastily ? "itemWingOfTheBatsHastily" : "itemWingsOfTheBats"; + return "itemWingsOfTheBats"; } /**