mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
commit
4ec44d13df
10 files changed
+63
-83
No files matched your search
@@ -21,6 +21,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.LavaTankLogic;
|
||||
import tconstruct.client.block.TankRender;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
@@ -157,7 +159,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated (World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
/**ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
@@ -181,14 +183,15 @@ public class LavaTankBlock extends BlockContainer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/**ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
if (current != null)
|
||||
{
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
//FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
LavaTankLogic logic = (LavaTankLogic) world.getTileEntity(x, y, z);
|
||||
TConstruct.logger.error(liquid);
|
||||
LavaTankLogic logic = (LavaTankLogic) world.getTileEntity(i, j, k);
|
||||
if (liquid != null)
|
||||
{
|
||||
int amount = logic.fill(ForgeDirection.UNKNOWN, liquid, false);
|
||||
@@ -202,7 +205,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else if (FluidContainerRegistry.isFilledContainer(current))
|
||||
else if (FluidContainerRegistry.isBucket(current))
|
||||
{
|
||||
FluidTankInfo[] tanks = logic.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
FluidStack fillFluid = tanks[0].fluid;//getFluid();
|
||||
@@ -233,7 +236,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,16 @@ package tconstruct.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.PartBuilderLogic;
|
||||
import tconstruct.blocks.logic.PatternChestLogic;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import tconstruct.client.block.TableRender;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import mantle.blocks.abstracts.InventoryBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -16,17 +26,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.PartBuilderLogic;
|
||||
import tconstruct.blocks.logic.PatternChestLogic;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import tconstruct.client.block.TableRender;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ToolStationBlock extends InventoryBlock
|
||||
{
|
||||
@@ -54,7 +53,6 @@ public class ToolStationBlock extends InventoryBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
if (meta <= 4)
|
||||
@@ -121,7 +119,7 @@ public class ToolStationBlock extends InventoryBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
public TileEntity createNewTileEntity (World world, int metadata)
|
||||
{
|
||||
switch (metadata)
|
||||
{
|
||||
@@ -154,7 +152,7 @@ public class ToolStationBlock extends InventoryBlock
|
||||
case 13:
|
||||
return new StencilTableLogic();
|
||||
/*case 14:
|
||||
return new CastingTableLogic();*/
|
||||
return new CastingTableLogic();*/
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -183,16 +181,16 @@ public class ToolStationBlock extends InventoryBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item b, CreativeTabs tab, List list)
|
||||
public void getSubBlocks (Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int iter = 0; iter < 6; iter++)
|
||||
{
|
||||
list.add(new ItemStack(b, 1, iter));
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
|
||||
for (int iter = 10; iter < 14; iter++)
|
||||
{
|
||||
list.add(new ItemStack(b, 1, iter));
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,10 +212,4 @@ public class ToolStationBlock extends InventoryBlock
|
||||
}
|
||||
super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, par6ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World var1, int var2)
|
||||
{
|
||||
return createTileEntity(var1, var2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -17,9 +20,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFluidHandler, ISidedInventory
|
||||
{
|
||||
@@ -425,7 +425,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new CraftingStationContainer(inventoryplayer, this, x, y, z);
|
||||
}
|
||||
|
||||
@@ -100,7 +101,7 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
@@ -132,4 +133,4 @@ public class CraftingStationLogic extends InventoryLogic implements ISidedInvent
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.PartCrafterChestContainer;
|
||||
import tconstruct.inventory.PartCrafterContainer;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -8,10 +12,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.PartCrafterChestContainer;
|
||||
import tconstruct.inventory.PartCrafterContainer;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
@@ -38,9 +38,12 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(xPos, y, zPos);
|
||||
if (tile != null && tile instanceof PatternChestLogic)
|
||||
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile);
|
||||
for (int yPos = y - 1; zPos <= y + 1; zPos++)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(xPos, yPos, zPos);
|
||||
if (tile != null && tile instanceof PatternChestLogic)
|
||||
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new PartCrafterContainer(inventoryplayer, this);
|
||||
@@ -205,4 +208,4 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.PatternChestContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.PatternChestContainer;
|
||||
|
||||
public class PatternChestLogic extends InventoryLogic
|
||||
{
|
||||
@@ -29,7 +29,7 @@ public class PatternChestLogic extends InventoryLogic
|
||||
{
|
||||
return new PatternChestContainer(inventoryplayer, this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
@@ -51,4 +51,4 @@ public class PatternChestLogic extends InventoryLogic
|
||||
public void closeInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -7,8 +10,6 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
|
||||
public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
@@ -35,7 +36,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void InventoryLogic()
|
||||
public void markDirty()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
inventory[1] = null;
|
||||
@@ -120,7 +121,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
@@ -142,4 +143,4 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
public void openInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.ToolStationContainer;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -7,8 +9,6 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.inventory.ToolStationContainer;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
|
||||
/* Simple class for storing items in the block
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package tconstruct.client.gui;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -12,6 +15,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
import tconstruct.util.network.packet.PacketStencilTable;
|
||||
@@ -66,8 +70,8 @@ public class StencilTableGui extends GuiContainer
|
||||
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.texture); // Repair
|
||||
repairButton.enabled = false;
|
||||
this.buttonList.add(repairButton);*/
|
||||
this.buttonList.add(new GuiButton(0, cornerX - 120, cornerY, 120, 20, StatCollector.translateToLocal("gui.stenciltable1")));
|
||||
this.buttonList.add(new GuiButton(1, cornerX - 120, cornerY + 20, 120, 20, StatCollector.translateToLocal("gui.stenciltable2")));
|
||||
this.buttonList.add(new GuiButton(0, cornerX - 120, cornerY, 120, 20, (StatCollector.translateToLocal("gui.stenciltable1"))));
|
||||
this.buttonList.add(new GuiButton(1, cornerX - 120, cornerY + 20, 120, 20, (StatCollector.translateToLocal("gui.stenciltable2"))));
|
||||
|
||||
//for (int iter = 0; iter < TConstructContent.patternOutputs.length; iter++)
|
||||
//{
|
||||
@@ -117,30 +121,6 @@ public class StencilTableGui extends GuiContainer
|
||||
|
||||
void updateServer (ItemStack stack)
|
||||
{
|
||||
/*ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
outputStream.writeByte(2);
|
||||
outputStream.writeInt(logic.getWorld().provider.dimensionId);
|
||||
outputStream.writeInt(logic.xCoord);
|
||||
outputStream.writeInt(logic.yCoord);
|
||||
outputStream.writeInt(logic.zCoord);
|
||||
outputStream.writeShort(stack.itemID);
|
||||
outputStream.writeShort(stack.getItemDamage());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "TConstruct";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new PacketStencilTable(logic.xCoord, logic.yCoord, logic.zCoord, stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package tconstruct.inventory;
|
||||
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
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 tconstruct.blocks.logic.StencilTableLogic;
|
||||
|
||||
public class PatternShaperContainer extends Container
|
||||
{
|
||||
@@ -102,4 +102,4 @@ public class PatternShaperContainer extends Container
|
||||
return stack;*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user