From 9fe3f693f1d6d015f45898818b7958b3a57a9f4a Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 26 Jul 2019 04:23:36 +0100 Subject: + Added config option to adjust ingame BGM delays. (Should be working) + Added a Pest Killer for quick removal of Butterflies and Bats. + Added Hydrogen Cyanide. % Replaced existing assets for the Bat King. % Replaced Bat King Logic, it's now an offensive mob. $ Fixed Bat King model scaling. --- .../core/block/machine/Machine_PestKiller.java | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/block/machine/Machine_PestKiller.java (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_PestKiller.java b/src/Java/gtPlusPlus/core/block/machine/Machine_PestKiller.java new file mode 100644 index 0000000000..11fa80f439 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_PestKiller.java @@ -0,0 +1,137 @@ +package gtPlusPlus.core.block.machine; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.handler.GuiHandler; +import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class Machine_PestKiller extends BlockContainer implements ITileTooltip +{ + @SideOnly(Side.CLIENT) + private IIcon textureTop; + @SideOnly(Side.CLIENT) + private IIcon textureBottom; + @SideOnly(Side.CLIENT) + private IIcon textureFront; + + /** + * Determines which tooltip is displayed within the itemblock. + */ + private final int mTooltipID = 6; + + @Override + public int getTooltipID() { + return this.mTooltipID; + } + + @SuppressWarnings("deprecation") + public Machine_PestKiller() + { + super(Material.wood); + this.setBlockName("blockPestKiller"); + this.setHardness(5f); + this.setResistance(1f); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockPestKiller"); + LanguageRegistry.addName(this, "Pest Killer"); + + } + + /** + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int aSide, final int p_149691_2_) + { + return aSide == 1 ? this.textureTop : (aSide == 0 ? this.textureBottom : this.textureFront); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); + this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_PESTKILLER_TOP"); + this.textureBottom = p_149651_1_.registerIcon("planks_acacia"); + this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); + } + + /** + * Called upon block activation (right click on the block.) + */ + @Override + public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz) + { + if (world.isRemote) { + return true; + } + + final TileEntity te = world.getTileEntity(x, y, z); + if ((te != null) && (te instanceof TileEntityPestKiller)){ + player.openGui(GTplusplus.instance, GuiHandler.GUI15, world, x, y, z); + return true; + } + return false; + } + + @Override + public int getRenderBlockPass() { + return 0; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { + return new TileEntityPestKiller(); + } + + @Override + public void onBlockAdded(final World world, final int x, final int y, final int z) { + super.onBlockAdded(world, x, y, z); + } + + @Override + public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { + InventoryUtils.dropInventoryItems(world, x, y, z, block); + super.breakBlock(world, x, y, z, block, number); + } + + @Override + public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { + if (stack.hasDisplayName()) { + ((TileEntityPestKiller) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName()); + } + } + + @Override + public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { + return false; + } + +} \ No newline at end of file -- cgit From d4d38f40f4500c3dfa218b516fc7621d64bc1759 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 11 Oct 2019 18:27:54 +0100 Subject: + Added Round-Robinator. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 4 + .../core/block/machine/Machine_RoundRobinator.java | 162 ++++++++++++ .../core/container/Container_RoundRobinator.java | 190 ++++++++++++++ .../core/gui/machine/GUI_RoundRobinator.java | 44 ++++ src/Java/gtPlusPlus/core/handler/GuiHandler.java | 7 +- .../core/inventories/Inventory_RoundRobinator.java | 173 ++++++++++++ .../item/base/itemblock/ItemBlockBasicTile.java | 5 + .../machines/TileEntityRoundRobinator.java | 291 +++++++++++++++++++++ 8 files changed, 875 insertions(+), 1 deletion(-) create mode 100644 src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java create mode 100644 src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java create mode 100644 src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java create mode 100644 src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java create mode 100644 src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index b59facf9e2..a448e313ac 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -21,6 +21,7 @@ import gtPlusPlus.core.block.machine.Machine_ModularityTable; import gtPlusPlus.core.block.machine.Machine_PestKiller; import gtPlusPlus.core.block.machine.Machine_PooCollector; import gtPlusPlus.core.block.machine.Machine_ProjectTable; +import gtPlusPlus.core.block.machine.Machine_RoundRobinator; import gtPlusPlus.core.block.machine.Machine_SuperJukebox; import gtPlusPlus.core.block.machine.Machine_TradeTable; import gtPlusPlus.core.block.machine.Machine_Workbench; @@ -34,6 +35,7 @@ import net.minecraftforge.fluids.Fluid; public final class ModBlocks { + public static Block blockRoundRobinator; public static Block blockCircuitProgrammer; public static Block blockFakeMiningPipe; public static Block blockFakeMiningHead; @@ -147,6 +149,8 @@ public final class ModBlocks { blockPooCollector = new Machine_PooCollector(); blockPestKiller = new Machine_PestKiller(); + + blockRoundRobinator = new Machine_RoundRobinator(); new BlockGenericRedstoneDetector(); new BlockGenericRedstoneTest(); diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java new file mode 100644 index 0000000000..71814cb868 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -0,0 +1,162 @@ +package gtPlusPlus.core.block.machine; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.common.items.GT_MetaGenerated_Tool_01; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.handler.GuiHandler; +import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; + +public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip +{ + @SideOnly(Side.CLIENT) + private IIcon textureTop; + @SideOnly(Side.CLIENT) + private IIcon textureBottom; + @SideOnly(Side.CLIENT) + private IIcon textureFront; + + /** + * Determines which tooltip is displayed within the itemblock. + */ + private final int mTooltipID = 7; + + @Override + public int getTooltipID() { + return this.mTooltipID; + } + + @SuppressWarnings("deprecation") + public Machine_RoundRobinator(){ + super(Material.iron); + this.setHardness(1f); + this.setResistance(1f); + this.setBlockName("blockRoundRobinator"); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockRoundRobinator"); + LanguageRegistry.addName(this, "Round-Robinator"); + + } + + /** + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) + { + return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (this.textureFront)); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); + this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); + this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G"); + this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"); + } + + /** + * Called upon block activation (right click on the block.) + */ + @Override + public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz) + { + if (world.isRemote) { + return true; + } + else { + + boolean mDidScrewDriver = false; + // Check For Screwdriver + try { + final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); + final Item mHandItem = mHandStack.getItem(); + if (((mHandItem instanceof GT_MetaGenerated_Tool_01) + && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { + final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z); + if (tile != null) { + mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z); + } + } + } + catch (final Throwable t) {} + + if (!mDidScrewDriver) { + final TileEntity te = world.getTileEntity(x, y, z); + if ((te != null) && (te instanceof TileEntityRoundRobinator)){ + player.openGui(GTplusplus.instance, GuiHandler.GUI16, world, x, y, z); + return true; + } + } + else { + return true; + } + + } + return false; + } + + @Override + public int getRenderBlockPass() { + return 1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { + return new TileEntityRoundRobinator(); + } + + @Override + public void onBlockAdded(final World world, final int x, final int y, final int z) { + super.onBlockAdded(world, x, y, z); + } + + @Override + public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { + InventoryUtils.dropInventoryItems(world, x, y, z, block); + super.breakBlock(world, x, y, z, block, number); + } + + @Override + public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { + if (stack.hasDisplayName()) { + ((TileEntityRoundRobinator) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName()); + } + } + + @Override + public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { + return false; + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java new file mode 100644 index 0000000000..ad2aef02f8 --- /dev/null +++ b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java @@ -0,0 +1,190 @@ +package gtPlusPlus.core.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.slots.SlotIntegratedCircuit; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; + +public class Container_RoundRobinator extends Container { + + protected TileEntityRoundRobinator tile_entity; + public final Inventory_RoundRobinator inventoryChest; + + private final World worldObj; + private final int posX; + private final int posY; + private final int posZ; + + public static final int SLOT_OUTPUT = 25; + + public static int StorageSlotNumber = 26; // Number of slots in storage area + public static int InventorySlotNumber = 36; // Inventory Slots (Inventory + // and Hotbar) + public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All + // slots + + public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) { + this.tile_entity = te; + this.inventoryChest = te.getInventory(); + + int var6; + int var7; + this.worldObj = te.getWorldObj(); + this.posX = te.xCoord; + this.posY = te.yCoord; + this.posZ = te.zCoord; + Logger.INFO("1"); + + int o = 0; + + // Storage Side + /*for (var6 = 0; var6 < 3; var6++) { + for (var7 = 0; var7 < 5; var7++) { + this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18))); + o++; + } + }*/ + + + int xStart = 8; + int yStart = 5; + + try { + //0 + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart, yStart)); + //1-10 + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+18)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+18)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+18)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+18)); + //11-20 + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+18)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+18)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+36)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+54)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+54)); + //21-24 + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+54)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+54)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+54)); + this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+54)); + Logger.INFO("2"); + + //Add Output + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); + o++; + Logger.INFO("3"); + + + + // Player Inventory + for (var6 = 0; var6 < 3; ++var6) { + for (var7 = 0; var7 < 9; ++var7) { + this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); + } + } + // Player Hotbar + for (var6 = 0; var6 < 9; ++var6) { + this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); + } + + + + Logger.INFO("4"); + } + catch (Throwable t) {} + + } + + @Override + public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, + final EntityPlayer aPlayer) { + + if (!aPlayer.worldObj.isRemote) { + if ((aSlotIndex == 999) || (aSlotIndex == -999)) { + // Utils.LOG_WARNING("??? - "+aSlotIndex); + } + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + @Override + public void onContainerClosed(final EntityPlayer par1EntityPlayer) { + super.onContainerClosed(par1EntityPlayer); + } + + @Override + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockRoundRobinator) { + return false; + } + + return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; + } + + @Override + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { + ItemStack var3 = null; + final Slot var4 = (Slot) this.inventorySlots.get(par2); + + if ((var4 != null) && var4.getHasStack()) { + final ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + /* + * if (par2 == 0) { if (!this.mergeItemStack(var5, + * InOutputSlotNumber, FullSlotNumber, true)) { return null; } + * + * var4.onSlotChange(var5, var3); } else if (par2 >= + * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if + * (!this.mergeItemStack(var5, InventoryOutSlotNumber, + * FullSlotNumber, false)) { return null; } } else if (par2 >= + * InventoryOutSlotNumber && par2 < FullSlotNumber) { if + * (!this.mergeItemStack(var5, InOutputSlotNumber, + * InventoryOutSlotNumber, false)) { return null; } } else if + * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, + * false)) { return null; } + */ + + if (var5.stackSize == 0) { + var4.putStack((ItemStack) null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; + } + + // Can merge Slot + @Override + public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { + return super.func_94530_a(p_94530_1_, p_94530_2_); + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java new file mode 100644 index 0000000000..7a9417c806 --- /dev/null +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java @@ -0,0 +1,44 @@ +package gtPlusPlus.core.gui.machine; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import gtPlusPlus.core.container.Container_RoundRobinator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; + +@SideOnly(Side.CLIENT) +public class GUI_RoundRobinator extends GuiContainer { + + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png"); + + public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te){ + super(new Container_RoundRobinator(player_inventory, te)); + } + + @Override + protected void drawGuiContainerForegroundLayer(final int i, final int j){ + super.drawGuiContainerForegroundLayer(i, j); + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){ + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(craftingTableGuiTextures); + final int x = (this.width - this.xSize) / 2; + final int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } + + //This method is called when the Gui is first called! + @Override + public void initGui(){ + super.initGui(); + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index 67493d7964..2141210650 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -54,6 +54,7 @@ public class GuiHandler implements IGuiHandler { public static final int GUI13 = 12; // Decayables Chest public static final int GUI14 = 13; // Super Jukebox public static final int GUI15 = 14; // Pest Killer + public static final int GUI16 = 15; // Round-Robinator public static void init() { @@ -102,6 +103,8 @@ public class GuiHandler implements IGuiHandler { return new Container_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te); } else if (ID == GUI15) { return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te); + } else if (ID == GUI16) { + return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); } } @@ -162,7 +165,9 @@ public class GuiHandler implements IGuiHandler { return new GUI_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te); } else if (ID == GUI15) { return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te); - } + } else if (ID == GUI16) { + return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); + } } if (ID == GUI9) { diff --git a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java new file mode 100644 index 0000000000..58d60b595f --- /dev/null +++ b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java @@ -0,0 +1,173 @@ +package gtPlusPlus.core.inventories; + +import gtPlusPlus.core.recipe.common.CI; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class Inventory_RoundRobinator implements IInventory{ + + private final String name = "Circuit Programmer"; + + /** Defining your inventory size this way is handy */ + public static final int INV_SIZE = 26; + + /** Inventory's size must be same as number of slots you add to the Container class */ + private ItemStack[] inventory = new ItemStack[INV_SIZE]; + + public void readFromNBT(final NBTTagCompound nbt){ + final NBTTagList list = nbt.getTagList("Items", 10); + this.inventory = new ItemStack[INV_SIZE]; + for(int i = 0;i= 0) && (slot < INV_SIZE)){ + //Utils.LOG_INFO("Trying to read NBT data from inventory."); + this.inventory[slot] = ItemStack.loadItemStackFromNBT(data); + } + } + } + + public void writeToNBT(final NBTTagCompound nbt){ + final NBTTagList list = new NBTTagList(); + for(int i = 0;i amount) + { + stack = stack.splitStack(amount); + // Don't forget this line or your inventory will not be saved! + this.markDirty(); + } + else + { + // this method also calls markDirty, so we don't need to call it again + this.setInventorySlotContents(slot, null); + } + } + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int slot) + { + final ItemStack stack = this.getStackInSlot(slot); + this.setInventorySlotContents(slot, null); + return stack; + } + + @Override + public void setInventorySlotContents(final int slot, final ItemStack stack) + { + this.inventory[slot] = stack; + + if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + // Don't forget this line or your inventory will not be saved! + this.markDirty(); + } + + // 1.7.2+ renamed to getInventoryName + @Override + public String getInventoryName() + { + return this.name; + } + + // 1.7.2+ renamed to hasCustomInventoryName + @Override + public boolean hasCustomInventoryName() + { + return this.name.length() > 0; + } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + /** + * This is the method that will handle saving the inventory contents, as it is called (or should be called!) + * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also + * let you change things in your inventory without ever opening a Gui, if you want. + */ + // 1.7.2+ renamed to markDirty + @Override + public void markDirty() + { + for (int i = 0; i < this.getSizeInventory(); ++i) + { + final ItemStack temp = this.getStackInSlot(i); + if (temp != null){ + //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize); + } + + if ((temp != null) && (temp.stackSize == 0)) { + this.inventory[i] = null; + } + } + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer entityplayer) + { + return true; + } + + // 1.7.2+ renamed to openInventory(EntityPlayer player) + @Override + public void openInventory() {} + + // 1.7.2+ renamed to closeInventory(EntityPlayer player) + @Override + public void closeInventory() {} + + /** + * This method doesn't seem to do what it claims to do, as + * items can still be left-clicked and placed in the inventory + * even when this returns false + */ + @Override + public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { + return (itemstack.getItem() == CI.getNumberedCircuit(0).getItem()); + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index 21ea826eea..73d6bb0ca2 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -44,6 +44,11 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); + } else if (this.mID == 7) { // Round-Robinator + list.add("Attempts to output items evenly on all for horizontal planes"); + list.add("Each tier operates at a factor of one operation every (20/tier)ticks"); + list.add("Top and bottom do not pull, so you must push item in"); + list.add("Sides can be disabled with a screwdriver"); } else { list.add("Bad Tooltip ID - " + mID); diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java new file mode 100644 index 0000000000..13ba5ca44d --- /dev/null +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java @@ -0,0 +1,291 @@ +package gtPlusPlus.core.tileentities.machines; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.PlayerUtils; + +public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory { + + private int tickCount = 0; + private final Inventory_RoundRobinator inventoryContents; + private String customName; + public int locationX; + public int locationY; + public int locationZ; + private int aCurrentMode = 0; + + public TileEntityRoundRobinator() { + this.inventoryContents = new Inventory_RoundRobinator(); + this.setTileLocation(); + } + + public boolean setTileLocation() { + if (this.hasWorldObj()) { + if (!this.getWorldObj().isRemote) { + this.locationX = this.xCoord; + this.locationY = this.yCoord; + this.locationZ = this.zCoord; + return true; + } + } + return false; + } + + //Rename to hasCircuitToConfigure + public final boolean hasCircuitToConfigure() { + for (ItemStack i : this.getInventory().getInventory()) { + if (i == null) { + continue; + } + else { + return true; + } + } + return false; + } + + public Inventory_RoundRobinator getInventory() { + return this.inventoryContents; + } + + public boolean addOutput() { + ItemStack[] aInputs = this.getInventory().getInventory().clone(); + //Check if there is output in slot. + Boolean hasOutput = false; + if (aInputs[25] != null) { + hasOutput = true; + } + AutoMap aValidSlots = new AutoMap(); + int aSlotCount = 0; + for (ItemStack i : aInputs) { + if (i != null) { + aValidSlots.put(aSlotCount); + } + aSlotCount++; + } + for (int e : aValidSlots) { + boolean doAdd = false; + ItemStack g = this.getStackInSlot(e); + int aSize = 0; + ItemStack aInputStack = null; + if (g != null) { + if (!hasOutput) { + aSize = g.stackSize; + doAdd = true; + } + else { + ItemStack f = this.getStackInSlot(25); + if (f != null) { + if (f.getItemDamage() == e) { + aSize = f.stackSize + g.stackSize; + if (aSize > 64) { + aInputStack = g.copy(); + aInputStack.stackSize = (aSize-64); + } + doAdd = true; + } + } + else { + doAdd = true; + aSize = g.stackSize; + } + } + if (doAdd) { + ItemStack aOutput = CI.getNumberedCircuit(e); + if (aOutput != null) { + aOutput.stackSize = aSize; + this.setInventorySlotContents(e, aInputStack); + this.setInventorySlotContents(25, aOutput); + return true; + } + } + } + continue; + } + return false; + } + + @Override + public void updateEntity() { + try{ + if (!this.worldObj.isRemote) { + if (tickCount % 10 == 0) { + if (hasCircuitToConfigure()) { + this.addOutput(); + this.markDirty(); + } + } + this.tickCount++; + } + } + catch (final Throwable t){} + } + + public boolean anyPlayerInRange() { + return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null; + } + + public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) { + if (!nbt.hasKey(tag)) { + nbt.setTag(tag, new NBTTagCompound()); + } + return nbt.getCompoundTag(tag); + } + + @Override + public void writeToNBT(final NBTTagCompound nbt) { + super.writeToNBT(nbt); + // Utils.LOG_WARNING("Trying to write NBT data to TE."); + final NBTTagCompound chestData = new NBTTagCompound(); + this.inventoryContents.writeToNBT(chestData); + nbt.setTag("ContentsChest", chestData); + if (this.hasCustomInventoryName()) { + nbt.setString("CustomName", this.getCustomName()); + } + nbt.setInteger("aCurrentMode", aCurrentMode); + } + + @Override + public void readFromNBT(final NBTTagCompound nbt) { + super.readFromNBT(nbt); + // Utils.LOG_WARNING("Trying to read NBT data from TE."); + this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); + if (nbt.hasKey("CustomName", 8)) { + this.setCustomName(nbt.getString("CustomName")); + } + aCurrentMode = nbt.getInteger("aCurrentMode"); + } + + @Override + public int getSizeInventory() { + return this.getInventory().getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(final int slot) { + return this.getInventory().getStackInSlot(slot); + } + + @Override + public ItemStack decrStackSize(final int slot, final int count) { + return this.getInventory().decrStackSize(slot, count); + } + + @Override + public ItemStack getStackInSlotOnClosing(final int slot) { + return this.getInventory().getStackInSlotOnClosing(slot); + } + + @Override + public void setInventorySlotContents(final int slot, final ItemStack stack) { + this.getInventory().setInventorySlotContents(slot, stack); + } + + @Override + public int getInventoryStackLimit() { + return this.getInventory().getInventoryStackLimit(); + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer entityplayer) { + return this.getInventory().isUseableByPlayer(entityplayer); + } + + @Override + public void openInventory() { + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); + this.getInventory().openInventory(); + } + + @Override + public void closeInventory() { + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); + this.getInventory().closeInventory(); + } + + @Override + public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { + return this.getInventory().isItemValidForSlot(slot, itemstack); + } + + @Override + public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { + final int[] accessibleSides = new int[this.getSizeInventory()]; + for (int r=0; r= 0 && p_102007_1_ <= 24; + } + + @Override + public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { + return p_102008_1_ == 25; + } + + public String getCustomName() { + return this.customName; + } + + public void setCustomName(final String customName) { + this.customName = customName; + } + + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.circuitprogrammer"; + } + + @Override + public boolean hasCustomInventoryName() { + return (this.customName != null) && !this.customName.equals(""); + } + + @Override + public Packet getDescriptionPacket() { + final NBTTagCompound tag = new NBTTagCompound(); + this.writeToNBT(tag); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag); + } + + @Override + public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) { + final NBTTagCompound tag = pkt.func_148857_g(); + this.readFromNBT(tag); + } + + public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) { + try { + if (aCurrentMode == 24) { + aCurrentMode = 0; + } + else { + aCurrentMode++; + } + PlayerUtils.messagePlayer(player, "Now configuring units for type "+aCurrentMode+"."); + return true; + } + catch (Throwable t) { + return false; + } + } + +} -- cgit From 82f4a138efb59d8fdc4a492a190d3c8d7c53fbff Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 13 Oct 2019 21:54:43 +0100 Subject: + Added Round-Robinator recipes. % Adjusted Zirconium Carbide tier, and changed the materials used for LV tiered recipes. % Finished work on the Round-Robinator logic. $ Removed PSS log spam. $ Many minor bug fixes. --- src/Java/gtPlusPlus/api/objects/data/AutoMap.java | 7 +- .../gtPlusPlus/api/objects/minecraft/BlockPos.java | 2 +- .../api/objects/minecraft/FakeBlockPos.java | 2 +- src/Java/gtPlusPlus/api/objects/random/XSTR.java | 7 + .../core/block/machine/Machine_RoundRobinator.java | 78 ++- .../core/container/Container_RoundRobinator.java | 247 +++++--- .../core/gui/machine/GUI_RoundRobinator.java | 86 ++- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 46 +- .../core/inventories/Inventory_RoundRobinator.java | 7 +- .../core/item/base/dusts/BaseItemDust.java | 3 +- .../core/item/base/dusts/BaseItemDustUnique.java | 2 +- .../item/base/itemblock/ItemBlockBasicTile.java | 6 +- .../base/itemblock/ItemBlockRoundRobinator.java | 111 ++++ .../core/item/bauble/FireProtectionBauble.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 43 ++ src/Java/gtPlusPlus/core/recipe/common/CI.java | 6 +- .../machines/TileEntityRoundRobinator.java | 695 +++++++++++++++++---- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 28 +- .../gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java | 2 +- .../plugin/fixes/vanilla/VanillaBedHeightFix.java | 2 +- src/Java/gtPlusPlus/preloader/DevHelper.java | 2 +- ...chMetaTileEntity_PowerSubStationController.java | 5 +- src/resources/assets/miscutils/lang/en_US.lang | 11 +- .../RoundRobinator/RoundRobinator_Side_0.png | Bin 0 -> 1448 bytes .../RoundRobinator/RoundRobinator_Side_1.png | Bin 0 -> 1444 bytes .../RoundRobinator/RoundRobinator_Side_2.png | Bin 0 -> 1446 bytes .../RoundRobinator/RoundRobinator_Side_3.png | Bin 0 -> 1446 bytes .../RoundRobinator/RoundRobinator_Side_4.png | Bin 0 -> 1443 bytes .../RoundRobinator/RoundRobinator_Top_0.png | Bin 0 -> 1405 bytes .../RoundRobinator/RoundRobinator_Top_1.png | Bin 0 -> 1403 bytes .../RoundRobinator/RoundRobinator_Top_2.png | Bin 0 -> 1403 bytes .../RoundRobinator/RoundRobinator_Top_3.png | Bin 0 -> 1402 bytes .../RoundRobinator/RoundRobinator_Top_4.png | Bin 0 -> 1400 bytes .../miscutils/textures/gui/RoundRobinator.png | Bin 0 -> 1648 bytes 34 files changed, 1113 insertions(+), 287 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png create mode 100644 src/resources/assets/miscutils/textures/gui/RoundRobinator.png (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index 3583a04a74..9e7f702200 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -212,11 +212,12 @@ public class AutoMap implements Iterable, Cloneable, Serializable, Collect @Override public boolean retainAll(Collection c) { - AutoMap aTempAllocation = new AutoMap(); + AutoMap aTempAllocation = new AutoMap(); boolean aTrue = false; aTempAllocation = this; - aTempAllocation.removeAll(c); - aTrue = this.removeAll(aTempAllocation); + aTempAllocation.removeAll(c); + aTempAllocation.clear(); + aTrue = aTempAllocation.isEmpty(); aTempAllocation.clear(); return aTrue; } diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java index 7c11e7232b..ab359c3853 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java @@ -19,7 +19,7 @@ public class BlockPos implements Serializable{ public final int yPos; public final int zPos; public final int dim; - public final World world; + public final transient World world; public static BlockPos generateBlockPos(String sUUID) { String[] s2 = sUUID.split("@"); diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java index d0c1f3f040..d5db8081dc 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java @@ -12,7 +12,7 @@ import net.minecraftforge.common.DimensionManager; public class FakeBlockPos extends BlockPos { private static final long serialVersionUID = -6442245826092414593L; - private Block aBlockAtPos; + private transient Block aBlockAtPos; private int aBlockMetaAtPos = 0; public static FakeBlockPos generateBlockPos(String sUUID) { diff --git a/src/Java/gtPlusPlus/api/objects/random/XSTR.java b/src/Java/gtPlusPlus/api/objects/random/XSTR.java index 6357e9895c..6ce1cbeb6c 100644 --- a/src/Java/gtPlusPlus/api/objects/random/XSTR.java +++ b/src/Java/gtPlusPlus/api/objects/random/XSTR.java @@ -115,6 +115,13 @@ public class XSTR extends Random implements Cloneable { */ @Override public XSTR clone() { + try { + super.clone(); + } + catch (CloneNotSupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return new XSTR(this.getSeed()); } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index 71814cb868..8ba7c2533b 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -1,14 +1,25 @@ package gtPlusPlus.core.block.machine; +import java.util.List; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; @@ -19,24 +30,12 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.handler.GuiHandler; -import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.util.minecraft.InventoryUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip { @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; + private IIcon[] textureTop = new IIcon[5]; @SideOnly(Side.CLIENT) - private IIcon textureFront; + private IIcon[] textureFront = new IIcon[5]; /** * Determines which tooltip is displayed within the itemblock. @@ -55,8 +54,8 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt this.setResistance(1f); this.setBlockName("blockRoundRobinator"); this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockRoundRobinator"); - LanguageRegistry.addName(this, "Round-Robinator"); + GameRegistry.registerBlock(this, ItemBlockRoundRobinator.class, "blockRoundRobinator"); + //LanguageRegistry.addName(this, "Round-Robinator"); } @@ -65,19 +64,23 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt */ @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) - { - return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (this.textureFront)); + public IIcon getIcon(final int aSide, final int aMeta) { + if (aSide < 2) { + return this.textureTop[aMeta]; + } + else { + return this.textureFront[aMeta]; + } } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) - { - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); - this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B"); - this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G"); - this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"); + public void registerBlockIcons(final IIconRegister p_149651_1_){ + this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "RoundRobinator_Side"); + for (int i=0;i<5;i++) { + this.textureTop[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Top_"+i); + this.textureFront[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Side_"+i); + } } /** @@ -109,16 +112,14 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt if (!mDidScrewDriver) { final TileEntity te = world.getTileEntity(x, y, z); if ((te != null) && (te instanceof TileEntityRoundRobinator)){ - player.openGui(GTplusplus.instance, GuiHandler.GUI16, world, x, y, z); - return true; + return ((TileEntityRoundRobinator) te).onRightClick((byte) side, player, x, y, z); } + return false; } else { return true; - } - + } } - return false; } @Override @@ -149,9 +150,7 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt @Override public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { - if (stack.hasDisplayName()) { - ((TileEntityRoundRobinator) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName()); - } + super.onBlockPlacedBy(world, x, y, z, entity, stack); } @Override @@ -159,4 +158,17 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt return false; } + @Override + public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + //super.getSubBlocks(aItem, p_149666_2_, aList); + for (int i=0;i<5;i++) { + aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); + } + } + + @Override + public IIcon getIcon(IBlockAccess aBlockAccess, int x, int y, int z, int aSide) { + return super.getIcon(aBlockAccess, x, y, z, aSide); + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java index ad2aef02f8..0da2933dfa 100644 --- a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java @@ -1,39 +1,52 @@ package gtPlusPlus.core.container; +import java.util.Iterator; + +import org.apache.commons.lang3.ArrayUtils; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.Inventory_RoundRobinator; -import gtPlusPlus.core.slots.SlotIntegratedCircuit; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; public class Container_RoundRobinator extends Container { - protected TileEntityRoundRobinator tile_entity; + public TileEntityRoundRobinator tile_entity; public final Inventory_RoundRobinator inventoryChest; private final World worldObj; private final int posX; private final int posY; private final int posZ; + + private final boolean[] mActiveData = new boolean[] {false, false, false, false}; - public static final int SLOT_OUTPUT = 25; - - public static int StorageSlotNumber = 26; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory + public static int mStorageSlotNumber = 4; // Number of slots in storage area + public static int mInventorySlotNumber = 36; // Inventory Slots (Inventory // and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All + public static int mFullSlotNumber = mInventorySlotNumber + mStorageSlotNumber; // All // slots public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) { this.tile_entity = te; this.inventoryChest = te.getInventory(); + boolean [] aTemp = te.getActiveSides(); + if (aTemp != null && aTemp.length == 4) { + for (int i=0;i<4;i++) { + mActiveData[i] = aTemp[i]; + } + } int var6; int var7; @@ -54,44 +67,20 @@ public class Container_RoundRobinator extends Container { }*/ - int xStart = 8; - int yStart = 5; + int xStart = 134; + int yStart = 32; try { //0 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart, yStart)); - //1-10 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+18)); - //11-20 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+18)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+36)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+18, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+36, yStart+54)); - //21-24 - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+54, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+72, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+90, yStart+54)); - this.addSlotToContainer(new SlotIntegratedCircuit(this.inventoryChest, o++, xStart+108, yStart+54)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart+17)); + this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart+17)); Logger.INFO("2"); //Add Output - this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); - o++; + //this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); + //o++; Logger.INFO("3"); @@ -112,6 +101,7 @@ public class Container_RoundRobinator extends Container { Logger.INFO("4"); } catch (Throwable t) {} + this.detectAndSendChanges(); } @@ -121,10 +111,14 @@ public class Container_RoundRobinator extends Container { if (!aPlayer.worldObj.isRemote) { if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); + } + else if (aSlotIndex < 4) { + this.tile_entity.toggleSide(aSlotIndex+2); + Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString()); } } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + return GT_Values.NI; + //return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @Override @@ -140,51 +134,136 @@ public class Container_RoundRobinator extends Container { return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; } + - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, true)) { return null; } - * - * var4.onSlotChange(var5, var3); } else if (par2 >= - * InOutputSlotNumber && par2 < InventoryOutSlotNumber) { if - * (!this.mergeItemStack(var5, InventoryOutSlotNumber, - * FullSlotNumber, false)) { return null; } } else if (par2 >= - * InventoryOutSlotNumber && par2 < FullSlotNumber) { if - * (!this.mergeItemStack(var5, InOutputSlotNumber, - * InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, - * false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - if (var5.stackSize == var3.stackSize) { - return null; - } + public final void addCraftingToCrafters(ICrafting par1ICrafting) { + try { + super.addCraftingToCrafters(par1ICrafting); + } catch (Throwable var3) { + + } + } + + public final void removeCraftingFromCrafters(ICrafting par1ICrafting) { + try { + super.removeCraftingFromCrafters(par1ICrafting); + } catch (Throwable var3) { + } + } - var4.onPickupFromSlot(par1EntityPlayer, var5); + public final void detectAndSendChanges() { + try { + super.detectAndSendChanges(); + detectAndSendChangesEx(); + } catch (Throwable var2) { } + } - return var3; + public final void updateProgressBar(int par1, int par2) { + try { + super.updateProgressBar(par1, par2); + updateProgressBarEx(par1, par2); + } catch (Throwable var4) { + } } + + + public int mSide_1 = 0; + public int mSide_2 = 0; + public int mSide_3 = 0; + public int mSide_4 = 0; + public int mTier = 1; + public int mTickRate = 50; + + private int oSide_1 = 0; + private int oSide_2 = 0; + private int oSide_3 = 0; + private int oSide_4 = 0; + private int oTier = 1; + private int oTickRate = 50; + + private int mTimer = 0; + + + + public void detectAndSendChangesEx() { + super.detectAndSendChanges(); + if (!this.tile_entity.getWorldObj().isRemote) { + boolean [] aTemp = tile_entity.getActiveSides(); + for (int i=0;i<4;i++) { + mActiveData[i] = aTemp[i]; + } + this.mSide_1 = aTemp[0] ? 1 : 0; + this.mSide_2 = aTemp[1] ? 1 : 0; + this.mSide_3 = aTemp[2] ? 1 : 0; + this.mSide_4 = aTemp[3] ? 1 : 0; + this.mTier = this.tile_entity.getTier(); + this.mTickRate = this.tile_entity.getTickRate(); + + String InventoryContents = ArrayUtils.toString(aTemp, "null"); + //Logger.INFO("Test: "+InventoryContents); + ++this.mTimer; + Iterator var2 = this.crafters.iterator(); + + while (true) { + ICrafting var1; + do { + if (!var2.hasNext()) { + this.oSide_1 = this.mSide_1; + this.oSide_2 = this.mSide_2; + this.oSide_3 = this.mSide_3; + this.oSide_4 = this.mSide_4; + this.oTier = this.mTier; + this.oTickRate = this.mTickRate; + return; + } + var1 = (ICrafting) var2.next(); + if (this.mTimer % 500 == 10 || this.oSide_1 != this.mSide_1) { + var1.sendProgressBarUpdate(this, 2, this.mSide_1); + } + if (this.mTimer % 500 == 10 || this.oSide_2 != this.mSide_2) { + var1.sendProgressBarUpdate(this, 4, this.mSide_2); + } + if (this.mTimer % 500 == 10 || this.oSide_3 != this.mSide_3) { + var1.sendProgressBarUpdate(this, 6, this.mSide_3); + } + if (this.mTimer % 500 == 10 || this.oSide_4 != this.mSide_4) { + var1.sendProgressBarUpdate(this, 8, this.mSide_4); + } + if (this.mTimer % 500 == 10 || this.oTier != this.mTier) { + var1.sendProgressBarUpdate(this, 10, this.mTier); + } + if (this.mTimer % 500 == 10 || this.oTickRate != this.mTickRate) { + var1.sendProgressBarUpdate(this, 12, this.mTickRate); + } + } while (this.mTimer % 500 != 10); + + } + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBarEx(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 2 : + this.mSide_1 = par2; + break; + case 4 : + this.mSide_2 = par2; + break; + case 6 : + this.mSide_3 = par2; + case 8 : + this.mSide_4 = par2; + case 10 : + this.mTier = par2; + case 12 : + this.mTickRate = par2; + break; + } - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java index 7a9417c806..c5a8341d8a 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java @@ -1,29 +1,75 @@ package gtPlusPlus.core.gui.machine; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; import gtPlusPlus.core.container.Container_RoundRobinator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class GUI_RoundRobinator extends GuiContainer { private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png"); + private TileEntityRoundRobinator mTile; + private Container_RoundRobinator mContainer; + private static final Method mDrawItemStack; + + static { + mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); + } public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te){ - super(new Container_RoundRobinator(player_inventory, te)); + this(new Container_RoundRobinator(player_inventory, te)); + mTile = te; + } + + private GUI_RoundRobinator(final Container_RoundRobinator aContainer){ + super(aContainer); + mContainer = aContainer; } @Override protected void drawGuiContainerForegroundLayer(final int i, final int j){ - super.drawGuiContainerForegroundLayer(i, j); + super.drawGuiContainerForegroundLayer(i, j); + + int xStart = 134; + int yStart = 31; + mTile = this.mContainer.tile_entity; + + int tier = mContainer.mTier; + int aTickRate = mContainer.mTickRate; + + fontRendererObj.drawString("Round Robinator", 85, 4, Utils.rgbtoHexValue(50, 150, 50)); + fontRendererObj.drawString("Tier: "+tier, 85, 12, Utils.rgbtoHexValue(50, 150, 50)); + fontRendererObj.drawString("Rate: 1 Item/"+aTickRate+"t", 85, 20, Utils.rgbtoHexValue(50, 150, 50)); + + boolean[] aStates = new boolean[] {mContainer.mSide_1 == 0 ? false : true, mContainer.mSide_2 == 0 ? false : true, mContainer.mSide_3 == 0 ? false : true,mContainer.mSide_4 == 0 ? false : true}; + + fontRendererObj.drawString("West: "+(aStates[0] ? "Active" : "Disabled"), 5, 5, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("North: "+(aStates[1] ? "Active" : "Disabled"), 5, 15, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("South: "+(aStates[2] ? "Active" : "Disabled"), 5, 25, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("East: "+(aStates[3] ? "Active" : "Disabled"), 5, 35, Utils.rgbtoHexValue(50, 50, 50)); + fontRendererObj.drawString("Toggling South will visually", 5, 65, Utils.rgbtoHexValue(150, 50, 50)); + fontRendererObj.drawString("toggle East, This is a visual bug.", 5, 74, Utils.rgbtoHexValue(150, 50, 50)); + drawStatus(aStates[0], xStart, yStart); + drawStatus(aStates[1], xStart+18, yStart); + drawStatus(aStates[2], xStart, yStart+18); + drawStatus(aStates[3], xStart+18, yStart+18); + } @Override @@ -33,6 +79,34 @@ public class GUI_RoundRobinator extends GuiContainer { final int x = (this.width - this.xSize) / 2; final int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + + + + } + + private static ItemStack aGreenGlass; + private static ItemStack aRedGlass; + + private void drawStatus(boolean aStateActive, int x, int y) { + if (aGreenGlass == null) { + Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem(); + aGreenGlass = ItemUtils.simpleMetaStack(pane, 5, 1); + } + if (aRedGlass == null) { + Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem(); + aRedGlass = ItemUtils.simpleMetaStack(pane, 14, 1); + } + if (mDrawItemStack != null) { + try { + if (aStateActive) { + mDrawItemStack.invoke(this, new Object[]{aGreenGlass, x, y, ""}); + } + else { + mDrawItemStack.invoke(this, new Object[]{aRedGlass, x, y, ""}); + } + } + catch (Throwable t) {} + } } //This method is called when the Gui is first called! diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index 2141210650..e44c9a8f20 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -2,16 +2,22 @@ package gtPlusPlus.core.handler; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.*; +import gtPlusPlus.core.container.Container_BackpackBase; +import gtPlusPlus.core.container.Container_CircuitProgrammer; +import gtPlusPlus.core.container.Container_DecayablesChest; +import gtPlusPlus.core.container.Container_FishTrap; +import gtPlusPlus.core.container.Container_Grindle; +import gtPlusPlus.core.container.Container_ModularityTable; +import gtPlusPlus.core.container.Container_PestKiller; +import gtPlusPlus.core.container.Container_ProjectTable; +import gtPlusPlus.core.container.Container_RoundRobinator; +import gtPlusPlus.core.container.Container_SuperJukebox; +import gtPlusPlus.core.container.Container_TradeTable; +import gtPlusPlus.core.container.Container_Workbench; +import gtPlusPlus.core.container.Container_WorkbenchAdvanced; import gtPlusPlus.core.container.box.LunchBoxContainer; import gtPlusPlus.core.container.box.MagicBagContainer; import gtPlusPlus.core.container.box.ToolBoxContainer; @@ -22,20 +28,38 @@ import gtPlusPlus.core.gui.item.GuiBaseGrindle; import gtPlusPlus.core.gui.item.box.LunchBoxGui; import gtPlusPlus.core.gui.item.box.MagicBagGui; import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.*; +import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; +import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; +import gtPlusPlus.core.gui.machine.GUI_FishTrap; +import gtPlusPlus.core.gui.machine.GUI_ModularityTable; +import gtPlusPlus.core.gui.machine.GUI_PestKiller; +import gtPlusPlus.core.gui.machine.GUI_ProjectTable; +import gtPlusPlus.core.gui.machine.GUI_RoundRobinator; +import gtPlusPlus.core.gui.machine.GUI_SuperJukebox; +import gtPlusPlus.core.gui.machine.GUI_TradeTable; +import gtPlusPlus.core.gui.machine.GUI_Workbench; +import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.inventories.BaseInventoryGrindle; import gtPlusPlus.core.inventories.box.LunchBoxInventory; import gtPlusPlus.core.inventories.box.MagicBagInventory; import gtPlusPlus.core.inventories.box.ToolBoxInventory; -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; import gtPlusPlus.core.tileentities.base.TileEntityBase; import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; -import gtPlusPlus.core.tileentities.machines.*; +import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; +import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; +import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; +import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; +import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; public class GuiHandler implements IGuiHandler { diff --git a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java index 58d60b595f..a47f250c39 100644 --- a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.inventories; -import gtPlusPlus.core.recipe.common.CI; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -9,10 +8,10 @@ import net.minecraft.nbt.NBTTagList; public class Inventory_RoundRobinator implements IInventory{ - private final String name = "Circuit Programmer"; + private final String name = "Round Robinator"; /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 26; + public static final int INV_SIZE = 4; /** Inventory's size must be same as number of slots you add to the Container class */ private ItemStack[] inventory = new ItemStack[INV_SIZE]; @@ -167,7 +166,7 @@ public class Inventory_RoundRobinator implements IInventory{ */ @Override public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - return (itemstack.getItem() == CI.getNumberedCircuit(0).getItem()); + return true; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 1b13d34495..9022f864cb 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -87,8 +87,7 @@ public class BaseItemDust extends BaseItemComponent { else if (amount == 10) { doesThings[0] = false; doesThings[1] = true; - doesThings[2] = false; - + doesThings[2] = false; } else if (amount == 100) { doesThings[0] = false; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index e1c3e179ee..e4fa06c58e 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -118,7 +118,7 @@ public class BaseItemDustUnique extends Item{ private String getCorrectTexture(final String pileSize){ if (!CORE.ConfigSwitches.useGregtechTextures){ - if ((pileSize == "dust") || (pileSize == "Dust")){ + if ((pileSize.equals("dust")) || (pileSize.equals("Dust"))){ this.setTextureName(CORE.MODID + ":" + "dust");} else{ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index c52eb0d222..42890ddfa6 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -44,11 +44,7 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { // Round-Robinator - list.add("Attempts to output items evenly on all four horizontal planes"); - list.add("Each tier operates at a factor of one operation every (20/tier)ticks"); - list.add("Top and bottom do not pull, so you must push item in"); - list.add("Sides can be disabled with a screwdriver"); + } else if (this.mID == 7) { } else { list.add("Bad Tooltip ID - " + mID); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java new file mode 100644 index 0000000000..fa18d745fb --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -0,0 +1,111 @@ +package gtPlusPlus.core.item.base.itemblock; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class ItemBlockRoundRobinator extends ItemBlockWithMetadata +{ + private final Block mBlock; + + public ItemBlockRoundRobinator(final Block aBlock){ + super(aBlock, aBlock); + this.mBlock = aBlock; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + list.add("Attempts to output items evenly on all four horizontal planes"); + if (stack.getItemDamage() == 0) { + list.add("1 Item per enabled side every 400 ticks"); + } + else if (stack.getItemDamage() == 1) { + list.add("1 Item per enabled side every 100 ticks"); + } + else if (stack.getItemDamage() == 2) { + list.add("1 Item per enabled side every 20 ticks"); + } + else if (stack.getItemDamage() == 3) { + list.add("1 Item per enabled side every 10 ticks"); + } + else if (stack.getItemDamage() == 4) { + list.add("1 Item per enabled side every 1 ticks"); + } + list.add("Top and bottom do not pull, so you must push item in"); + list.add("Sides can also be disabled with a screwdriver"); + super.addInformation(stack, aPlayer, list, bool); + } + + /** + * Gets an icon index based on an item's damage value + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int p_77617_1_) + { + return this.mBlock.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + @Override + public int getMetadata(final int p_77647_1_) + { + return p_77647_1_; + } + + @Override + public String getUnlocalizedName(final ItemStack stack) { + return this.getUnlocalizedName() + "." + stack.getItemDamage(); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return 0; + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java index 93a5a969f7..6a8751b682 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java @@ -29,7 +29,7 @@ public class FireProtectionBauble extends BaseBauble { private static Field isImmuneToFire; static { - isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.IsObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire"); + isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire"); } public static boolean fireImmune(Entity aEntity) { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 0bd5c0cf76..bc1c7fc398 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -230,6 +230,7 @@ public class RECIPES_Machines { fakeMachineCasingCovers(); ztonesCoverRecipes(); superBuses(); + roundRobinators(); } private static void initModItems(){ @@ -2251,4 +2252,46 @@ public class RECIPES_Machines { } + private static void roundRobinators() { + + RecipeUtils.addShapedGregtechRecipe( + ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper), + CI.craftingToolWrench, CI.machineCasing_ULV, CI.craftingToolScrewdriver, + ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1)); + + ItemStack[] aRobinators = new ItemStack[] { + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 1, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 2, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 3, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 4, 1), + }; + + int aCostMultiplier = GTNH ? 2 : 1; + + for (int i = 0; i < 5; i++) { + if (i == 0) { + continue; + } + int aTier = i+1; + ItemStack[] aInputs = new ItemStack[] { + aRobinators[i-1], + CI.getTieredMachineHull(aTier, 1 * aCostMultiplier), + CI.getConveyor(aTier, 2 * aCostMultiplier), + CI.getElectricMotor(aTier, 2 * aCostMultiplier), + CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier), + CI.getTieredComponent(OrePrefixes.circuit, i, 2 * aCostMultiplier), + }; + + CORE.RA.addSixSlotAssemblingRecipe( + aInputs, + CI.getAlternativeTieredFluid(aTier, (144 * 2 * i)), //Input Fluid + aRobinators[i], + 45 * 10 * 1 * (i+1), + MaterialUtils.getVoltageForTier(i)); + + } + } + } diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 15589ada84..63477cda19 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -547,7 +547,7 @@ public class CI { private static final Material[] aMaterial_Main = new Material[] { ALLOY.POTIN, - ALLOY.ZIRCONIUM_CARBIDE, + ALLOY.TUMBAGA, ALLOY.EGLIN_STEEL, ALLOY.INCONEL_792, ALLOY.TUNGSTEN_TITANIUM_CARBIDE, @@ -561,7 +561,7 @@ public class CI { }; private static final Material[] aMaterial_Secondary = new Material[] { - ALLOY.TUMBAGA, + ALLOY.STEEL, ALLOY.SILICON_CARBIDE, ALLOY.TUNGSTEN_CARBIDE, ALLOY.INCONEL_690, @@ -576,7 +576,7 @@ public class CI { }; private static final Material[] aMaterial_Tertiary = new Material[] { - ALLOY.STEEL, + ELEMENT.getInstance().LEAD, ELEMENT.getInstance().ALUMINIUM, ALLOY.STAINLESS_STEEL, ELEMENT.getInstance().TUNGSTEN, diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java index 13ba5ca44d..4950718f4a 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java @@ -1,19 +1,36 @@ package gtPlusPlus.core.tileentities.machines; +import java.util.List; + +import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.handler.GuiHandler; +import gtPlusPlus.core.inventories.Inventory_RoundRobinator; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.sys.KeyboardUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; 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.IHopper; import net.minecraft.tileentity.TileEntity; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.inventories.Inventory_RoundRobinator; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.PlayerUtils; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; -public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory { +public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory, IHopper { private int tickCount = 0; private final Inventory_RoundRobinator inventoryContents; @@ -21,7 +38,9 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent public int locationX; public int locationY; public int locationZ; - private int aCurrentMode = 0; + private int aData = 1111; + private int aTier = 1; + private int aTickRate = 100; public TileEntityRoundRobinator() { this.inventoryContents = new Inventory_RoundRobinator(); @@ -34,6 +53,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.locationX = this.xCoord; this.locationY = this.yCoord; this.locationZ = this.zCoord; + this.aTier = this.getWorldObj().getBlockMetadata(locationX, locationY, locationZ) + 1; return true; } } @@ -41,8 +61,8 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } //Rename to hasCircuitToConfigure - public final boolean hasCircuitToConfigure() { - for (ItemStack i : this.getInventory().getInventory()) { + public final boolean hasInventoryContents() { + for (ItemStack i : this.aHopperInventory) { if (i == null) { continue; } @@ -56,76 +76,54 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent public Inventory_RoundRobinator getInventory() { return this.inventoryContents; } - - public boolean addOutput() { - ItemStack[] aInputs = this.getInventory().getInventory().clone(); - //Check if there is output in slot. - Boolean hasOutput = false; - if (aInputs[25] != null) { - hasOutput = true; - } - AutoMap aValidSlots = new AutoMap(); - int aSlotCount = 0; - for (ItemStack i : aInputs) { - if (i != null) { - aValidSlots.put(aSlotCount); - } - aSlotCount++; - } - for (int e : aValidSlots) { - boolean doAdd = false; - ItemStack g = this.getStackInSlot(e); - int aSize = 0; - ItemStack aInputStack = null; - if (g != null) { - if (!hasOutput) { - aSize = g.stackSize; - doAdd = true; - } - else { - ItemStack f = this.getStackInSlot(25); - if (f != null) { - if (f.getItemDamage() == e) { - aSize = f.stackSize + g.stackSize; - if (aSize > 64) { - aInputStack = g.copy(); - aInputStack.stackSize = (aSize-64); - } - doAdd = true; - } - } - else { - doAdd = true; - aSize = g.stackSize; - } - } - if (doAdd) { - ItemStack aOutput = CI.getNumberedCircuit(e); - if (aOutput != null) { - aOutput.stackSize = aSize; - this.setInventorySlotContents(e, aInputStack); - this.setInventorySlotContents(25, aOutput); - return true; - } - } - } - continue; - } - return false; + + public int getTier() { + return this.aTier; + } + + public int getTickRate() { + return this.aTickRate; } @Override public void updateEntity() { try{ - if (!this.worldObj.isRemote) { - if (tickCount % 10 == 0) { - if (hasCircuitToConfigure()) { - this.addOutput(); - this.markDirty(); + // TODO + if (this.worldObj != null && !this.worldObj.isRemote){ + setTileLocation(); + aTickRate = (60-(aTier*10)); + if (this.getTier() == 1) { + // 20 s + aTickRate = 400; + } + else if (this.getTier() == 2) { + // 5 + aTickRate = 100; + } + else if (this.getTier() == 3) { + // 1 + aTickRate = 20; + } + else if (this.getTier() == 4) { + // 1/5 + aTickRate = 10; + } + else if (this.getTier() == 5) { + // 1/20 + aTickRate = 1; + } + else { + aTickRate = 999999; + } + + if (tickCount % getTickRate() == 0) { + if (hasInventoryContents()) { + Logger.INFO("Trying to move items. "+aTickRate); + this.tryProcessItems(); } } - this.tickCount++; - } + this.tickCount++; + } } catch (final Throwable t){} } @@ -144,55 +142,26 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent @Override public void writeToNBT(final NBTTagCompound nbt) { super.writeToNBT(nbt); - // Utils.LOG_WARNING("Trying to write NBT data to TE."); - final NBTTagCompound chestData = new NBTTagCompound(); - this.inventoryContents.writeToNBT(chestData); - nbt.setTag("ContentsChest", chestData); if (this.hasCustomInventoryName()) { nbt.setString("CustomName", this.getCustomName()); } - nbt.setInteger("aCurrentMode", aCurrentMode); + nbt.setInteger("aCurrentMode", aData); + this.writeToNBT2(nbt); } @Override public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); - // Utils.LOG_WARNING("Trying to read NBT data from TE."); - this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); if (nbt.hasKey("CustomName", 8)) { this.setCustomName(nbt.getString("CustomName")); } - aCurrentMode = nbt.getInteger("aCurrentMode"); - } - - @Override - public int getSizeInventory() { - return this.getInventory().getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.getInventory().getStackInSlot(slot); - } - - @Override - public ItemStack decrStackSize(final int slot, final int count) { - return this.getInventory().decrStackSize(slot, count); - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - return this.getInventory().getStackInSlotOnClosing(slot); - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.getInventory().setInventorySlotContents(slot, stack); + aData = nbt.getInteger("aCurrentMode"); + this.readFromNBT2(nbt); } @Override public int getInventoryStackLimit() { - return this.getInventory().getInventoryStackLimit(); + return 64; } @Override @@ -205,7 +174,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().openInventory(); + //this.getInventory().openInventory(); } @Override @@ -213,32 +182,27 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().closeInventory(); + //this.getInventory().closeInventory(); } @Override public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - return this.getInventory().isItemValidForSlot(slot, itemstack); + return true; } @Override - public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - final int[] accessibleSides = new int[this.getSizeInventory()]; - for (int r=0; r= 0 && p_102007_1_ <= 24; + public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int aSide) { + return aSide < 2; } @Override - public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { - return p_102008_1_ == 25; + public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int aSide) { + return false; } public String getCustomName() { @@ -251,7 +215,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent @Override public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.circuitprogrammer"; + return this.hasCustomInventoryName() ? this.customName : "container.roundrobinator"; } @Override @@ -272,15 +236,37 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent this.readFromNBT(tag); } - public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) { - try { - if (aCurrentMode == 24) { - aCurrentMode = 0; + + public boolean onRightClick(byte side, EntityPlayer player, int x, int y, int z) { + if (player != null && player.getHeldItem() == null) { + if (!player.isSneaking() && !KeyboardUtils.isShiftKeyDown()) { + player.openGui(GTplusplus.instance, GuiHandler.GUI16, player.getEntityWorld(), x, y, z); } else { - aCurrentMode++; + String InventoryContents = ItemUtils.getArrayStackNames(this.aHopperInventory); + PlayerUtils.messagePlayer(player, "Contents: "+InventoryContents+" | "+getDataString()); + } + return true; + } + else { + return false; + } + } + + public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) { + try { + if (side < 2) { + // Top/Bottom } - PlayerUtils.messagePlayer(player, "Now configuring units for type "+aCurrentMode+"."); + else { + if (toggleSide(side)) { + PlayerUtils.messagePlayer(player, "Enabling side "+side+"."); + } + else { + PlayerUtils.messagePlayer(player, "Disabling side "+side+"."); + } + PlayerUtils.messagePlayer(player, "Mode String: "+aData+""); + } return true; } catch (Throwable t) { @@ -288,4 +274,461 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } } + public int getDataString() { + return aData; + } + + public boolean[] getActiveSides() { + this.markDirty(); + String s = String.valueOf(aData); + if (s == null || s.length() != 4) { + s = "1111"; + } + boolean[] aActiveSides = new boolean[4]; + for (int i=0;i<4;i++) { + char ch = s.charAt(i); + if (ch == '1') { + aActiveSides[i] = true; + } + else { + aActiveSides[i] = false; + } + } + return aActiveSides; + } + + /** + * Toggle active state of side + * @param aSide - Forge Direction / Side + * @return - True if the side is now Active, false if now disabled. + */ + public boolean toggleSide(int aSide) { + setSideActive(!getSideActive(aSide), aSide); + return getSideActive(aSide); + } + + + public void setSideActive(boolean aActive, int aSide) { + try { + if (aSide < 2) { + } + else { + if (aData < 1111) { + aData = 1111; + } + else if (aData > 2222) { + aData = 2222; + } + String s = String.valueOf(aData); + StringBuilder aDataString = new StringBuilder(s); + int aIndex = aSide - 2; + if (aActive) { + aDataString.setCharAt(aIndex, '1'); + } + else { + aDataString.setCharAt(aIndex, '2'); + } + aData = Integer.valueOf(aDataString.toString()); + this.markDirty(); + } + } + catch (Throwable t) { + } + } + + public boolean getSideActive(int aSide) { + this.markDirty(); + try { + if (aSide < 2) { + return false; + } + else { + if (aData < 1111) { + aData = 1111; + } + else if (aData > 2222) { + aData = 2222; + } + String s = String.valueOf(aData); + int aIndex = aSide - 2; + char ch = s.charAt(aIndex); + if (ch == '1') { + return true; + } + else { + return false; + } + + } + } + catch (Throwable t) { + return false; + } + } + + @Override + public double getXPos() { + return this.locationX; + } + + @Override + public double getYPos() { + return this.locationY; + } + + @Override + public double getZPos() { + return this.locationZ; + } + + + + + + + + + // TODO + + + + /* + * Hopper Code + */ + + + private ItemStack[] aHopperInventory = new ItemStack[5]; + + public int getSizeInventory() { + return this.aHopperInventory.length; + } + + public ItemStack getStackInSlot(int aSlot) { + return this.aHopperInventory[aSlot]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int aSlot, int aMinimumSizeOfExistingStack) + { + if (this.aHopperInventory[aSlot] != null) + { + ItemStack itemstack; + + if (this.aHopperInventory[aSlot].stackSize <= aMinimumSizeOfExistingStack) + { + itemstack = this.aHopperInventory[aSlot]; + this.aHopperInventory[aSlot] = null; + return itemstack; + } + else + { + itemstack = this.aHopperInventory[aSlot].splitStack(aMinimumSizeOfExistingStack); + + if (this.aHopperInventory[aSlot].stackSize == 0) + { + this.aHopperInventory[aSlot] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int aSlot) + { + if (this.aHopperInventory[aSlot] != null) + { + ItemStack itemstack = this.aHopperInventory[aSlot]; + this.aHopperInventory[aSlot] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int aSlot, ItemStack aStack) + { + this.aHopperInventory[aSlot] = aStack; + + if (aStack != null && aStack.stackSize > this.getInventoryStackLimit()) + { + aStack.stackSize = this.getInventoryStackLimit(); + } + } + + public boolean tryProcessItems() { + if (this.worldObj != null && !this.worldObj.isRemote) { + boolean didSomething = false; + if (!this.isEmpty()) { + Logger.INFO("Has Items, Trying to push to all active directions."); + didSomething = this.tryPushItemsIntoNeighbours(); + } + if (didSomething) { + this.markDirty(); + return true; + } + } + return false; + } + + /** + * Is Empty + * @return + */ + private boolean isEmpty() { + ItemStack[] aitemstack = this.aHopperInventory; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = aitemstack[j]; + + if (itemstack != null) { + return false; + } + } + + return true; + } + + private boolean tryPushItemsIntoNeighbours() { + + boolean aDidPush = false; + + for (int u = 2; u < 6; u++) { + if (!this.getSideActive(u)) { + Logger.INFO("Not pushing on side "+u); + continue; + } + + Logger.INFO("Pushing on side "+u); + IInventory iinventory = this.getInventoryFromFacing(u); + + if (iinventory == null) { + Logger.INFO("No inventory found."); + continue; + } + else { + + int i = Facing.oppositeSide[u]; + Logger.INFO("Using Opposite direction: "+i); + + if (this.isInventoryFull(iinventory, i)) { + Logger.INFO("Target is full, skipping."); + continue; + } + else { + Logger.INFO("Target has space, let's move a single item."); + for (int j = 0; j < this.getSizeInventory(); ++j) { + if (this.getStackInSlot(j) != null) { + ItemStack itemstack = this.getStackInSlot(j).copy(); + ItemStack itemstack1 = setStackInNeighbour(iinventory, this.decrStackSize(j, 1), i); + if (itemstack1 == null || itemstack1.stackSize == 0) { + iinventory.markDirty(); + aDidPush = true; + continue; + } + this.setInventorySlotContents(j, itemstack); + } + } + } + } + } + + return aDidPush; + } + + private boolean isInventoryFull(IInventory aInv, int aSide) { + if (aInv instanceof ISidedInventory && aSide > -1) { + ISidedInventory isidedinventory = (ISidedInventory)aInv; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide); + + for (int l = 0; l < aint.length; ++l) + { + ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]); + + if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) + { + return false; + } + } + } + else { + int j = aInv.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = aInv.getStackInSlot(k); + + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + } + return true; + } + + public static ItemStack setStackInNeighbour(IInventory aNeighbour, ItemStack aStack, int aSide) { + if (aNeighbour instanceof ISidedInventory && aSide > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)aNeighbour; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide); + + for (int l = 0; l < aint.length && aStack != null && aStack.stackSize > 0; ++l) + { + aStack = tryMoveStack(aNeighbour, aStack, aint[l], aSide); + } + } + else + { + int j = aNeighbour.getSizeInventory(); + + for (int k = 0; k < j && aStack != null && aStack.stackSize > 0; ++k) + { + aStack = tryMoveStack(aNeighbour, aStack, k, aSide); + } + } + + if (aStack != null && aStack.stackSize == 0) + { + aStack = null; + } + + return aStack; + } + + private static boolean canInsertItemIntoNeighbour(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) { + return !aNeighbour.isItemValidForSlot(aSlot, aStack) ? false : !(aNeighbour instanceof ISidedInventory) || ((ISidedInventory)aNeighbour).canInsertItem(aSlot, aStack, aSide); + } + + private static ItemStack tryMoveStack(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) { + ItemStack itemstack1 = aNeighbour.getStackInSlot(aSlot); + if (canInsertItemIntoNeighbour(aNeighbour, aStack, aSlot, aSide)) { + boolean aDidSomething = false; + if (itemstack1 == null) { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit()); + if (max >= aStack.stackSize) { + aNeighbour.setInventorySlotContents(aSlot, aStack); + aStack = null; + } + else { + aNeighbour.setInventorySlotContents(aSlot, aStack.splitStack(max)); + } + aDidSomething = true; + } + else if (areItemStacksEqual(itemstack1, aStack)) { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit()); + if (max > itemstack1.stackSize) { + int l = Math.min(aStack.stackSize, max - itemstack1.stackSize); + aStack.stackSize -= l; + itemstack1.stackSize += l; + aDidSomething = l > 0; + } + } + if (aDidSomething){ + aNeighbour.markDirty(); + } + } + return aStack; + } + + private IInventory getInventoryFromFacing(int aSide) + { + int i = aSide; + return tryFindInvetoryAtXYZ(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i])); + } + + public static IInventory tryFindInvetoryAtXYZ(World aWorld, double aX, double aY, double aZ) + { + IInventory iinventory = null; + int sX = MathHelper.floor_double(aX); + int sY = MathHelper.floor_double(aY); + int sZ = MathHelper.floor_double(aZ); + TileEntity tileentity = aWorld.getTileEntity(sX, sY, sZ); + + if (tileentity != null && tileentity instanceof IInventory) + { + iinventory = (IInventory)tileentity; + + if (iinventory instanceof TileEntityChest) + { + Block block = aWorld.getBlock(sX, sY, sZ); + + if (block instanceof BlockChest) + { + iinventory = ((BlockChest)block).func_149951_m(aWorld, sX, sY, sZ); + } + } + } + + if (iinventory == null) + { + List list = aWorld.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1.0D, aY + 1.0D, aZ + 1.0D), IEntitySelector.selectInventories); + + if (list != null && list.size() > 0) + { + iinventory = (IInventory)list.get(aWorld.rand.nextInt(list.size())); + } + } + + return iinventory; + } + + private static boolean areItemStacksEqual(ItemStack aStack, ItemStack aStack2) { + return aStack.getItem() != aStack2.getItem() ? false : (aStack.getItemDamage() != aStack2.getItemDamage() ? false : (aStack.stackSize > aStack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(aStack, aStack2))); + } + + public void readFromNBT2(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10); + this.aHopperInventory = new ItemStack[this.getSizeInventory()]; + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + if (b0 >= 0 && b0 < this.aHopperInventory.length) { + this.aHopperInventory[b0] = ItemStack.loadItemStackFromNBT( + nbttagcompound1 + ); + } + } + } + + public void writeToNBT2(NBTTagCompound aNBT) { + super.writeToNBT(aNBT); + NBTTagList nbttaglist = new NBTTagList(); + for (int i = 0; i < this.aHopperInventory.length; ++i) { + if (this.aHopperInventory[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.aHopperInventory[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + aNBT.setTag("Items", nbttaglist); + } + + + + + + + } diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index b5f5fa7989..dae1a663d7 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -220,7 +220,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { @Override public int compareTo(CachedRecipe o) { - if (o instanceof DecayableRecipeNEI) { + boolean b = DecayableRecipeNEI.class.isInstance(o); + if (b) { DecayableRecipeNEI p = (DecayableRecipeNEI) o; if (p.time > this.time) { return 1; @@ -232,5 +233,30 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { } return 0; } + + @Override + public boolean equals(Object obj) { + if (obj != null) { + if (DecayableRecipeNEI.class.isInstance(obj)) { + DecayableRecipeNEI p = (DecayableRecipeNEI) obj; + if (p != null) { + // Time check first to keep it simple and not unbox the Recipes. + if (p.time == this.time) { + ItemStack aInput = p.input.item; + ItemStack aOutput = p.output.item; + if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) { + if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) { + return true; + } + } + } + } + + } + } + return false; + } + + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java index 6612ab703f..e3c980e6a4 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java @@ -928,7 +928,7 @@ extends TemplateRecipeHandler { } - public class recipeCompare implements Comparator { + public class RecipeCompare implements Comparator { public int compare(GT_Recipe a, GT_Recipe b) { if (a.mEUt != b.mEUt) { return a.mEUt - b.mEUt; diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java index 5f3b1d8abd..f33cc71fc6 100644 --- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java +++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java @@ -23,7 +23,7 @@ public class VanillaBedHeightFix implements IBugFix { mParent = minstance; if (DevHelper.isValidHelperObject()) { Method m; - if (DevHelper.IsObfuscatedEnvironment()) { + if (DevHelper.isObfuscatedEnvironment()) { m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class); } else { diff --git a/src/Java/gtPlusPlus/preloader/DevHelper.java b/src/Java/gtPlusPlus/preloader/DevHelper.java index d942de503a..81d36d591b 100644 --- a/src/Java/gtPlusPlus/preloader/DevHelper.java +++ b/src/Java/gtPlusPlus/preloader/DevHelper.java @@ -32,7 +32,7 @@ public class DevHelper { - public static boolean IsObfuscatedEnvironment() { + public static boolean isObfuscatedEnvironment() { // Are we in a 'decompiled' environment? boolean deobfuscatedEnvironment = false; byte[] bs; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index dda1a6b0c0..7300b3507b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -21,6 +21,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_PowerSubStation; import gtPlusPlus.xmod.gregtech.api.gui.GUI_PowerSubStation; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; @@ -120,7 +121,9 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe checkMachineProblem(problem); } private void checkMachineProblem(String msg) { - Logger.INFO("Power Sub-Station problem: " + msg); + if (!AsmConfig.disableAllLogging) { + Logger.INFO("Power Sub-Station problem: " + msg); + } } public static int getCellTier(Block aBlock, int aMeta) { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 193df880f0..a66ac39435 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3025,4 +3025,13 @@ item.dustImpureRareEarthIII.name=Impure Rare Earth (III) Dust item.dustPureRareEarthIII.name=Purified Rare Earth (III) Dust item.itemDustRareEarthIII.name=Rare Earth (III) Dust item.itemDustTinyRareEarthIII.name=Tiny Pile of Rare Earth (III) Dust -item.itemDustSmallRareEarthIII.name=Small Pile of Rare Earth (III) Dust \ No newline at end of file +item.itemDustSmallRareEarthIII.name=Small Pile of Rare Earth (III) Dust + + + +//Added 13/10/19 +tile.blockRoundRobinator.0.name=Round Robinator I +tile.blockRoundRobinator.1.name=Round Robinator II +tile.blockRoundRobinator.2.name=Round Robinator III +tile.blockRoundRobinator.3.name=Round Robinator IV +tile.blockRoundRobinator.4.name=Round Robinator V \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png new file mode 100644 index 0000000000..cbf604f2b3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png new file mode 100644 index 0000000000..3b7ac3d50e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png new file mode 100644 index 0000000000..a5a5e2c559 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png new file mode 100644 index 0000000000..b68c900ddd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png new file mode 100644 index 0000000000..df182aeaa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png new file mode 100644 index 0000000000..85bc3f16cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png new file mode 100644 index 0000000000..f82185ebdb Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png new file mode 100644 index 0000000000..345476e03c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png new file mode 100644 index 0000000000..971164eb3e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png new file mode 100644 index 0000000000..5b5bac3ad2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png differ diff --git a/src/resources/assets/miscutils/textures/gui/RoundRobinator.png b/src/resources/assets/miscutils/textures/gui/RoundRobinator.png new file mode 100644 index 0000000000..54c06f22ae Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/RoundRobinator.png differ -- cgit From 0ba472ad9bc0f829302f41128df559fa852113ff Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 13 Oct 2019 22:22:06 +0100 Subject: % Tweaked recipes for Round-Robinators. % Tweaked composition of Ancient Granite, Black Metal, Rare Earth MID/HIGH. --- .../core/block/machine/Machine_RoundRobinator.java | 3 +- .../core/container/Container_RoundRobinator.java | 41 +++++----------------- .../core/gui/machine/GUI_RoundRobinator.java | 4 ++- .../base/itemblock/ItemBlockRoundRobinator.java | 9 ++--- src/Java/gtPlusPlus/core/material/ELEMENT.java | 27 ++++++++++++-- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 4 +-- .../machines/TileEntityRoundRobinator.java | 23 +++++++----- 7 files changed, 59 insertions(+), 52 deletions(-) (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index 8ba7c2533b..cd480dcffe 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.block.machine; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.common.items.GT_MetaGenerated_Tool_01; @@ -124,7 +123,7 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt @Override public int getRenderBlockPass() { - return 1; + return 0; } @Override diff --git a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java index 0da2933dfa..cbd08c2cca 100644 --- a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java @@ -54,19 +54,8 @@ public class Container_RoundRobinator extends Container { this.posX = te.xCoord; this.posY = te.yCoord; this.posZ = te.zCoord; - Logger.INFO("1"); int o = 0; - - // Storage Side - /*for (var6 = 0; var6 < 3; var6++) { - for (var7 = 0; var7 < 5; var7++) { - this.addSlotToContainer(new SlotIntegratedCircuit(o, this.inventoryChest, o, 44 + (var7 * 18), 15 + (var6 * 18))); - o++; - } - }*/ - - int xStart = 134; int yStart = 32; @@ -76,14 +65,6 @@ public class Container_RoundRobinator extends Container { this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart)); this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart+17)); this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart+17)); - Logger.INFO("2"); - - //Add Output - //this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, xStart+(8*18), yStart+54)); - //o++; - Logger.INFO("3"); - - // Player Inventory for (var6 = 0; var6 < 3; ++var6) { @@ -95,12 +76,10 @@ public class Container_RoundRobinator extends Container { for (var6 = 0; var6 < 9; ++var6) { this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); } - - - - Logger.INFO("4"); } - catch (Throwable t) {} + catch (Throwable t) { + t.printStackTrace(); + } this.detectAndSendChanges(); } @@ -110,11 +89,9 @@ public class Container_RoundRobinator extends Container { final EntityPlayer aPlayer) { if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - } - else if (aSlotIndex < 4) { + if (aSlotIndex < 4) { this.tile_entity.toggleSide(aSlotIndex+2); - Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString()); + //Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString()); } } return GT_Values.NI; @@ -141,7 +118,7 @@ public class Container_RoundRobinator extends Container { try { super.addCraftingToCrafters(par1ICrafting); } catch (Throwable var3) { - + var3.printStackTrace(); } } @@ -149,6 +126,7 @@ public class Container_RoundRobinator extends Container { try { super.removeCraftingFromCrafters(par1ICrafting); } catch (Throwable var3) { + var3.printStackTrace(); } } @@ -157,6 +135,7 @@ public class Container_RoundRobinator extends Container { super.detectAndSendChanges(); detectAndSendChangesEx(); } catch (Throwable var2) { + var2.printStackTrace(); } } @@ -165,6 +144,7 @@ public class Container_RoundRobinator extends Container { super.updateProgressBar(par1, par2); updateProgressBarEx(par1, par2); } catch (Throwable var4) { + var4.printStackTrace(); } } @@ -200,9 +180,6 @@ public class Container_RoundRobinator extends Container { this.mSide_4 = aTemp[3] ? 1 : 0; this.mTier = this.tile_entity.getTier(); this.mTickRate = this.tile_entity.getTickRate(); - - String InventoryContents = ArrayUtils.toString(aTemp, "null"); - //Logger.INFO("Test: "+InventoryContents); ++this.mTimer; Iterator var2 = this.crafters.iterator(); diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java index c5a8341d8a..edb53e8ec0 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java @@ -105,7 +105,9 @@ public class GUI_RoundRobinator extends GuiContainer { mDrawItemStack.invoke(this, new Object[]{aRedGlass, x, y, ""}); } } - catch (Throwable t) {} + catch (Throwable t) { + t.printStackTrace(); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java index fa18d745fb..f586695eb7 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -16,7 +16,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata public ItemBlockRoundRobinator(final Block aBlock){ super(aBlock, aBlock); this.mBlock = aBlock; - this.setMaxDamage(0); + this.setMaxDamage(4); this.setHasSubtypes(true); } @@ -38,10 +38,11 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata list.add("1 Item per enabled side every 10 ticks"); } else if (stack.getItemDamage() == 4) { - list.add("1 Item per enabled side every 1 ticks"); + list.add("1 Item per enabled side every tick"); } list.add("Top and bottom do not pull, so you must push item in"); list.add("Sides can also be disabled with a screwdriver"); + list.add("Shift+RMB with empty hand to view inventory contents"); super.addInformation(stack, aPlayer, list, bool); } @@ -52,7 +53,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(final int p_77617_1_) { - return this.mBlock.getIcon(2, p_77617_1_); + return this.mBlock.getIcon(0, p_77617_1_); } /** @@ -61,7 +62,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata @Override public int getMetadata(final int p_77647_1_) { - return p_77647_1_; + return super.getMetadata(p_77647_1_); } @Override diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 99586b37fe..ba2579aa97 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -217,9 +217,32 @@ public final class ELEMENT { //Runescape materials - public static final Material BLACK_METAL = new Material("Black Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {5, 5, 5}, 2350, 4650, 24, 17, false, "҈", 0, new MaterialStack[]{new MaterialStack(getInstance().LEAD, 15), new MaterialStack(getInstance().TUNGSTEN, 25), new MaterialStack(getInstance().CARBON, 60)});//Not a GT Inherited Material + public static final Material BLACK_METAL = new Material("Black Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {5, 5, 5}, 2350, 4650, 24, 17, false, "҈", 0, new MaterialStack[]{new MaterialStack(getInstance().LEAD, 15), new MaterialStack(getInstance().MANGANESE, 25), new MaterialStack(getInstance().CARBON, 60)});//Not a GT Inherited Material public static final Material WHITE_METAL = new Material("White Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {255, 255, 255}, 4560, 7580, 35, 41, false, "҉", 0, new MaterialStack[]{new MaterialStack(getInstance().COPPER, 5), new MaterialStack(getInstance().ANTIMONY, 10), new MaterialStack(getInstance().PLATINUM, 10), new MaterialStack(getInstance().TIN, 75)});//Not a GT Inherited Material - public static final Material GRANITE = new Material("Ancient Granite", MaterialState.SOLID, TextureSet.SET_SAND, new short[] {107, 107, 107}, 500, 2000, 16, 12, false, "«»", 0, false);//Not a GT Inherited Material + + public static final Material GRANITE = new Material( + "Ancient Granite", + MaterialState.SOLID, + TextureSet.SET_SAND, + new short[] {107, 107, 107}, + 500, + 2000, + 16, + 12, + false, + "«»", + 0, + false, + new MaterialStack[]{ + new MaterialStack(getInstance().OXYGEN, 30), + new MaterialStack(getInstance().IRON, 20), + new MaterialStack(getInstance().SILICON, 20), + new MaterialStack(getInstance().ALUMINIUM, 10), + new MaterialStack(getInstance().POTASSIUM, 10), + new MaterialStack(getInstance().CALCIUM, 5), + new MaterialStack(getInstance().SODIUM, 5) + });//Not a GT Inherited Material + public static final Material RUNITE = new Material("Runite", MaterialState.SOLID, TextureSet.SET_FINE, new short[] {60, 200, 190}, 6750, 11550, 73, 87, true, "§", 0);//Not a GT Inherited Material public static final Material DRAGON_METAL = new Material("Dragonblood", MaterialState.SOLID, TextureSet.SET_SHINY, new short[] {220, 40, 20, 2}, 10160, 17850, 96, 105, true, "۞", 0);//Not a GT Inherited Material diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index 0e661fd429..6e1e6ea5ad 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -142,7 +142,7 @@ public final class MISC_MATERIALS { new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Galena), 1), new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite), 1), new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Cobaltite), 1), - new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1) + new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1) }); public static final Material RARE_EARTH_MID = new Material( @@ -162,8 +162,8 @@ public final class MISC_MATERIALS { new MaterialStack(ORES.CROCROITE, 1), new MaterialStack(ORES.NICHROMITE, 1), new MaterialStack(ORES.ZIRCON, 1), + new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1), new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1), - new MaterialStack(ELEMENT.STANDALONE.WHITE_METAL, 1), new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1) }); diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java index 4950718f4a..a220997c84 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java @@ -118,14 +118,16 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent if (tickCount % getTickRate() == 0) { if (hasInventoryContents()) { - Logger.INFO("Trying to move items. "+aTickRate); + Logger.WARNING("Trying to move items. "+aTickRate); this.tryProcessItems(); } } this.tickCount++; } } - catch (final Throwable t){} + catch (final Throwable t){ + t.printStackTrace(); + } } public boolean anyPlayerInRange() { @@ -270,6 +272,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent return true; } catch (Throwable t) { + t.printStackTrace(); return false; } } @@ -333,6 +336,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } } catch (Throwable t) { + t.printStackTrace(); } } @@ -362,6 +366,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent } } catch (Throwable t) { + t.printStackTrace(); return false; } } @@ -476,7 +481,7 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent if (this.worldObj != null && !this.worldObj.isRemote) { boolean didSomething = false; if (!this.isEmpty()) { - Logger.INFO("Has Items, Trying to push to all active directions."); + Logger.WARNING("Has Items, Trying to push to all active directions."); didSomething = this.tryPushItemsIntoNeighbours(); } if (didSomething) { @@ -512,28 +517,28 @@ public class TileEntityRoundRobinator extends TileEntity implements ISidedInvent for (int u = 2; u < 6; u++) { if (!this.getSideActive(u)) { - Logger.INFO("Not pushing on side "+u); + Logger.WARNING("Not pushing on side "+u); continue; } - Logger.INFO("Pushing on side "+u); + Logger.WARNING("Pushing on side "+u); IInventory iinventory = this.getInventoryFromFacing(u); if (iinventory == null) { - Logger.INFO("No inventory found."); + Logger.WARNING("No inventory found."); continue; } else { int i = Facing.oppositeSide[u]; - Logger.INFO("Using Opposite direction: "+i); + Logger.WARNING("Using Opposite direction: "+i); if (this.isInventoryFull(iinventory, i)) { - Logger.INFO("Target is full, skipping."); + Logger.WARNING("Target is full, skipping."); continue; } else { - Logger.INFO("Target has space, let's move a single item."); + Logger.WARNING("Target has space, let's move a single item."); for (int j = 0; j < this.getSizeInventory(); ++j) { if (this.getStackInSlot(j) != null) { ItemStack itemstack = this.getStackInSlot(j).copy(); -- cgit From 10d4c7d4b4fd651d64f17936a916785b36a43f92 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 8 Dec 2019 02:00:35 +0000 Subject: + Added an assembly recipe for tier 1 Round Robinators. + Added localization for Rotor Housing achievement. + Added the Algae Farm (WIP). - Removed Durability bar on Iridium Rotors. - Reverted 2A hatch fix on Multiblocks. % Adjusted all Robinator recipes, removing the fluid requirements. $ Fixed Robinators Crashing on Servers. $ Implemented new backend for all future non-GT tile entities. --- .../api/objects/minecraft/CubicObject.java | 62 +++++ .../api/objects/minecraft/SafeTexture.java | 64 +++++ .../core/block/base/BasicTileBlockWithTooltip.java | 309 +++++++++++++++++++++ .../core/block/machine/CircuitProgrammer.java | 111 ++++---- .../core/block/machine/Machine_RoundRobinator.java | 138 ++++----- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + .../item/base/itemblock/ItemBlockBasicTile.java | 33 ++- .../item/base/itemblock/ItemBlockBasicTooltip.java | 34 --- .../base/itemblock/ItemBlockRoundRobinator.java | 6 +- src/Java/gtPlusPlus/core/lib/CORE.java | 23 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 6 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 13 +- .../core/util/minecraft/ClientUtils.java | 18 ++ .../xmod/gregtech/api/enums/GregtechItemList.java | 3 + .../base/GregtechMeta_MultiBlockBase.java | 51 ++-- .../algae/GregtechMTE_AlgaePondBase.java | 128 +++++++++ .../gregtech/GregtechAlgaeContent.java | 24 ++ .../xmod/ic2/item/CustomKineticRotor.java | 274 ++++++++++++++++++ src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java | 68 ++--- .../gtPlusPlus/xmod/ic2/item/RotorIridium.java | 5 + src/resources/assets/gregtech/lang/en_US.lang | 4 +- .../RoundRobinator/RoundRobinator_Side_0.png | Bin 1448 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_1.png | Bin 1444 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_2.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_3.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_4.png | Bin 1443 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_0.png | Bin 1405 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_1.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_2.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_3.png | Bin 1402 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_4.png | Bin 1400 -> 0 bytes .../blocks/TileEntities/RoundRobinator/Side_0.png | Bin 0 -> 1448 bytes .../blocks/TileEntities/RoundRobinator/Side_1.png | Bin 0 -> 1444 bytes .../blocks/TileEntities/RoundRobinator/Side_2.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_3.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_4.png | Bin 0 -> 1443 bytes .../blocks/TileEntities/RoundRobinator/Top_0.png | Bin 0 -> 1405 bytes .../blocks/TileEntities/RoundRobinator/Top_1.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_2.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_3.png | Bin 0 -> 1402 bytes .../blocks/TileEntities/RoundRobinator/Top_4.png | Bin 0 -> 1400 bytes 41 files changed, 1096 insertions(+), 279 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java create mode 100644 src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java delete mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java create mode 100644 src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java create mode 100644 src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png (limited to 'src/Java/gtPlusPlus/core/block/machine') diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java new file mode 100644 index 0000000000..8c76513d09 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java @@ -0,0 +1,62 @@ +package gtPlusPlus.api.objects.minecraft; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.common.util.ForgeDirection; + +public class CubicObject { + + public final T NORTH; + public final T SOUTH; + + public final T WEST; + public final T EAST; + + public final T UP; + public final T DOWN; + + public CubicObject(AutoMap aDataSet) { + this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5)); + } + + public CubicObject(T[] aDataSet) { + this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]); + } + + public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) { + DOWN = aDOWN; + UP = aUP; + NORTH = aNORTH; + SOUTH = aSOUTH; + WEST = aWEST; + EAST = aEAST; + } + + public T get(int aSide) { + return get(ForgeDirection.getOrientation(aSide)); + } + + public T get(ForgeDirection aSide) { + if (aSide == ForgeDirection.DOWN) { + return DOWN; + } + else if (aSide == ForgeDirection.UP) { + return UP; + } + else if (aSide == ForgeDirection.NORTH) { + return NORTH; + } + else if (aSide == ForgeDirection.SOUTH) { + return SOUTH; + } + else if (aSide == ForgeDirection.WEST) { + return WEST; + } + else if (aSide == ForgeDirection.EAST) { + return EAST; + } + else { + return null; + } + } + +} diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java new file mode 100644 index 0000000000..7c418b5a77 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java @@ -0,0 +1,64 @@ +package gtPlusPlus.api.objects.minecraft; + +import java.util.HashMap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gtPlusPlus.core.util.Utils; +import net.minecraft.util.IIcon; + +/** + * A Server Side safe object that can hold {@link IIcon}s. + * @author Alkalus + * + */ +public class SafeTexture implements Runnable { + + @SideOnly(Side.CLIENT) + private static final HashMap mHashToIconCache = new HashMap(); + + @SideOnly(Side.CLIENT) + private static final HashMap mPathToHashCash = new HashMap(); + + private static final HashMap mTextureObjectCache = new HashMap(); + + private final int mHash; + + private final String mTextureName; + + private final static String getKey(String aTexPath) { + String aNameKey = Utils.sanitizeString(aTexPath); + aNameKey = aNameKey.replace('/', ' '); + aNameKey = aNameKey.toLowerCase(); + return aNameKey; + } + + public static SafeTexture register(String aTexturePath) { + String aNameKey = getKey(aTexturePath); + SafeTexture g = mTextureObjectCache.get(aNameKey); + if (g == null) { + g = new SafeTexture(aTexturePath); + mTextureObjectCache.put(aNameKey, g); + mPathToHashCash.put(aTexturePath, aTexturePath.hashCode()); + } + return g; + } + + private SafeTexture(String aTexturePath) { + mTextureName = aTexturePath; + mHash = getKey(aTexturePath).hashCode(); + GregTech_API.sGTBlockIconload.add(this); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return mHashToIconCache.get(mHash); + } + + @Override + public void run() { + mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName)); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java new file mode 100644 index 0000000000..098b670509 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -0,0 +1,309 @@ +package gtPlusPlus.core.block.base; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.api.objects.minecraft.SafeTexture; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip { + + /** + * Each mapped object holds the data for the six sides. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTextureArray = new AutoMap>(); + + /** + * Holds the data for the six sides, each side holds an array of data for each respective meta. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTexturePathArray = new AutoMap>(); + + /** + * Does this block have any meta at all? + * @return + */ + public final boolean hasMeta() { + return getMetaCount() > 0; + } + + /** + * The amount of meta this block has. + * @return + */ + public abstract int getMetaCount(); + + /** + * Does this {@link Block} require special {@link ItemBlock} handling? + * @return The {@link Class} that will be used for this {@link Block}. + */ + public Class getItemBlockClass() { + return ItemBlock.class; + } + + /** + * A lazy way to declare the unlocal name for the block, makes boilerplating easy. + * @return The internal name for this block. + */ + public abstract String getUnlocalBlockName(); + + /** + * Does this Block have {@link ITileTooltip} support? + * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not. + */ + public final boolean hasTooltip() { + return getTooltipID() >= -1; + } + + /** + * Lazy Boilerplating. + * @return Block Hardness. + */ + protected abstract float initBlockHardness(); + + /** + * Lazy Boilerplating. + * @return Block Resistance. + */ + protected abstract float initBlockResistance(); + + /** + * Lazy Boilerplating. + * @return The {@link CreativeTab} this Block is shown on. + */ + protected abstract CreativeTabs initCreativeTab(); + + /** + * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}(). + * @return + */ + @Override + public abstract int getTooltipID(); + + public BasicTileBlockWithTooltip(Material aBlockMat){ + super(aBlockMat); + //Use Abstract method values + this.setHardness(initBlockHardness()); + this.setResistance(initBlockResistance()); + this.setBlockName(getUnlocalBlockName()); + this.setCreativeTab(initCreativeTab()); + // Register the block last. + GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName()); + Logger.INFO("Registered "+getTileEntityName()+"."); + if (Utils.isClient()) { + // Handle Textures + handleTextures(); + } + } + + /** + * The name of the Tile Entity. + * @return + */ + protected abstract String getTileEntityName(); + + /** + * The String used for texture pathing. + * @return Sanitized {@link String}, containing no spaces or illegal characters. + */ + private final String getTileEntityNameForTexturePathing() { + return Utils.sanitizeString(getTileEntityName().replace(" ", "")); + } + + /** + * An array of CubicObjects, one for each meta, else just a single cell array. + * Expected to be null regularly, as the default texture handling should suffice. + * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used, + * inclusive of the MODID and a colon. + * @return + */ + public CubicObject[] getCustomTextureDirectoryObject(){ + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public final IIcon getIcon(final int aSide, final int aMeta) { + return mSidedTextureArray.get(aMeta).get(aSide).getIcon(); + } + + @Override + public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + return super.getIcon(aWorld, aX, aY, aZ, aSide); + } + + @SideOnly(Side.CLIENT) + private final void handleTextures() { + + Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+"."); + //Store them in forge order + //DOWN, UP, NORTH, SOUTH, WEST, EAST + + // Default Path Name, this will make us look inside 'miscutils\textures\blocks' + final String aPrefixTexPath = CORE.MODID + ":"; + // Default Path Name, this will make us look in the sub-directory for this Tile Entity. + final String aTexPathMid = "TileEntities"+CORE.SEPERATOR+getTileEntityNameForTexturePathing()+CORE.SEPERATOR; + // Construct a full path + String aTexPathBuilt = aPrefixTexPath + aTexPathMid; + // File Name Suffixes, without meta tags + String aStringBot; + String aStringTop; + String aStringBack; + String aStringFront; + String aStringLeft; + String aStringRight; + // Do we provide a matrix of custom data to be used for texture processing instead? + if (getCustomTextureDirectoryObject() != null) { + // Get custom provided texture data. + CubicObject[] aDataMap = getCustomTextureDirectoryObject(); + Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: "+aDataMap.length); + // Map each meta string data to the main map. + for (int i=0;i aMetaBlob = new CubicObject(aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight); + mSidedTexturePathArray.put(aMetaBlob); + Logger.INFO("[TeTexture] Added Texture Path data to map for meta "+i); + } + } + Logger.INFO("[TeTexture] Map size for pathing: "+mSidedTexturePathArray.size()); + + // Iteration Index + int aIndex = 0; + + // Iterate each CubicObject, holding the six texture paths for each meta. + for (CubicObject aMetaBlob : mSidedTexturePathArray) { + // Make a Safe Texture for each side + SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN); + SafeTexture aTop = SafeTexture.register(aMetaBlob.UP); + SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH); + SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH); + SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST); + SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST); + // Store them in an Array + SafeTexture[] aInjectBlob = new SafeTexture[] { + aBottom, + aTop, + aBack, + aFont, + aWest, + aEast + }; + // Convenience Blob + CubicObject aMetaBlob2 = new CubicObject(aInjectBlob); + // Store this Blob into + mSidedTextureArray.put(aMetaBlob2); + Logger.INFO("[TeTexture] Added SafeTexture data to map for meta "+(aIndex++)); + } + Logger.INFO("[TeTexture] Map size for registration: "+mSidedTextureArray.size()); + + + } + + @Override + @SideOnly(Side.CLIENT) + public final void registerBlockIcons(final IIconRegister aRegisterer){ + this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net"); + } + + @Override + public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); + + /** + * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call. + */ + public void onBlockBreak() { + + } + + @Override + public final void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { + onBlockBreak(); + InventoryUtils.dropInventoryItems(world, x, y, z, block); + super.breakBlock(world, x, y, z, block, number); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + if (hasMeta()) { + for (int i=0;i[] getCustomTextureDirectoryObject() { + String[] aTexData = new String[] { + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G", + CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I" + }; + CubicObject[] aTextureData = new CubicObject[] {new CubicObject(aTexData)}; + return aTextureData; + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index cd480dcffe..dc87b885b9 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -1,85 +1,27 @@ package gtPlusPlus.core.block.machine; -import java.util.List; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.util.minecraft.InventoryUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip -{ - @SideOnly(Side.CLIENT) - private IIcon[] textureTop = new IIcon[5]; - @SideOnly(Side.CLIENT) - private IIcon[] textureFront = new IIcon[5]; +public class Machine_RoundRobinator extends BasicTileBlockWithTooltip { + - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 7; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - @SuppressWarnings("deprecation") public Machine_RoundRobinator(){ super(Material.iron); - this.setHardness(1f); - this.setResistance(1f); - this.setBlockName("blockRoundRobinator"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockRoundRobinator.class, "blockRoundRobinator"); - //LanguageRegistry.addName(this, "Round-Robinator"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int aSide, final int aMeta) { - if (aSide < 2) { - return this.textureTop[aMeta]; - } - else { - return this.textureFront[aMeta]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_){ - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "RoundRobinator_Side"); - for (int i=0;i<5;i++) { - this.textureTop[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Top_"+i); - this.textureFront[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Side_"+i); - } } /** @@ -97,13 +39,11 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt // Check For Screwdriver try { final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); - final Item mHandItem = mHandStack.getItem(); - if (((mHandItem instanceof GT_MetaGenerated_Tool_01) - && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { + if (ItemUtils.isToolScrewdriver(mHandStack)) { final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z); if (tile != null) { mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z); - } + } } } catch (final Throwable t) {} @@ -122,52 +62,70 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt } @Override - public int getRenderBlockPass() { - return 0; + public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { + return new TileEntityRoundRobinator(); } @Override - public boolean isOpaqueCube() { - return false; + public int getMetaCount() { + return 5; } @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityRoundRobinator(); + public String getUnlocalBlockName() { + return "blockRoundRobinator"; } @Override - public void onBlockAdded(final World world, final int x, final int y, final int z) { - super.onBlockAdded(world, x, y, z); + protected float initBlockHardness() { + return 1; } @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { - InventoryUtils.dropInventoryItems(world, x, y, z, block); - super.breakBlock(world, x, y, z, block, number); + protected float initBlockResistance() { + return 1; } @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + protected CreativeTabs initCreativeTab() { + return AddToCreativeTab.tabMachines; } @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { - return false; + public int getTooltipID() { + return -1; } @Override - public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { - //super.getSubBlocks(aItem, p_149666_2_, aList); - for (int i=0;i<5;i++) { - aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); - } + protected String getTileEntityName() { + return "Round Robinator"; + } + + @Override + public Class getItemBlockClass() { + return ItemBlockRoundRobinator.class; } @Override - public IIcon getIcon(IBlockAccess aBlockAccess, int x, int y, int z, int aSide) { - return super.getIcon(aBlockAccess, x, y, z, aSide); + public CubicObject[] getCustomTextureDirectoryObject() { + AutoMap aTemp = new AutoMap(); + for (int i=0;i<5;i++) { + String[] aTexData = new String[] { + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + }; + aTemp.put(aTexData); + } + AutoMap> aTemp2 = new AutoMap>(); + for (String[] y : aTemp) { + aTemp2.put(new CubicObject(y)); + } + CubicObject[] aTextureData = new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)}; + return aTextureData; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 0b1078366a..ca62a524c1 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -136,6 +136,7 @@ public class COMPAT_HANDLER { GregtechLargeTurbinesAndHeatExchanger.run(); GregtechPowerBreakers.run(); GregtechFluidReactor.run(); + GregtechAlgaeContent.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index 42890ddfa6..251230932c 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -26,28 +26,43 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Can also be placed beside upto 4 other fish traps"); list.add("Requires at least two faces touching water"); list.add("1/1000 chance to produce triple loot."); - } else if (this.mID == 1) { // Modularity + } + else if (this.mID == 1) { // Modularity list.add("Used to construct modular armour & bauble upgrades.."); - } else if (this.mID == 2) { // Trade + } + else if (this.mID == 2) { // Trade list.add("Allows for SMP trade-o-mat type trading."); - } else if (this.mID == 3) { // Project + } + else if (this.mID == 3) { // Project list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter.."); - } else if (this.mID == 4) { // Circuit Table + } + else if (this.mID == 4) { // Circuit Table list.add("Easy Circuit Configuration"); list.add("Change default setting with a Screwdriver"); list.add("Default is used to select slot for auto-insertion"); - } else if (this.mID == 5) { // Decayables Chest + } + else if (this.mID == 5) { // Decayables Chest list.add("Chest which holds radioactive materials"); list.add("Items which decay will tick while inside"); list.add("Place with right click"); - } else if (this.mID == 6) { // Butterfly Killer + } + else if (this.mID == 6) { // Butterfly Killer list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { - } else { - list.add("Bad Tooltip ID - " + mID); + } + else if (this.mID == 7) { + } + else if (this.mID == 8){ + + } + else if (this.mID == 9){ + + } + + else { + list.add("Bad Tooltip ID - " + mID); } super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java deleted file mode 100644 index 9badd384d8..0000000000 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java +++ /dev/null @@ -1,34 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.api.interfaces.ITileTooltip; - -public class ItemBlockBasicTooltip extends ItemBlock{ - - protected final int mID; - - public ItemBlockBasicTooltip(final Block block) { - super(block); - this.mID = ((ITileTooltip) block).getTooltipID(); - } - - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - if (this.mID == 0){ //blockDarkWorldPortalFrame - list.add("Assembled in the same shape as the Nether Portal."); - } - else if (this.mID == 1){ //Modularity - list.add("Used to construct modular armour & bauble upgrades.."); - } - } - - -} diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java index f586695eb7..2d0fd00dd9 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -16,8 +16,6 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata public ItemBlockRoundRobinator(final Block aBlock){ super(aBlock, aBlock); this.mBlock = aBlock; - this.setMaxDamage(4); - this.setHasSubtypes(true); } @@ -40,7 +38,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata else if (stack.getItemDamage() == 4) { list.add("1 Item per enabled side every tick"); } - list.add("Top and bottom do not pull, so you must push item in"); + list.add("Top and bottom do not pull, so you must push items in"); list.add("Sides can also be disabled with a screwdriver"); list.add("Shift+RMB with empty hand to view inventory contents"); super.addInformation(stack, aPlayer, list, bool); @@ -62,7 +60,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata @Override public int getMetadata(final int p_77647_1_) { - return super.getMetadata(p_77647_1_); + return p_77647_1_; } @Override diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 04f1861cfe..3330ad8c3f 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -5,10 +5,13 @@ import java.util.concurrent.ConcurrentHashMap; import com.mojang.authlib.GameProfile; +import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.core.util.sys.GeoUtils; import gtPlusPlus.core.util.sys.NetworkUtils; import gtPlusPlus.preloader.CORE_Preloader; @@ -52,7 +55,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.7.03.01"; + public static final String VERSION = "1.7.03.45"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); @@ -76,7 +79,7 @@ public class CORE { public static int turbineCutoffBase = 75000; //GT++ Fake Player Profile - public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); + public static final GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); public static final WeakHashMap fakePlayerCache = new WeakHashMap(); //Tooltips; public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; @@ -88,6 +91,7 @@ public class CORE { //Because I want to be lazy. Beyond Reality Classic Var. public static boolean BRC = false; + public static final String SEPERATOR = "/"; /** @@ -286,7 +290,20 @@ public class CORE { } public static final void crash() { - System.exit(0); + Logger.ERROR("=========================================================="); + Logger.ERROR("[GT++ CRASH]"); + Logger.ERROR("=========================================================="); + Logger.ERROR("Oooops..."); + Logger.ERROR("This should only happy in a development environment or when something really bad happens."); + Logger.ERROR("=========================================================="); + Logger.ERROR("Called from: "+ReflectionUtils.getMethodName(0)); + Logger.ERROR(ReflectionUtils.getMethodName(1)); + Logger.ERROR(ReflectionUtils.getMethodName(2)); + Logger.ERROR(ReflectionUtils.getMethodName(3)); + Logger.ERROR(ReflectionUtils.getMethodName(4)); + Logger.ERROR(ReflectionUtils.getMethodName(5)); + Logger.ERROR(ReflectionUtils.getMethodName(6)); + FMLCommonHandler.instance().exitJava(0, true); } public static final void gc() { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index ea7f5e4ef7..cac54cec4e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1584,10 +1584,10 @@ public class RECIPES_GREGTECH { // Supreme Pizza Gloves CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { - ItemUtils.getGregtechCircuit(17), - ItemUtils.getSimpleStack(ModItems.itemRope, 16), + ItemUtils.getGregtechCircuit(19), + ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4), - ItemUtils.getItemStackOfAmountFromOreDict("wireFineTin", GTNH ? 32 : 16), + ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1) }, FluidUtils.getFluidStack("molten.rubber", 2000), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index c0a4a998e8..f5bd390aee 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -2331,6 +2331,17 @@ public class RECIPES_Machines { for (int i = 0; i < 5; i++) { if (i == 0) { + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedCircuit(17), + CI.getTieredMachineCasing(0), + ItemUtils.getSimpleStack(Blocks.hopper, 4), + CI.getTieredComponent(OrePrefixes.circuit, 0, 2) + }, + GT_Values.NF, //Input Fluid + aRobinators[i], + 45 * 10 * 1, + 8); continue; } int aTier = i+1; @@ -2345,7 +2356,7 @@ public class RECIPES_Machines { CORE.RA.addSixSlotAssemblingRecipe( aInputs, - CI.getAlternativeTieredFluid(aTier, (144 * 2 * i)), //Input Fluid + GT_Values.NF, //Input Fluid aRobinators[i], 45 * 10 * 1 * (i+1), MaterialUtils.getVoltageForTier(i)); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java new file mode 100644 index 0000000000..806f83d830 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java @@ -0,0 +1,18 @@ +package gtPlusPlus.core.util.minecraft; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; + +public class ClientUtils { + + static { + if (FMLCommonHandler.instance().getSide() == Side.SERVER) { + Logger.ERROR("Something tried to access the ClientUtils class from the Server Side."); + Logger.ERROR("Soft crashing to prevent data corruption."); + CORE.crash(); + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 3ea2851a85..3fc6d9d667 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -228,6 +228,9 @@ public enum GregtechItemList implements GregtechItemContainer { //Fish Pond Industrial_FishingPond, Casing_FishPond, + + //Algae + AlgaeFarm_Controller, //GT4 autoCrafter diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index e5d7f58dc6..ece8dfaa87 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -474,7 +474,7 @@ GT_MetaTileEntity_MultiBlockBase { public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) { Logger.INFO("Determining if we have space to buffer outputs."); - + // Null recipe or a recipe with lots of outputs? // E.G. Gendustry custom comb with a billion centrifuge outputs? // Do it anyway. @@ -736,7 +736,7 @@ GT_MetaTileEntity_MultiBlockBase { // Check next fluid continue aFluidMatch; } - + } else { continue aFluidMatch; @@ -744,14 +744,14 @@ GT_MetaTileEntity_MultiBlockBase { } } } - + for (Triplet aFreeHatchCheck : aOutputHatches) { // Free Hatch if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { aEmptyFluidHatches++; } } - + // We have Fluid Stacks we did not merge. Do we have space? if (aOutputFluids.size() > 0) { // Not enough space to add fluids. @@ -760,7 +760,7 @@ GT_MetaTileEntity_MultiBlockBase { return false; } } - + /* * End Fluid Management */ @@ -978,41 +978,22 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - // Based on the Processing Array. A bit overkill, but very flexible. - - + // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new FluidStack[]{}; - - - - // Get input Voltage + long tVoltage = getMaxInputVoltage(); - - // Get total Amps available to this multiblock - long tAmpsIn = 0; - for (GT_MetaTileEntity_Hatch_Energy aHatch : this.mEnergyHatches) { - tAmpsIn += aHatch.maxAmperesIn(); - } - - // How much voltage can actually go in - long tEffectiveVoltage = tVoltage * tAmpsIn; - - byte tTierInputVoltage = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tEffectiveVoltage)); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); - log("Amps: "+tAmpsIn); - log("Input Voltage: "+tVoltage+", Tier: "+tTierInputVoltage); - log("Effective Voltage: "+tEffectiveVoltage+", Effective Tier: "+tTier); GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, - gregtech.api.enums.GT_Values.V[tTierInputVoltage], aFluidInputs, aItemInputs); + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); // Remember last recipe - an optimization for findRecipe() @@ -1024,8 +1005,7 @@ GT_MetaTileEntity_MultiBlockBase { } if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - log("BAD RETURN - 2"); // TODO - Logger.INFO("No Output Space."); + log("BAD RETURN - 2"); return false; } @@ -1041,12 +1021,12 @@ GT_MetaTileEntity_MultiBlockBase { log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEffectiveVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+". Can use "+tEffectiveVoltage); + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; } @@ -1058,6 +1038,7 @@ GT_MetaTileEntity_MultiBlockBase { // -- Try not to fail after this point - inputs have already been consumed! -- + // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); @@ -1071,10 +1052,10 @@ GT_MetaTileEntity_MultiBlockBase { // Overclock if (this.mEUt <= 16) { - this.mEUt = (this.mEUt * (1 << tTierInputVoltage - 1) * (1 << tTierInputVoltage - 1)); - this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTierInputVoltage - 1)); + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTierInputVoltage - 1)]) { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java new file mode 100644 index 0000000000..332c46dc3e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -0,0 +1,128 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { + + private int mLevel = 0; + + public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMTE_AlgaePondBase(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMTE_AlgaePondBase(this.mName); + } + + @Override + public String getMachineType() { + return "Algae Pond"; + } + + @Override + public String[] getTooltip() { + return new String[]{ + "Grows Algae!", + "Controller Block for the Algae Farm", + "Size: 3x3x3 (Hollow)", + "Controller (front middle)", + "1x Input Hatch", + "1x Output Hatch", + "1x Input Bus", + "1x Output Bus" + }; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(207)); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public boolean isFacingValid(final byte aFacing) { + return aFacing > 1; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); + } + + @Override + public int getMaxParallelRecipes() { + return this.mLevel * 10; + } + + @Override + public int getEuDiscountForParallelism() { + return 0; + } + + @Override + public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + this.mLevel = 0; + return true; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java new file mode 100644 index 0000000000..57a726f7e8 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae.GregtechMTE_AlgaePondBase; + +public class GregtechAlgaeContent { + + public static void run() { + if (LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Algae Content."); + run1(); + } + } + + private static void run1() { + // Industrial Centrifuge Multiblock + GregtechItemList.AlgaeFarm_Controller.set( + new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L)); + + } + +} diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java new file mode 100644 index 0000000000..e433396a1b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java @@ -0,0 +1,274 @@ +package gtPlusPlus.xmod.ic2.item; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.lib.LoadedMods; +import ic2.api.item.IKineticRotor; +import ic2.core.IC2; +import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class CustomKineticRotor extends Item implements IKineticRotor { + + private final int mTier; + + @SideOnly(Side.CLIENT) + private final IIcon[] mTextures = new IIcon[6]; + + private static final String[] mRegistrationNames = new String[] { + "itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor" + }; + + private static final String[] mUnlocalNames = new String[] { + "itemEnergeticRotor", + "itemTungstenSteelRotor", + "itemVibrantRotor", + "itemIridiumRotor", + "itemMagnaliumRotor", + "itemUltimetRotor", + }; + private static final int[] mMaxDurability = new int[] { + 512000, 809600, 1600000, 3200000 + }; + private static final int[] mRadius = new int[] { + 9, 11, 13, 15 + }; + private static final float[] mEfficiency = new float[] { + 0.9f, 1.0f, 1.2f, 1.5f + }; + private static final int[] mMinWindStrength = new int[] { + 12, 14, 16, 18 + }; + private static final int[] mMaxWindStrength = new int[] { + 80, 120, 160, 320 + }; + + private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] { + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"), + }; + + private final int maxWindStrength; + private final int minWindStrength; + private final int radius; + private final float efficiency; + private final ResourceLocation renderTexture; + + public CustomKineticRotor(int aTier) { + mTier = aTier; + this.setMaxStackSize(1); + // Handle Differences if EIO is not loaded + if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) { + this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)]; + this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]); + } + else { + this.renderTexture = mResourceLocations[aTier]; + this.setUnlocalizedName(mUnlocalNames[aTier]); + } + this.setMaxDamage(mMaxDurability[aTier]); + this.radius = mRadius[aTier]; + this.efficiency = mEfficiency[aTier]; + this.minWindStrength = mMinWindStrength[aTier]; + this.maxWindStrength = mMaxWindStrength[aTier]; + this.setNoRepair(); + this.setCreativeTab(IC2.tabIC2); + GameRegistry.registerItem(this, mRegistrationNames[aTier]); + } + + @Override + public void setDamage(final ItemStack stack, final int damage) { + if (mTier < 3) { + super.setDamage(stack, damage); + } + } + + @Override + public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) { + + info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[]{this.minWindStrength, this.maxWindStrength})); + + GearboxType type = null; + if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { + type = GearboxType.WATER; + } + else if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { + type = GearboxType.WIND; + } + + if (type != null) { + info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))); + } + + } + + @Override + public int getDiameter(final ItemStack stack) + { + return this.radius; + } + + @Override + public ResourceLocation getRotorRenderTexture(final ItemStack stack) + { + return this.renderTexture; + } + + @Override + public float getEfficiency(final ItemStack stack) + { + return this.efficiency; + } + + @Override + public int getMinWindStrength(final ItemStack stack) + { + return this.minWindStrength; + } + + @Override + public int getMaxWindStrength(final ItemStack stack) + { + return this.maxWindStrength; + } + + @Override + public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type){ + return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER); + } + + public String getUnlocalizedName() { + return "ic2." + super.getUnlocalizedName().substring(5); + } + + public String getUnlocalizedName(ItemStack itemStack) { + return this.getUnlocalizedName(); + } + + public String getItemStackDisplayName(ItemStack itemStack) { + return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack)); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return mTier < 3; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconIndex(ItemStack aIndex) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + protected String getIconString() { + return super.getIconString(); + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return super.getDisplayDamage(stack); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return super.getDurabilityForDisplay(stack); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + int aIndex = 0; + for (String y : mUnlocalNames) { + mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y); + } + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java index 64aa7f99bf..862ba38748 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java @@ -1,13 +1,9 @@ package gtPlusPlus.xmod.ic2.item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.LoadedMods; -import ic2.core.IC2; -import ic2.core.init.InternalName; +import net.minecraft.item.ItemStack; public class IC2_Items { @@ -29,45 +25,33 @@ public class IC2_Items { public static ItemStack blockRTG; public static ItemStack blockKineticGenerator; - public static void register(){ + private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"}; + private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"}; + private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"}; + private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"}; + - if(LoadedMods.EnderIO){ - //Tier 1 - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemEnergeticRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemVibrantRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); + public static void register(){ - } - else { - //Tier 1 - Magnalium - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemMagnaliumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - Ultimet - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemUltimetRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); - } + int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1); + + // Rotor Blades + rotor_Blade_Material_1 = new ItemStack (new CoreItem(mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_3 = new ItemStack (new CoreItem(mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotor Shafts + shaft_Material_1 = new ItemStack (new CoreItem(mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_3 = new ItemStack (new CoreItem(mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotors + rotor_Material_1 = new ItemStack (new CustomKineticRotor(0)); + rotor_Material_2 = new ItemStack (new CustomKineticRotor(1)); + rotor_Material_3 = new ItemStack (new CustomKineticRotor(2)); + rotor_Material_4 = new ItemStack (new CustomKineticRotor(3)); } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java index aca1c6a310..b9dffbd371 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java @@ -118,5 +118,10 @@ public class RotorIridium extends RotorBase{ this.setCustomDamage(stack, this.getCustomDamage(stack) + damage); return true; } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } } diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index 9989bffcf0..e2120fdf7b 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -212,7 +212,9 @@ achievement.decay.technetium99.desc=Cyclotron Product - +//24/11/19 +achievement.gt.blockmachines.hatch.turbine.input.tier.00=Turbine Housing +achievement.gt.blockmachines.hatch.turbine.input.tier.00.desc=[AL] Pickup this item to see the recipe in NEI diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png deleted file mode 100644 index cbf604f2b3..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png deleted file mode 100644 index 3b7ac3d50e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png deleted file mode 100644 index a5a5e2c559..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png deleted file mode 100644 index b68c900ddd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png deleted file mode 100644 index df182aeaa5..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png deleted file mode 100644 index 85bc3f16cd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png deleted file mode 100644 index f82185ebdb..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png deleted file mode 100644 index 345476e03c..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png deleted file mode 100644 index 971164eb3e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png deleted file mode 100644 index 5b5bac3ad2..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png new file mode 100644 index 0000000000..cbf604f2b3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png new file mode 100644 index 0000000000..3b7ac3d50e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png new file mode 100644 index 0000000000..a5a5e2c559 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png new file mode 100644 index 0000000000..b68c900ddd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png new file mode 100644 index 0000000000..df182aeaa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png new file mode 100644 index 0000000000..85bc3f16cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png new file mode 100644 index 0000000000..f82185ebdb Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png new file mode 100644 index 0000000000..345476e03c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png new file mode 100644 index 0000000000..971164eb3e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png new file mode 100644 index 0000000000..5b5bac3ad2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png differ -- cgit