mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
Make glove haste actually work.
This commit is contained in:
1 parent
e3c3fa38ce
commit
3bb73019a5
3 files changed
+18
-5
No files matched your search
@@ -47,11 +47,13 @@ public class TinkerArmor
|
||||
// public static Item netherPattern;
|
||||
public static Block dryingRack;
|
||||
// Wearables
|
||||
/*
|
||||
public static Item heavyHelmet;
|
||||
public static Item heavyChestplate;
|
||||
public static Item heavyPants;
|
||||
public static Item heavyBoots;
|
||||
public static Item glove;
|
||||
*/
|
||||
public static Item knapsack;
|
||||
public static Item heartCanister;
|
||||
// Armor - basic
|
||||
|
||||
@@ -58,10 +58,22 @@ public class TinkerArmorEvents
|
||||
@SubscribeEvent
|
||||
public void armorMineSpeed (net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed event)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.entityPlayer);
|
||||
float modifier = 1f + stats.mineSpeed / 1000f;
|
||||
float base = stats.mineSpeed / 250f;
|
||||
event.newSpeed = (event.newSpeed + base) * modifier;
|
||||
if(event.entityPlayer == null)
|
||||
return;
|
||||
|
||||
ItemStack glove = TPlayerStats.get(event.entityPlayer).armor.getStackInSlot(1);
|
||||
if(event.entityPlayer.worldObj.isRemote) // todo: sync extended inventory with clients so this stuff and rendering is done properly...
|
||||
glove = ArmorProxyClient.armorExtended.getStackInSlot(1);
|
||||
if(glove == null || !glove.hasTagCompound())
|
||||
return;
|
||||
|
||||
// ok, we got a glove. bonus mining speeeeed
|
||||
NBTTagCompound tags = glove.getTagCompound().getCompoundTag(TinkerArmor.travelGlove.getBaseTagName());
|
||||
float mineSpeed = tags.getInteger("MiningSpeed");
|
||||
|
||||
float modifier = 1f + mineSpeed / 1000f;
|
||||
float base = mineSpeed / 250f;
|
||||
event.newSpeed = (event.originalSpeed + base) * modifier;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -20,7 +20,6 @@ public class TPlayerStats implements IExtendedEntityProperties, IPlayerExtendedI
|
||||
public int damage;
|
||||
public int hunger;
|
||||
public int previousDimension;
|
||||
public int mineSpeed;
|
||||
|
||||
public boolean climbWalls;
|
||||
public boolean activeGoggles = true;
|
||||
|
||||
Reference in new issue
Block a user