From 80e084ea7fe7b04883b1927b816bd0058e5766a4 Mon Sep 17 00:00:00 2001 From: MachineMuse Date: Sat, 19 Jan 2013 07:12:42 -0700 Subject: [PATCH] See extended description --- resource/moreiconideas.txt | 8 + resource/museicons.png | Bin 5382 -> 0 bytes resource/watericons.png | Bin 14465 -> 6894 bytes .../machinemuse/general/MuseStringUtils.java | 2 +- .../net/machinemuse/general/gui/MuseIcon.java | 33 +- .../general/gui/frame/ItemSelectionFrame.java | 73 ++-- .../powersuits/client/ClientProxy.java | 8 +- .../powersuits/client/KeybindKeyHandler.java | 45 +++ .../powersuits/client/ToolModel.java | 218 ++++++++++-- ...uipmentRenderer.java => ToolRenderer.java} | 91 +---- .../powersuits/common/CommonProxy.java | 1 + .../machinemuse/powersuits/common/Config.java | 75 ++-- .../powersuits/common/PowersuitsMod.java | 5 +- .../powersuits/common/RecipeManager.java | 336 ++++++++++++++---- .../powersuits/event/MovementManager.java | 11 + .../powersuits/item/ItemComponent.java | 65 ++-- .../powersuits/item/ItemPowerArmor.java | 16 +- .../powersuits/item/ItemPowerTool.java | 8 +- .../powersuits/item/ModularCommon.java | 60 +++- .../tick/PlayerTickHandlerClient.java | 32 +- 20 files changed, 768 insertions(+), 319 deletions(-) create mode 100644 resource/moreiconideas.txt delete mode 100644 resource/museicons.png create mode 100644 src/minecraft/net/machinemuse/powersuits/client/KeybindKeyHandler.java rename src/minecraft/net/machinemuse/powersuits/client/{EquipmentRenderer.java => ToolRenderer.java} (68%) diff --git a/resource/moreiconideas.txt b/resource/moreiconideas.txt new file mode 100644 index 0000000..8f3885e --- /dev/null +++ b/resource/moreiconideas.txt @@ -0,0 +1,8 @@ + +BTW, some new components that will be added soon (and added to the cost of existing modules as well as some new ones): +-Tungsten plating (for heat capacity) +-Cooling systems of some sort +-Carbon myofibers (artificial muscles, will supplement servos in movement modules) +-Control circuits (for modules that can be configured on-the-fly) +-Laser/hologram emitters (for HUD-related modules as well as cosmetic ones) +-Force field generators (to make energy shields more difficult to acquire, and perhaps add some some other things like an item magnet, hover mode, etc.) diff --git a/resource/museicons.png b/resource/museicons.png deleted file mode 100644 index 307e73d16a8947c58fd9a4a9dcd19e01e4c558ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5382 zcmeHL_ct33w2$2yrC+U4yH7A>>(L$WM*d24ab)z#EX9yZ+)?n z0j?l-GHZ-hz!w+B32$1wUq-(07+AR9vMYJbCPy=+S-jjxL9$HbirjN0LpMXi{LBHF z5Y*aa$YC*PvEYWVXQGnr*tM0V7J{?d_7J_KdtVK=Potgm;1E2B@#aGMj=xipFj?^3 z#PSCr395arraz`IDMKPE74kIMaP~58I{-m&_DS15jrWAuH)F9&*iz9*y3w6pb_5gnO&c-EFDh7SIqT-pMr zjpw!M>`XKD?S%p0~!Hb`#e>*|Q~qSacLV;^zX$jC@hpa?mql>Yas zWjm$5bK|(Tx0h51g2X{u?APsjVzgI6bzXn!*N-^}s;;c`3WV7>usS*^2v{N;L;~7p zIWb^yfM2=Q6JZS4-_MVm?Ek|JOuCu~d3-Imm<=ery7}~HT&&)Nw#^II0d#vv{#w~=9mvhOWenA-w=c2zd_k(@ zSthgiSf6skVd}SKbrV35O^EhpESVZVkn@LGn;cA5B8yn(p#R*QX>^M{N$VBdK^5w< zBEk1T zU-9fz=%{&~xNi7bb!~mePi%pjSCu_%kwT#q59~jI*{pv};^=G(Btcacn_v!Y;yQQv zO4;;QqGsr9Tmq3?0t!`lJYG8kbkgqa>q}W(Uq7BPV{*K5!A2X3V6$s-{hAmw`z_hR zppVl#9ui}hsvBs0b)WcWEy{g zZPM{e5nuZ51*P7I|5|boi$v}|2&kfdt2Rb^lg6Q#UXMeb`eyINkzp%)mBq((Evz0w zvt~^~Cw+D=Qjz)k3JWOs>&m$n-wVcp4`-Um4s26gU4r?}tD4LbtR)56LNjC*2A$&= zf;cG3cRWks;6vI)%-u;-m4y-_+Dfcf^8JZm;mwN;5uHot#O$7@7Y+QF?WE;Rt=Wj= z?YK`7nKi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zxN<8a+j+OiB3@tqa^50FIAqWWUwiLNVWJa4?d%6Rdw~)Np76+ zk@%}jaHe~=mh-)3KIC1g%aqyd?c-Z>6o~>Zm#Q!5-rC(8$1rgBm!^21YcmL6 z-h-SRj2;f^u+h+DZ;bV~ZcMVX%5L^`d8c`>z)hB=>#hNIM@3eaS+1!_QB>qL(YkK_}AcUq1XU#o3J=sC;?k)Z6Q;=OoPKP%|}j(38#94J%t=hMYzbo)B!?}Vc8ob?XD zb*BI73rP*M(iCKcWGj1qz!rZ^rkVM~tP{xImhQt_oQm5(BuS8*Y+9KjBPFigr zVV@LUo)F%HCov$=Uu?e4wrJ{XJ{{NE`boUJamOdX>8-+Pw)D zmRQ5yN4=#4Ly0KS$#3h85P7T`%ecOFmdk|{UGaus-yC5x*#tb9C}bi3`auE50&ZH5 zxVVv@O$Ld78mn)}{~&(+(P`jWB0;qe+A16|cvy^EhQb>qL)^s`#__DT5iYrCR(9p| zl3v{~+>4*=w^_PiuHnEG(;RCpa9aE+`%=aAg;ge*2P?5%c2&mxQmH=sm16IMY0b!j zd>QrT=HmIpO4Ybgk)X(D&Cr=bEOX$o;=xhr_|5yn8 eS>Ow3?7SMrVyM<57CbBny^>avDt=+)|9=57$2wL3 diff --git a/src/minecraft/net/machinemuse/general/MuseStringUtils.java b/src/minecraft/net/machinemuse/general/MuseStringUtils.java index c1dc21b..8209366 100644 --- a/src/minecraft/net/machinemuse/general/MuseStringUtils.java +++ b/src/minecraft/net/machinemuse/general/MuseStringUtils.java @@ -92,7 +92,7 @@ public abstract class MuseStringUtils { break; } strlist.add(str.substring(i, j)); - i = j; + i = j+1; } strlist.add(str.substring(i)); diff --git a/src/minecraft/net/machinemuse/general/gui/MuseIcon.java b/src/minecraft/net/machinemuse/general/gui/MuseIcon.java index cdf2dc1..c3a2878 100644 --- a/src/minecraft/net/machinemuse/general/gui/MuseIcon.java +++ b/src/minecraft/net/machinemuse/general/gui/MuseIcon.java @@ -45,23 +45,32 @@ public class MuseIcon { public static final MuseIcon IRON_PLATING = new MuseIcon(WC_ICON_PATH, 7); public static final MuseIcon DIAMOND_PLATING = new MuseIcon(WC_ICON_PATH, 8); public static final MuseIcon HEART = new MuseIcon(WC_ICON_PATH, 13); - public static final MuseIcon BATTERY_FULL = new MuseIcon(WC_ICON_PATH, 14); - public static final MuseIcon BATTERY_EMPTY = new MuseIcon(WC_ICON_PATH, 15); + public static final MuseIcon FIELD_EMITTER = new MuseIcon(WC_ICON_PATH, 14); + public static final MuseIcon CARBON_MYOFIBER = new MuseIcon(WC_ICON_PATH, 15); public static final MuseIcon SHOCK_ABSORBER = new MuseIcon(WC_ICON_PATH, 16); public static final MuseIcon PARACHUTE_MODULE = new MuseIcon(WC_ICON_PATH, 18); public static final MuseIcon TRANSPARENT_ARMOR = new MuseIcon(WC_ICON_PATH, 20); - public static final MuseIcon GO_FAST = new MuseIcon(WC_ICON_PATH, 21); + public static final MuseIcon SWIM_BOOST = new MuseIcon(WC_ICON_PATH, 21); // Component icons - public static final MuseIcon COMPONENT_WIRING = new MuseIcon(WC_ICON_PATH, 32); - public static final MuseIcon COMPONENT_SOLENOID = new MuseIcon(WC_ICON_PATH, 33); - public static final MuseIcon COMPONENT_GLIDERWING = new MuseIcon(WC_ICON_PATH, 35); - public static final MuseIcon COMPONENT_SERVOMOTOR = new MuseIcon(WC_ICON_PATH, 34); - public static final MuseIcon COMPONENT_IONTHRUSTER = new MuseIcon(WC_ICON_PATH, 36); - public static final MuseIcon COMPONENT_LVCAPACITOR = new MuseIcon(WC_ICON_PATH, 37); - public static final MuseIcon COMPONENT_PARACHUTE = new MuseIcon(WC_ICON_PATH, 38); - public static final MuseIcon COMPONENT_MVCAPACITOR = new MuseIcon(WC_ICON_PATH, 53); - public static final MuseIcon COMPONENT_HVCAPACITOR = new MuseIcon(WC_ICON_PATH, 69); + public static final MuseIcon WIRING = new MuseIcon(WC_ICON_PATH, 32); + public static final MuseIcon SOLENOID = new MuseIcon(WC_ICON_PATH, 33); + public static final MuseIcon GLIDERWING = new MuseIcon(WC_ICON_PATH, 35); + public static final MuseIcon SERVOMOTOR = new MuseIcon(WC_ICON_PATH, 34); + public static final MuseIcon IONTHRUSTER = new MuseIcon(WC_ICON_PATH, 36); + public static final MuseIcon LVCAPACITOR = new MuseIcon(WC_ICON_PATH, 37); + public static final MuseIcon PARACHUTE = new MuseIcon(WC_ICON_PATH, 38); + public static final MuseIcon MVCAPACITOR = new MuseIcon(WC_ICON_PATH, 53); + public static final MuseIcon HVCAPACITOR = new MuseIcon(WC_ICON_PATH, 69); + public static final MuseIcon BATTERY1 = new MuseIcon(WC_ICON_PATH, 30); + public static final MuseIcon BATTERY2 = new MuseIcon(WC_ICON_PATH, 46); + public static final MuseIcon BATTERYCRYSTAL = new MuseIcon(WC_ICON_PATH, 62); + public static final MuseIcon ALIEN = new MuseIcon(WC_ICON_PATH, 78); + public static final MuseIcon NETHERSTAR = new MuseIcon(WC_ICON_PATH, 94); + public static final MuseIcon ARCREACTOR = new MuseIcon(WC_ICON_PATH, 110); + public static final MuseIcon CIRCUIT = new MuseIcon(WC_ICON_PATH, 31); + public static final MuseIcon LAMP = new MuseIcon(WC_ICON_PATH, 47); + public static final MuseIcon CRYSTAL = new MuseIcon(WC_ICON_PATH, 63); String texturefile; int index; diff --git a/src/minecraft/net/machinemuse/general/gui/frame/ItemSelectionFrame.java b/src/minecraft/net/machinemuse/general/gui/frame/ItemSelectionFrame.java index 01ff002..575bd55 100644 --- a/src/minecraft/net/machinemuse/general/gui/frame/ItemSelectionFrame.java +++ b/src/minecraft/net/machinemuse/general/gui/frame/ItemSelectionFrame.java @@ -17,7 +17,7 @@ public class ItemSelectionFrame extends ScrollableFrame { protected int selectedItemStack = -1; protected EntityPlayer player; protected List itemPoints; - + public ItemSelectionFrame(Point2D topleft, Point2D bottomright, Colour borderColour, Colour insideColour, EntityPlayer player) { super(topleft, bottomright, borderColour, insideColour); @@ -27,7 +27,7 @@ public class ItemSelectionFrame extends ScrollableFrame { loadPoints(slots.size()); loadItems(); } - + private void loadPoints(int num) { double centerx = (topleft.x() + bottomright.x()) / 2; double centery = (topleft.y() + bottomright.y()) / 2; @@ -42,50 +42,54 @@ public class ItemSelectionFrame extends ScrollableFrame { point, 200)); } } - + private void loadItems() { - itemButtons = new ArrayList(); - double centerx = (topleft.x() + bottomright.x()) / 2; - double centery = (topleft.y() + bottomright.y()) / 2; - List slots = ItemUtils - .getModularItemSlotsInInventory(player.inventory); - if (slots.size() > itemPoints.size()) { - loadPoints(slots.size()); - } - if (slots.size() > 0) { - Iterator pointiterator = itemPoints.iterator(); - - for (int slot : slots) { - ClickableItem clickie = new ClickableItem( - player.inventory.getStackInSlot(slot), - pointiterator.next(), slot); - itemButtons.add(clickie); + if (player != null) { + itemButtons = new ArrayList(); + double centerx = (topleft.x() + bottomright.x()) / 2; + double centery = (topleft.y() + bottomright.y()) / 2; + List slots = ItemUtils + .getModularItemSlotsInInventory(player.inventory); + if (slots.size() > itemPoints.size()) { + loadPoints(slots.size()); + } + if (slots.size() > 0) { + Iterator pointiterator = itemPoints.iterator(); + + for (int slot : slots) { + ClickableItem clickie = new ClickableItem( + player.inventory.getStackInSlot(slot), + pointiterator.next(), slot); + itemButtons.add(clickie); + } } } } - - @Override public void update(double mousex, double mousey) { + + @Override + public void update(double mousex, double mousey) { loadItems(); - + } - - @Override public void draw() { + + @Override + public void draw() { drawBackground(); drawItems(); drawSelection(); } - + private void drawBackground() { MuseRenderer.drawFrameRect(topleft, bottomright, borderColour, insideColour, 0, 4); } - + private void drawItems() { for (ClickableItem item : itemButtons) { item.draw(); } } - + private void drawSelection() { if (selectedItemStack != -1) { MuseRenderer.drawCircleAround( @@ -96,10 +100,11 @@ public class ItemSelectionFrame extends ScrollableFrame { 10); } } + public boolean hasNoItems() { return itemButtons.size() == 0; } - + public ClickableItem getSelectedItem() { if (itemButtons.size() > selectedItemStack && selectedItemStack != -1) { return itemButtons.get(selectedItemStack); @@ -107,8 +112,9 @@ public class ItemSelectionFrame extends ScrollableFrame { return null; } } - - @Override public void onMouseDown(double x, double y, int button) { + + @Override + public void onMouseDown(double x, double y, int button) { int i = 0; for (ClickableItem item : itemButtons) { if (item.hitBox(x, y)) { @@ -119,8 +125,9 @@ public class ItemSelectionFrame extends ScrollableFrame { } } } - - @Override public List getToolTip(int x, int y) { + + @Override + public List getToolTip(int x, int y) { int itemHover = -1; int i = 0; for (ClickableItem item : itemButtons) { @@ -137,5 +144,5 @@ public class ItemSelectionFrame extends ScrollableFrame { return null; } } - + } diff --git a/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java b/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java index 90ded59..d17726e 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java +++ b/src/minecraft/net/machinemuse/powersuits/client/ClientProxy.java @@ -22,17 +22,17 @@ import cpw.mods.fml.relauncher.Side; * */ public class ClientProxy extends CommonProxy { - private static EquipmentRenderer equipmentRenderer = new EquipmentRenderer(); + private static ToolRenderer toolRenderer = new ToolRenderer(); private static RenderTickHandler renderTickHandler; private static PlayerTickHandlerClient playerTickHandler; + public static KeybindKeyHandler keybindHandler; /** * Register all the custom renderers for this mod. */ @Override public void registerRenderers() { - // MinecraftForgeClient.registerItemRenderer(PowersuitsMod.powerTool.itemID, - // equipmentRenderer); + MinecraftForgeClient.registerItemRenderer(PowersuitsMod.powerTool.itemID, toolRenderer); int tinkTableRenderID = RenderingRegistry.getNextAvailableRenderId(); TinkerTableRenderer tinkTableRenderer = new TinkerTableRenderer( tinkTableRenderID); @@ -52,6 +52,8 @@ public class ClientProxy extends CommonProxy { */ @Override public void registerHandlers() { + keybindHandler = new KeybindKeyHandler(); + playerTickHandler = new PlayerTickHandlerClient(); TickRegistry.registerTickHandler(playerTickHandler, Side.CLIENT); diff --git a/src/minecraft/net/machinemuse/powersuits/client/KeybindKeyHandler.java b/src/minecraft/net/machinemuse/powersuits/client/KeybindKeyHandler.java new file mode 100644 index 0000000..682f8b7 --- /dev/null +++ b/src/minecraft/net/machinemuse/powersuits/client/KeybindKeyHandler.java @@ -0,0 +1,45 @@ +package net.machinemuse.powersuits.client; + +import java.util.EnumSet; + +import org.lwjgl.input.Keyboard; + +import net.minecraft.client.settings.KeyBinding; +import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; +import cpw.mods.fml.common.TickType; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class KeybindKeyHandler extends KeyHandler { + public static KeyBinding openKeybindGUI = new KeyBinding("Open Muse Keybind GUI", Keyboard.KEY_K); + + public KeybindKeyHandler() { + super(new KeyBinding[]{openKeybindGUI}, new boolean[]{false}); + } + + @Override + public String getLabel() { + return "machineMuseKeybinds"; + } + + @Override + public void keyDown(EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { + if(kb.equals(openKeybindGUI)) { + + } + } + + @Override + public void keyUp(EnumSet types, KeyBinding kb, boolean tickEnd) { + // TODO Auto-generated method stub + + } + + @Override + public EnumSet ticks() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/minecraft/net/machinemuse/powersuits/client/ToolModel.java b/src/minecraft/net/machinemuse/powersuits/client/ToolModel.java index 09fe5c5..5eb2ad4 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/ToolModel.java +++ b/src/minecraft/net/machinemuse/powersuits/client/ToolModel.java @@ -6,12 +6,25 @@ package net.machinemuse.powersuits.client; +import net.machinemuse.powersuits.common.MuseLogger; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.ForgeHooksClient; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; public class ToolModel extends ModelBase { + public final static String TEXTUREPATH = "/resource/tool.png"; // fields ModelRenderer mainarm; @@ -269,45 +282,168 @@ public class ToolModel extends ModelBase setRotation(supportleft5, 0F, -0.7714355F, 0F); } - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + public static int xtap; + public static int ytap; + public static int ztap; + public static boolean tap; + + public void render(Entity entity, float scale, boolean isFirstPerson) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5); - mainarm.render(f5); - armorright.render(f5); - armorleft.render(f5); - wristtopright.render(f5); - wristtopleft.render(f5); - wristbottomright.render(f5); - wristbottomleft.render(f5); - index1.render(f5); - index2.render(f5); - middlefinger1.render(f5); - middlefinger2.render(f5); - ringfinger1.render(f5); - ringfinger2.render(f5); - pinky1.render(f5); - pinky2.render(f5); - thumb1.render(f5); - thumb2.render(f5); - fingerguard.render(f5); - crystalholder.render(f5); - crystal.render(f5); - supportright1.render(f5); - supportright2.render(f5); - supportright3.render(f5); - supportright4.render(f5); - supportright5.render(f5); - supportbaseright.render(f5); - palm.render(f5); - supportbaseleft.render(f5); - supportleftfront.render(f5); - supportrightfront.render(f5); - supportleft1.render(f5); - supportleft2.render(f5); - supportleft3.render(f5); - supportleft4.render(f5); - supportleft5.render(f5); + // super.render(entity, f, f1, f2, f3, f4, f5); + int numsegments = 16; + if (!tap) { + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)) { + xtap = (xtap + 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)) { + ytap = (ytap + 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3)) { + ztap = (ztap + 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)) { + xtap = (xtap - 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)) { + ytap = (ytap - 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD6)) { + ztap = (ztap - 1); + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD8)) { + xtap = 0; + ytap = 0; + ztap = 0; + tap = true; + } + if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD0)) { + MuseLogger.logDebug(xtap + ", " + ytap + ", " + ztap); + tap = true; + } + } else { + if (!Keyboard.isKeyDown(Keyboard.KEY_NUMPAD0) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD3) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5) + && !Keyboard.isKeyDown(Keyboard.KEY_NUMPAD6)) { + tap = false; + } + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + tap = false; + } + } + GL11.glPushMatrix(); + + ForgeHooksClient.bindTexture(TEXTUREPATH, 0); + + double scale1 = 1.0 / 16.0; + boolean isThisEntity = entity == Minecraft.getMinecraft().renderViewEntity; + isFirstPerson = (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0); + boolean isInInventoryGui = Minecraft.getMinecraft().currentScreen instanceof GuiInventory + || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative; + boolean doFirstPersonRender = isThisEntity && isFirstPerson && !isInInventoryGui; + if (doFirstPersonRender) { + // if (entity instanceof EntityPlayer) { + // EntityPlayer player = (EntityPlayer) entity; + // RenderPlayer rp = new RenderPlayer(); + // // Render first person hand: + // rp.func_82441_a(player); + // } + GL11.glScaled(scale1, scale1, scale1); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glRotatef(270, 1, 0, 0); + GL11.glRotatef(45, 0, 1, 0); + GL11.glRotatef(-90, 0, 0, 1); + GL11.glTranslatef(0, 0, 4); + // GL11.glRotatef(xtap, 1, 0, 0); + // GL11.glRotatef(ytap, 0, 1, 0); + // GL11.glRotatef(ztap, 0, 0, 1); + + } else { + GL11.glScaled(-scale1, scale1, scale1); + GL11.glRotatef(-90, 0, 1, 0); + GL11.glRotatef(180, 0, 0, 1); + GL11.glRotatef(35, 1, 0, 0); + + GL11.glRotatef(-5, 0, 1, 0); + GL11.glRotatef(1.5F, 0, 0, 1); + GL11.glTranslatef(2 / 4.0F, 3 / 4.0F, 1 / 4.0F); + GL11.glTranslatef(-2, -1, 4); + + } + GL11.glPushMatrix(); + // Compensate for offset when Sebk was doing his rendering + GL11.glRotatef(-15, 1, 0, 0); + GL11.glTranslatef(3, 0, 8); + GL11.glScalef(1 / 1.5F, 1 / 1.5F, 1 / 1.5F); + if (doFirstPersonRender) { + mainarm.render(scale); + } + armorright.render(scale); + armorleft.render(scale); + wristtopright.render(scale); + wristtopleft.render(scale); + wristbottomright.render(scale); + wristbottomleft.render(scale); + index1.render(scale); + index2.render(scale); + middlefinger1.render(scale); + middlefinger2.render(scale); + ringfinger1.render(scale); + ringfinger2.render(scale); + pinky1.render(scale); + pinky2.render(scale); + thumb1.render(scale); + thumb2.render(scale); + fingerguard.render(scale); + crystalholder.render(scale); + supportright1.render(scale); + supportright2.render(scale); + supportright3.render(scale); + supportright4.render(scale); + supportright5.render(scale); + supportbaseright.render(scale); + palm.render(scale); + supportbaseleft.render(scale); + supportleftfront.render(scale); + supportrightfront.render(scale); + supportleft1.render(scale); + supportleft2.render(scale); + supportleft3.render(scale); + supportleft4.render(scale); + supportleft5.render(scale); + + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F); + + crystal.render(scale); + + GL11.glPopMatrix(); + // GL11.glDisable(GL11.GL_DEPTH_TEST); + // GL11.glBegin(GL11.GL_LINES); + // + // GL11.glColor3f(1, 0, 0); + // GL11.glVertex3f(-16, 0, 0); + // GL11.glVertex3f(16, 0, 0); + // + // GL11.glColor3f(0, 1, 0); + // GL11.glVertex3f(0, -16, 0); + // GL11.glVertex3f(0, 16, 0); + // + // GL11.glColor3f(0, 0, 1); + // GL11.glVertex3f(0, 0, -16); + // GL11.glVertex3f(0, 0, 16); + // GL11.glColor3f(1, 1, 1); + // GL11.glEnd(); + // GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glPopMatrix(); } private void setRotation(ModelRenderer model, float x, float y, float z) @@ -317,6 +453,12 @@ public class ToolModel extends ModelBase model.rotateAngleZ = z; } + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are + * used for animating the movement of arms and legs, where par1 represents + * the time(so that arms and legs swing back and forth) and par2 represents + * how "far" arms and legs can swing at most. + */ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, 0.0625f, null); diff --git a/src/minecraft/net/machinemuse/powersuits/client/EquipmentRenderer.java b/src/minecraft/net/machinemuse/powersuits/client/ToolRenderer.java similarity index 68% rename from src/minecraft/net/machinemuse/powersuits/client/EquipmentRenderer.java rename to src/minecraft/net/machinemuse/powersuits/client/ToolRenderer.java index 9f4d26b..02c214b 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/EquipmentRenderer.java +++ b/src/minecraft/net/machinemuse/powersuits/client/ToolRenderer.java @@ -1,7 +1,12 @@ package net.machinemuse.powersuits.client; +import org.lwjgl.opengl.GL11; + +import net.machinemuse.general.geometry.Colour; import net.machinemuse.general.geometry.MuseRenderer; +import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.powersuits.item.IModularItem; +import net.machinemuse.powersuits.item.ItemPowerTool; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderEngine; import net.minecraft.client.renderer.entity.Render; @@ -11,6 +16,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.storage.MapData; +import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.IItemRenderer; /** @@ -21,7 +27,8 @@ import net.minecraftforge.client.IItemRenderer; * @author MachineMuse * */ -public class EquipmentRenderer extends Render implements IItemRenderer { +public class ToolRenderer extends Render implements IItemRenderer { + public ToolModel model = new ToolModel(); /** * Forge checks this to see if our custom renderer will handle a certain @@ -51,98 +58,31 @@ public class EquipmentRenderer extends Render implements IItemRenderer { @Override public void renderItem(ItemRenderType type, ItemStack itemStack, Object... data) { - - IModularItem item; - if (itemStack.getItem() instanceof IModularItem) { - item = (IModularItem) (itemStack.getItem()); - } else { - return; - } - + boolean drawIcon = false; + switch (type) { case ENTITY: RenderBlocks renderEntity = (RenderBlocks) data[0]; EntityItem entityEntity = (EntityItem) data[1]; + model.render(null, 1, false); break; case INVENTORY: RenderBlocks renderInventory = (RenderBlocks) data[0]; + MuseRenderer.drawIconAt(0, 0, ItemPowerTool.getCurrentIconFor(itemStack), Colour.WHITE); break; case EQUIPPED: RenderBlocks renderEquipped = (RenderBlocks) data[0]; EntityLiving entityEquipped = (EntityLiving) data[1]; + model.render(entityEquipped, 1, false); break; case FIRST_PERSON_MAP: EntityPlayer playerFirstPerson = (EntityPlayer) data[0]; RenderEngine engineFirstPerson = (RenderEngine) data[1]; MapData mapDataFirstPerson = (MapData) data[2]; + model.render(playerFirstPerson, 1, true); break; default: } - switch (item.getItemType()) { - case PowerArmorHead: - drawHead(itemStack); - break; - case PowerArmorTorso: - drawTorso(itemStack); - break; - case PowerArmorLegs: - drawLegs(itemStack); - break; - case PowerArmorFeet: - drawFeet(itemStack); - break; - case PowerTool: - new ToolModel().render(null, 0, 0, 0, 0, 0, 0); - break; - default: - break; - } - } - - public void drawHead(ItemStack itemStack) { - } - - public void drawTorso(ItemStack itemStack) { - } - - public void drawLegs(ItemStack itemStack) { - float z = 1.0F; - float a = 1F; - - float[] v = { - 2, 1, z, - 14, 1, z, - 15, 15, z, - 9, 15, z, - 8, 5, z, - 7, 15, z, - 1, 15, z - }; - - float[] c = { - 1.0F, 1.0F, 1.0F, a, - 0.1F, 0.1F, 0.1F, a, - 0.1F, 0.1F, 0.1F, a, - 0.7F, 0.7F, 0.7f, a, - 0.8F, 0.8F, 0.8F, a, - 0.9F, 0.9F, 0.9F, a, - 1.0F, 1.0F, 1.0F, a - }; - int[] i = { - 0, 6, 5, - 0, 5, 4, - 0, 4, 1, - 1, 3, 2, - 1, 4, 3 - }; - MuseRenderer.drawTriangles2D(v, c, i); - } - - public void drawFeet(ItemStack itemStack) { - // MuseRenderer.drawRectPrism(0, 16, 0, 16, 0, 16); - } - - public void drawTool(ItemStack itemStack, ItemRenderType type) { } /** @@ -169,8 +109,7 @@ public class EquipmentRenderer extends Render implements IItemRenderer { @Override public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { - // TODO Auto-generated method stub - + } } diff --git a/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java b/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java index 53f9c85..e8776b2 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java +++ b/src/minecraft/net/machinemuse/powersuits/common/CommonProxy.java @@ -1,5 +1,6 @@ package net.machinemuse.powersuits.common; +import net.machinemuse.powersuits.client.KeybindKeyHandler; import net.machinemuse.powersuits.network.MusePacketHandler; import net.machinemuse.powersuits.tick.PlayerTickHandlerClient; import cpw.mods.fml.common.ITickHandler; diff --git a/src/minecraft/net/machinemuse/powersuits/common/Config.java b/src/minecraft/net/machinemuse/powersuits/common/Config.java index 4e77fb6..0b839c9 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/Config.java +++ b/src/minecraft/net/machinemuse/powersuits/common/Config.java @@ -1,16 +1,21 @@ package net.machinemuse.powersuits.common; -import cpw.mods.fml.common.Loader; +import org.lwjgl.input.Keyboard; + +import net.machinemuse.general.MuseStringUtils; import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.powersuits.item.ItemComponent; import net.machinemuse.powersuits.item.ModularCommon; import net.machinemuse.powersuits.powermodule.ModuleManager; import net.machinemuse.powersuits.powermodule.PowerModule; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; /** * Initial attempt at storing all tweakable/configurable values in one class. @@ -139,23 +144,23 @@ public class Config { boolean[] ALLITEMS = { true, true, true, true, true }; PowerModule module; - module = new PowerModule(ModularCommon.MODULE_IRON_PLATING, ARMORONLY, MuseIcon.IRON_PLATING, ModularCommon.CATEGORY_ARMOR) - .setDescription("Iron plating is heavy but protective.") - .addInstallCost(new ItemStack(Item.ingotIron, 5)) + module = new PowerModule(ModularCommon.MODULE_BASIC_PLATING, ARMORONLY, MuseIcon.IRON_PLATING, ModularCommon.CATEGORY_ARMOR) + .setDescription("Basic plating is heavy but protective.") + .addInstallCost(copyAndResize(ItemComponent.basicPlating, 1)) .addTradeoffProperty("Plating Thickness", ModularCommon.ARMOR_VALUE_PHYSICAL, 5, " Points") .addTradeoffProperty("Plating Thickness", ModularCommon.WEIGHT, 10000, "g"); ModuleManager.addModule(module); module = new PowerModule(ModularCommon.MODULE_DIAMOND_PLATING, ARMORONLY, MuseIcon.DIAMOND_PLATING, ModularCommon.CATEGORY_ARMOR) - .setDescription("Diamonds are lighter, harder, and more protective than Iron but much harder to find.") - .addInstallCost(new ItemStack(Item.diamond, 5)) + .setDescription("Advanced plating is lighter, harder, and more protective than Basic but much harder to make.") + .addInstallCost(copyAndResize(ItemComponent.advancedPlating, 1)) .addTradeoffProperty("Plating Thickness", ModularCommon.ARMOR_VALUE_PHYSICAL, 6, " Points") .addTradeoffProperty("Plating Thickness", ModularCommon.WEIGHT, 6000, "g"); ModuleManager.addModule(module); 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.solenoid, 4)) + .addInstallCost(copyAndResize(ItemComponent.fieldEmitter, 4)) .addTradeoffProperty("Field Strength", ModularCommon.ARMOR_VALUE_ENERGY, 6, " Points") .addTradeoffProperty("Field Strength", ModularCommon.ARMOR_ENERGY_CONSUMPTION, 500, "J"); ModuleManager.addModule(module); @@ -190,7 +195,7 @@ public class Config { .addTradeoffProperty("Overclock", ModularCommon.PICKAXE_HARVEST_SPEED, 18); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_BATTERY_BASIC, ALLITEMS, MuseIcon.COMPONENT_LVCAPACITOR, ModularCommon.CATEGORY_ENERGY) + module = new PowerModule(ModularCommon.MODULE_BATTERY_BASIC, ALLITEMS, MuseIcon.BATTERY1, ModularCommon.CATEGORY_ENERGY) .setDescription("Integrate a battery to allow the item to store energy.") .addInstallCost(copyAndResize(ItemComponent.lvcapacitor, 1)) .addBaseProperty(ModularCommon.MAXIMUM_ENERGY, 20000, "J") @@ -199,7 +204,7 @@ public class Config { .addTradeoffProperty("Battery Size", ModularCommon.WEIGHT, 8000); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_BATTERY_ADVANCED, ALLITEMS, MuseIcon.BATTERY_EMPTY, ModularCommon.CATEGORY_ENERGY) + module = new PowerModule(ModularCommon.MODULE_BATTERY_ADVANCED, ALLITEMS, MuseIcon.BATTERY2, ModularCommon.CATEGORY_ENERGY) .setDescription("Integrate a more advanced battery to store more energy.") .addInstallCost(copyAndResize(ItemComponent.mvcapacitor, 1)) .addBaseProperty(ModularCommon.MAXIMUM_ENERGY, 100000, "J") @@ -208,7 +213,7 @@ public class Config { .addTradeoffProperty("Battery Size", ModularCommon.WEIGHT, 8000); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_BATTERY_ELITE, ALLITEMS, MuseIcon.BATTERY_FULL, ModularCommon.CATEGORY_ENERGY) + module = new PowerModule(ModularCommon.MODULE_BATTERY_ELITE, ALLITEMS, MuseIcon.BATTERYCRYSTAL, ModularCommon.CATEGORY_ENERGY) .setDescription("Integrate a the most advanced battery to store an extensive amount of energy.") .addInstallCost(copyAndResize(ItemComponent.hvcapacitor, 1)) .addBaseProperty(ModularCommon.MAXIMUM_ENERGY, 750000, "J") @@ -223,27 +228,17 @@ public class Config { .addInstallCost(new ItemStack(Item.diamond, 3)); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_RED_TINT, ARMORONLY, MuseIcon.PLATE_2_RED, ModularCommon.CATEGORY_COSMETIC) - .setDescription("Give your armor some red tinting. Combine with the other cosmetic modules to customize your armor's appearance.") - .addInstallCost(new ItemStack(Item.dyePowder, 1, 1)) - .addTradeoffProperty("Intensity", ModularCommon.MODULE_RED_TINT, 1, "%"); - ModuleManager.addModule(module); - - module = new PowerModule(ModularCommon.MODULE_GREEN_TINT, ARMORONLY, MuseIcon.PLATE_2_GREEN, ModularCommon.CATEGORY_COSMETIC) - .setDescription("Give your armor some green tinting. Combine with the other cosmetic modules to customize your armor's appearance.") - .addInstallCost(new ItemStack(Item.dyePowder, 1, 2)) - .addTradeoffProperty("Intensity", ModularCommon.MODULE_GREEN_TINT, 1, "%"); - ModuleManager.addModule(module); - - module = new PowerModule(ModularCommon.MODULE_BLUE_TINT, ARMORONLY, MuseIcon.PLATE_2_BLUE, ModularCommon.CATEGORY_COSMETIC) - .setDescription("Give your armor some blue tinting. Combine with the other cosmetic modules to customize your armor's appearance.") - .addInstallCost(new ItemStack(Item.dyePowder, 1, 4)) - .addTradeoffProperty("Intensity", ModularCommon.MODULE_BLUE_TINT, 1, "%"); + 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)) + .addTradeoffProperty("Red Intensity", ModularCommon.RED_TINT, 1, "%") + .addTradeoffProperty("Green Intensity", ModularCommon.GREEN_TINT, 1, "%") + .addTradeoffProperty("Blue Intensity", ModularCommon.BLUE_TINT, 1, "%"); ModuleManager.addModule(module); 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.") - .addInstallCost(new ItemStack(Block.glass, 3)); + .addInstallCost(copyAndResize(ItemComponent.laserHologram, 1)); ModuleManager.addModule(module); module = new PowerModule(ModularCommon.MODULE_SPRINT_ASSIST, LEGSONLY, MuseIcon.SPRINT_ASSIST, ModularCommon.CATEGORY_MOVEMENT) @@ -266,6 +261,10 @@ public class Config { module, "Power", ModularCommon.JUMP_ENERGY_CONSUMPTION, "J", 0, 5, ModularCommon.JUMP_MULTIPLIER, "%", 1, 4); + ModuleManager.addSimpleTradeoff( + module, "Compensation", + ModularCommon.JUMP_ENERGY_CONSUMPTION, "J", 0, 1, + ModularCommon.JUMP_FOOD_COMPENSATION, "%", 0, 1); ModuleManager.addModule(module); module = new PowerModule(ModularCommon.MODULE_SHOCK_ABSORBER, FEETONLY, MuseIcon.SHOCK_ABSORBER, ModularCommon.CATEGORY_MOVEMENT) @@ -322,7 +321,7 @@ public class Config { .addTradeoffProperty("Power", ModularCommon.UNDERWATER_HARVEST_SPEED, 0.8); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_SWIM_BOOST, LEGSONLY, MuseIcon.INDICATOR_1_BLUE, ModularCommon.CATEGORY_AQUATIC) + module = new PowerModule(ModularCommon.MODULE_SWIM_BOOST, LEGSONLY, MuseIcon.SWIM_BOOST, ModularCommon.CATEGORY_AQUATIC) .setDescription( "By refitting an ion thruster for underwater use, you may be able to add extra forward (or backward) thrust when underwater.") .addInstallCost(copyAndResize(ItemComponent.ionThruster, 1)) @@ -331,7 +330,7 @@ public class Config { .addTradeoffProperty("Thrust", ModularCommon.SWIM_BOOST_AMOUNT, 1, "m/s"); ModuleManager.addModule(module); - module = new PowerModule(ModularCommon.MODULE_CLIMB_ASSIST, LEGSONLY, MuseIcon.GO_FAST, ModularCommon.CATEGORY_MOVEMENT) + module = new PowerModule(ModularCommon.MODULE_CLIMB_ASSIST, LEGSONLY, MuseIcon.INDICATOR_1_BLUE, ModularCommon.CATEGORY_MOVEMENT) .setDescription("A pair of dedicated servos allow you to effortlessly step up 1m-high ledges.") .addInstallCost(copyAndResize(ItemComponent.servoMotor, 2)); ModuleManager.addModule(module); @@ -413,4 +412,22 @@ public class Config { public static Configuration getConfig() { return config; } + + public static boolean doAdditionalInfo() { + if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){ + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return true; + } + } + return false; + } + + public static Object additionalInfoInstructions() { + String message = "Press SHIFT for more information."; + message = MuseStringUtils.wrapMultipleFormatTags( + message, + MuseStringUtils.FormatCodes.Grey, + MuseStringUtils.FormatCodes.Italic); + return message; + } } diff --git a/src/minecraft/net/machinemuse/powersuits/common/PowersuitsMod.java b/src/minecraft/net/machinemuse/powersuits/common/PowersuitsMod.java index 8be2995..03417cb 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/PowersuitsMod.java +++ b/src/minecraft/net/machinemuse/powersuits/common/PowersuitsMod.java @@ -1,6 +1,7 @@ package net.machinemuse.powersuits.common; import net.machinemuse.powersuits.block.BlockTinkerTable; +import net.machinemuse.powersuits.client.KeybindKeyHandler; import net.machinemuse.powersuits.event.EventHandler; import net.machinemuse.powersuits.event.MovementManager; import net.machinemuse.powersuits.item.ItemComponent; @@ -36,7 +37,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; // Informs forge that this is a base mod class, and gives it some info for the // FML mod list. This is also where it looks to see if your client's version // matches the server's. -@Mod(modid = "mmmPowersuits", name = "MachineMuse's Modular Powersuits", version = "0.1.10") +@Mod(modid = "mmmPowersuits", name = "MachineMuse's Modular Powersuits", version = "0.1.37") // Informs forge of the requirements: // // clientSideRequired means players can't connect without it. True for things @@ -120,6 +121,7 @@ public class PowersuitsMod { tinkerTable = new BlockTinkerTable(); components = new ItemComponent(); components.populate(); + Config.loadPowerModules(); @@ -139,5 +141,6 @@ public class PowersuitsMod { public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); RecipeManager.addRecipes(); + Config.getConfig().save(); } } \ No newline at end of file diff --git a/src/minecraft/net/machinemuse/powersuits/common/RecipeManager.java b/src/minecraft/net/machinemuse/powersuits/common/RecipeManager.java index 37699d6..2a77313 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/RecipeManager.java +++ b/src/minecraft/net/machinemuse/powersuits/common/RecipeManager.java @@ -1,5 +1,6 @@ package net.machinemuse.powersuits.common; +import gregtechmod.api.GregTech_API; import ic2.api.Ic2Recipes; import net.machinemuse.powersuits.item.ItemComponent; import net.minecraft.block.Block; @@ -28,11 +29,38 @@ public class RecipeManager { ItemStack glass = new ItemStack(Block.glass); ItemStack glowstone = new ItemStack(Item.lightStoneDust); ItemStack emerald = new ItemStack(Item.emerald); - ItemStack lapis = new ItemStack(Item.dyePowder, 1, 4); // metadata 4 = - // 'blue' + ItemStack diamond = new ItemStack(Item.diamond); + ItemStack lapis = new ItemStack(Item.dyePowder, 1, 4); + ItemStack rosered = new ItemStack(Item.dyePowder, 1, 1); + ItemStack cactusgreen = new ItemStack(Item.dyePowder, 1, 2); ItemStack enderPearl = new ItemStack(Item.enderPearl); if (ModCompatability.vanillaRecipesEnabled()) { + GameRegistry.addRecipe(ItemComponent.basicPlating, + "II", + "CI", + "II", + 'C', ItemComponent.wiring, + 'I', iron); + + GameRegistry.addRecipe(ItemComponent.advancedPlating, + "II", + "CI", + "II", + 'C', ItemComponent.solenoid, + 'I', diamond); + + GameRegistry.addRecipe(ItemComponent.laserHologram, + "YTG", + "TWT", + "BTR", + 'W', ItemComponent.wiring, + 'T', glass, + 'Y', glowstone, + 'G', cactusgreen, + 'B', lapis, + 'R', rosered); + GameRegistry.addRecipe(new ItemStack(PowersuitsMod.tinkerTable), "ILI", "LEL", @@ -114,17 +142,60 @@ public class RecipeManager { "EIE", 'I', iron, 'E', ItemComponent.solenoid, 'W', ItemComponent.wiring); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.fieldEmitter, true, + "SES", + "ESE", + "SES", + 'S', ItemComponent.solenoid, + 'E', enderPearl)); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.controlCircuit, true, + "WGW", + "LWL", + "WGW", + 'W', ItemComponent.wiring, + 'G', glass, + 'L', lapis)); + GameRegistry.addRecipe(ItemComponent.ionThruster, - " EE", + " FE", "IG ", - "IEE", - 'I', iron, 'E', ItemComponent.solenoid, 'G', glowstone); + "IFE", + 'I', iron, + 'E', ItemComponent.solenoid, + 'G', glowstone, + 'F', ItemComponent.fieldEmitter); + } if (ModCompatability.UERecipesEnabled()) { String basicCircuit = "basicCircuit"; String advancedCircuit = "advancedCircuit"; String eliteCircuit = "eliteCircuit"; ItemStack lapisBlock = new ItemStack(Block.blockLapis); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.laserHologram, true, + "YTG", + "TWT", + "BTR", + 'W', ItemComponent.wiring, + 'T', glass, + 'Y', glowstone, + 'G', cactusgreen, + 'B', lapis, + 'R', rosered)); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.basicPlating, true, + "II", + "CI", + "II", + 'C', basicCircuit, + 'I', "plateSteel")); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.advancedPlating, true, + "II", + "CI", + "II", + 'C', advancedCircuit, + 'I', diamond)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.tinkerTable), true, "ILI", @@ -197,10 +268,24 @@ public class RecipeManager { " C ", "EIE", 'I', iron, 'E', ItemComponent.solenoid, 'C', "basicCircuit")); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.fieldEmitter, true, + "SES", + "ECE", + "SES", + 'S', ItemComponent.solenoid, + 'E', enderPearl, + 'C', "advancedCircuit")); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.ionThruster, true, - " EE", + " FE", "CG ", - "IEE", 'I', "plateSteel", 'E', ItemComponent.solenoid, 'G', glowstone, 'C', "advancedCircuit")); + "IFE", + 'I', + "plateSteel", + 'E', ItemComponent.solenoid, + 'G', glowstone, + 'C', "advancedCircuit", + 'F', ItemComponent.fieldEmitter)); } if (ModCompatability.IC2RecipesEnabled()) { circuit = ModCompatability.getIC2Item("electronicCircuit").copy(); @@ -213,9 +298,33 @@ public class RecipeManager { ItemStack energyCrystal = ModCompatability.getIC2Item("energyCrystal").copy(); ItemStack lapotronCrystal = ModCompatability.getIC2Item("lapotronCrystal").copy(); ItemStack iridiumOre = ModCompatability.getIC2Item("iridiumOre").copy(); - ItemStack carbonFiber = ModCompatability.getIC2Item("carbonPlate").copy(); + ItemStack carbonPlate = ModCompatability.getIC2Item("carbonPlate").copy(); ItemStack machine = ModCompatability.getIC2Item("machine").copy(); ItemStack advMachine = ModCompatability.getIC2Item("advancedMachine").copy(); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.laserHologram, true, + "YTG", + "TWT", + "BTR", + 'W', ItemComponent.wiring, + 'T', glass, + 'Y', glowstone, + 'G', cactusgreen, + 'B', lapis, + 'R', rosered)); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.basicPlating, true, + "II", + "CI", + "II", + 'C', circuit, + 'I', "ingotRefinedIron")); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.advancedPlating, true, + "II", + "CI", + "II", + 'C', advCircuit, + 'I', diamond)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.tinkerTable), true, "E", @@ -283,7 +392,7 @@ public class RecipeManager { " CC", "CCI", "C ", - 'C', carbonFiber.copy(), + 'C', carbonPlate.copy(), 'I', ItemComponent.solenoid)); GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.servoMotor, true, @@ -291,6 +400,14 @@ public class RecipeManager { "EME", 'M', machine.copy(), 'E', ItemComponent.solenoid, 'W', circuit.copy())); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.fieldEmitter, true, + "SES", + "ECE", + "SES", + 'S', ItemComponent.solenoid, + 'E', enderPearl, + 'C', advCircuit)); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.ionThruster, true, " EE", "MG ", @@ -305,103 +422,178 @@ public class RecipeManager { // This means Gregtech is installed, and GregoriusT in his infinite // wisdom has registered literally everything in the universe with // the ore dictionary, so we can just use strings here :D ...once we decide what to put. - circuit = ModCompatability.getIC2Item("electronicCircuit"); - ItemStack advCircuit = ModCompatability.getIC2Item("advancedCircuit"); - gold = ModCompatability.getIC2Item("goldCableItem"); - String refIron = "ingotRefinedIron"; - String tin = "ingotTin"; - String copper = "ingotCopper"; - ItemStack reBattery = ModCompatability.getIC2Item("reBattery").copy(); - ItemStack energyCrystal = ModCompatability.getIC2Item("energyCrystal").copy(); - ItemStack lapotronCrystal = ModCompatability.getIC2Item("lapotronCrystal").copy(); + String computerMonitor = "monitorTier02"; + String advancedCircuit = "circuitTier04"; + String refinedIron = "ingotRefinedIron"; + String advancedMachine = "rawMachineTier02"; + String dataStorageCircuit = "circuitTier05"; + String energyFlowCircuit = "circuitTier07"; + String machineParts = "itemMachineParts"; + String nitrogen = "molecule_1n"; + ItemStack neutronReflector = GregTech_API.getGregTechItem(40, 1, 0);; + String advancedHeatVent = "item.reactorVentDiamond"; + ItemStack carbonPlate = ModCompatability.getIC2Item("carbonPlate").copy(); + ItemStack uninsulatedCopper = ModCompatability.getIC2Item("copperCableItem").copy(); + ItemStack luminator = ModCompatability.getIC2Item("luminator").copy(); - ItemStack iridiumOre = ModCompatability.getIC2Item("iridiumOre"); - ItemStack carbonFiber = ModCompatability.getIC2Item("carbonPlate"); - ItemStack machine = ModCompatability.getIC2Item("machine"); - ItemStack advMachine = ModCompatability.getIC2Item("advancedMachine"); + + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.laserHologram, true, + "LLL", + "RGB", + "LLL", + 'L', luminator, + 'R', "gemRuby", + 'G', "gemGreenSapphire", + 'B', "gemSapphire")); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.basicPlating, true, + "II", + "CI", + "II", + 'C', advancedCircuit, + 'I', "ingotTitanium")); + + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.advancedPlating, true, + "II", + "CI", + "II", + 'C', dataStorageCircuit, + 'I', "plateIridium")); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.tinkerTable), true, - "E", "C", "M", - 'E', "gemEmerald", 'C', "circuitTier04", 'M', "rawMachineTier02")); + "CVC", + "IEI", + "IMI", + 'C', advancedCircuit, + 'E', emerald, + 'V', computerMonitor, + 'I', refinedIron, + 'M', advancedMachine)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.powerArmorHead), true, - "III", - "C C", - 'I', refIron, 'C', circuit.copy())); + "ACA", + "MVM", + 'A', "ingotAluminium", + 'C', dataStorageCircuit, + 'M', machineParts, + 'V', computerMonitor)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.powerArmorTorso), true, - "I I", - "CIC", - "III", - 'I', refIron, 'C', circuit.copy())); + "AMA", + "ACA", + "AAA", + 'A', "ingotAluminium", + 'C', dataStorageCircuit, + 'M', machineParts)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.powerArmorLegs), true, - "III", - "C C", - "I I", - 'I', refIron, 'C', circuit.copy())); + "MCM", + "A A", + "A A", + 'A', "ingotAluminium", + 'C', dataStorageCircuit, + 'M', machineParts)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.powerArmorFeet), true, - "C C", - "I I", - 'I', refIron, 'C', circuit.copy())); + "M M", + "ACA", + 'A', "ingotAluminium", + 'C', dataStorageCircuit, + 'M', machineParts)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(PowersuitsMod.powerTool), true, + "A A", + "AMA", " C ", - "CI ", - " IC", - 'I', refIron, 'C', circuit.copy())); + 'A', "ingotAluminium", + 'C', dataStorageCircuit, + 'M', machineParts)); GameRegistry.addRecipe(new ShapedOreRecipe(copyAndResize(ItemComponent.wiring, 2), true, - "GRG", 'G', gold.copy(), 'R', redstone)); + "CCC", + "SSS", + "CCC", + 'C', uninsulatedCopper, + 'S', "ingotSilver")); GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.parachute, true, - "WWW", "S S", 'W', wool, 'S', string)); + "WWW", + "S S", + "CNC", + 'W', wool, + 'S', string, + 'C', carbonPlate, + 'N', nitrogen)); Ic2Recipes.addCraftingRecipe(ItemComponent.lvcapacitor, - "WBW", - 'W', ItemComponent.wiring.copy(), - 'B', reBattery); + "IWI", + "IBI", + "IBI", + 'W', ItemComponent.wiring, + 'I', refinedIron, + 'B', "100kEUStore"); // Lithium battery Ic2Recipes.addCraftingRecipe(ItemComponent.mvcapacitor, - "WBW", - 'W', ItemComponent.wiring.copy(), - 'B', energyCrystal); + "IWI", + "IBI", + "IBI", + 'W', ItemComponent.wiring, + 'I', "ingotTitanium", + 'B', "1kkEUStore"); // Lapotron crystal Ic2Recipes.addCraftingRecipe(ItemComponent.hvcapacitor, - "WBW", - 'W', ItemComponent.wiring.copy(), - 'B', lapotronCrystal); + "IWI", + "IBI", + "IBI", + 'W', ItemComponent.wiring, + 'I', "ingotChrome", + 'B', "10kkEUStore"); // Lapotronic EnergyOrb GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.solenoid, true, - " W ", - "WIW", - " W ", + "WSW", + "WSW", + "WSW", 'W', ItemComponent.wiring, - 'I', machine)); + 'S', "ingotSteel")); GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.gliderWing, true, - " CC", - "CCI", - "C ", - 'C', carbonFiber.copy(), - 'I', ItemComponent.solenoid)); + " MC", + "MPI", + "M ", + 'P', carbonPlate, + 'M', "plateMagnalium", + 'I', ItemComponent.solenoid, + 'C', advancedCircuit)); GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.servoMotor, true, - " W ", - "EME", - 'M', machine.copy(), 'E', ItemComponent.solenoid, 'W', circuit.copy())); + "IBI", + "CSC", + "IBI", + 'I', "ingotSteel", + 'B', "ingotBrass", + 'C', advancedCircuit, + 'S', ItemComponent.solenoid)); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.fieldEmitter, true, + "ISI", + "CUC", + "ISI", + 'I', "plateIridium", + 'S', ItemComponent.solenoid, + 'U', energyFlowCircuit, + 'C', "itemSuperconductor")); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemComponent.ionThruster, true, - " EE", - "MG ", - "CEE", - 'I', iron, - 'E', ItemComponent.solenoid, - 'G', glowstone, - 'C', advCircuit.copy(), - 'M', advMachine.copy())); + "ISI", + "FCF", + "N N", + 'I', "plateIridium", + 'S', "itemSuperconductor", + 'N', neutronReflector, + 'C', ItemComponent.hvcapacitor, + 'F', ItemComponent.fieldEmitter)); } } } diff --git a/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java b/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java index dfce58b..7cc6514 100644 --- a/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java +++ b/src/minecraft/net/machinemuse/powersuits/event/MovementManager.java @@ -3,9 +3,12 @@ package net.machinemuse.powersuits.event; import java.util.HashMap; import java.util.Map; +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; @@ -41,6 +44,14 @@ public class MovementManager { if (drain < avail) { ItemUtils.drainPlayerEnergy(player, drain); setPlayerJumpTicks(player, jumpAssist); + double jumpCompensationRatio = ModuleManager.computeModularProperty(stack, ModularCommon.JUMP_FOOD_COMPENSATION); + MuseLogger.logDebug("Jumped"); + if (player.isSprinting()) { + player.getFoodStats().addExhaustion((float) (-0.8 * jumpCompensationRatio)); + } else { + player.getFoodStats().addExhaustion((float) (-0.2 * jumpCompensationRatio)); + } + } } diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemComponent.java b/src/minecraft/net/machinemuse/powersuits/item/ItemComponent.java index 43f6fab..7a5b8bf 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemComponent.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemComponent.java @@ -16,6 +16,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry; public class ItemComponent extends Item { public static List icons; public static List names; + public static List descriptions; public static ItemStack wiring; public static ItemStack solenoid; @@ -27,6 +28,12 @@ public class ItemComponent extends Item { public static ItemStack mvcapacitor; public static ItemStack hvcapacitor; public static ItemStack evcapacitor; + public static ItemStack basicPlating; + public static ItemStack advancedPlating; + public static ItemStack fieldEmitter; + public static ItemStack laserHologram; + public static ItemStack carbonMyofiber; + public static ItemStack controlCircuit; public ItemComponent() { super(Config.getAssignedItemID(Config.Items.PowerArmorComponent)); @@ -35,40 +42,54 @@ public class ItemComponent extends Item { this.setCreativeTab(Config.getCreativeTab()); icons = new ArrayList(); names = new ArrayList(); + descriptions = new ArrayList(); } - public ItemStack addComponent(String name, MuseIcon icon) { - names.add(name); + public ItemStack addComponent(String oredictName, String englishName, String description, MuseIcon icon) { + names.add(oredictName); icons.add(icon.getIconIndex()); + descriptions.add(description); this.setTextureFile(icon.getTexturefile()); ItemStack stack = new ItemStack(this, 1, names.size() - 1); - LanguageRegistry.addName(stack, name); + LanguageRegistry.addName(stack, englishName); return stack; } public void addInformation(ItemStack stack, EntityPlayer player, List currentTipList, boolean advancedToolTips) { - currentTipList.add( - MuseStringUtils.wrapMultipleFormatTags( - "Power Armor Component", - MuseStringUtils.FormatCodes.Grey, - MuseStringUtils.FormatCodes.Italic)); - currentTipList.add( - MuseStringUtils.wrapMultipleFormatTags( - "For use in Tinker Table", - MuseStringUtils.FormatCodes.Grey, - MuseStringUtils.FormatCodes.Italic)); + if(Config.doAdditionalInfo()){ + String message = "For use in Tinker Table."; + message = MuseStringUtils.wrapMultipleFormatTags( + message, + MuseStringUtils.FormatCodes.Grey, + MuseStringUtils.FormatCodes.Italic); + currentTipList.add(message); + int damage = stack.getItemDamage(); + if( damage < descriptions.size()) { + String description = descriptions.get(damage); + currentTipList.addAll(MuseStringUtils.wrapStringToLength(description, 30)); + } + } else { + currentTipList.add(Config.additionalInfoInstructions()); + } } public void populate() { - wiring = addComponent("Wiring", MuseIcon.COMPONENT_WIRING); - solenoid = addComponent("Solenoid", MuseIcon.COMPONENT_SOLENOID); - servoMotor = addComponent("Servo Motor", MuseIcon.COMPONENT_SERVOMOTOR); - gliderWing = addComponent("Glider Wing", MuseIcon.COMPONENT_GLIDERWING); - ionThruster = addComponent("Ion Thruster", MuseIcon.COMPONENT_IONTHRUSTER); - lvcapacitor = addComponent("LV Capacitor", MuseIcon.COMPONENT_LVCAPACITOR); - mvcapacitor = addComponent("MV Capacitor", MuseIcon.COMPONENT_MVCAPACITOR); - hvcapacitor = addComponent("HV Capacitor", MuseIcon.COMPONENT_HVCAPACITOR); - parachute = addComponent("Parachute", MuseIcon.COMPONENT_PARACHUTE); + // NOTE: Only add to end otherwise people's IDs will get screwed up n.n' + wiring = addComponent("componentWiring", "Wiring", "A special type of wiring with high voltaic capacity and precision, necessary for the sensitive electronics in power armor.", MuseIcon.WIRING); + solenoid = addComponent("componentSolenoid", "Solenoid","Wires wound around a ferromagnetic core produces a basic electromagnet.", MuseIcon.SOLENOID); + servoMotor = addComponent("componentServo", "Servo Motor", "A special type of motor which uses a pulse-modulated signal to enact very precise movements.", MuseIcon.SERVOMOTOR); + gliderWing = addComponent("componentGliderWing", "Glider Wing", "A lightweight aerodynamic wing with an electromagnet for quick deployment and retraction.", MuseIcon.GLIDERWING); + ionThruster = addComponent("componentIonThruster", "Ion Thruster", "Essentially a miniature particle accelerator. Accelerates ions to near-light speed to produce thrust.", MuseIcon.IONTHRUSTER); + lvcapacitor = addComponent("componentLVCapacitor", "LV Capacitor", "A simple capacitor can store and discharge small amounts of energy rapidly.", MuseIcon.LVCAPACITOR); + mvcapacitor = addComponent("componentMVCapacitor", "MV Capacitor","A more advanced capacitor which can store more energy at higher voltages.", MuseIcon.MVCAPACITOR); + hvcapacitor = addComponent("componentHVCapacitor", "HV Capacitor", "A synthetic crystal device which can store and release massive amounts of energy.", MuseIcon.HVCAPACITOR); + parachute = addComponent("componentParachute", "Parachute", "A simple reusable parachute which can be deployed and recovered in midair.", MuseIcon.PARACHUTE); + basicPlating = addComponent("componentPlatingBasic", "Basic Plating", "Some carefully-arranged metal armor plates.", MuseIcon.IRON_PLATING); + advancedPlating = addComponent("componentPlatingAdvanced", "Advanced Plating","Some carefully-arranged armor plates of a rare and stronger material", MuseIcon.DIAMOND_PLATING); + fieldEmitter = addComponent("componentFieldEmitter", "Force Field Emitter","An advanced device which directly manipulates electromagnetic and gravitational fields in an area.", MuseIcon.FIELD_EMITTER); + laserHologram = addComponent("componentLaserEmitter", "Hologram Emitter", "A multicoloured laser array which can cheaply alter the appearance of something.", MuseIcon.NETHERSTAR); + carbonMyofiber = addComponent("componentCarbonMyofiber", "Carbon Myofiber", "An artificial muscle with less range of movement but more strength than human muscles.", MuseIcon.NEXUS_1_BLUE); + controlCircuit = addComponent("controlCircuit", "Control Circuit", "A simple networkable microcontroller for coordinating an individual component.", MuseIcon.CIRCUIT); } /** diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.java b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.java index 359e1d9..6855f09 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.java @@ -120,9 +120,9 @@ public abstract class ItemPowerArmor extends ItemArmor } public Colour getColorFromItemStack(ItemStack stack) { - double computedred = ModuleManager.computeModularProperty(stack, ModularCommon.MODULE_RED_TINT); - double computedgreen = ModuleManager.computeModularProperty(stack, ModularCommon.MODULE_GREEN_TINT); - double computedblue = ModuleManager.computeModularProperty(stack, ModularCommon.MODULE_BLUE_TINT); + double computedred = ModuleManager.computeModularProperty(stack, ModularCommon.RED_TINT); + double computedgreen = ModuleManager.computeModularProperty(stack, ModularCommon.GREEN_TINT); + double computedblue = ModuleManager.computeModularProperty(stack, ModularCommon.BLUE_TINT); Colour colour = new Colour( clampDouble(1 + computedred - (computedblue + computedgreen), 0, 1), clampDouble(1 + computedgreen - (computedblue + computedred), 0, 1), @@ -159,9 +159,9 @@ public abstract class ItemPowerArmor extends ItemArmor public boolean hasColor(ItemStack stack) { NBTTagCompound itemTag = ItemUtils.getMuseItemTag(stack); - if (ItemUtils.tagHasModule(itemTag, ModularCommon.MODULE_RED_TINT) - || ItemUtils.tagHasModule(itemTag, ModularCommon.MODULE_GREEN_TINT) - || ItemUtils.tagHasModule(itemTag, ModularCommon.MODULE_BLUE_TINT)) { + if (ItemUtils.tagHasModule(itemTag, ModularCommon.RED_TINT) + || ItemUtils.tagHasModule(itemTag, ModularCommon.GREEN_TINT) + || ItemUtils.tagHasModule(itemTag, ModularCommon.BLUE_TINT)) { MuseLogger.logDebug("True!"); return true; } else { @@ -268,7 +268,7 @@ public abstract class ItemPowerArmor extends ItemArmor @Override public double onUse(double joulesNeeded, ItemStack itemStack) { - return ModularCommon.onUse(joulesNeeded, itemStack); + return ModularCommon.discharge(joulesNeeded, itemStack); } @Override @@ -340,7 +340,7 @@ public abstract class ItemPowerArmor extends ItemArmor joulesRequested = maxJoules / 200.0; } double currentJoules = ModularCommon.getJoules(stack); - double givenJoules = ModularCommon.onUse(joulesRequested, stack); + double givenJoules = ModularCommon.discharge(joulesRequested, stack); if (simulate) { ModularCommon.setJoules(currentJoules, stack); } diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerTool.java b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerTool.java index 2a4e5a2..3c078b2 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerTool.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerTool.java @@ -299,7 +299,7 @@ public class ItemPowerTool extends ItemTool @Override public double onUse(double joulesNeeded, ItemStack itemStack) { - return ModularCommon.onUse(joulesNeeded, itemStack); + return ModularCommon.discharge(joulesNeeded, itemStack); } @Override @@ -363,7 +363,7 @@ public class ItemPowerTool extends ItemTool double joulesRequested = ModCompatability.joulesFromEU(amount); double currentJoules = ModularCommon.getJoules(stack); - double givenJoules = ModularCommon.onUse(joulesRequested, stack); + double givenJoules = ModularCommon.discharge(joulesRequested, stack); if(simulate) { ModularCommon.setJoules(currentJoules, stack); } @@ -416,4 +416,8 @@ public class ItemPowerTool extends ItemTool return 0; } + public static MuseIcon getCurrentIconFor(ItemStack itemStack) { + return MuseIcon.TOOL_PICK; + } + } diff --git a/src/minecraft/net/machinemuse/powersuits/item/ModularCommon.java b/src/minecraft/net/machinemuse/powersuits/item/ModularCommon.java index 2df1fea..f56fff9 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ModularCommon.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ModularCommon.java @@ -1,13 +1,15 @@ package net.machinemuse.powersuits.item; +import java.util.LinkedList; import java.util.List; import net.machinemuse.general.MuseStringUtils; +import net.machinemuse.powersuits.common.Config; import net.machinemuse.powersuits.powermodule.ModuleManager; +import net.machinemuse.powersuits.powermodule.PowerModule; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import universalelectricity.core.electricity.ElectricInfo; public abstract class ModularCommon { /** @@ -28,9 +30,10 @@ public abstract class ModularCommon { public static final String BATTERY_WEIGHT = "Battery Weight"; public static final String SPRINT_ENERGY_CONSUMPTION = "Sprint Energy Consumption"; public static final String SPRINT_SPEED_MULTIPLIER = "Sprint Speed Multiplier"; - public static final String SPRINT_FOOD_COMPENSATION = "Exhaustion Compensation"; + public static final String SPRINT_FOOD_COMPENSATION = "Sprint Exhaustion Compensation"; public static final String JUMP_ENERGY_CONSUMPTION = "Jump Energy Consumption"; public static final String JUMP_MULTIPLIER = "Jump Multiplier"; + public static final String JUMP_FOOD_COMPENSATION = "Jump Exhaustion Compensation"; public static final String SHOCK_ABSORB_MULTIPLIER = "Distance Reduction"; public static final String SHOCK_ABSORB_ENERGY_CONSUMPTION = "Impact Energy consumption"; public static final String JET_ENERGY_CONSUMPTION = "Jet Energy Consumption"; @@ -40,6 +43,9 @@ public abstract class ModularCommon { public static final String UNDERWATER_HARVEST_SPEED = "Underwater Harvest Speed"; public static final String SWIM_BOOST_AMOUNT = "Underwater Movement Boost"; public static final String SWIM_BOOST_ENERGY_CONSUMPTION = "Swim Boost Energy Consumption"; + public static final String RED_TINT = "Red Tint"; + public static final String GREEN_TINT = "Green Tint"; + public static final String BLUE_TINT = "Blue Tint"; /** * Module names @@ -50,7 +56,7 @@ public abstract class ModularCommon { public static final String MODULE_BATTERY_BASIC = "Basic Battery"; public static final String MODULE_BATTERY_ADVANCED = "Advanced Battery"; public static final String MODULE_BATTERY_ELITE = "Elite Battery"; - public static final String MODULE_IRON_PLATING = "Iron Plating"; + public static final String MODULE_BASIC_PLATING = "Iron Plating"; public static final String MODULE_DIAMOND_PLATING = "Diamond Plating"; public static final String MODULE_ENERGY_SHIELD = "Energy Shield"; public static final String MODULE_DIAMOND_PICK_UPGRADE = "Diamond Drill Upgrade"; @@ -65,9 +71,7 @@ public abstract class ModularCommon { public static final String MODULE_ANTIGRAVITY = "Antigravity Drive"; public static final String MODULE_WATER_ELECTROLYZER = "Water Electrolyzer"; public static final String MODULE_AQUA_AFFINITY = "Aqua Affinity"; - public static final String MODULE_RED_TINT = "Red Tint"; - public static final String MODULE_GREEN_TINT = "Green Tint"; - public static final String MODULE_BLUE_TINT = "Blue Tint"; + public static final String MODULE_TINT = "Custom Colour Module"; public static final String MODULE_CLIMB_ASSIST = "Uphill Step Assist"; public static final String MODULE_SWIM_BOOST = "Swim Boost"; @@ -110,11 +114,33 @@ public abstract class ModularCommon { currentTipList.add( MuseStringUtils.wrapMultipleFormatTags(energyinfo, MuseStringUtils.FormatCodes.Italic.character, MuseStringUtils.FormatCodes.Grey) ); + if (Config.doAdditionalInfo()) { + List installed = ModularCommon.getItemInstalledModules(player, stack); + if (installed.size() == 0) { + String message = "No installed modules! This item is useless until you add some modules at a Tinker Table."; + currentTipList.addAll(MuseStringUtils.wrapStringToLength(message, 30)); + } else { + currentTipList.add("Installed Modules:"); + currentTipList.addAll(installed); + } + } else { + currentTipList.add(Config.additionalInfoInstructions()); + } } // ///////////////////////////// // // --- UNIVERSAL ELECTRICITY --- // // ///////////////////////////// // + + /** + * Provide energy to an item. + * + * @param joulesNeeded + * Amount to request (in UE Joules). + * @param itemStack + * Itemstack to request the energy from. + * @return Amount of joules provided by the item. + */ public static double charge(double amount, ItemStack itemStack) { double stored = getJoules(itemStack); double capacity = getMaxJoules(itemStack) - stored; @@ -124,7 +150,16 @@ public abstract class ModularCommon { return surplus; } - public static double onUse(double joulesNeeded, ItemStack itemStack) { + /** + * Request energy from this item. + * + * @param joulesNeeded + * Amount to request (in UE Joules). + * @param itemStack + * Itemstack to request the energy from. + * @return Amount of joules provided by the item. + */ + public static double discharge(double joulesNeeded, ItemStack itemStack) { NBTTagCompound itemProperties = ItemUtils.getMuseItemTag(itemStack); double joulesAvail = getJoules(itemStack); @@ -167,4 +202,15 @@ public abstract class ModularCommon { public static double getTotalWeight(ItemStack stack) { return ModuleManager.computeModularProperty(stack, ModularCommon.WEIGHT); } + + public static List getItemInstalledModules(EntityPlayer player, ItemStack stack) { + NBTTagCompound itemTag = ItemUtils.getMuseItemTag(stack); + List modules = new LinkedList(); + for (PowerModule module : ItemUtils.getValidModulesForItem(player, stack)) { + if (ItemUtils.tagHasModule(itemTag, module.getName())) { + modules.add(module.getName()); + } + } + return modules; + } } diff --git a/src/minecraft/net/machinemuse/powersuits/tick/PlayerTickHandlerClient.java b/src/minecraft/net/machinemuse/powersuits/tick/PlayerTickHandlerClient.java index 45dd0ef..fd62dc7 100644 --- a/src/minecraft/net/machinemuse/powersuits/tick/PlayerTickHandlerClient.java +++ b/src/minecraft/net/machinemuse/powersuits/tick/PlayerTickHandlerClient.java @@ -43,14 +43,14 @@ public class PlayerTickHandlerClient implements ITickHandler { if (side == Side.CLIENT && rawPlayer instanceof EntityClientPlayerMP) { EntityClientPlayerMP player = (EntityClientPlayerMP) rawPlayer; handleClient(player); - } else if((side == Side.SERVER) && (rawPlayer instanceof EntityPlayerMP)) { + } else if ((side == Side.SERVER) && (rawPlayer instanceof EntityPlayerMP)) { EntityPlayerMP player = (EntityPlayerMP) rawPlayer; handleServer(player); } - - } - public void handleClient(EntityClientPlayerMP player) { + } + + public void handleClient(EntityClientPlayerMP player) { ItemStack helmet = player.getCurrentArmor(3); ItemStack torso = player.getCurrentArmor(2); ItemStack pants = player.getCurrentArmor(1); @@ -62,12 +62,10 @@ public class PlayerTickHandlerClient implements ITickHandler { double weightCapacity = 25000; double totalEnergyDrain = 0; - double exhaustionAdjustment = 0; + double foodAdjustment = 0; double landMovementFactor = 0.1; double jumpMovementFactor = 0.02; - double horzMovement = Math.sqrt(player.motionX * player.motionX + player.motionZ * player.motionZ); - double exhaustion = Math.round(horzMovement * 100.0F) * 0.01; Vec3 playerHorzFacing = player.getLookVec(); playerHorzFacing.yCoord = 0; @@ -131,7 +129,6 @@ public class PlayerTickHandlerClient implements ITickHandler { } } } else { - // Jump Assist if (hasJumpAssist && jumpkey) { double multiplier = MovementManager.getPlayerJumpMultiplier(player); if (multiplier > 0) { @@ -183,7 +180,8 @@ public class PlayerTickHandlerClient implements ITickHandler { // Parachute if (hasParachute && sneakkey && player.motionY < -0.1 && (!hasGlider || forwardkey <= 0)) { - double totalVelocity = Math.sqrt(horzMovement * horzMovement + player.motionY * player.motionY)*getWeightPenaltyRatio(totalWeight, weightCapacity); + double totalVelocity = Math.sqrt(player.motionX * player.motionX + player.motionZ * player.motionZ + player.motionY * player.motionY) + * getWeightPenaltyRatio(totalWeight, weightCapacity); if (totalVelocity > 0) { player.motionX = player.motionX * 0.1 / totalVelocity; player.motionY = player.motionY * 0.1 / totalVelocity; @@ -193,6 +191,9 @@ public class PlayerTickHandlerClient implements ITickHandler { // Sprint assist 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); @@ -200,7 +201,7 @@ public class PlayerTickHandlerClient implements ITickHandler { totalEnergyDrain += sprintCost; player.landMovementFactor *= sprintMultiplier; - exhaustionComp += -0.01 * exhaustion * exhaustionComp; + foodAdjustment += 0.01 * exhaustion * exhaustionComp; } } } @@ -216,20 +217,21 @@ public class PlayerTickHandlerClient implements ITickHandler { ItemUtils.givePlayerEnergy(player, -totalEnergyDrain); } - player.addExhaustion((float) (exhaustionAdjustment)); + player.getFoodStats().addExhaustion((float) (-foodAdjustment)); // Weight movement penalty if (totalWeight > weightCapacity) { player.motionX *= weightCapacity / totalWeight; player.motionZ *= weightCapacity / totalWeight; } - - MusePacket packet = new MusePacketPlayerUpdate(player, -totalEnergyDrain, exhaustionAdjustment); + + MusePacket packet = new MusePacketPlayerUpdate(player, -totalEnergyDrain, -foodAdjustment); player.sendQueue.addToSendQueue(packet.getPacket250()); - + } + public void handleServer(EntityPlayerMP player) { - + } public static double getWeightPenaltyRatio(double currentWeight, double capacity) {