From 4bd1d848803a7eed3bee25f60a6cfa3b5bb5cf4c Mon Sep 17 00:00:00 2001 From: MachineMuse Date: Sat, 26 Jan 2013 00:57:55 -0700 Subject: [PATCH] packets now actually send, lol --- .../general/gui/clickable/ClickableKeybinding.java | 1 + .../net/machinemuse/powersuits/event/MovementManager.java | 7 ++----- .../net/machinemuse/powersuits/item/ItemUtils.java | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/minecraft/net/machinemuse/general/gui/clickable/ClickableKeybinding.java b/src/minecraft/net/machinemuse/general/gui/clickable/ClickableKeybinding.java index 9fa47d9..2a302a2 100644 --- a/src/minecraft/net/machinemuse/general/gui/clickable/ClickableKeybinding.java +++ b/src/minecraft/net/machinemuse/general/gui/clickable/ClickableKeybinding.java @@ -55,6 +55,7 @@ public class ClickableKeybinding extends ClickableButton { player.sendChatToPlayer("Toggled " + module.getModule().getName() + valstring); ItemUtils.toggleModuleForPlayer(player, module.getModule().getName(), toggleval); MusePacketToggleRequest toggleRequest = new MusePacketToggleRequest((Player) player, module.getModule().getName(), toggleval); + player.sendQueue.addToSendQueue(toggleRequest.getPacket250()); } toggleval = !toggleval; } diff --git a/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java b/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java index 7cc6514..2070fbe 100644 --- a/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java +++ b/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java @@ -7,8 +7,6 @@ import net.machinemuse.powersuits.common.MuseLogger; import net.machinemuse.powersuits.item.ItemPowerArmor; import net.machinemuse.powersuits.item.ItemUtils; import net.machinemuse.powersuits.item.ModularCommon; -import net.machinemuse.powersuits.network.MusePacket; -import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate; import net.machinemuse.powersuits.powermodule.ModuleManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -33,11 +31,10 @@ public class MovementManager { @ForgeSubscribe public void handleLivingJumpEvent(LivingJumpEvent event) { - event.entityLiving.setJumping(true); if (event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; ItemStack stack = player.getCurrentArmor(1); - if (stack != null && stack.getItem() instanceof ItemPowerArmor && ItemUtils.itemHasModule(stack, ModularCommon.MODULE_JUMP_ASSIST)) { + if (stack != null && stack.getItem() instanceof ItemPowerArmor && ItemUtils.itemHasActiveModule(stack, ModularCommon.MODULE_JUMP_ASSIST)) { double jumpAssist = ModuleManager.computeModularProperty(stack, ModularCommon.JUMP_MULTIPLIER) * 2; double drain = ModuleManager.computeModularProperty(stack, ModularCommon.JUMP_ENERGY_CONSUMPTION); double avail = ItemUtils.getPlayerEnergy(player); @@ -64,7 +61,7 @@ public class MovementManager { EntityPlayer player = (EntityPlayer) event.entityLiving; ItemStack boots = player.getCurrentArmor(0); if (boots != null) { - if (ItemUtils.itemHasModule(boots, ModularCommon.MODULE_SHOCK_ABSORBER)) { + if (ItemUtils.itemHasActiveModule(boots, ModularCommon.MODULE_SHOCK_ABSORBER)) { double distanceAbsorb = event.distance * ModuleManager.computeModularProperty(boots, ModularCommon.SHOCK_ABSORB_MULTIPLIER); double drain = distanceAbsorb * distanceAbsorb * 0.05 diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemUtils.java b/src/minecraft/net/machinemuse/powersuits/item/ItemUtils.java index fa65f99..f89f6c1 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemUtils.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemUtils.java @@ -509,7 +509,7 @@ public class ItemUtils { } public static boolean itemHasActiveModule(ItemStack itemStack, String moduleName) { - return (itemHasModule(itemStack, moduleName) && isModuleActive(getMuseItemTag(itemStack), moduleName)); + return isModuleActive(getMuseItemTag(itemStack), moduleName); } }