Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Updating the Textures in my TILE ENTITY CLASS
- */
- @Override
- public Packet getDescriptionPacket()
- {
- NBTTagCompound tag = new NBTTagCompound();
- writeToNBT(tag);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, tag);
- }
- @Override
- public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
- {
- readFromNBT(pkt.func_148857_g());
- }
- public void markForUpdate()
- {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- Minecraft.getMinecraft().renderGlobal.markBlockForUpdate(xCoord, yCoord, zCoord);
- Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
- }
- public void updateCircuitTextures(World world, int x, int y, int z)
- {
- // sets orientation of sides
- if (this.meta == 2)
- {
- this.left = 5;
- this.right = 4;
- this.back = 3;
- }
- else if (this.meta == 3)
- {
- this.left = 4;
- this.right = 5;
- this.back = 2;
- }
- else if (this.meta == 4)
- {
- this.left = 2;
- this.right = 3;
- this.back = 5;
- }
- else if (this.meta == 5)
- {
- this.left = 3;
- this.right = 2;
- this.back = 4;
- }
- // Sets circuit textures
- // Top Side
- if (this.getStackInSlot(4) != null)
- {
- if (this.getStackInSlot(4).getItem() == Construct.circuitImport)
- {
- this.sTop = 1;
- }
- else if (this.getStackInSlot(4).getItem() == Construct.circuitExport)
- {
- this.sTop = 2;
- }
- }
- else
- {
- this.sTop = 0;
- }
- // Left Side
- if (this.getStackInSlot(5) != null)
- {
- if (this.getStackInSlot(5).getItem() == Construct.circuitImport)
- {
- this.sLeft = 1;
- }
- else if (this.getStackInSlot(5).getItem() == Construct.circuitExport)
- {
- this.sLeft = 2;
- }
- }
- else
- {
- this.sLeft = 0;
- }
- // Back Side
- if (this.getStackInSlot(6) != null)
- {
- if (this.getStackInSlot(6).getItem() == Construct.circuitImport)
- {
- this.sBack = 1;
- }
- else if (this.getStackInSlot(6).getItem() == Construct.circuitExport)
- {
- this.sBack = 2;
- }
- }
- else
- {
- this.sBack = 0;
- }
- // Right Side
- if (this.getStackInSlot(7) != null)
- {
- if (this.getStackInSlot(7).getItem() == Construct.circuitImport)
- {
- this.sRight = 1;
- }
- else if (this.getStackInSlot(7).getItem() == Construct.circuitExport)
- {
- this.sRight = 2;
- }
- }
- else
- {
- this.sRight = 0;
- }
- // Bottom Side
- if (this.getStackInSlot(8) != null)
- {
- if (this.getStackInSlot(8).getItem() == Construct.circuitImport)
- {
- this.sBot = 1;
- }
- else if (this.getStackInSlot(8).getItem() == Construct.circuitExport)
- {
- this.sBot = 2;
- }
- }
- else
- {
- this.sBot = 0;
- }
- this.markForUpdate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement