Keybinds almost fully implemented, just need save/load functionality

This commit is contained in:
MachineMuse 2013-01-25 20:11:58 -07:00
parent a44fd2c2f1
commit 3d6870525d
12 changed files with 158 additions and 68 deletions

View file

@ -11,8 +11,6 @@ import net.machinemuse.powersuits.item.ItemUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.lwjgl.input.Keyboard;
@ -33,6 +31,10 @@ public class ClickableKeybinding extends ClickableButton {
return toggled;
}
public void doToggleTick() {
doToggleIf(keybind.pressed);
}
public void doToggleIf(boolean value) {
if (value && !toggled) {
toggleModules();
@ -45,13 +47,11 @@ public class ClickableKeybinding extends ClickableButton {
if (player == null) {
return;
}
for (ItemStack stack : ItemUtils.getModularItemsInInventory(player)) {
NBTTagCompound itemTag = ItemUtils.getMuseItemTag(stack);
for (ClickableModule module : boundModules) {
ItemUtils.toggleModule(itemTag, module.getModule().getName(), toggleval);
}
for (ClickableModule module : boundModules) {
String valstring = toggleval ? " on" : " off";
player.sendChatToPlayer("Toggled " + module.getModule().getName() + valstring);
ItemUtils.toggleModuleForPlayer(player, module.getModule().getName(), toggleval);
}
toggleval = !toggleval;
}
@ -115,4 +115,5 @@ public class ClickableKeybinding extends ClickableButton {
}
}
}
}

View file

