aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorAlkalus <Draknyte1@hotmail.com>2020-05-25 02:55:32 +0100
committerAlkalus <Draknyte1@hotmail.com>2020-05-25 02:55:32 +0100
commit6fb4b8a333e69bd591d49d9c5f251797de333c7b (patch)
treec54bb1070920660d96c71dd48d68ef7095b1aafe /src/Java
parent2b7ae2001ed8f49d2de8f88ef306426af60c279b (diff)
downloadGT5-Unofficial-6fb4b8a333e69bd591d49d9c5f251797de333c7b.tar.gz
GT5-Unofficial-6fb4b8a333e69bd591d49d9c5f251797de333c7b.tar.bz2
GT5-Unofficial-6fb4b8a333e69bd591d49d9c5f251797de333c7b.zip
+ Added the Volumetric Flask Configurator.
+ Added a recipe for the Egg Box. + Added a Book for the Chemical Plant. % Changed the Tooltip for the Egg Box. $ Fixed Robinators not returning the correct block when mined. $ Fixed Electric tool recipes not consuming the original tool. $ Redid handling of all shaped crafting recipes. $ Fixed recipe handling for the last few multiblocks. $ Potentially forgot some other minor fixes.
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java2
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java9
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java13
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/EggBox.java2
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java169
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java38
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java2
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java162
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java149
-rw-r--r--src/Java/gtPlusPlus/core/handler/BookHandler.java16
-rw-r--r--src/Java/gtPlusPlus/core/handler/GuiHandler.java7
-rw-r--r--src/Java/gtPlusPlus/core/handler/PacketHandler.java118
-rw-r--r--src/Java/gtPlusPlus/core/inventories/Inventory_VolumetricFlaskSetter.java173
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java5
-rw-r--r--src/Java/gtPlusPlus/core/network/handler/AbstractClientMessageHandler.java13
-rw-r--r--src/Java/gtPlusPlus/core/network/handler/AbstractMessageHandler.java37
-rw-r--r--src/Java/gtPlusPlus/core/network/handler/AbstractServerMessageHandler.java13
-rw-r--r--src/Java/gtPlusPlus/core/network/packet/AbstractPacket.java9
-rw-r--r--src/Java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui.java128
-rw-r--r--src/Java/gtPlusPlus/core/network/packet/Packet_VolumetricFlaskGui2.java127
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ClientProxy.java32
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_General.java34
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java12
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java79
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java12
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotVolumetricFlask.java30
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java5
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java348
-rw-r--r--src/Java/gtPlusPlus/core/util/data/ArrayUtils.java7
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java8
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java195
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java81
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java124
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java32
46 files changed, 2073 insertions, 307 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index f138d5f95d..4e4088a367 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -28,6 +28,7 @@ import gtPlusPlus.core.commands.CommandMath;
import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.config.ConfigHandler;
import gtPlusPlus.core.handler.BookHandler;
+import gtPlusPlus.core.handler.PacketHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.handler.events.BlockEventHandler;
import gtPlusPlus.core.handler.events.LoginEventHandler;
@@ -134,6 +135,7 @@ public class GTplusplus implements ActionListener {
Logger.INFO("Loading " + CORE.name + " "+CORE.VERSION+" on Gregtech "+Utils.getGregtechVersionAsString());
//Load all class objects within the plugin package.
Core_Manager.veryEarlyInit();
+ PacketHandler.init();
if(!Utils.isServer()){
enableCustomCapes = true;
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
index d5bf2da25d..de207335f2 100644
--- a/src/Java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -17,6 +17,8 @@ import gtPlusPlus.core.block.machine.*;
import gtPlusPlus.core.block.machine.bedrock.Mining_Head_Fake;
import gtPlusPlus.core.block.machine.bedrock.Mining_Pipe_Fake;
import gtPlusPlus.core.fluids.FluidRegistryHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
@@ -25,6 +27,7 @@ public final class ModBlocks {
public static Block blockRoundRobinator;
public static Block blockCircuitProgrammer;
+ public static Block blockVolumetricFlaskSetter;
public static Block blockFakeMiningPipe;
public static Block blockFakeMiningHead;
@@ -144,7 +147,11 @@ public final class ModBlocks {
blockPestKiller = new Machine_PestKiller();
blockRoundRobinator = new Machine_RoundRobinator();
-
+
+ if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
+ blockVolumetricFlaskSetter = new VolumetricFlaskSetter();
+ }
+
new BlockGenericRedstoneDetector();
new BlockGenericRedstoneTest();
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
index 6166835f31..2bfd09d848 100644
--- a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
+++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -1,6 +1,8 @@
package gtPlusPlus.core.block.base;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -22,6 +24,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
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;
@@ -312,4 +315,14 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
return l;
}
+
+ public Item getItemDropped(int meta, Random rand, int p_149650_3_){
+ return ItemUtils.getSimpleStack(this, 1).getItem();
+ }
+
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ return drops;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/EggBox.java b/src/Java/gtPlusPlus/core/block/machine/EggBox.java
index f36dc83704..630c4b5bc2 100644
--- a/src/Java/gtPlusPlus/core/block/machine/EggBox.java
+++ b/src/Java/gtPlusPlus/core/block/machine/EggBox.java
@@ -37,7 +37,7 @@ public class EggBox extends BlockContainer implements ITileTooltip
/**
* Determines which tooltip is displayed within the itemblock.
*/
- private final int mTooltipID = 5;
+ private final int mTooltipID = 7;
public final int field_149956_a = 0;
@Override
diff --git a/src/Java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java b/src/Java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
new file mode 100644
index 0000000000..4f86de49d3
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
@@ -0,0 +1,169 @@
+package gtPlusPlus.core.block.machine;
+
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip;
+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.network.packet.Packet_VolumetricFlaskGui2;
+import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.block.material.Material;
+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.world.IBlockAccess;
+import net.minecraft.world.World;
+
+public class VolumetricFlaskSetter extends BasicTileBlockWithTooltip {
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 8;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @Override
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlockBasicTile.class;
+ }
+
+ @SuppressWarnings("deprecation")
+ public VolumetricFlaskSetter(){
+ super(Material.iron);
+ LanguageRegistry.addName(this, "Volumetric Flask Configurator");
+ }
+
+ /**
+ * 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 TileEntityVolumetricFlaskSetter tile = (TileEntityVolumetricFlaskSetter) 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 TileEntityVolumetricFlaskSetter)){
+ player.openGui(GTplusplus.instance, GuiHandler.GUI18, world, x, y, z);
+ TileEntityVolumetricFlaskSetter aTile = (TileEntityVolumetricFlaskSetter) te;
+ new Packet_VolumetricFlaskGui2(aTile, aTile.getCustomValue());
+ 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 TileEntityVolumetricFlaskSetter();
+ }
+
+ @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 onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityVolumetricFlaskSetter) 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;
+ }
+
+ @Override
+ public int getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockVolumetricFlaskSetter";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Volumetric Flask Configurator";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_A",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_C",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H"
+ };
+ CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
+ return aTextureData;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index 4dad732e25..9565d242c4 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.common;
import cpw.mods.fml.common.event.*;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.OrePrefixes;
@@ -42,8 +43,10 @@ import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.monster.EntityZombie;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
import net.minecraftforge.client.IItemRenderer;
public class CommonProxy {
@@ -138,7 +141,7 @@ public class CommonProxy {
Utils.registerEvent(new HandlerTooltip_EIO());
// Handles Custom Tooltips for GC
Utils.registerEvent(new HandlerTooltip_GC());
-
+
if (CORE.DEVENV) {
Utils.registerEvent(new StopAnnoyingFuckingAchievements());
}
@@ -231,13 +234,13 @@ public class CommonProxy {
Utils.createNewMobSpawner(1, EntitySickBlaze.class);
Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class);
}
-
+
public void registerCustomItemsForMaterials() {
Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1));
}
-
+
public void registerCustomMobDrops() {
-
+
//Zombie
EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100);
EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250);
@@ -245,14 +248,14 @@ public class CommonProxy {
EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10);
EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10);
EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10);
-
+
//Blazes
if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) {
EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
}
-
-
+
+
//Special mobs Support
if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) {
Class<?> aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie");
@@ -264,7 +267,7 @@ public class CommonProxy {
EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1);
EntityUtils.registerDropsForMob(aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200);
}
-
+
//GalaxySpace Support
if (ReflectionUtils.doesClassExist("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze")) {
Class<?> aColdBlaze = ReflectionUtils.getClass("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze");
@@ -287,16 +290,16 @@ public class CommonProxy {
EntityUtils.registerDropsForMob(aColdBlaze, aTinyCryo, 2, 100);
}
}
-
+
}
-
+
protected final AutoMap<Pair<Item, IItemRenderer>> mItemRenderMappings = new AutoMap<Pair<Item, IItemRenderer>>();
-
+
public static void registerItemRendererGlobal(Item aItem, IItemRenderer aRenderer) {
GTplusplus.proxy.registerItemRenderer(aItem, aRenderer);
}
-
+
public void registerItemRenderer(Item aItem, IItemRenderer aRenderer) {
if (Utils.isServer()) {
return;
@@ -306,4 +309,15 @@ public class CommonProxy {
}
}
+ public World getClientWorld() {
+ return null;
+ }
+
+ /**
+ * Returns a side-appropriate EntityPlayer for use during message handling
+ */
+ public EntityPlayer getPlayerEntity(MessageContext ctx) {
+ return ctx.getServerHandler().playerEntity;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
index 4d736e1362..d5ee51f61a 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
@@ -21,7 +21,7 @@ public class COMPAT_ExtraUtils {
if (ConfigSwitches.enableAlternativeDivisionSigilRecipe){
//Division Sigil
- RecipeUtils.recipeBuilder(
+ RecipeUtils.addShapedRecipe(
"plateNetherStar", "gemIridium", "plateNetherStar",
"plateIridium", RECIPES_Tools.craftingToolHardHammer, "plateIridium",
"plateNetherStar", "gemIridium", "plateNetherStar",
diff --git a/src/Java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java b/src/Java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java
new file mode 100644
index 0000000000..5c776b7a57
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java
@@ -0,0 +1,162 @@
+package gtPlusPlus.core.container;
+
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.inventories.Inventory_VolumetricFlaskSetter;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.slots.SlotVolumetricFlask;
+import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
+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;
+
+public class Container_VolumetricFlaskSetter extends Container {
+
+ protected TileEntityVolumetricFlaskSetter tile_entity;
+ public final Inventory_VolumetricFlaskSetter inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ public static final int SLOT_OUTPUT = 8;
+
+ public static int StorageSlotNumber = 8; // 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_VolumetricFlaskSetter(final InventoryPlayer inventory, final TileEntityVolumetricFlaskSetter 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;
+
+ 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 = 26;
+ int yStart = 12;
+
+ try {
+ //0
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart+=18, yStart));
+ this.addSlotToContainer(new SlotVolumetricFlask(this.inventoryChest, o++, xStart, yStart+18));
+
+ //Add Output
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, SLOT_OUTPUT, 8+(8*18), 59));
+ o++;
+
+
+
+ // 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));
+ }
+ }
+ 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.blockVolumetricFlaskSetter) {
+ 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_VolumetricFlaskSetter.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java
new file mode 100644
index 0000000000..6bdf8f2ef5
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSett