From ead4de1a27292440153f7d0dd24053f8abedef9b Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 28 Oct 2012 16:17:08 +0800 Subject: [PATCH] Moved textures and fixed build file --- Include Resources.bat | 4 + buildnumber.txt | 1 + info.txt | 0 publish.bat | 8 +- .../assemblyline/textures/BeltMid.png | Bin .../assemblyline/textures/BeltSingle.png | Bin .../assemblyline/textures/BeltTexture.png | Bin .../assemblyline/textures/CoalGenerator.png | Bin .../assemblyline/textures/ConveyorBelt.png | Bin .../assemblyline/textures/ConveyorBeltF.png | Bin .../assemblyline/textures/ConveyorBeltR.png | Bin .../assemblyline/textures/ConveyorBeltRF.png | Bin .../assemblyline/textures/Grey64.png | Bin .../assemblyline/textures/dropbox.png | Bin .../assemblyline/textures/ejector.png | Bin .../assemblyline/textures/gui_crafter.png | Bin .../assemblyline/textures/gui_ejector.png | Bin .../assemblyline/textures/injector.png | Bin src/common/assemblyline/ALCommonProxy.java | 6 +- src/common/assemblyline/AssemblyLine.java | 12 +- .../assemblyline/belts/BlockConveyorBelt.java | 14 +-- .../belts/TileEntityConveyorBelt.java | 105 +++++++++--------- .../interaction/BlockInteraction.java | 9 +- .../interaction/ContainerEjector.java | 4 +- ...jector.java => TileEntityManipulator.java} | 2 +- ...tityEjector.java => TileEntitySorter.java} | 4 +- src/minecraft/assemblyline/ALClientProxy.java | 12 +- .../assemblyline/gui/GuiEjectorSettings.java | 6 +- ...delInjector.java => ModelManipulator.java} | 4 +- .../{ModelEjector.java => ModelSorter.java} | 4 +- .../assemblyline/render/RenderDropBox.java | 43 ------- .../assemblyline/render/RenderHelper.java | 12 +- ...erInjector.java => RenderManipulator.java} | 12 +- .../{RenderEjector.java => RenderSorter.java} | 12 +- 34 files changed, 117 insertions(+), 157 deletions(-) create mode 100644 Include Resources.bat create mode 100644 buildnumber.txt create mode 100644 info.txt rename {src/minecraft => resources}/assemblyline/textures/BeltMid.png (100%) rename {src/minecraft => resources}/assemblyline/textures/BeltSingle.png (100%) rename {src/minecraft => resources}/assemblyline/textures/BeltTexture.png (100%) rename {src/minecraft => resources}/assemblyline/textures/CoalGenerator.png (100%) rename {src/minecraft => resources}/assemblyline/textures/ConveyorBelt.png (100%) rename {src/minecraft => resources}/assemblyline/textures/ConveyorBeltF.png (100%) rename {src/minecraft => resources}/assemblyline/textures/ConveyorBeltR.png (100%) rename {src/minecraft => resources}/assemblyline/textures/ConveyorBeltRF.png (100%) rename {src/minecraft => resources}/assemblyline/textures/Grey64.png (100%) rename {src/minecraft => resources}/assemblyline/textures/dropbox.png (100%) rename {src/minecraft => resources}/assemblyline/textures/ejector.png (100%) rename {src/minecraft => resources}/assemblyline/textures/gui_crafter.png (100%) rename {src/minecraft => resources}/assemblyline/textures/gui_ejector.png (100%) rename {src/minecraft => resources}/assemblyline/textures/injector.png (100%) rename src/common/assemblyline/interaction/{TileEntityInjector.java => TileEntityManipulator.java} (98%) rename src/common/assemblyline/interaction/{TileEntityEjector.java => TileEntitySorter.java} (98%) rename src/minecraft/assemblyline/model/{ModelInjector.java => ModelManipulator.java} (98%) rename src/minecraft/assemblyline/model/{ModelEjector.java => ModelSorter.java} (97%) delete mode 100644 src/minecraft/assemblyline/render/RenderDropBox.java rename src/minecraft/assemblyline/render/{RenderInjector.java => RenderManipulator.java} (73%) rename src/minecraft/assemblyline/render/{RenderEjector.java => RenderSorter.java} (73%) diff --git a/Include Resources.bat b/Include Resources.bat new file mode 100644 index 000000000..0d85a8082 --- /dev/null +++ b/Include Resources.bat @@ -0,0 +1,4 @@ +@echo off +cd resources +"..\..\7za.exe" a "..\jars\bin\minecraft.jar" "*" +pause \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt new file mode 100644 index 000000000..c22708346 --- /dev/null +++ b/buildnumber.txt @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/info.txt b/info.txt new file mode 100644 index 000000000..e69de29bb diff --git a/publish.bat b/publish.bat index 580a84f8d..dea99768e 100644 --- a/publish.bat +++ b/publish.bat @@ -9,7 +9,7 @@ set /a BUILD_NUMBER=%CurrentBuild%+1 echo %BUILD_NUMBER% >buildnumber.txt set FILE_NAME=AssemblyLine_v%MODVERSION%.%BUILD_NUMBER%.jar -set API_NAME=AssemblyLine_v%MODVERSION%.%BUILD_NUMBER%_api.zip +::set API_NAME=AssemblyLine_v%MODVERSION%.%BUILD_NUMBER%_api.zip set BACKUP_NAME=AssemblyLine_v%MODVERSION%.%BUILD_NUMBER%_backup.zip echo Starting to build %FILE_NAME% @@ -27,14 +27,14 @@ cd ..\..\ cd resources\ "..\..\7za.exe" a "..\builds\%FILE_NAME%" "*" -"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*" -pcalclavia +"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*" -pdarkguardsman cd ..\ cd src\ -"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*\assemblyline\" -pcalclavia +"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*\assemblyline\" -pdarkguardsman ::"..\..\7za.exe" a "..\builds\%API_NAME%" "*\atomicscience\api\" cd ..\ -::UPDATE INFO FILE %API_NAME% +::UPDATE INFO FILE echo %PROMOTION% %FILE_NAME%>>info.txt ::GENERATE FTP Script diff --git a/src/minecraft/assemblyline/textures/BeltMid.png b/resources/assemblyline/textures/BeltMid.png similarity index 100% rename from src/minecraft/assemblyline/textures/BeltMid.png rename to resources/assemblyline/textures/BeltMid.png diff --git a/src/minecraft/assemblyline/textures/BeltSingle.png b/resources/assemblyline/textures/BeltSingle.png similarity index 100% rename from src/minecraft/assemblyline/textures/BeltSingle.png rename to resources/assemblyline/textures/BeltSingle.png diff --git a/src/minecraft/assemblyline/textures/BeltTexture.png b/resources/assemblyline/textures/BeltTexture.png similarity index 100% rename from src/minecraft/assemblyline/textures/BeltTexture.png rename to resources/assemblyline/textures/BeltTexture.png diff --git a/src/minecraft/assemblyline/textures/CoalGenerator.png b/resources/assemblyline/textures/CoalGenerator.png similarity index 100% rename from src/minecraft/assemblyline/textures/CoalGenerator.png rename to resources/assemblyline/textures/CoalGenerator.png diff --git a/src/minecraft/assemblyline/textures/ConveyorBelt.png b/resources/assemblyline/textures/ConveyorBelt.png similarity index 100% rename from src/minecraft/assemblyline/textures/ConveyorBelt.png rename to resources/assemblyline/textures/ConveyorBelt.png diff --git a/src/minecraft/assemblyline/textures/ConveyorBeltF.png b/resources/assemblyline/textures/ConveyorBeltF.png similarity index 100% rename from src/minecraft/assemblyline/textures/ConveyorBeltF.png rename to resources/assemblyline/textures/ConveyorBeltF.png diff --git a/src/minecraft/assemblyline/textures/ConveyorBeltR.png b/resources/assemblyline/textures/ConveyorBeltR.png similarity index 100% rename from src/minecraft/assemblyline/textures/ConveyorBeltR.png rename to resources/assemblyline/textures/ConveyorBeltR.png diff --git a/src/minecraft/assemblyline/textures/ConveyorBeltRF.png b/resources/assemblyline/textures/ConveyorBeltRF.png similarity index 100% rename from src/minecraft/assemblyline/textures/ConveyorBeltRF.png rename to resources/assemblyline/textures/ConveyorBeltRF.png diff --git a/src/minecraft/assemblyline/textures/Grey64.png b/resources/assemblyline/textures/Grey64.png similarity index 100% rename from src/minecraft/assemblyline/textures/Grey64.png rename to resources/assemblyline/textures/Grey64.png diff --git a/src/minecraft/assemblyline/textures/dropbox.png b/resources/assemblyline/textures/dropbox.png similarity index 100% rename from src/minecraft/assemblyline/textures/dropbox.png rename to resources/assemblyline/textures/dropbox.png diff --git a/src/minecraft/assemblyline/textures/ejector.png b/resources/assemblyline/textures/ejector.png similarity index 100% rename from src/minecraft/assemblyline/textures/ejector.png rename to resources/assemblyline/textures/ejector.png diff --git a/src/minecraft/assemblyline/textures/gui_crafter.png b/resources/assemblyline/textures/gui_crafter.png similarity index 100% rename from src/minecraft/assemblyline/textures/gui_crafter.png rename to resources/assemblyline/textures/gui_crafter.png diff --git a/src/minecraft/assemblyline/textures/gui_ejector.png b/resources/assemblyline/textures/gui_ejector.png similarity index 100% rename from src/minecraft/assemblyline/textures/gui_ejector.png rename to resources/assemblyline/textures/gui_ejector.png diff --git a/src/minecraft/assemblyline/textures/injector.png b/resources/assemblyline/textures/injector.png similarity index 100% rename from src/minecraft/assemblyline/textures/injector.png rename to resources/assemblyline/textures/injector.png diff --git a/src/common/assemblyline/ALCommonProxy.java b/src/common/assemblyline/ALCommonProxy.java index 3f9bb241a..9ad5ad099 100644 --- a/src/common/assemblyline/ALCommonProxy.java +++ b/src/common/assemblyline/ALCommonProxy.java @@ -5,7 +5,7 @@ import net.minecraft.src.TileEntity; import net.minecraft.src.World; import assemblyline.gui.GuiEjectorSettings; import assemblyline.interaction.ContainerEjector; -import assemblyline.interaction.TileEntityEjector; +import assemblyline.interaction.TileEntitySorter; import cpw.mods.fml.common.network.IGuiHandler; public class ALCommonProxy implements IGuiHandler @@ -32,7 +32,7 @@ public class ALCommonProxy implements IGuiHandler { switch(ID) { - case 0: return new GuiEjectorSettings(player.inventory, ((TileEntityEjector)tileEntity)); + case 0: return new GuiEjectorSettings(player.inventory, ((TileEntitySorter)tileEntity)); } } @@ -48,7 +48,7 @@ public class ALCommonProxy implements IGuiHandler { switch(ID) { - case 0: return new ContainerEjector(player.inventory, ((TileEntityEjector)tileEntity)); + case 0: return new ContainerEjector(player.inventory, ((TileEntitySorter)tileEntity)); } } diff --git a/src/common/assemblyline/AssemblyLine.java b/src/common/assemblyline/AssemblyLine.java index f455de8c3..83485f029 100644 --- a/src/common/assemblyline/AssemblyLine.java +++ b/src/common/assemblyline/AssemblyLine.java @@ -15,8 +15,8 @@ import assemblyline.belts.TileEntityConveyorBelt; import assemblyline.interaction.BlockInteraction; import assemblyline.interaction.BlockInteraction.MachineType; import assemblyline.interaction.ItemBlockInteraction; -import assemblyline.interaction.TileEntityEjector; -import assemblyline.interaction.TileEntityInjector; +import assemblyline.interaction.TileEntitySorter; +import assemblyline.interaction.TileEntityManipulator; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; @@ -68,13 +68,13 @@ public class AssemblyLine public void load(FMLInitializationEvent evt) { GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "belt"); - GameRegistry.registerTileEntity(TileEntityEjector.class, "ejector"); - GameRegistry.registerTileEntity(TileEntityInjector.class, "scop"); + GameRegistry.registerTileEntity(TileEntitySorter.class, "ejector"); + GameRegistry.registerTileEntity(TileEntityManipulator.class, "scop"); proxy.init(); // Names LanguageRegistry.addName(new ItemStack(blockConveyorBelt, 1), "Coneveyor Belt"); - LanguageRegistry.addName(new ItemStack(blockInteraction, 1, MachineType.EJECTOR.metadata), MachineType.EJECTOR.name); - LanguageRegistry.addName(new ItemStack(blockInteraction, 1, MachineType.INJECTOR.metadata), MachineType.EJECTOR.name); + LanguageRegistry.addName(new ItemStack(blockInteraction, 1, MachineType.SORTER.metadata), MachineType.SORTER.name); + LanguageRegistry.addName(new ItemStack(blockInteraction, 1, MachineType.MANIPULATOR.metadata), MachineType.SORTER.name); LanguageRegistry.addName(new ItemStack(blockInteraction, 1, 8), "FutureBlock"); LanguageRegistry.addName(new ItemStack(blockInteraction, 1, 12), "FutureBlock"); } diff --git a/src/common/assemblyline/belts/BlockConveyorBelt.java b/src/common/assemblyline/belts/BlockConveyorBelt.java index 2c3983e91..884ab6d3c 100644 --- a/src/common/assemblyline/belts/BlockConveyorBelt.java +++ b/src/common/assemblyline/belts/BlockConveyorBelt.java @@ -7,6 +7,7 @@ import net.minecraft.src.Material; import net.minecraft.src.MathHelper; import net.minecraft.src.TileEntity; import net.minecraft.src.World; +import universalelectricity.core.UniversalElectricity; import universalelectricity.prefab.BlockMachine; import assemblyline.render.RenderHelper; @@ -18,10 +19,8 @@ public class BlockConveyorBelt extends BlockMachine { public BlockConveyorBelt(int id) { - super("Conveyor Belt", id, Material.wood); + super("Conveyor Belt", id, UniversalElectricity.machine); this.setBlockBounds(0, 0, 0, 1, 0.3f, 1); - this.setTextureFile("/textures/items.png"); - this.blockIndexInTexture = 0; this.setCreativeTab(CreativeTabs.tabTransport); } @Override @@ -57,12 +56,13 @@ public class BlockConveyorBelt extends BlockMachine * Returns the TileEntity used by this block. */ @Override - public TileEntity createNewTileEntity(World var1,int meta) + public TileEntity createNewTileEntity(World var1, int metadata) { - if(meta >=0 && meta < 4) + if(metadata >=0 && metadata < 4) { - return new TileEntityConveyorBelt(); + return new TileEntityConveyorBelt(); } + return null; } @@ -77,10 +77,10 @@ public class BlockConveyorBelt extends BlockMachine { return false; } + @Override public boolean renderAsNormalBlock() { return false; } - } diff --git a/src/common/assemblyline/belts/TileEntityConveyorBelt.java b/src/common/assemblyline/belts/TileEntityConveyorBelt.java index f63f97b00..83fd963b1 100644 --- a/src/common/assemblyline/belts/TileEntityConveyorBelt.java +++ b/src/common/assemblyline/belts/TileEntityConveyorBelt.java @@ -14,6 +14,7 @@ import net.minecraft.src.Packet250CustomPayload; import net.minecraft.src.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.Vector3; +import universalelectricity.electricity.ElectricInfo; import universalelectricity.implement.IConductor; import universalelectricity.prefab.TileEntityElectricityReceiver; import universalelectricity.prefab.network.IPacketReceiver; @@ -24,9 +25,16 @@ import com.google.common.io.ByteArrayDataInput; public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implements IPacketReceiver { - public double electricityStored = 0; - public final double electricityRequired = 0.1f; - public final double energyMax = 10; + /** + * Joules required to run this thing. + */ + public static final int JOULES_REQUIRED = 5; + + /** + * The amount of watts received. + */ + public double wattsReceived = 0; + private float speed = -0.05F; public float wheelRotation = 0; public boolean running = false; @@ -39,23 +47,28 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem public boolean connected = false; public List entityIgnoreList = new ArrayList(); - // Checks Adjacent belt to see if there - // powered. Reduces need for wire per belt - public boolean powerNeighbor() + /** + * Powers nearby conveyor belts. + * + * @return + */ + public boolean searchNeighborBelts() { - for (int n = 2; n < 6; n++) + for (int i = 2; i < 6; i++) { - ForgeDirection d = ForgeDirection.getOrientation(n); - TileEntity ent = worldObj.getBlockTileEntity(xCoord - d.offsetX, yCoord, zCoord - d.offsetZ); - if (ent instanceof TileEntityConveyorBelt) + ForgeDirection direction = ForgeDirection.getOrientation(i); + TileEntity tileEntity = worldObj.getBlockTileEntity(xCoord - direction.offsetX, yCoord, zCoord - direction.offsetZ); + + if (tileEntity instanceof TileEntityConveyorBelt) { - adjBelts[n - 2] = (TileEntityConveyorBelt) ent; + adjBelts[i - 2] = (TileEntityConveyorBelt) tileEntity; } else { - adjBelts[n - 2] = null; + adjBelts[i - 2] = null; } } + int rr = 0; for (int b = 0; b < 4; b++) { @@ -64,7 +77,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem TileEntityConveyorBelt belt = (TileEntityConveyorBelt) adjBelts[b]; if (belt.range > rr) { - rr = belt.getRange(); + rr = belt.range; } } } @@ -72,17 +85,12 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem return false; } - public int getRange() - { - return this.range; - } - @Override public void updateEntity() { super.updateEntity(); - - if (this.ticks % 10 == 0) + + if (this.ticks % 20 == 0) { if (worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord) instanceof IConductor) { @@ -92,20 +100,22 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem { this.connected = false; } - - if (this.electricityStored >= this.electricityRequired) + + if (this.wattsReceived >= JOULES_REQUIRED) { - this.electricityStored = Math.max(this.electricityStored - this.electricityRequired, 0); + this.wattsReceived = Math.max(this.wattsReceived - JOULES_REQUIRED, 0); this.range = 20; } else { this.range = 0; } + if (!this.connected) { - powerNeighbor(); + searchNeighborBelts(); } + if (this.range > 0) { this.running = true; @@ -117,10 +127,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem if (!worldObj.isRemote) { - Packet packet = PacketManager.getPacket("asmLine", this, new Object[] - { running, range }); - PacketManager.sendPacketToClients(packet, worldObj, new Vector3(xCoord, yCoord, zCoord), 40); - + PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj, Vector3.get(this), 15); } } @@ -184,15 +191,27 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem { flip = true; } - + this.wheelRotation -= this.speed; } } + @Override + public Packet getDescriptionPacket() + { + return PacketManager.getPacket(AssemblyLine.CHANNEL, this, this.running, this.range); + } + @Override public double wattRequest() { - return energyMax - electricityStored; + return JOULES_REQUIRED; + } + + @Override + public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) + { + this.wattsReceived += ElectricInfo.getWatts(amps, voltage); } @Override @@ -289,13 +308,6 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem } - @Override - public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) - { - this.electricityStored += (amps * voltage); - - } - /** * Used to tell the belt not to apply velocity * to some Entity in case they are being @@ -304,7 +316,7 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem * * @param entity */ - public void ignore(Entity entity) + public void ignoreEntity(Entity entity) { if (!this.entityIgnoreList.contains(entity)) { @@ -312,21 +324,4 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem } } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.electricityStored = nbt.getDouble("energy"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setDouble("energy", this.electricityStored); - } } diff --git a/src/common/assemblyline/interaction/BlockInteraction.java b/src/common/assemblyline/interaction/BlockInteraction.java index 6e0e5df6d..3c8869047 100644 --- a/src/common/assemblyline/interaction/BlockInteraction.java +++ b/src/common/assemblyline/interaction/BlockInteraction.java @@ -12,15 +12,15 @@ import assemblyline.render.RenderHelper; /** * A metadata block containing a bunch of machines with direction. - * @author Darkguardsman + * @author Darkguardsman, Calclavia * */ public class BlockInteraction extends BlockMachine { public static enum MachineType { - EJECTOR("Ejector", 0, TileEntityEjector.class), - INJECTOR("Injector", 4, TileEntityInjector.class), + SORTER("Sorter", 0, TileEntitySorter.class), + MANIPULATOR("Manipulator", 4, TileEntityManipulator.class), INVALID_1("Invalid", 8, null), INVALID_2("Invalid", 12, null); @@ -73,6 +73,9 @@ public class BlockInteraction extends BlockMachine return currentDirection + this.metadata; } + /** + * Creates a new TIleEntity. + */ public TileEntity instantiateTileEntity() { try diff --git a/src/common/assemblyline/interaction/ContainerEjector.java b/src/common/assemblyline/interaction/ContainerEjector.java index 2edb5532e..bf67dfec2 100644 --- a/src/common/assemblyline/interaction/ContainerEjector.java +++ b/src/common/assemblyline/interaction/ContainerEjector.java @@ -9,9 +9,9 @@ import net.minecraft.src.Slot; public class ContainerEjector extends Container { - private TileEntityEjector tileEntity; + private TileEntitySorter tileEntity; - public ContainerEjector(InventoryPlayer par1InventoryPlayer, TileEntityEjector tileEntity) + public ContainerEjector(InventoryPlayer par1InventoryPlayer, TileEntitySorter tileEntity) { this.tileEntity = tileEntity; for(int i = 0; i < 4; i++) diff --git a/src/common/assemblyline/interaction/TileEntityInjector.java b/src/common/assemblyline/interaction/TileEntityManipulator.java similarity index 98% rename from src/common/assemblyline/interaction/TileEntityInjector.java rename to src/common/assemblyline/interaction/TileEntityManipulator.java index 2d016f3eb..251cad7e5 100644 --- a/src/common/assemblyline/interaction/TileEntityInjector.java +++ b/src/common/assemblyline/interaction/TileEntityManipulator.java @@ -19,7 +19,7 @@ import universalelectricity.prefab.network.IPacketReceiver; import com.google.common.io.ByteArrayDataInput; -public class TileEntityInjector extends TileEntityElectricityReceiver implements IPacketReceiver, IInventory +public class TileEntityManipulator extends TileEntityElectricityReceiver implements IPacketReceiver, IInventory { public float energyReq = .1f; public float energyMax = 10f; diff --git a/src/common/assemblyline/interaction/TileEntityEjector.java b/src/common/assemblyline/interaction/TileEntitySorter.java similarity index 98% rename from src/common/assemblyline/interaction/TileEntityEjector.java rename to src/common/assemblyline/interaction/TileEntitySorter.java index 4c0f868f6..a8024756b 100644 --- a/src/common/assemblyline/interaction/TileEntityEjector.java +++ b/src/common/assemblyline/interaction/TileEntitySorter.java @@ -23,7 +23,7 @@ import assemblyline.TileEntityBase; import assemblyline.belts.TileEntityConveyorBelt; import cpw.mods.fml.common.network.PacketDispatcher; -public class TileEntityEjector extends TileEntityBase implements IElectricityReceiver, IPacketReceiver +public class TileEntitySorter extends TileEntityBase implements IElectricityReceiver, IPacketReceiver { /** * Joules required per tick. @@ -107,7 +107,7 @@ public class TileEntityEjector extends TileEntityBase implements IElectricityRec this.firePiston = true; if (this.beltSide != null) { - this.beltSide.ignore(entity); + this.beltSide.ignoreEntity(entity); } entity.motionX = (double) side.offsetX * 0.1; diff --git a/src/minecraft/assemblyline/ALClientProxy.java b/src/minecraft/assemblyline/ALClientProxy.java index 549f717e6..9f1ae04a0 100644 --- a/src/minecraft/assemblyline/ALClientProxy.java +++ b/src/minecraft/assemblyline/ALClientProxy.java @@ -4,12 +4,12 @@ import net.minecraftforge.client.MinecraftForgeClient; import assemblyline.AssemblyLine; import assemblyline.ALCommonProxy; import assemblyline.belts.TileEntityConveyorBelt; -import assemblyline.interaction.TileEntityEjector; -import assemblyline.interaction.TileEntityInjector; -import assemblyline.render.RenderEjector; +import assemblyline.interaction.TileEntitySorter; +import assemblyline.interaction.TileEntityManipulator; +import assemblyline.render.RenderSorter; import assemblyline.render.RenderHelper; import assemblyline.render.RenderConveyorBelt; -import assemblyline.render.RenderInjector; +import assemblyline.render.RenderManipulator; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -28,8 +28,8 @@ public class ALClientProxy extends ALCommonProxy // ClientRegistry.registerTileEntity(TileEntityConveyorBelt.class, // "belt", new RenderConveyorBelt()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorBelt.class, new RenderConveyorBelt()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEjector.class, new RenderEjector()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityInjector.class, new RenderInjector()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySorter.class, new RenderSorter()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityManipulator.class, new RenderManipulator()); } } diff --git a/src/minecraft/assemblyline/gui/GuiEjectorSettings.java b/src/minecraft/assemblyline/gui/GuiEjectorSettings.java index 7d22ba6a1..683c82a45 100644 --- a/src/minecraft/assemblyline/gui/GuiEjectorSettings.java +++ b/src/minecraft/assemblyline/gui/GuiEjectorSettings.java @@ -8,16 +8,16 @@ import org.lwjgl.opengl.GL11; import assemblyline.AssemblyLine; import assemblyline.interaction.ContainerEjector; -import assemblyline.interaction.TileEntityEjector; +import assemblyline.interaction.TileEntitySorter; public class GuiEjectorSettings extends GuiContainer { - private TileEntityEjector tileEntity; + private TileEntitySorter tileEntity; private int containerWidth; private int containerHeight; - public GuiEjectorSettings(InventoryPlayer par1InventoryPlayer, TileEntityEjector tileEntity) + public GuiEjectorSettings(InventoryPlayer par1InventoryPlayer, TileEntitySorter tileEntity) { super(new ContainerEjector(par1InventoryPlayer, tileEntity)); this.tileEntity = tileEntity; diff --git a/src/minecraft/assemblyline/model/ModelInjector.java b/src/minecraft/assemblyline/model/ModelManipulator.java similarity index 98% rename from src/minecraft/assemblyline/model/ModelInjector.java rename to src/minecraft/assemblyline/model/ModelManipulator.java index 995722dbe..fc0753ca3 100644 --- a/src/minecraft/assemblyline/model/ModelInjector.java +++ b/src/minecraft/assemblyline/model/ModelManipulator.java @@ -4,7 +4,7 @@ import net.minecraft.src.Entity; import net.minecraft.src.ModelBase; import net.minecraft.src.ModelRenderer; -public class ModelInjector extends ModelBase +public class ModelManipulator extends ModelBase { // fields ModelRenderer bBELTLong; @@ -28,7 +28,7 @@ public class ModelInjector extends ModelBase ModelRenderer RCPanel; ModelRenderer LCPanel; - public ModelInjector() + public ModelManipulator() { textureWidth = 128; textureHeight = 128; diff --git a/src/minecraft/assemblyline/model/ModelEjector.java b/src/minecraft/assemblyline/model/ModelSorter.java similarity index 97% rename from src/minecraft/assemblyline/model/ModelEjector.java rename to src/minecraft/assemblyline/model/ModelSorter.java index 39cdecb1f..82261816a 100644 --- a/src/minecraft/assemblyline/model/ModelEjector.java +++ b/src/minecraft/assemblyline/model/ModelSorter.java @@ -10,7 +10,7 @@ import net.minecraft.src.Entity; import net.minecraft.src.ModelBase; import net.minecraft.src.ModelRenderer; -public class ModelEjector extends ModelBase +public class ModelSorter extends ModelBase { // fields ModelRenderer Base; @@ -24,7 +24,7 @@ public class ModelEjector extends ModelBase ModelRenderer PistonShaft; ModelRenderer PistonFace; - public ModelEjector() + public ModelSorter() { textureWidth = 128; textureHeight = 128; diff --git a/src/minecraft/assemblyline/render/RenderDropBox.java b/src/minecraft/assemblyline/render/RenderDropBox.java deleted file mode 100644 index 11e39c500..000000000 --- a/src/minecraft/assemblyline/render/RenderDropBox.java +++ /dev/null @@ -1,43 +0,0 @@ -package assemblyline.render; - -import net.minecraft.src.TileEntity; -import net.minecraft.src.TileEntitySpecialRenderer; - -import org.lwjgl.opengl.GL11; - -import assemblyline.AssemblyLine; -import assemblyline.interaction.TileEntityInjector; -import assemblyline.model.ModelDropBox; - -public class RenderDropBox extends TileEntitySpecialRenderer -{ - private ModelDropBox model = new ModelDropBox(); - - public void renderAModelAt(TileEntityInjector tileEntity, double x, double y, double z, float f) - { - int face = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - bindTextureByName(AssemblyLine.TEXTURE_PATH+"DropBox.png"); - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - switch(face) - { - case 4: GL11.glRotatef(180f, 0f, 1f, 0f); break; - case 6: GL11.glRotatef(0f, 0f, 1f, 0f); break; - case 5: GL11.glRotatef(270f, 0f, 1f, 0f); break; - case 7: GL11.glRotatef(90f, 0f, 1f, 0f); break; - } - System.out.println("RENDERIN DROP BOX"); - model.render(0.0625F); - GL11.glPopMatrix(); - - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - this.renderAModelAt((TileEntityInjector)tileEntity, var2, var4, var6, var8); - } - -} \ No newline at end of file diff --git a/src/minecraft/assemblyline/render/RenderHelper.java b/src/minecraft/assemblyline/render/RenderHelper.java index 7be462f77..169ab78dc 100644 --- a/src/minecraft/assemblyline/render/RenderHelper.java +++ b/src/minecraft/assemblyline/render/RenderHelper.java @@ -9,8 +9,8 @@ import org.lwjgl.opengl.GL11; import assemblyline.AssemblyLine; import assemblyline.interaction.BlockInteraction.MachineType; import assemblyline.model.ModelConveyorBelt; -import assemblyline.model.ModelEjector; -import assemblyline.model.ModelInjector; +import assemblyline.model.ModelSorter; +import assemblyline.model.ModelManipulator; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -20,8 +20,8 @@ public class RenderHelper implements ISimpleBlockRenderingHandler public static RenderHelper instance = new RenderHelper(); public static final int BLOCK_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); private ModelConveyorBelt modelConveyorBelt = new ModelConveyorBelt(); - private ModelEjector modelEjector = new ModelEjector(); - private ModelInjector modelInjector = new ModelInjector(); + private ModelSorter modelEjector = new ModelSorter(); + private ModelManipulator modelInjector = new ModelManipulator(); @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) @@ -37,7 +37,7 @@ public class RenderHelper implements ISimpleBlockRenderingHandler } else if (block.blockID == AssemblyLine.blockInteraction.blockID) { - if(metadata == MachineType.EJECTOR.metadata) + if(metadata == MachineType.SORTER.metadata) { GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH+"ejector.png")); GL11.glPushMatrix(); @@ -48,7 +48,7 @@ public class RenderHelper implements ISimpleBlockRenderingHandler modelEjector.renderPiston(0.0625F, 1); GL11.glPopMatrix(); } - else if(metadata == MachineType.INJECTOR.metadata) + else if(metadata == MachineType.MANIPULATOR.metadata) { GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH+"injector.png")); GL11.glPushMatrix(); diff --git a/src/minecraft/assemblyline/render/RenderInjector.java b/src/minecraft/assemblyline/render/RenderManipulator.java similarity index 73% rename from src/minecraft/assemblyline/render/RenderInjector.java rename to src/minecraft/assemblyline/render/RenderManipulator.java index cfc00b14b..ba965cdec 100644 --- a/src/minecraft/assemblyline/render/RenderInjector.java +++ b/src/minecraft/assemblyline/render/RenderManipulator.java @@ -7,14 +7,14 @@ import org.lwjgl.opengl.GL11; import assemblyline.AssemblyLine; import assemblyline.belts.TileEntityConveyorBelt; -import assemblyline.interaction.TileEntityInjector; -import assemblyline.model.ModelInjector; +import assemblyline.interaction.TileEntityManipulator; +import assemblyline.model.ModelManipulator; -public class RenderInjector extends TileEntitySpecialRenderer +public class RenderManipulator extends TileEntitySpecialRenderer { - private ModelInjector model = new ModelInjector(); + private ModelManipulator model = new ModelManipulator(); - public void renderAModelAt(TileEntityInjector tileEntity, double x, double y, double z, float f) + public void renderAModelAt(TileEntityManipulator tileEntity, double x, double y, double z, float f) { String flip = "";//if(tileEntity.flip){flip = "F";} int face = tileEntity.getBeltDirection(); @@ -40,7 +40,7 @@ public class RenderInjector extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) { - this.renderAModelAt((TileEntityInjector)tileEntity, var2, var4, var6, var8); + this.renderAModelAt((TileEntityManipulator)tileEntity, var2, var4, var6, var8); } } \ No newline at end of file diff --git a/src/minecraft/assemblyline/render/RenderEjector.java b/src/minecraft/assemblyline/render/RenderSorter.java similarity index 73% rename from src/minecraft/assemblyline/render/RenderEjector.java rename to src/minecraft/assemblyline/render/RenderSorter.java index 6ce23a276..7257a493b 100644 --- a/src/minecraft/assemblyline/render/RenderEjector.java +++ b/src/minecraft/assemblyline/render/RenderSorter.java @@ -6,14 +6,14 @@ import net.minecraft.src.TileEntitySpecialRenderer; import org.lwjgl.opengl.GL11; import assemblyline.AssemblyLine; -import assemblyline.interaction.TileEntityEjector; -import assemblyline.model.ModelEjector; +import assemblyline.interaction.TileEntitySorter; +import assemblyline.model.ModelSorter; -public class RenderEjector extends TileEntitySpecialRenderer +public class RenderSorter extends TileEntitySpecialRenderer { - private ModelEjector model = new ModelEjector(); + private ModelSorter model = new ModelSorter(); - public void renderAModelAt(TileEntityEjector tileEntity, double x, double y, double z, float f) + public void renderAModelAt(TileEntitySorter tileEntity, double x, double y, double z, float f) { boolean fire = tileEntity.firePiston; int face = tileEntity.getDirection(tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)); @@ -36,7 +36,7 @@ public class RenderEjector extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) { - this.renderAModelAt((TileEntityEjector)tileEntity, var2, var4, var6, var8); + this.renderAModelAt((TileEntitySorter)tileEntity, var2, var4, var6, var8); } } \ No newline at end of file