@ -8,6 +8,7 @@ import net.machinemuse.powersuits.common.ModCompatability;
import net.machinemuse.powersuits.common.PowersuitsMod;
import net.machinemuse.powersuits.event.ThaumRenderEventHandler;
import net.machinemuse.powersuits.network.MusePacketHandler;
import net.machinemuse.powersuits.tick.ClientTickHandler;
import net.machinemuse.powersuits.tick.PlayerTickHandlerClient;
import net.machinemuse.powersuits.tick.RenderTickHandler;
import net.minecraftforge.client.MinecraftForgeClient;
@ -27,6 +28,7 @@ import cpw.mods.fml.relauncher.Side;
*/
public class ClientProxy extends CommonProxy {
private static ToolRenderer toolRenderer = new ToolRenderer();
private static ClientTickHandler clientTickHandler;
private static RenderTickHandler renderTickHandler;
private static PlayerTickHandlerClient playerTickHandler;
public static KeybindKeyHandler keybindHandler;
@ -58,14 +60,17 @@ public class ClientProxy extends CommonProxy {
public void registerHandlers() {
keybindHandler = new KeybindKeyHandler();
KeyBindingRegistry.registerKeyBinding(keybindHandler);
playerTickHandler = new PlayerTickHandlerClient();
TickRegistry.registerTickHandler(playerTickHandler, Side.CLIENT);
renderTickHandler = new RenderTickHandler();
TickRegistry.registerTickHandler(renderTickHandler, Side.CLIENT);
if(ModCompatability.isThaumCraftLoaded() && ModCompatability.enableThaumGogglesModule()) {
clientTickHandler = new ClientTickHandler();
TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT);
if (ModCompatability.isThaumCraftLoaded() && ModCompatability.enableThaumGogglesModule()) {
MinecraftForge.EVENT_BUS.register(new ThaumRenderEventHandler());
}

View file

@ -64,7 +64,7 @@ public class Config {
}
config.save();
}
/**
* The packet channel for this mod. We will only listen for and send packets
* on this 'channel'. Max of 16 characters.
@ -169,7 +169,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_ENERGY_SHIELD, ARMORONLY, MuseIcon.ENERGY_SHIELD, ModularCommon.CATEGORY_ARMOR)
.setDescription("Energy shields are much lighter than plating, but consume energy.")
.addInstallCost(copyAndResize(ItemComponent.fieldEmitter, 4))
.addInstallCost(copyAndResize(ItemComponent.fieldEmitter, 2))
.addTradeoffProperty("Field Strength", ModularCommon.ARMOR_VALUE_ENERGY, 6, " Points")
.addTradeoffProperty("Field Strength", ModularCommon.ARMOR_ENERGY_CONSUMPTION, 500, "J");
ModuleManager.addModule(module);
@ -204,7 +204,6 @@ public class Config {
.addTradeoffProperty("Overclock", ModularCommon.PICKAXE_HARVEST_SPEED, 18);
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_DIAMOND_PICK_UPGRADE, TOOLONLY, MuseIcon.DIAMOND_PICK, ModularCommon.CATEGORY_TOOL_ADDON)
.setDescription("Add diamonds to allow your pickaxe module to mine Obsidian. *REQUIRES PICKAXE MODULE TO WORK*")
.addInstallCost(copyAndResize(ItemComponent.solenoid, 1))
@ -214,6 +213,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_AQUA_AFFINITY, TOOLONLY, MuseIcon.AQUA_AFFINITY, ModularCommon.CATEGORY_TOOL_ADDON)
.setDescription("Reduces the speed penalty for using your tool underwater.")
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 1))
.setToggleable(true)
.addBaseProperty(ModularCommon.AQUA_AFFINITY_ENERGY_CONSUMPTION, 0, "J")
.addBaseProperty(ModularCommon.UNDERWATER_HARVEST_SPEED, 0.2, "%")
.addTradeoffProperty("Power", ModularCommon.AQUA_AFFINITY_ENERGY_CONSUMPTION, 100)
@ -246,9 +246,10 @@ public class Config {
.addTradeoffProperty("Battery Size", ModularCommon.MAXIMUM_ENERGY, 4250000)
.addTradeoffProperty("Battery Size", ModularCommon.WEIGHT, 8000);
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_SPRINT_ASSIST, LEGSONLY, MuseIcon.SPRINT_ASSIST, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("A set of servo motors to help you sprint (double-tap forward) faster.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 4));
ModuleManager.addSimpleTradeoff(
module, "Power",
@ -262,6 +263,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_JUMP_ASSIST, LEGSONLY, MuseIcon.JUMP_ASSIST, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("Another set of servo motors to help you jump higher.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 4));
ModuleManager.addSimpleTradeoff(
module, "Power",
@ -276,6 +278,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_SHOCK_ABSORBER, FEETONLY, MuseIcon.SHOCK_ABSORBER, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("With some servos, springs, and padding, you should be able to negate a portion of fall damage.")
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 2))
.setToggleable(true)
.addInstallCost(new ItemStack(Block.cloth, 2));
ModuleManager.addSimpleTradeoff(
module, "Power",
@ -284,6 +287,7 @@ public class Config {
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_GLIDER, TORSOONLY, MuseIcon.GLIDER, ModularCommon.CATEGORY_MOVEMENT)
.setToggleable(true)
.setDescription(
"Tack on some wings to turn downward into forward momentum. Press sneak+forward while falling to activate.")
.addInstallCost(copyAndResize(ItemComponent.gliderWing, 2));
@ -296,6 +300,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_JETPACK, TORSOONLY, MuseIcon.JETPACK, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("A jetpack should allow you to jump indefinitely, or at least until you run out of power.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.ionThruster, 4))
.addBaseProperty(ModularCommon.JET_ENERGY_CONSUMPTION, 0, "J/s")
.addBaseProperty(ModularCommon.JET_THRUST, 0, "N")
@ -305,6 +310,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_JETBOOTS, FEETONLY, MuseIcon.JETBOOTS, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("Jet boots are not as strong as a jetpack, but they should at least be strong enough to counteract gravity.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.ionThruster, 2))
.addBaseProperty(ModularCommon.JET_ENERGY_CONSUMPTION, 0)
.addBaseProperty(ModularCommon.JET_THRUST, 0)
@ -315,12 +321,14 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_WATER_ELECTROLYZER, HEADONLY, MuseIcon.WATER_ELECTROLYZER, ModularCommon.CATEGORY_ENVIRONMENTAL)
.setDescription("When you run out of air, this module will jolt the water around you, electrolyzing a small bubble to breathe from.")
.addInstallCost(copyAndResize(ItemComponent.lvcapacitor, 1))
.setToggleable(true)
.addBaseProperty(ModularCommon.WATERBREATHING_ENERGY_CONSUMPTION, 1000, "J");
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_SWIM_BOOST, LEGSONLY, MuseIcon.SWIM_BOOST, ModularCommon.CATEGORY_MOVEMENT)
.setDescription(
"By refitting an ion thruster for underwater use, you may be able to add extra forward (or backward) thrust when underwater.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.ionThruster, 1))
.addInstallCost(copyAndResize(ItemComponent.solenoid, 2))
.addTradeoffProperty("Thrust", ModularCommon.SWIM_BOOST_ENERGY_CONSUMPTION, 100, "J")
@ -329,12 +337,14 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_CLIMB_ASSIST, LEGSONLY, MuseIcon.STEP_ASSIST, ModularCommon.CATEGORY_MOVEMENT)
.setDescription("A pair of dedicated servos allow you to effortlessly step up 1m-high ledges.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 2));
ModuleManager.addModule(module);
module = new PowerModule(ModularCommon.MODULE_TINT, ARMORONLY, MuseIcon.NETHERSTAR, ModularCommon.CATEGORY_COSMETIC)
.setDescription("Give your armor some coloured tinting to customize your armor's appearance.")
.addInstallCost(copyAndResize(ItemComponent.laserHologram, 1))
.setToggleable(true)
.addTradeoffProperty("Red Intensity", ModularCommon.RED_TINT, 1, "%")
.addTradeoffProperty("Green Intensity", ModularCommon.GREEN_TINT, 1, "%")
.addTradeoffProperty("Blue Intensity", ModularCommon.BLUE_TINT, 1, "%");
@ -342,6 +352,7 @@ public class Config {
module = new PowerModule(ModularCommon.MODULE_TRANSPARENT_ARMOR, ARMORONLY, MuseIcon.TRANSPARENT_ARMOR, ModularCommon.CATEGORY_COSMETIC)
.setDescription("Make the item transparent, so you can show off your skin without losing armor.")
.setToggleable(true)
.addInstallCost(copyAndResize(ItemComponent.laserHologram, 1));
ModuleManager.addModule(module);
@ -418,14 +429,14 @@ public class Config {
GuiTinkerTable,
GuiSuitManager;
}
public static Configuration getConfig() {
return config;
}
public static boolean doAdditionalInfo() {
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
return true;
}
}

View file

@ -17,9 +17,9 @@ public abstract class MuseLogger {
protected final static String ERRORPREFIX = "MMMPS - ERROR - ";
public static void logDebug(String string) {
if(Config.isDebugging()) {
if (Config.isDebugging()) {
Side side = FMLCommonHandler.instance().getEffectiveSide();
Logger.getLogger("MMMPS DEBUG").info(side + ": " + string);
Logger.getLogger("STDOUT").info(DEBUGPREFIX + side + ": " + string);
}
}
@ -28,7 +28,7 @@ public abstract class MuseLogger {
*/
public static void logError(String string) {
Side side = FMLCommonHandler.instance().getEffectiveSide();
Logger.getLogger("MMMPS ERROR").info(side + ": " + string);
Logger.getLogger("STDERR").info(ERRORPREFIX + side + ": " + string);
}
}

View file

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Set;
import net.machinemuse.general.MuseMathUtils;
import net.machinemuse.powersuits.common.MuseLogger;
import net.machinemuse.powersuits.powermodule.ModuleManager;
import net.machinemuse.powersuits.powermodule.PowerModule;
import net.minecraft.entity.player.EntityPlayer;
@ -42,12 +43,20 @@ public class ItemUtils {
}
public static boolean isModuleActive(NBTTagCompound itemTag, String moduleName) {
if (itemTag.hasKey(moduleName) && itemTag.getCompoundTag(moduleName).getBoolean(ACTIVE)) {
if (ItemUtils.tagHasModule(itemTag, moduleName) && itemTag.getCompoundTag(moduleName).getBoolean(ACTIVE)) {
return true;
}
return false;
}
public static void toggleModule(NBTTagCompound itemTag, String name, boolean toggleval) {
if (ItemUtils.tagHasModule(itemTag, name)) {
MuseLogger.logDebug("Toggling " + name + ": " + toggleval);
NBTTagCompound moduleTag = itemTag.getCompoundTag(name);
moduleTag.setBoolean(ACTIVE, toggleval);
}
}
public static boolean itemHasModule(ItemStack stack, String moduleName) {
return tagHasModule(getMuseItemTag(stack), moduleName);
}
@ -251,9 +260,7 @@ public class ItemUtils {
* Sets the value of the given nbt tag, or removes it if the value would be
* zero.
*/
public static void setDoubleOrRemove(NBTTagCompound itemProperties,
String string,
double value) {
public static void setDoubleOrRemove(NBTTagCompound itemProperties, String string, double value) {
if (itemProperties != null) {
if (value == 0) {
itemProperties.removeTag(string);
@ -491,10 +498,12 @@ public class ItemUtils {
return installedModules;
}
public static void toggleModule(NBTTagCompound itemTag, String name, boolean toggleval) {
if (ItemUtils.tagHasModule(itemTag, name)) {
NBTTagCompound moduleTag = itemTag.getCompoundTag(name);
moduleTag.setBoolean(ACTIVE, toggleval);
public static void toggleModuleForPlayer(EntityPlayer player, String name, boolean toggleval) {
for (ItemStack stack : ItemUtils.modularItemsEquipped(player)) {
NBTTagCompound itemTag = ItemUtils.getMuseItemTag(stack);
toggleModule(itemTag, name, toggleval);
}
}
}

View file

@ -23,18 +23,18 @@ import cpw.mods.fml.common.network.Player;
*
*/
public abstract class MusePacket {
protected static final int READ_ERROR = -150;
protected Player player;
protected ByteArrayOutputStream bytes;
protected Packet250CustomPayload packet;
protected DataOutputStream dataout;
protected DataInputStream datain;
protected int id;
protected MusePacket(Player player) {
this.player = player;
this.bytes = new ByteArrayOutputStream();
@ -42,12 +42,12 @@ public abstract class MusePacket {
int id = MusePacketHandler.getTypeID(this);
writeInt(id);
}
protected MusePacket(Player player, DataInputStream data) {
this.player = player;
this.datain = data;
}
/**
* Gets the MC packet associated with this MusePacket
*
@ -58,16 +58,16 @@ public abstract class MusePacket {
return new Packet250CustomPayload(Config.getNetworkChannelName(),
bytes.toByteArray());
}
/**
* Called by the network manager since it does all the packet mapping
*
* @param player2
*/
public abstract void handleClient(EntityClientPlayerMP player);
public abstract void handleServer(EntityPlayerMP player);
public int readInt() {
try {
int read = datain.readInt();
@ -78,15 +78,35 @@ public abstract class MusePacket {
return READ_ERROR;
}
}
public void writeInt(int i) {
try {
dataout.writeInt(i);
} catch (IOException e) {
e.printStackTrace();
}
}
public boolean readBoolean() {
try {
boolean read = datain.readBoolean();
return read;
} catch (IOException e) {
MuseLogger.logError("PROBLEM READING DOUBLE FROM PACKET D:");
e.printStackTrace();
return false;
}
}
public void writeBoolean(boolean val) {
try {
dataout.writeBoolean(val);
} catch (IOException e) {
e.printStackTrace();
}
}
public double readDouble() {
try {
double read = datain.readDouble();
@ -97,16 +117,16 @@ public abstract class MusePacket {
return READ_ERROR;
}
}
public void writeDouble(double i) {
try {
dataout.writeDouble(i);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Reads a ItemStack from the InputStream
*/
@ -115,7 +135,7 @@ public abstract class MusePacket {
ItemStack stack = null;
try {
short itemID = datain.readShort();
if (itemID >= 0)
{
byte stackSize = datain.readByte();
@ -123,14 +143,14 @@ public abstract class MusePacket {
stack = new ItemStack(itemID, stackSize, damageAmount);
stack.stackTagCompound = readNBTTagCompound();
}
} catch (IOException e) {
MuseLogger.logError("Problem reading itemstack D:");
e.printStackTrace();
}
return stack;
}
/**
* Writes the ItemStack's ID (short), then size (byte), then damage. (short)
*/
@ -147,13 +167,13 @@ public abstract class MusePacket {
dataout.writeByte(stack.stackSize);
dataout.writeShort(stack.getItemDamage());
NBTTagCompound nbt = null;
if (stack.getItem().isDamageable()
|| stack.getItem().getShareTag())
{
nbt = stack.stackTagCompound;
}
writeNBTTagCompound(nbt);
}
} catch (IOException e) {
@ -161,14 +181,14 @@ public abstract class MusePacket {
e.printStackTrace();
}
}
/**
* Reads a compressed NBTTagCompound from the InputStream
*/
public NBTTagCompound readNBTTagCompound() throws IOException
{
short length = datain.readShort();
if (length < 0)
{
return null;
@ -180,7 +200,7 @@ public abstract class MusePacket {
return CompressedStreamTools.decompress(fullData);
}
}
/**
* Writes a compressed NBTTagCompound to the OutputStream
*/
@ -198,7 +218,7 @@ public abstract class MusePacket {
dataout.write(compressednbt);
}
}
/**
* Writes a String to the DataOutputStream
*/
@ -212,7 +232,7 @@ public abstract class MusePacket {
e.printStackTrace();
}
}
/**
* Reads a string from a packet
*/
@ -221,7 +241,7 @@ public abstract class MusePacket {
String read = null;
try {
short length = datain.readShort();
if (length > maxlength)
{
throw new IOException(
@ -236,12 +256,12 @@ public abstract class MusePacket {
else
{
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; ++i)
{
builder.append(datain.readChar());
}
read = builder.toString();
}
} catch (IOException e) {
@ -249,5 +269,5 @@ public abstract class MusePacket {
}
return read;
}
}

View file

@ -16,6 +16,7 @@ import net.machinemuse.powersuits.network.packets.MusePacketInstallModuleRequest
import net.machinemuse.powersuits.network.packets.MusePacketInventoryRefresh;
import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate;
import net.machinemuse.powersuits.network.packets.MusePacketSalvageModuleRequest;
import net.machinemuse.powersuits.network.packets.MusePacketToggleRequest;
import net.machinemuse.powersuits.network.packets.MusePacketTweakRequest;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
@ -44,6 +45,7 @@ public class MusePacketHandler implements IPacketHandler {
addPacketType(4, MusePacketTweakRequest.class);
addPacketType(5, MusePacketFallDistance.class);
addPacketType(6, MusePacketPlayerUpdate.class);
addPacketType(6, MusePacketToggleRequest.class);
NetworkRegistry.instance().registerChannel(this,
Config.getNetworkChannelName());

View file

@ -0,0 +1,38 @@
package net.machinemuse.powersuits.network.packets;
import java.io.DataInputStream;
import net.machinemuse.powersuits.item.ItemUtils;
import net.machinemuse.powersuits.network.MusePacket;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayerMP;
import cpw.mods.fml.common.network.Player;
public class MusePacketToggleRequest extends MusePacket {
String module;
boolean value;
protected MusePacketToggleRequest(Player player, String module, boolean active) {
super(player);
writeString(module);
writeBoolean(active);
}
protected MusePacketToggleRequest(Player player, DataInputStream data) {
super(player, data);
module = readString(64);
value = readBoolean();
}
@Override
public void handleClient(EntityClientPlayerMP player) {
}
@Override
public void handleServer(EntityPlayerMP player) {
ItemUtils.toggleModuleForPlayer(player, module, value);
}
}

View file

@ -31,7 +31,9 @@ public class ModuleManager {
double propertyValue = 0;
NBTTagCompound itemTag = ItemUtils.getMuseItemTag(stack);
for (PowerModule module : moduleList) {
propertyValue = module.applyPropertyModifiers(itemTag, propertyName, propertyValue);
if (ItemUtils.isModuleActive(itemTag, module.getName())) {
propertyValue = module.applyPropertyModifiers(itemTag, propertyName, propertyValue);
}
}
return propertyValue;
}

View file

@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Set;
import net.machinemuse.general.gui.MuseIcon;
import net.machinemuse.powersuits.item.ItemUtils;
import net.machinemuse.powersuits.powermodule.property.IPropertyModifier;
import net.machinemuse.powersuits.powermodule.property.PropertyModifierFlatAdditive;
import net.machinemuse.powersuits.powermodule.property.PropertyModifierLinearAdditive;
@ -26,7 +27,7 @@ public class PowerModule {
protected NBTTagCompound defaultTag;
protected Map<String, List<IPropertyModifier>> propertyModifiers;
protected static Map<String, String> units = new HashMap();
protected boolean toggleable = true;
protected boolean toggleable = false;
public PowerModule(String name, boolean[] validSlots, MuseIcon icon, String category) {
this.name = name;
@ -37,6 +38,7 @@ public class PowerModule {
this.propertyModifiers = new HashMap();
this.installCost = new ArrayList();
this.defaultTag = new NBTTagCompound();
this.defaultTag.setBoolean(ItemUtils.ACTIVE, true);
}
public String getName() {
@ -58,6 +60,7 @@ public class PowerModule {
public boolean isToggleable() {
return toggleable;
}
public PowerModule setToggleable(boolean value) {
this.toggleable = value;
return this;

View file

@ -2,6 +2,8 @@ package net.machinemuse.powersuits.tick;
import java.util.EnumSet;
import net.machinemuse.general.gui.clickable.ClickableKeybinding;
import net.machinemuse.powersuits.client.KeybindManager;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
@ -15,15 +17,13 @@ public class ClientTickHandler implements ITickHandler {
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
// TODO Auto-generated method stub
for (ClickableKeybinding kb : KeybindManager.getKeybindings()) {
kb.doToggleTick();
}
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
// TODO Auto-generated method stub
}
public void tickEnd(EnumSet<TickType> type, Object... tickData) {}
@Override
public EnumSet<TickType> ticks() {

View file

@ -47,7 +47,6 @@ public class PlayerTickHandlerClient implements ITickHandler {
EntityPlayerMP player = (EntityPlayerMP) rawPlayer;
handleServer(player);
}
}
public void handleClient(EntityClientPlayerMP player) {
@ -193,7 +192,7 @@ public class PlayerTickHandlerClient implements ITickHandler {
if (hasSprintAssist && player.isSprinting()) {
double horzMovement = Math.sqrt(player.motionX * player.motionX + player.motionZ * player.motionZ);
double exhaustion = Math.round(horzMovement * 100.0F) * 0.01;
double sprintCost = ModuleManager.computeModularProperty(pants, ModularCommon.SPRINT_ENERGY_CONSUMPTION);
if (sprintCost + totalEnergyDrain < totalEnergy) {
double sprintMultiplier = ModuleManager.computeModularProperty(pants, ModularCommon.SPRINT_SPEED_MULTIPLIER);