From 6d0a68e47ee4002a4e641849b6058f98a54d472d Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Wed, 29 May 2013 21:51:48 -0400 Subject: [PATCH] v5.5.6 Beta #12 *Fixed up new upgrade behavior. *Added button to teleport Robit back home. *Robit now picks up items off the ground. *Fixed Robit's inventory shift-clicking. *Robit now stores his name in item form. --- .../mods/mekanism/gui/GuiRobitMain.png | Bin 10450 -> 10864 bytes .../mekanism/client/GuiRobitMain.java | 23 +++++- .../common/ContainerRobitInventory.java | 19 ++--- .../mekanism/common/EntityRobit.java | 70 ++++++++++++++++-- .../mekanism/common/EnumPacketType.java | 3 + src/minecraft/mekanism/common/ItemRobit.java | 26 ++++++- .../mekanism/common/MekanismUtils.java | 4 +- .../mekanism/common/PacketHandler.java | 16 ++++ .../mekanism/common/RobitAIFollow.java | 2 +- .../common/TileEntityMetallurgicInfuser.java | 8 +- 10 files changed, 140 insertions(+), 31 deletions(-) diff --git a/bin/minecraft/mods/mekanism/gui/GuiRobitMain.png b/bin/minecraft/mods/mekanism/gui/GuiRobitMain.png index 24bf1f95188a8239c59de90422834f236f5a6a66..6ef7e586cba6221543dcc6d16f61d8d93bc5e263 100644 GIT binary patch delta 9841 zcmaKyc|25)|L@O?!Pv*Xgqfj*N>rANZ7dl{)ZLoN`$Or)*rN5w|df5jyX8}eZZo2Y% zaO;h`znKLkRxcs{tLyAN{fHQhpy`Br{7G|EdyQC#N<4$AF6yvmy_)8kMQ>Z(uZP30 zGZjQs4_B*bsoA#6SG|=p^P0OAf8?-QzWZC=L2R@5D+PJO_OC1cvD=R8ZC_TsHr91E zK36^7(oUJ12e+5DznGX8T2{aIlW||0z7i~T_H0j$tKP0UVpW7lwX+LrNqb+DaAR); z;Na#`mC_+@of7F}gDX%A)w$svh1X>GPS|<<#3?xGRNrCNY)h?9+9cj}leaN8)_szj zt~h`H?NiPGz1j|6ul>L*n{or}V)sSKmQ0z;*rEzQ99aB`Ptm;XRgV7W$9@G4ZoVhj zt6c8PchP+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9yT=-;3JnB_CICq))?J-Ia{$Sl|U3b$NiB&XX6Z$my z^80c67``ER?9au#U@WJ*M;EIv9<4SIh9Y!M9w2f{0C0kmR>9Vl0()*pUUaX!)UL3* zK@zo-4f=AMlc#R+_0aKB$S{|bSSc(+<7ohuGpiUNK>rK`50CbRg@tv)l)9EU#Dh9D zi54Y835QzRIU!Uu3wjDXT$g}w)gf>ZRjL>R#GpzN^l?S6p%0>Z!s#(@|0(p)&agdE Y$!T79m3ozKfc`tJZ=&~H$078;0QUW44*&oF diff --git a/src/minecraft/mekanism/client/GuiRobitMain.java b/src/minecraft/mekanism/client/GuiRobitMain.java index 99c317275..46ac149dc 100644 --- a/src/minecraft/mekanism/client/GuiRobitMain.java +++ b/src/minecraft/mekanism/client/GuiRobitMain.java @@ -2,6 +2,7 @@ package mekanism.client; import mekanism.common.ContainerRobitMain; import mekanism.common.EntityRobit; +import mekanism.common.EnumPacketType; import mekanism.common.Mekanism; import mekanism.common.PacketHandler; import net.minecraft.client.gui.GuiButton; @@ -12,11 +13,10 @@ import net.minecraft.entity.player.InventoryPlayer; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import universalelectricity.core.electricity.ElectricityDisplay; import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiRobitMain extends GuiContainer @@ -127,6 +127,10 @@ public class GuiRobitMain extends GuiContainer { drawCreativeTabHoveringText("Rename this Robit", xAxis, yAxis); } + else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34) + { + drawCreativeTabHoveringText("Teleport back home", xAxis, yAxis); + } } @Override @@ -197,6 +201,14 @@ public class GuiRobitMain extends GuiContainer drawTexturedModalRect(guiWidth + 6, guiHeight + 53, 176 + 25, 234, 18, 18); } + if(xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34) + { + drawTexturedModalRect(guiWidth + 6, guiHeight + 16, 176 + 25 + 18, 36, 18, 18); + } + else { + drawTexturedModalRect(guiWidth + 6, guiHeight + 16, 176 + 25 + 18, 54, 18, 18); + } + int displayInt; displayInt = getScaledEnergyLevel(120); @@ -264,6 +276,11 @@ public class GuiRobitMain extends GuiContainer mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); toggleNameChange(); } + else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34) + { + mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); + PacketHandler.sendPacketDataInt(EnumPacketType.GO_HOME, robit.entityId); + } } } } diff --git a/src/minecraft/mekanism/common/ContainerRobitInventory.java b/src/minecraft/mekanism/common/ContainerRobitInventory.java index 08fdb5361..b02523195 100644 --- a/src/minecraft/mekanism/common/ContainerRobitInventory.java +++ b/src/minecraft/mekanism/common/ContainerRobitInventory.java @@ -60,26 +60,17 @@ public class ContainerRobitInventory extends Container ItemStack slotStack = currentSlot.getStack(); stack = slotStack.copy(); - if(slotID >= 27 && slotID <= 53) + if(slotID < 27) { - if(!mergeItemStack(slotStack, 54, inventorySlots.size(), false)) - { - return null; - } - } - else if(slotID > 53) - { - if(!mergeItemStack(slotStack, 27, 53, false)) - { - return null; - } - } - else { if(!mergeItemStack(slotStack, 27, inventorySlots.size(), true)) { return null; } } + else if(!mergeItemStack(slotStack, 0, 27, false)) + { + return null; + } if(slotStack.stackSize == 0) { diff --git a/src/minecraft/mekanism/common/EntityRobit.java b/src/minecraft/mekanism/common/EntityRobit.java index 85b84c63d..7d8509da5 100644 --- a/src/minecraft/mekanism/common/EntityRobit.java +++ b/src/minecraft/mekanism/common/EntityRobit.java @@ -5,6 +5,7 @@ import ic2.api.item.IElectricItem; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.List; import mekanism.api.EnergizedItemManager; import mekanism.api.IEnergizedItem; @@ -118,6 +119,8 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine if(!worldObj.isRemote) { + collectItems(); + if(homeLocation == null) { setDead(); @@ -135,12 +138,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine if(getEnergy() == 0 && !isOnChargepad()) { - setFollowing(false); - setPositionAndUpdate(homeLocation.xCoord+0.5, homeLocation.yCoord+0.3, homeLocation.zCoord+0.5); - - motionX = 0; - motionY = 0; - motionZ = 0; + goHome(); } if(inventory[27] != null && getEnergy() < MAX_ELECTRICITY) @@ -227,6 +225,65 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine } } } + + private void collectItems() + { + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, boundingBox.expand(1.5, 1.5, 1.5)); + + if(items != null && !items.isEmpty()) + { + for(EntityItem item : items) + { + if(item.delayBeforeCanPickup > 0) + { + continue; + } + + for(int i = 0; i < 27; i++) + { + ItemStack itemStack = inventory[i]; + + if(itemStack == null) + { + inventory[i] = item.getEntityItem(); + item.setPosition(posX, posY, posZ); + item.setDead(); + playSound("random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + + break; + } + else if(itemStack.isItemEqual(item.getEntityItem()) && itemStack.stackSize < itemStack.getMaxStackSize()) + { + int needed = itemStack.getMaxStackSize() - itemStack.stackSize; + int toAdd = Math.min(needed, item.getEntityItem().stackSize); + + itemStack.stackSize += toAdd; + item.getEntityItem().stackSize -= toAdd; + + if(item.getEntityItem().stackSize == 0) + { + item.setPosition(posX, posY, posZ); + item.setDead(); + } + + playSound("random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + + break; + } + } + } + } + } + + public void goHome() + { + setFollowing(false); + setPositionAndUpdate(homeLocation.xCoord+0.5, homeLocation.yCoord+0.3, homeLocation.zCoord+0.5); + + motionX = 0; + motionY = 0; + motionZ = 0; + } private boolean canSmelt() { @@ -316,6 +373,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine ItemRobit item = (ItemRobit)entityItem.getEntityItem().getItem(); item.setEnergy(entityItem.getEntityItem(), getEnergy()); item.setInventory(getInventory(), entityItem.getEntityItem()); + item.setName(entityItem.getEntityItem(), getName()); float k = 0.05F; entityItem.motionX = 0; diff --git a/src/minecraft/mekanism/common/EnumPacketType.java b/src/minecraft/mekanism/common/EnumPacketType.java index 9db1b2c52..e725b9841 100644 --- a/src/minecraft/mekanism/common/EnumPacketType.java +++ b/src/minecraft/mekanism/common/EnumPacketType.java @@ -75,6 +75,9 @@ public enum EnumPacketType /** Used to send a Robit name update packet to the server. */ NAME_UPDATE(21), + /** Used to send a Robit 'go home' packet to the server. */ + GO_HOME(22), + /** A custom packet type. Handled in PacketHandler. */ CUSTOM(-1); diff --git a/src/minecraft/mekanism/common/ItemRobit.java b/src/minecraft/mekanism/common/ItemRobit.java index 0f3272079..64e048237 100644 --- a/src/minecraft/mekanism/common/ItemRobit.java +++ b/src/minecraft/mekanism/common/ItemRobit.java @@ -36,8 +36,10 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) { + list.add(EnumColor.INDIGO + "Name: " + EnumColor.GREY + (getName(itemstack).isEmpty() ? "Robit" : getName(itemstack))); + super.addInformation(itemstack, entityplayer, list, flag); - + list.add(EnumColor.AQUA + "Inventory: " + EnumColor.GREY + (getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0)); } @@ -58,6 +60,7 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory robit.setEnergy(getEnergy(itemstack)); robit.setOwner(entityplayer.username); robit.setInventory(getInventory(itemstack)); + robit.setName(getName(itemstack)); world.spawnEntityInWorld(robit); } @@ -77,6 +80,27 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory return false; } + public void setName(ItemStack itemstack, String name) + { + if(itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.stackTagCompound.setString("name", name); + } + + public String getName(ItemStack itemstack) + { + if(itemstack.stackTagCompound == null) + { + return null; + } + + String name = itemstack.stackTagCompound.getString("name"); + return name != null ? name : ""; + } + @Override public void setInventory(NBTTagList nbtTags, Object... data) { diff --git a/src/minecraft/mekanism/common/MekanismUtils.java b/src/minecraft/mekanism/common/MekanismUtils.java index f6f2a5882..46726b7c3 100644 --- a/src/minecraft/mekanism/common/MekanismUtils.java +++ b/src/minecraft/mekanism/common/MekanismUtils.java @@ -517,7 +517,7 @@ public final class MekanismUtils } /** - * Gets the energy required per tick for a machine via it's upgrades. + * Gets the energy required per tick for a machine via it's upgrades. * @param speedUpgrade - number of speed upgrades * @param energyUpgrade - number of energy upgrades * @param def - the original, default energy required @@ -529,7 +529,7 @@ public final class MekanismUtils } /** - * Gets the energy required per tick for a machine via it's upgrades. + * Gets the energy required per tick for a machine via it's upgrades. * @param speedUpgrade - number of speed upgrades * @param energyUpgrade - number of energy upgrades * @param def - the original, default energy required diff --git a/src/minecraft/mekanism/common/PacketHandler.java b/src/minecraft/mekanism/common/PacketHandler.java index 002ff98b5..06c00fdad 100644 --- a/src/minecraft/mekanism/common/PacketHandler.java +++ b/src/minecraft/mekanism/common/PacketHandler.java @@ -533,6 +533,22 @@ public class PacketHandler implements IPacketHandler e.printStackTrace(); } } + else if(packetType == EnumPacketType.GO_HOME.id) + { + try { + int id = dataStream.readInt(); + + EntityRobit robit = (EntityRobit)entityplayer.worldObj.getEntityByID(id); + + if(robit != null) + { + robit.goHome(); + } + } catch(Exception e) { + System.err.println("[Mekanism] Error while handling go home packet."); + e.printStackTrace(); + } + } } catch(Exception e) { System.err.println("[Mekanism] Error while handling packet."); e.printStackTrace(); diff --git a/src/minecraft/mekanism/common/RobitAIFollow.java b/src/minecraft/mekanism/common/RobitAIFollow.java index d28e930a2..73462baf1 100644 --- a/src/minecraft/mekanism/common/RobitAIFollow.java +++ b/src/minecraft/mekanism/common/RobitAIFollow.java @@ -98,7 +98,7 @@ public class RobitAIFollow extends EntityAIBase @Override public void updateTask() { - theRobit.getLookHelper().setLookPositionWithEntity(theOwner, 12.0F, theRobit.getVerticalFaceSpeed()); + theRobit.getLookHelper().setLookPositionWithEntity(theOwner, 6.0F, theRobit.getVerticalFaceSpeed()); if(theRobit.getFollowing()) { diff --git a/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java b/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java index c104897e4..d19907e16 100644 --- a/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java +++ b/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java @@ -175,19 +175,19 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem } } - if(electricityStored >= ENERGY_PER_TICK) + if(electricityStored >= MekanismUtils.getEnergyPerTick(speedMultiplier, energyMultiplier, ENERGY_PER_TICK)) { if(canOperate() && (operatingTicks+1) < MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED)) { operatingTicks++; - electricityStored -= ENERGY_PER_TICK; + electricityStored -= MekanismUtils.getEnergyPerTick(speedMultiplier, energyMultiplier, ENERGY_PER_TICK); } else if(canOperate() && (operatingTicks+1) >= MekanismUtils.getTicks(speedMultiplier, TICKS_REQUIRED)) { operate(); operatingTicks = 0; - electricityStored -= ENERGY_PER_TICK; + electricityStored -= MekanismUtils.getEnergyPerTick(speedMultiplier, energyMultiplier, ENERGY_PER_TICK); } } @@ -202,7 +202,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem type = InfusionType.NONE; } - if(canOperate() && electricityStored >= ENERGY_PER_TICK) + if(canOperate() && electricityStored >= MekanismUtils.getEnergyPerTick(speedMultiplier, energyMultiplier, ENERGY_PER_TICK)) { setActive(true); }