From 42bec8abb9afe1e38bbaaf7e7c7288bffb972a2a Mon Sep 17 00:00:00 2001 From: alltra101ify Date: Thu, 26 Nov 2015 21:53:37 -0500 Subject: [PATCH] Added Advanced Waste Handler --- .../modGUIs/ASUGuiHandler.java | 5 + .../modGUIs/GuiEnderCoreGenerator.java | 4 +- .../modGUIs/GuiNetherCoreGenerator.java | 4 +- .../modGUIs/ModGUIs.java | 1 + .../modblocks/CoreStabilizer.java | 10 +- .../modblocks/EnderCoreGenerator.java | 22 +- .../modblocks/ModBlocks.java | 4 + .../modblocks/NetherCoreGenerator.java | 25 +- .../tileentities/ModTileEntities.java | 2 + .../TileEntityEnderCoreGenerator.java | 135 +++---- .../TileEntityNetherCoreGenerator.java | 137 +++---- .../ContainerEnderCoreGenerator.java | 7 +- .../ContainerNetherCoreGenerator.java | 3 +- .../packets/ASUCoreTogglePacket.java | 8 +- .../ModMachineBlock.java | 28 +- .../TileEntityCoreGenerator.java | 346 ------------------ .../renderer/RenderCoreStabilizer.java | 5 +- src/main/resources/assets/asu/lang/en_US.lang | 2 + .../asu/textures/blocks/BlockOfASHAD.png | Bin 514 -> 2094 bytes .../blocks/BlockOfASHADWithQuaridium.png | Bin 474 -> 1976 bytes .../asu/textures/gui/GUICoreGenerator.png | Bin 2276 -> 2403 bytes 21 files changed, 223 insertions(+), 525 deletions(-) delete mode 100644 src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ASUGuiHandler.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ASUGuiHandler.java index 665479e..33bf5a3 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ASUGuiHandler.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ASUGuiHandler.java @@ -1,7 +1,9 @@ package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityAdvancedWasteHandler; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerAdvancedWasteHandler; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerEnderCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerNetherCoreGenerator; @@ -20,6 +22,8 @@ public class ASUGuiHandler implements IGuiHandler { case ModGUIs.ENDERCOREGENERATORID: if (tileentity instanceof TileEntityEnderCoreGenerator) returned = new ContainerEnderCoreGenerator(player.inventory, (TileEntityEnderCoreGenerator)tileentity); break; case ModGUIs.NETHERCOREGENERATORID: if (tileentity instanceof TileEntityNetherCoreGenerator) returned = new ContainerNetherCoreGenerator(player.inventory, (TileEntityNetherCoreGenerator)tileentity); + break; + case ModGUIs.ADVANCEDWASTEHANDLERID: if (tileentity instanceof TileEntityAdvancedWasteHandler) returned = new ContainerAdvancedWasteHandler(player.inventory, (TileEntityAdvancedWasteHandler)tileentity); } return returned; @@ -37,6 +41,7 @@ public class ASUGuiHandler implements IGuiHandler { break; case ModGUIs.NETHERCOREGENERATORID: if (tileentity instanceof TileEntityNetherCoreGenerator) returned = new GuiNetherCoreGenerator(player.inventory, (TileEntityNetherCoreGenerator)tileentity); break; + case ModGUIs.ADVANCEDWASTEHANDLERID: if (tileentity instanceof TileEntityAdvancedWasteHandler) returned = new GuiAdvancedWasteHandler(player.inventory, (TileEntityAdvancedWasteHandler)tileentity); } return returned; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java index dfb7b55..3d4ca65 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiEnderCoreGenerator.java @@ -18,7 +18,9 @@ import net.minecraft.world.World; public class GuiEnderCoreGenerator extends GuiContainer { - int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown, currentpower; + int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown; + + float currentpower; private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GuiCoreGenerator.png"); private TileEntityEnderCoreGenerator tileentity; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java index 9f1dea0..5803f4e 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/GuiNetherCoreGenerator.java @@ -16,7 +16,9 @@ import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; public class GuiNetherCoreGenerator extends GuiContainer { - int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown, currentpower; + int scaledtobar, scaledtopercentage, scaledtofueltransfer, currentcooldown; + + float currentpower; private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GUICoreGenerator.png"); private TileEntityNetherCoreGenerator tileentity; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ModGUIs.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ModGUIs.java index 9a5ab35..51a3b1c 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ModGUIs.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modGUIs/ModGUIs.java @@ -4,5 +4,6 @@ public class ModGUIs { public static final byte ENDERCOREGENERATORID = 0; public static final byte NETHERCOREGENERATORID = 1; + public static final byte ADVANCEDWASTEHANDLERID = 2; } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java index 2ace878..1ebc250 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java @@ -5,7 +5,7 @@ import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; @@ -51,7 +51,7 @@ public class CoreStabilizer extends ModMachineBlock { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer, 1)); } - return true; + return false; } @Override @@ -61,13 +61,15 @@ public class CoreStabilizer extends ModMachineBlock { } public void isMultBlock(World world, int x, int y, int z) { - if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreGenerator) { + if (world.getTileEntity(x, y+1, z) instanceof TileEntityGenerator) { world.scheduleBlockUpdate(x, y+1, z, world.getBlock(x, y+1, z), 0); - } else if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreGenerator) { + } else if (world.getTileEntity(x, y-1, z) instanceof TileEntityGenerator) { world.scheduleBlockUpdate(x, y-1, z, world.getBlock(x, y-1, z), 0); } else { ((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false; world.markBlockForUpdate(x, y, z); } } + + } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java index 9f4d9cb..45d819b 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java @@ -10,7 +10,7 @@ import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; import org.lwjgl.input.Keyboard; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; @@ -44,7 +44,7 @@ public class EnderCoreGenerator extends ModMachineBlock { @Override public void onBlockAdded(World world, int x, int y, int z) { - ((TileEntityCoreGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); + ((TileEntityGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); super.onBlockAdded(world, x, y, z); } @@ -69,7 +69,7 @@ public class EnderCoreGenerator extends ModMachineBlock { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { - int[] info = this.wrenched(player, world, x, y, z, ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock, ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.EnderCoreGenerator, 1)); + int[] info = this.wrenched(player, world, x, y, z, ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock, (int) ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.EnderCoreGenerator, 1)); switch (info[1]) { case 0: ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).currentPower = info[0]; @@ -81,8 +81,9 @@ public class EnderCoreGenerator extends ModMachineBlock { } } else if (world.getTileEntity(x, y, z) != null && ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).humanInterface() && !world.isRemote && ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock) { FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.ENDERCOREGENERATORID, world, x, y, z); + return true; } - return true; + return false; } public void isMultiBlock(World world, int x, int y, int z) { @@ -107,5 +108,18 @@ public class EnderCoreGenerator extends ModMachineBlock { } world.markBlockForUpdate(x, y, z); } + + @Override + public int getRenderType() { + return -1; + } + @Override + public boolean isOpaqueCube() { + return false; + } + @Override + public boolean renderAsNormalBlock() { + return false; + } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java index 335cef8..29f0ed5 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java @@ -12,6 +12,8 @@ public class ModBlocks { public static Block ASUPedestal = new ASUPedestal(); public static Block EnderCoreGenerator = new EnderCoreGenerator(); public static Block CoreStabilizer = new CoreStabilizer(); + public static Block AdvancedWasteHandler_active = new AdvancedWasteHandler(true); + public static Block AdvancedWasteHandler = new AdvancedWasteHandler(false); public static Block quaridiumOre = new QuaridiumOre(Material.iron); public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron); public static Block netherCoreGenerator = new NetherCoreGenerator(); @@ -25,5 +27,7 @@ public class ModBlocks { ASURegistryHelper.registerBlock(quaridiumOre); ASURegistryHelper.registerBlock(blockofashadwithquaridium); ASURegistryHelper.registerBlock(netherCoreGenerator); + ASURegistryHelper.registerBlock(AdvancedWasteHandler); + ASURegistryHelper.registerBlock(AdvancedWasteHandler_active); } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java index 3962ce4..619107e 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java @@ -18,7 +18,7 @@ import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo; import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; @@ -55,14 +55,14 @@ public class NetherCoreGenerator extends ModMachineBlock { @Override public void onBlockAdded(World world, int x, int y, int z) { - ((TileEntityCoreGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); + ((TileEntityGenerator)world.getTileEntity(x, y, z)).setCoords(x, y, z); super.onBlockAdded(world, x, y, z); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { - int[] info = this.wrenched(player, world, x, y, z, ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock, ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.netherCoreGenerator, 1)); + int[] info = this.wrenched(player, world, x, y, z, ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock, (int) ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.netherCoreGenerator, 1)); switch (info[1]) { case 0: ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).currentPower = info[0]; @@ -73,14 +73,13 @@ public class NetherCoreGenerator extends ModMachineBlock { } } else if (world.getTileEntity(x, y, z) != null && ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).humanInterface() && !world.isRemote && ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock) { FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.NETHERCOREGENERATORID, world, x, y, z); + return true; } - return true; + return false; } public void isMultiBlock(World world, int x, int y, int z) { if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { - world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer); - world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer); ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; @@ -90,16 +89,26 @@ public class NetherCoreGenerator extends ModMachineBlock { ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false; if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) { ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false; - world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer); world.markBlockForUpdate(x, y+1, z); } if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) { ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false; - world.setBlock(x, y, z, ModBlocks.CoreStabilizer); world.markBlockForUpdate(x, y-1, z); } } world.markBlockForUpdate(x, y, z); } + @Override + public int getRenderType() { + return -1; + } + @Override + public boolean isOpaqueCube() { + return false; + } + @Override + public boolean renderAsNormalBlock() { + return false; + } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/ModTileEntities.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/ModTileEntities.java index ab14afa..fe0cc89 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/ModTileEntities.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/ModTileEntities.java @@ -9,6 +9,8 @@ public class ModTileEntities { ASURegistryHelper.registerTileEntity(TileEntityASUPedestal.class, "ASUPedestal"); ASURegistryHelper.registerTileEntity(TileEntityEnderCoreGenerator.class, "EnderCore"); ASURegistryHelper.registerTileEntity(TileEntityNetherCoreGenerator.class, "NetherCore"); + ASURegistryHelper.registerTileEntity(TileEntityAdvancedWasteHandler.class, "AdvancedWasteHandler_true"); + ASURegistryHelper.registerTileEntity(TileEntityAdvancedWasteHandler.class, "AdvancedWasteHandler_false"); } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java index ee06c5d..664382e 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityEnderCoreGenerator.java @@ -1,13 +1,13 @@ package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -public class TileEntityEnderCoreGenerator extends TileEntityCoreGenerator implements ISidedInventory { +public class TileEntityEnderCoreGenerator extends TileEntityGenerator implements ISidedInventory { int[] fuelqueue; public TileEntityEnderCoreGenerator() { @@ -17,70 +17,73 @@ public class TileEntityEnderCoreGenerator extends TileEntityCoreGenerator implem configureVars(fuelqueue); configureVars(150); setMaxPower(40000); + setItems(new ItemStack[4]); + setUpgradeslotstart(1); + setFuelConversionSpeed(15F); } - @Override - public void readFromNBT(NBTTagCompound var1) { - this.rotationY = var1.getFloat("rotationY"); - this.rotationX = var1.getFloat("rotationX"); - this.speed = var1.getFloat("speed"); - this.toggle = var1.getBoolean("toggle"); - this.speedSlower = var1.getFloat("speedSlower"); - this.currentPower = var1.getInteger("currentPower"); - this.multiblock = var1.getBoolean("multiblock"); - this.currentPower = var1.getInteger("currentPower"); - this.currentfuelqueue = var1.getInteger("Fuel"); - this.currentcooldown = var1.getInteger("currentCooldown"); - this.cooldown = var1.getInteger("cooldown"); - - NBTTagList slots = var1.getTagList("items", 10); - this.items = new ItemStack[getSizeInventory()]; - - for (int i = 0; i < slots.tagCount(); i++) { - NBTTagCompound item = slots.getCompoundTagAt(i); - byte itemPos = item.getByte("itemPos"); - - if (itemPos >= 0 && itemPos < this.items.length) { - this.items[itemPos] = ItemStack.loadItemStackFromNBT(item); - } - - if (var1.hasKey("customName")) { - this.setCustomInventoryName(var1.getString("customName")); - } - - } - - super.readFromNBT(var1); - } - - @Override - public void writeToNBT(NBTTagCompound var1) { - var1.setFloat("rotationY", this.rotationY); - var1.setFloat("rotationX", this.rotationX); - var1.setFloat("speed", this.speed); - var1.setBoolean("toggle", this.toggle); - var1.setFloat("speedSlower", this.speedSlower); - var1.setBoolean("multiblock", this.multiblock); - var1.setInteger("currentPower", this.currentPower); - var1.setInteger("Fuel", this.currentfuelqueue); - var1.setInteger("currentCooldown", this.currentcooldown); - var1.setInteger("cooldown", this.cooldown); - - NBTTagList slots = new NBTTagList(); - for (int i = 0; i < items.length; i++) { - if (this.items[i] != null) { - NBTTagCompound item = new NBTTagCompound(); - item.setByte("itemPos", (byte) i); - this.items[i].writeToNBT(item); - slots.appendTag(item); - } - } - - if (this.hasCustomInventoryName()) { - var1.setString("customName", this.customName); - } - var1.setTag("items", slots); - super.writeToNBT(var1); - - } +// @Override +// public void readFromNBT(NBTTagCompound var1) { +// this.rotationY = var1.getFloat("rotationY"); +// this.rotationX = var1.getFloat("rotationX"); +// this.speed = var1.getFloat("speed"); +// this.toggle = var1.getBoolean("toggle"); +// this.speedSlower = var1.getFloat("speedSlower"); +// this.currentPower = var1.getInteger("currentPower"); +// this.multiblock = var1.getBoolean("multiblock"); +// this.currentPower = var1.getInteger("currentPower"); +// this.currentfuelqueue = var1.getInteger("Fuel"); +// this.currentcooldown = var1.getInteger("currentCooldown"); +// this.cooldown = var1.getInteger("cooldown"); +// +// NBTTagList slots = var1.getTagList("items", 10); +// this.items = new ItemStack[getSizeInventory()]; +// +// for (int i = 0; i < slots.tagCount(); i++) { +// NBTTagCompound item = slots.getCompoundTagAt(i); +// byte itemPos = item.getByte("itemPos"); +// +// if (itemPos >= 0 && itemPos < this.items.length) { +// this.items[itemPos] = ItemStack.loadItemStackFromNBT(item); +// } +// +// if (var1.hasKey("customName")) { +// this.setCustomInventoryName(var1.getString("customName")); +// } +// +// } +// +// super.readFromNBT(var1); +// } +// +// @Override +// public void writeToNBT(NBTTagCompound var1) { +// var1.setFloat("rotationY", this.rotationY); +// var1.setFloat("rotationX", this.rotationX); +// var1.setFloat("speed", this.speed); +// var1.setBoolean("toggle", this.toggle); +// var1.setFloat("speedSlower", this.speedSlower); +// var1.setBoolean("multiblock", this.multiblock); +// var1.setInteger("currentPower", this.currentPower); +// var1.setInteger("Fuel", this.currentfuelqueue); +// var1.setInteger("currentCooldown", this.currentcooldown); +// var1.setInteger("cooldown", this.cooldown); +// +// NBTTagList slots = new NBTTagList(); +// for (int i = 0; i < items.length; i++) { +// if (this.items[i] != null) { +// NBTTagCompound item = new NBTTagCompound(); +// item.setByte("itemPos", (byte) i); +// this.items[i].writeToNBT(item); +// slots.appendTag(item); +// } +// } +// +// if (this.hasCustomInventoryName()) { +// var1.setString("customName", this.customName); +// } +// var1.setTag("items", slots); +// super.writeToNBT(var1); +// +// } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java index 57d7b08..ff09dce 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityNetherCoreGenerator.java @@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; -public class TileEntityNetherCoreGenerator extends TileEntityCoreGenerator implements ISidedInventory { +public class TileEntityNetherCoreGenerator extends TileEntityGenerator implements ISidedInventory { Item[] item; int[] fuel; public TileEntityNetherCoreGenerator() { @@ -19,71 +19,74 @@ public class TileEntityNetherCoreGenerator extends TileEntityCoreGenerator imple item[0] = Items.blaze_rod; setParticle("flame"); configureVars(fuel, 30000, 125); - ItemValidityByItem(item); + ItemValidityByItem(item); + setItems(new ItemStack[4]); + setUpgradeslotstart(1); + setFuelConversionSpeed(15F); } - @Override - public void readFromNBT(NBTTagCompound var1) { - this.rotationY = var1.getFloat("rotationY"); - this.rotationX = var1.getFloat("rotationX"); - this.speed = var1.getFloat("speed"); - this.toggle = var1.getBoolean("toggle"); - this.speedSlower = var1.getFloat("speedSlower"); - this.currentPower = var1.getInteger("currentPower"); - this.multiblock = var1.getBoolean("multiblock"); - this.currentPower = var1.getInteger("currentPower"); - this.currentfuelqueue = var1.getInteger("Fuel"); - this.currentcooldown = var1.getInteger("currentCooldown"); - this.cooldown = var1.getInteger("cooldown"); - - NBTTagList slots = var1.getTagList("items", 10); - this.items = new ItemStack[getSizeInventory()]; - - for (int i = 0; i < slots.tagCount(); i++) { - NBTTagCompound item = slots.getCompoundTagAt(i); - byte itemPos = item.getByte("itemPos"); - - if (itemPos >= 0 && itemPos < this.items.length) { - this.items[itemPos] = ItemStack.loadItemStackFromNBT(item); - } - - if (var1.hasKey("customName")) { - this.setCustomInventoryName(var1.getString("customName")); - } - - } - - super.readFromNBT(var1); - } - - @Override - public void writeToNBT(NBTTagCompound var1) { - var1.setFloat("rotationY", this.rotationY); - var1.setFloat("rotationX", this.rotationX); - var1.setFloat("speed", this.speed); - var1.setBoolean("toggle", this.toggle); - var1.setFloat("speedSlower", this.speedSlower); - var1.setBoolean("multiblock", this.multiblock); - var1.setInteger("currentPower", this.currentPower); - var1.setInteger("Fuel", this.currentfuelqueue); - var1.setInteger("currentCooldown", this.currentcooldown); - var1.setInteger("cooldown", this.cooldown); - - NBTTagList slots = new NBTTagList(); - for (int i = 0; i < items.length; i++) { - if (this.items[i] != null) { - NBTTagCompound item = new NBTTagCompound(); - item.setByte("itemPos", (byte) i); - this.items[i].writeToNBT(item); - slots.appendTag(item); - } - } - - if (this.hasCustomInventoryName()) { - var1.setString("customName", this.customName); - } - var1.setTag("items", slots); - super.writeToNBT(var1); - - } +// @Override +// public void readFromNBT(NBTTagCompound var1) { +// this.rotationY = var1.getFloat("rotationY"); +// this.rotationX = var1.getFloat("rotationX"); +// this.speed = var1.getFloat("speed"); +// this.toggle = var1.getBoolean("toggle"); +// this.speedSlower = var1.getFloat("speedSlower"); +// this.currentPower = var1.getInteger("currentPower"); +// this.multiblock = var1.getBoolean("multiblock"); +// this.currentPower = var1.getInteger("currentPower"); +// this.currentfuelqueue = var1.getInteger("Fuel"); +// this.currentcooldown = var1.getInteger("currentCooldown"); +// this.cooldown = var1.getInteger("cooldown"); +// +// NBTTagList slots = var1.getTagList("items", 10); +// this.items = new ItemStack[getSizeInventory()]; +// +// for (int i = 0; i < slots.tagCount(); i++) { +// NBTTagCompound item = slots.getCompoundTagAt(i); +// byte itemPos = item.getByte("itemPos"); +// +// if (itemPos >= 0 && itemPos < this.items.length) { +// this.items[itemPos] = ItemStack.loadItemStackFromNBT(item); +// } +// +// if (var1.hasKey("customName")) { +// this.setCustomInventoryName(var1.getString("customName")); +// } +// +// } +// +// super.readFromNBT(var1); +// } +// +// @Override +// public void writeToNBT(NBTTagCompound var1) { +// var1.setFloat("rotationY", this.rotationY); +// var1.setFloat("rotationX", this.rotationX); +// var1.setFloat("speed", this.speed); +// var1.setBoolean("toggle", this.toggle); +// var1.setFloat("speedSlower", this.speedSlower); +// var1.setBoolean("multiblock", this.multiblock); +// var1.setInteger("currentPower", this.currentPower); +// var1.setInteger("Fuel", this.currentfuelqueue); +// var1.setInteger("currentCooldown", this.currentcooldown); +// var1.setInteger("cooldown", this.cooldown); +// +// NBTTagList slots = new NBTTagList(); +// for (int i = 0; i < items.length; i++) { +// if (this.items[i] != null) { +// NBTTagCompound item = new NBTTagCompound(); +// item.setByte("itemPos", (byte) i); +// this.items[i].writeToNBT(item); +// slots.appendTag(item); +// } +// } +// +// if (this.hasCustomInventoryName()) { +// var1.setString("customName", this.customName); +// } +// var1.setTag("items", slots); +// super.writeToNBT(var1); +// +// } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerEnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerEnderCoreGenerator.java index cca90c1..998b7b1 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerEnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerEnderCoreGenerator.java @@ -9,16 +9,15 @@ import net.minecraft.item.ItemStack; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator; import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots.EnderCoreGeneratorSlot; import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; public class ContainerEnderCoreGenerator extends Container { - public static final int INPUT_1 = 0; + public static final byte INPUT_1 = 0; public TileEntityEnderCoreGenerator endercoregenerator; - public ContainerEnderCoreGenerator(InventoryPlayer inventoryplayer, - TileEntityEnderCoreGenerator tileentity) { + public ContainerEnderCoreGenerator(InventoryPlayer inventoryplayer, TileEntityEnderCoreGenerator tileentity) { this.endercoregenerator = tileentity; this.addSlotToContainer(new EnderCoreGeneratorSlot(tileentity, INPUT_1, 7, 28, tileentity)); diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerNetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerNetherCoreGenerator.java index 2ffcc90..30c8d0e 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerNetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modcontainers/ContainerNetherCoreGenerator.java @@ -16,8 +16,7 @@ public class ContainerNetherCoreGenerator extends Container { private TileEntityNetherCoreGenerator nethercoregenerator; - public ContainerNetherCoreGenerator(InventoryPlayer inventoryplayer, - TileEntityNetherCoreGenerator tileentity) { + public ContainerNetherCoreGenerator(InventoryPlayer inventoryplayer, TileEntityNetherCoreGenerator tileentity) { this.nethercoregenerator = tileentity; this.addSlotToContainer(new NetherCoreGeneratorSlot(tileentity, INPUT_1, 7, 28, tileentity)); diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java index 968956f..86346e6 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/packets/ASUCoreTogglePacket.java @@ -2,7 +2,7 @@ package org.bitbucket.alltra101ify.advancedsatelliteutilization.packets; import net.minecraft.tileentity.TileEntity; -import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator; +import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityGenerator; import io.netty.buffer.ByteBuf; import cpw.mods.fml.common.network.ByteBufUtils; @@ -45,10 +45,10 @@ public class ASUCoreTogglePacket implements IMessage { @Override public IMessage onMessage(ASUCoreTogglePacket message, MessageContext ctx) { TileEntity tileentity = ctx.getServerHandler().playerEntity.getEntityWorld().getTileEntity(message.x, message.y, message.z); - if (tileentity instanceof TileEntityCoreGenerator && message.toggle == 1) { - ((TileEntityCoreGenerator)tileentity).toggle = true; + if (tileentity instanceof TileEntityGenerator && message.toggle == 1) { + ((TileEntityGenerator)tileentity).toggle = true; } else { - ((TileEntityCoreGenerator)tileentity).toggle = false; + ((TileEntityGenerator)tileentity).toggle = false; } return null; } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/ModMachineBlock.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/ModMachineBlock.java index 39d045a..d2b72ff 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/ModMachineBlock.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/ModMachineBlock.java @@ -17,11 +17,22 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; public abstract class ModMachineBlock extends BlockContainer { - protected ModMachineBlock(Material material) { super(material); } - + /** + * + * @param player EntityPlayer + * @param world world + * @param x x coordinate + * @param y y coordinate + * @param z z coordinate + * @param multiblock if this is a multiblock or not. If does not belong to a multiblock, always true. + * @param currentPower current power of the block. For debugging purposes. + * @param scale percentage of power + * @param itemtogive item to return when using wrench to break + * @return returns 1 on array [1] on servers if it is valid for opening gui while 2 is for destroying and giving item to player. array [0] is to set the new power. + */ public int[] wrenched(EntityPlayer player, World world, int x, int y, int z, boolean multiblock, int currentPower, byte scale, ItemStack itemtogive) { int[] info = new int[2]; info[0] = currentPower; @@ -57,17 +68,4 @@ public abstract class ModMachineBlock extends BlockContainer { return info; } - @Override - public int getRenderType() { - return -1; - } - @Override - public boolean isOpaqueCube() { - return false; - } - @Override - public boolean renderAsNormalBlock() { - return false; - } - } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java deleted file mode 100644 index 6892f44..0000000 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/reference/moditemblockreference/TileEntityCoreGenerator.java +++ /dev/null @@ -1,346 +0,0 @@ -package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference; - -import java.util.Random; - -import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityCoreGenerator extends TileEntity implements ISidedInventory { - protected ItemStack[] items = new ItemStack[4]; - public boolean toggle, multiblock; - protected String customName; - public int currentfuelqueue, maxpower, currentPower, cooldown, currentcooldown, fuelqueue[]; - public float rotationX, rotationY, speed, speedSlower; - Item[] validItemByItem; - String validItemByString, particle; - protected int x, y, z; - - @Override - public void updateEntity() { - if (currentcooldown != 0) { - currentcooldown--; - } - for (int i = 1; i < items.length; i++) { - if (items[i] != null) { - if (currentcooldown >= 1 && items[i].getItem() == ModItems.fanModule) { - currentcooldown--; - } else if (toggle && items[i].getItem() == ModItems.conversionSpeedUpgrade && currentfuelqueue >= 2) { - currentfuelqueue = currentfuelqueue - 2; - currentPower = currentPower + 2; - } - } - } - - - if (!multiblock && toggle) { - toggle = false; - } - - if (currentfuelqueue > maxpower) { - currentfuelqueue = maxpower; - } - - if (currentPower >= maxpower) { - currentPower = maxpower; - } - if (currentPower <= 0) { - currentPower = 0; - } - - if (toggle) { - //Register fuel and such using item and fuel index system - if (items[0] != null && this.validItemByItem != null) { - for (int i = 0; i < validItemByItem.length; i++) { - if (currentcooldown == 0 && currentfuelqueue <= maxpower - fuelqueue[i] && items[0].getItem() == validItemByItem[i]) { - if (items[0].stackSize == 1) { - this.items[0] = null; - } else { - items[0].splitStack(1); - if (this.items[0].stackSize == 0) { - this.items[0] = null; - - } - } - this.currentfuelqueue += fuelqueue[i]; - this.currentcooldown = cooldown; - } - } - - } - //Register fuel and such by default or customized index fuel - if (items[0] != null && this.validItemByString !=null) { - if (currentfuelqueue <= maxpower - fuelqueue[0] && currentcooldown == 0) { - if (items[0].stackSize == 1) { - this.items[0] = null; - } else { - items[0].splitStack(1); - if (this.items[0].stackSize == 0) { - this.items[0] = null; - } - } - this.currentfuelqueue += fuelqueue[0]; - this.currentcooldown = cooldown; - } - - } - - if (currentfuelqueue > 0 && currentPower != maxpower) { - if (currentfuelqueue >= 10) { - currentfuelqueue -= 10; - currentPower += 10; - } else if (currentfuelqueue == 1) { - currentfuelqueue --; - currentfuelqueue ++; - } - } - } - rotationY += speed; - if (rotationY > 6.3f) { - rotationY = 0f; - } - - rotationX += speedSlower; - if (rotationX >= 6.3f) { - rotationX = 0f; - } - - if (toggle && speed < 0.055f) { - speed += 0.0005f; - speedSlower += 0.00007f; - - } else if (toggle == false && speed > 0f) { - speed -= 0.0005f; - speedSlower -= 0.00007f; - - } - } - - public int powerScaled(int scale) { - return (this.currentPower * scale / maxpower); - } - - public int genscaled(int scale) { - return (this.currentfuelqueue * scale / maxpower); - } - - public int cooldownscaled(int scale) { - return (this.currentcooldown * scale / cooldown); - } - - public boolean humanInterface() { - for (int i = 1; i < items.length; i++) { - if (items[i] != null && items[i].getItem() == ModItems.humanInterfaceGate) { - return true; - } - } - return false; - } - - 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()); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - @Override - public int getSizeInventory() { - - return this.items.length; - } - - @Override - public ItemStack getStackInSlot(int slotNumber) { - - return this.items[slotNumber]; - } - - @Override - public ItemStack decrStackSize(int slotNumber, int amountDecr) { - - if (this.items[slotNumber] != null) { - //how much is returned to the hand - ItemStack itemstack; - - if (this.items[slotNumber].stackSize <= amountDecr) { - itemstack = this.items[slotNumber]; - this.items[slotNumber] = null; - } else { - itemstack = items[slotNumber].splitStack(amountDecr); - if (this.items[slotNumber].stackSize == 0) { - this.items[slotNumber] = null; - } - } - - return itemstack; - } - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - - return null; - } - - @Override - public void setInventorySlotContents(int slotNumber, ItemStack itemstack) { - this.items[slotNumber] = itemstack; - if (itemstack != null - && itemstack.stackSize > this.getInventoryStackLimit()) { - itemstack.stackSize = this.getInventoryStackLimit(); - } - } - - protected void setCustomInventoryName(String customName) { - - this.customName = customName; - - } - - @Override - public boolean hasCustomInventoryName() { - boolean customname = false; - if (customName != null) { - customname = true; - } - return customname; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - - return true; - } - - @Override - public void openInventory() { - - } - - @Override - public void closeInventory() { - - } - - @Override - public int[] getAccessibleSlotsFromSide(int p_94128_1_) { - - return null; - } - - @Override - public boolean canInsertItem(int p_1020071_, ItemStack p_102007_2_, - int p_102007_3_) { - - return false; - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, - int p_102008_3_) { - - return false; - } - - @Override - public String getInventoryName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return isItemValidForFuelSlot(itemstack); - } - - public boolean isItemValidForFuelSlot(ItemStack itemstack) { - boolean itemvalid = false; - if (this.validItemByString != null && itemstack.getItem().getUnlocalizedName().toLowerCase().contains(this.validItemByString)) { - itemvalid = true; - } else if (this.validItemByItem != null) { - for (int i1 = 0; i1 < this.validItemByItem.length; i1++) { - if (itemstack.getItem().equals(this.validItemByItem[i1])) { - itemvalid = true; - break; - } - } - } - - return itemvalid; - } - - - /** - * @param fuelqueue how much more fuel do we give? - * @param maxpower self-explanatory - * @param cooldown cool down time to transfer next item to fuel (in ticks) - */ - public void configureVars(int[] fuelqueue, int maxpower, int cooldown) { - this.fuelqueue = fuelqueue; - this.maxpower = maxpower; - this.cooldown = cooldown; - } - - public void configureVars (int[] fuelqueue) { - this.fuelqueue = fuelqueue; - } - - public void configureVars (int cooldown) { - this.cooldown = cooldown; - } - - public void setMaxPower (int maxpower) { - this.maxpower = maxpower; - } - public void ItemValidityByItem(Item[] item) { - this.validItemByItem = item; - } - /** - * - * @param string (should only be used for testing as there is very little control) Sets what is valid by name of item. - */ - public void itemValidityByString(String string) { - this.validItemByString = string; - } - - public int RetrievePower (int amountofpower) { - if (currentPower >= amountofpower) { - currentPower = currentPower - amountofpower; - } - return amountofpower; - } - - public void setCoords(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } - - public void setParticle(String particle) { - this.particle = particle; - } - -} \ No newline at end of file diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java index bb2f701..be1987a 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java @@ -13,8 +13,7 @@ import net.minecraft.util.ResourceLocation; public class RenderCoreStabilizer extends TileEntitySpecialRenderer { - byte type; - + private ModelCoreStabilizer modelASU = new ModelCoreStabilizer(); public static ResourceLocation[] texture = new ResourceLocation[3]; public void renderTileEntityAt(TileEntityCoreStabilizer tileentity, double x, @@ -28,7 +27,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); GL11.glRotatef(180, 0f, 0f, 1f); - this.bindTexture(texture[type]); + this.bindTexture(texture[1]); modelASU.renderModel(0.0625f); diff --git a/src/main/resources/assets/asu/lang/en_US.lang b/src/main/resources/assets/asu/lang/en_US.lang index 97746de..43d0259 100644 --- a/src/main/resources/assets/asu/lang/en_US.lang +++ b/src/main/resources/assets/asu/lang/en_US.lang @@ -21,4 +21,6 @@ tile.HolographicLight.name=Holographic Light tile.QuaridiumOre.name=Quaridium Ore tile.BlockOfASHADWithQuaridium.name=Block of ASHAD with Quaridium tile.NetherCoreGenerator.name=Nether Core Generator +tile.AdvancedWasteHandler_false.name=Advanced Waste Disposer +tile.AdvancedWasteHandler_true.name=Advanced Waste Disposer itemGroup.asu=Advanced Satellite Utilization \ No newline at end of file diff --git a/src/main/resources/assets/asu/textures/blocks/BlockOfASHAD.png b/src/main/resources/assets/asu/textures/blocks/BlockOfASHAD.png index 027c2945ed10eb27692d09c3ea092099a699668e..3b170be750bdee160e30a26f3df73608ab865ac4 100644 GIT binary patch literal 2094 zcmV+}2+{Y6P)NklPS65dzH#h&;O0l-K77PYG9?$CPs(aPl zuj;R67M7Nl-oJle zT_qei9FEJ&%frKiY&NsLzMf1b6~REj@AFBLxZlY!H=Vk>5_h^P16w;9;&7Z(@%2m9$vn(*T| z2(N`h!H~C9qE(erg#&sZxm-8b*GGk;-JRWRE=!>>h{a-*)F1GB+#bm#5yZ-hjk5Ii z_EuF@;b2vge*N|4`1ojhdkYh)q!`o>>UDaJTHRk`<{ zOiWCeOeUkzI5adgpc~MrHFT@Dx38zCSE*FKdGn^MtgNoCj$52g$Nc>KHtgo*x9j&b;*P0r!xwFEDY}MG<(9+WK z{P}YQ<(3y;pFMlVhOhkg`0?Y19Iq?>Q&(5{pi;i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