packets now actually send, lol
This commit is contained in:
parent
e31f75eb2e
commit
4bd1d84880
3 changed files with 4 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue