diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
9 files changed, 605 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/common/BasePlayer.java b/src/Java/gtPlusPlus/core/common/BasePlayer.java new file mode 100644 index 0000000000..fb17480b8f --- /dev/null +++ b/src/Java/gtPlusPlus/core/common/BasePlayer.java @@ -0,0 +1,346 @@ +package gtPlusPlus.core.common; + +import gtPlusPlus.core.handler.events.CustomMovementHandler; +import gtPlusPlus.core.handler.events.SneakManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.potion.Potion; +import net.minecraft.util.MovementInputFromOptions; +import net.minecraft.util.ResourceLocation; +import api.player.client.ClientPlayerAPI; +import api.player.client.ClientPlayerBase; + +public class BasePlayer extends ClientPlayerBase +{ + private final Minecraft mc = Minecraft.getMinecraft(); + private final CustomMovementHandler customMovementInput = new CustomMovementHandler(); + private final GameSettings settings = mc.gameSettings; + + public BasePlayer(ClientPlayerAPI api) + { + super(api); + } + + /* + * EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI + */ + @Override + public void onLivingUpdate() + { + if(this.player.sprintingTicksLeft > 0) + { + --this.player.sprintingTicksLeft; + if(this.player.sprintingTicksLeft == 0) + { + this.player.setSprinting(false); + } + } + + if(this.playerAPI.getSprintToggleTimerField() > 0) + { + this.playerAPI.setSprintToggleTimerField(this.playerAPI.getSprintToggleTimerField() - 1); + } + + if(this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + this.player.posX = this.player.posZ = 0.5D; + this.player.posX = 0.0D; + this.player.posZ = 0.0D; + this.player.rotationYaw = (float)this.player.ticksExisted / 12.0F; + this.player.rotationPitch = 10.0F; + this.player.posY = 68.5D; + } + else + { + this.player.prevTimeInPortal = this.player.timeInPortal; + if(this.playerAPI.getInPortalField()) + { + if(this.mc.currentScreen != null) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + + if(this.player.timeInPortal == 0.0F) + { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("portal.trigger"), this.player.getRNG().nextFloat() * 0.4F + 0.8F)); + } + + this.player.timeInPortal += 0.0125F; + + if(this.player.timeInPortal >= 1.0F) + { + this.player.timeInPortal = 1.0F; + } + + this.playerAPI.setInPortalField(false); + } + else if(this.player.isPotionActive(Potion.confusion) && this.player.getActivePotionEffect(Potion.confusion).getDuration() > 60) + { + this.player.timeInPortal += 0.006666667F; + if(this.player.timeInPortal > 1.0F) + { + this.player.timeInPortal = 1.0F; + } + } + else + { + if(this.player.timeInPortal > 0.0F) + { + this.player.timeInPortal -= 0.05F; + } + + if(this.player.timeInPortal < 0.0F) + { + this.player.timeInPortal = 0.0F; + } + } + + + if(this.player.timeUntilPortal > 0) + { + --this.player.timeUntilPortal; + } + + boolean isJumping = this.player.movementInput.jump; + + float minSpeed = 0.8F; + boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed; + this.customMovementInput.update(this.mc, (MovementInputFromOptions)this.player.movementInput, this.player); + + if(this.player.isUsingItem() && !this.player.isRiding()) + { + this.player.movementInput.moveStrafe *= 0.2F; + this.player.movementInput.moveForward *= 0.2F; + this.playerAPI.setSprintToggleTimerField(0); + } + + if(this.player.movementInput.sneak && this.player.ySize < 0.2F) + { + this.player.ySize = 0.2F; + } + + this.playerAPI.localPushOutOfBlocks(this.player.posX - (double)this.player.width * 0.35D, this.player.boundingBox.minY + 0.5D, this.player.posZ + (double)this.player.width * 0.35D); + this.playerAPI.localPushOutOfBlocks(this.player.posX - (double)this.player.width * 0.35D, this.player.boundingBox.minY + 0.5D, this.player.posZ - (double)this.player.width * 0.35D); + this.playerAPI.localPushOutOfBlocks(this.player.posX + (double)this.player.width * 0.35D, this.player.boundingBox.minY + 0.5D, this.player.posZ - (double)this.player.width * 0.35D); + this.playerAPI.localPushOutOfBlocks(this.player.posX + (double)this.player.width * 0.35D, this.player.boundingBox.minY + 0.5D, this.player.posZ + (double)this.player.width * 0.35D); + boolean enoughHunger = (float)this.player.getFoodStats().getFoodLevel() > 6.0F || this.player.capabilities.isFlying; + + /* + * Begin ToggleSneak Changes - ToggleSprint + */ + + boolean isSprintDisabled = !SneakManager.canSprint; + boolean canDoubleTap = SneakManager.optionDoubleTap; + + // Detect when ToggleSprint was disabled in the in-game options menu + if(SneakManager.wasSprintDisabled) + { + this.player.setSprinting(false); + customMovementInput.UpdateSprint(false, false); + SneakManager.wasSprintDisabled = false; + } + + // Default Sprint routine converted to PlayerAPI, use if ToggleSprint is disabled - TODO - Disable sprinting as a whole + if(isSprintDisabled) + { + if(SneakManager.optionDoubleTap && this.player.onGround && !isMovingForward && this.player.movementInput.moveForward >= minSpeed && !this.player.isSprinting() && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness)) + { + if(this.playerAPI.getSprintToggleTimerField() <= 0 && !this.settings.keyBindSprint.getIsKeyPressed()) + { + this.playerAPI.setSprintToggleTimerField(7); + } + else + { + if (!SneakManager.SprintingDisabled()){ + this.player.setSprinting(true); + customMovementInput.UpdateSprint(true, false); + } + else { + this.player.setSprinting(false); + customMovementInput.UpdateSprint(false, false); + } + } + } + + if(!this.player.isSprinting() && this.player.movementInput.moveForward >= minSpeed && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && this.settings.keyBindSprint.getIsKeyPressed()) + { + if (!SneakManager.SprintingDisabled()){ + this.player.setSprinting(true); + customMovementInput.UpdateSprint(true, false); + } + else { + this.player.setSprinting(false); + customMovementInput.UpdateSprint(false, false); + } + } + } + else + { + boolean state = this.customMovementInput.sprint; + + // Only handle changes in state under the following conditions: + // On ground, not hungry, not eating/using item, not blind, and not Vanilla + // + // 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior. + //if(this.player.onGround && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased) + + if(enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased) + { + if(canDoubleTap && !this.player.isSprinting() || !canDoubleTap) + { + if (!SneakManager.SprintingDisabled()) + this.player.setSprinting(state); + else + this.player.setSprinting(false); + } + } + + if(canDoubleTap && !state && this.player.onGround && !isMovingForward && this.player.movementInput.moveForward >= minSpeed && !this.player.isSprinting() && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness)) + { + if(this.playerAPI.getSprintToggleTimerField() == 0) + { + this.playerAPI.setSprintToggleTimerField(7); + } + else + { + if (!SneakManager.SprintingDisabled()){ + this.player.setSprinting(true); + customMovementInput.UpdateSprint(true, true); + this.playerAPI.setSprintToggleTimerField(0); + } + } + } + } + + // If sprinting, break the sprint in appropriate circumstances: + // Player stops moving forward, runs into something, or gets too hungry + if(this.player.isSprinting() && (this.player.movementInput.moveForward < minSpeed || this.player.isCollidedHorizontally || !enoughHunger)) + { + this.player.setSprinting(false); + + // Undo toggle if we resumed vanilla operation due to Hold&Release, DoubleTap, Fly, Ride + if (customMovementInput.sprintHeldAndReleased == true || isSprintDisabled || customMovementInput.sprintDoubleTapped || this.player.capabilities.isFlying || this.player.isRiding()) + { + customMovementInput.UpdateSprint(false, false); + } + } + + /* + * End ToggleSneak Changes - ToggleSprint + */ + + // // + // // Debug Framework - Added 5/7/2014 + // // + // if (this.showDebug && this.settings.keyBindPickBlock.getIsKeyPressed() && !this.handledDebugPress) + // { + // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); + // this.player.addChatMessage(new ChatComponentText("| ToggleSneak Debug Info |")); + // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText("isFlying - " + (this.player.capabilities.isFlying == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("isCreative - " + (this.player.capabilities.isCreativeMode == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("enableFlyBoost - " + (SneakManager.optionEnableFlyBoost == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("flyBoostAmount - " + SneakManager.optionFlyBoostAmount)); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText("keybindSprint - " + (this.settings.keyBindSprint.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("keybindSneak - " + (this.settings.keyBindSneak.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("keybindJump - " + (this.settings.keyBindJump.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText(" ")); + // + // this.handledDebugPress = true; + // } + // else if (this.showDebug && !this.settings.keyBindPickBlock.getIsKeyPressed() && this.handledDebugPress) + // { + // this.handledDebugPress = false; + // } + + // + // Fly Speed Boosting - Added 5/7/2014 + // + if(this.player.capabilities.getFlySpeed() != 0.05F) + { + this.player.capabilities.setFlySpeed(0.05F); + } + + + if(this.player.capabilities.allowFlying && !isJumping && this.player.movementInput.jump) + { + if(this.playerAPI.getFlyToggleTimerField() == 0) + { + this.playerAPI.setFlyToggleTimerField(7); + } + else + { + this.player.capabilities.isFlying = !this.player.capabilities.isFlying; + this.player.sendPlayerAbilities(); + this.playerAPI.setFlyToggleTimerField(0); + } + } + + if(this.player.capabilities.isFlying) + { + if(this.player.movementInput.sneak) + { + this.player.motionY -= 0.15D; + } + if(this.player.movementInput.jump) + { + this.player.motionY += 0.15D; + } + } + + if(this.player.isRidingHorse()) + { + if(this.playerAPI.getHorseJumpPowerCounterField() < 0) + { + this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() + 1); + if(this.playerAPI.getHorseJumpPowerCounterField() == 0) + { + this.playerAPI.setHorseJumpPowerField(0.0F); + } + } + + if(isJumping && !this.player.movementInput.jump) + { + this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() - 10); + this.playerAPI.setHorseJumpPowerCounterField(-10); + ((EntityClientPlayerMP)this.player).sendQueue.addToSendQueue(new C0BPacketEntityAction(this.player, 6, (int)(this.player.getHorseJumpPower() * 100.0F))); + } + else if(!isJumping && this.player.movementInput.jump) + { + this.playerAPI.setHorseJumpPowerCounterField(0); + this.playerAPI.setHorseJumpPowerField(0.0F); + } + else if(isJumping) + { + this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() + 1); + if(this.playerAPI.getHorseJumpPowerCounterField() < 10) + { + this.playerAPI.setHorseJumpPowerField((float)this.playerAPI.getHorseJumpPowerCounterField() * 0.1F); + } + else + { + this.playerAPI.setHorseJumpPowerField(0.8F + 2.0F / (float)(this.playerAPI.getHorseJumpPowerCounterField() - 9) * 0.1F); + } + } + } + else + { + this.playerAPI.setHorseJumpPowerField(0.0F); + } + + this.playerAPI.superOnLivingUpdate(); + if(this.player.onGround && this.player.capabilities.isFlying) + { + this.player.capabilities.isFlying = false; + this.player.sendPlayerAbilities(); + } + } + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/events/CustomMovementHandler.java b/src/Java/gtPlusPlus/core/handler/events/CustomMovementHandler.java new file mode 100644 index 0000000000..e2eb1538e6 --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/events/CustomMovementHandler.java @@ -0,0 +1,160 @@ +package gtPlusPlus.core.handler.events; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MovementInputFromOptions; + +/* + * Replacement for MovementInputFromOptions - Built from the source of ToggleSneak 3.0.3 + */ + +public class CustomMovementHandler { + + public boolean isDisabled; + public boolean canDoubleTap; + + public boolean sprint = false; + public boolean sprintHeldAndReleased = false; + public boolean sprintDoubleTapped = false; + + private long lastPressed; + private long lastSprintPressed; + private boolean handledSneakPress; + private boolean handledSprintPress; + private boolean wasRiding; + + /* + * MovementInputFromOptions.updatePlayerMoveState() + */ + public void update(Minecraft mc, MovementInputFromOptions options, EntityPlayerSP thisPlayer) + { + options.moveStrafe = 0.0F; + options.moveForward = 0.0F; + + GameSettings settings = mc.gameSettings; + + if(settings.keyBindForward.getIsKeyPressed()) + { + ++options.moveForward; + } + + if(settings.keyBindBack.getIsKeyPressed()) + { + --options.moveForward; + } + + if(settings.keyBindLeft.getIsKeyPressed()) + { + ++options.moveStrafe; + } + + if(settings.keyBindRight.getIsKeyPressed()) + { + --options.moveStrafe; + } + + options.jump = settings.keyBindJump.getIsKeyPressed(); + + // + // Sneak Toggle - Essentially the same as old ToggleSneak + // + + // Check to see if Enabled - Added 6/17/14 to provide option to disable Sneak Toggle + if (SneakManager.Sneaking()) + { + // Key Pressed + if (settings.keyBindSneak.getIsKeyPressed() && !this.handledSneakPress) + { + // Descend if we are flying, note if we were riding (so we can unsneak once dismounted) + if(thisPlayer.isRiding() || thisPlayer.capabilities.isFlying) + { + options.sneak = true; + this.wasRiding = thisPlayer.isRiding(); + } + else + { + options.sneak = !options.sneak; + } + + this.lastPressed = System.currentTimeMillis(); + this.handledSneakPress = true; + } + + // Key Released + if (!settings.keyBindSneak.getIsKeyPressed() && this.handledSneakPress) + { + // If we are flying or riding, stop sneaking after descent/dismount. + if(thisPlayer.capabilities.isFlying || this.wasRiding) + { + options.sneak = false; + this.wasRiding = false; + } + // If the key was held down for more than 300ms, stop sneaking upon release. + else if(System.currentTimeMillis() - this.lastPressed > 300L) + { + options.sneak = false; + } + + this.handledSneakPress = false; + } + } + else + { + options.sneak = settings.keyBindSneak.getIsKeyPressed(); + } + + if(options.sneak || SneakManager.Sneaking()) + { + options.moveStrafe = (float)((double)options.moveStrafe * 0.3D); + options.moveForward = (float)((double)options.moveForward * 0.3D); + } + + // + // Sprint Toggle - Updated 6/18/2014 + // + + // Establish conditions where we don't want to start a sprint - sneaking, riding, flying, hungry + boolean enoughHunger = (float)thisPlayer.getFoodStats().getFoodLevel() > 6.0F || thisPlayer.capabilities.isFlying; + boolean canSprint = !options.sneak && !thisPlayer.isRiding() && !thisPlayer.capabilities.isFlying && enoughHunger; + + isDisabled = !SneakManager.canSprint; + canDoubleTap = SneakManager.optionDoubleTap; + + // Key Pressed + if((canSprint || isDisabled) && settings.keyBindSprint.getIsKeyPressed() && !this.handledSprintPress) + { + if(!isDisabled) + { + this.sprint = !this.sprint; + this.lastSprintPressed = System.currentTimeMillis(); + this.handledSprintPress = true; + this.sprintHeldAndReleased = false; + } + } + + // Key Released + if((canSprint || isDisabled) && !settings.keyBindSprint.getIsKeyPressed() && this.handledSprintPress) + { + // Was key held for longer than 300ms? If so, mark it so we can resume vanilla behavior + if(System.currentTimeMillis() - this.lastSprintPressed > 300L) + { + this.sprintHeldAndReleased = true; + } + this.handledSprintPress = false; + } + + } + + public void UpdateSprint(boolean newValue, boolean doubleTapped){ + if (SneakManager.SprintingDisabled()){ + this.sprint = false; + this.sprintDoubleTapped = doubleTapped; + } + else{ + this.sprint = newValue; + this.sprintDoubleTapped = doubleTapped; + } + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java new file mode 100644 index 0000000000..9e783a3a4f --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java @@ -0,0 +1,73 @@ +package gtPlusPlus.core.handler.events; + +import net.minecraft.client.Minecraft; + +public class SneakManager { + + //We make this a singleton for clientside data storage. + public static SneakManager instance = new SneakManager(); + protected static final Minecraft mc = Minecraft.getMinecraft(); + public static boolean canSprint = true; + public static boolean isSneaking = true; + public static boolean optionDoubleTap = false; + public static boolean wasSprintDisabled = false; + + private static State Sprinting = State.OFF; + private static State Crouching = State.OFF; + + public static boolean Sneaking(){ + return Crouching.getState(); + } + + public static boolean SprintingDisabled(){ + return Sprinting.getState(); + } + + public static State getSneakingState(){ + return Crouching; + } + + public static State getSprintingDisabledState(){ + return Sprinting; + } + + public static void toggleSneaking(){ + toggleState(Crouching); + } + + public static void toggleSprinting(){ + toggleState(Sprinting); + } + + private static State toggleState(State state){ + if (state == State.ON) + return state = State.OFF; + return state = State.ON; + } + + public static State setStateON(State state1){ + return state1 = State.ON; + } + + public static State setStateOFF(State state1){ + return state1 = State.OFF; + } + + public static enum State { + ON(true), + OFF(false); + + private boolean STATE; + private State (final boolean State) + { + this.STATE = State; + } + + public boolean getState() { + return STATE; + } + + } + +} + diff --git a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java index 2d1c758116..4605b00645 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java @@ -1,11 +1,14 @@ package gtPlusPlus.core.item.general; import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.handler.events.CustomMovementHandler; +import gtPlusPlus.core.handler.events.SneakManager; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.item.ItemUtils; import java.util.List; +import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -22,6 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry; public class ItemSlowBuildingRing extends Item implements IBauble{ private final String unlocalizedName = "SlowBuildingRing"; + CustomMovementHandler x; public ItemSlowBuildingRing(){ this.setCreativeTab(AddToCreativeTab.tabMachines); @@ -100,6 +104,8 @@ public class ItemSlowBuildingRing extends Item implements IBauble{ arg1.setSneaking(false); } } + SneakManager.setStateOFF(SneakManager.getSneakingState()); + SneakManager.setStateOFF(SneakManager.getSprintingDisabledState()); } @Override //TODO @@ -111,9 +117,15 @@ public class ItemSlowBuildingRing extends Item implements IBauble{ if (arg1.worldObj.isRemote){ if (!arg1.isSneaking()){ arg1.setSneaking(true); + Minecraft.getMinecraft().thePlayer.setSneaking(true); + SneakManager.setStateON(SneakManager.getSneakingState()); + SneakManager.setStateON(SneakManager.getSprintingDisabledState()); } else if (arg1.isSneaking()){ arg1.setSprinting(false); + Minecraft.getMinecraft().thePlayer.setSprinting(true); + SneakManager.setStateON(SneakManager.getSneakingState()); + SneakManager.setStateON(SneakManager.getSprintingDisabledState()); } } } diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java index 0a7c98202e..592b41b0e9 100644 --- a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java +++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java @@ -8,6 +8,7 @@ import ic2.api.item.*; import java.util.List; +import api.cofh.energy.ItemEnergyContainer; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -18,7 +19,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import cofh.api.energy.ItemEnergyContainer; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index 276af700f0..12b99e76da 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -1,13 +1,17 @@ package gtPlusPlus.core.proxy; import gtPlusPlus.GTplusplus; +import gtPlusPlus.core.common.BasePlayer; import gtPlusPlus.core.common.CommonProxy; +import gtPlusPlus.core.handler.events.SneakManager; import gtPlusPlus.core.handler.render.FirepitRender; import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.util.particles.EntityParticleFXMysterious; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.Entity; +import net.minecraftforge.common.MinecraftForge; +import api.player.client.ClientPlayerAPI; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.event.*; @@ -28,11 +32,17 @@ public class ClientProxy extends CommonProxy{ super.preInit(e); //Do this weird things for textures. GTplusplus.loadTextures(); + //We boot up the sneak manager. + MinecraftForge.EVENT_BUS.register(SneakManager.instance); } @Override public void init(FMLInitializationEvent e) { // TODO Auto-generated method stub + + //Register player instance + ClientPlayerAPI.register("SneakManager", BasePlayer.class); + super.init(e); } @@ -60,8 +70,6 @@ public class ClientProxy extends CommonProxy{ return RenderingRegistry.addNewArmourRendererPrefix(armor); } - - @Override public void generateMysteriousParticles(Entity theEntity) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java index 195b85c0c4..53865da327 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java @@ -17,6 +17,7 @@ import ic2.api.energy.tile.IEnergySink; import java.util.ArrayList; import java.util.Arrays; +import api.cofh.energy.IEnergyReceiver; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.tileentity.TileEntity; @@ -24,7 +25,6 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import cofh.api.energy.IEnergyReceiver; public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implements IMetaTileEntityCable { public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java index ad9b2c6771..8e7cc778bd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java @@ -18,6 +18,7 @@ import ic2.api.energy.tile.IEnergySink; import java.util.ArrayList; import java.util.Arrays; +import api.cofh.energy.IEnergyReceiver; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.tileentity.TileEntity; @@ -25,7 +26,6 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import cofh.api.energy.IEnergyReceiver; public class GregtechMetaPipeEntity_SuperConductor extends GregtechMetaPipeEntityBase_Cable implements IMetaTileEntityCable { public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java index 1d10cb71b2..4daa150889 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java @@ -22,6 +22,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; +import api.cofh.energy.IEnergyReceiver; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -31,7 +32,6 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import cofh.api.energy.IEnergyReceiver; public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements IMetaTileEntityCable { public final float mThickNess; |