mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
Push everything i did.
This commit is contained in:
1 parent
e0a254fd3f
commit
06ec60d1ee
29 files changed
+132
-164
No files matched your search
@@ -3,7 +3,6 @@ package tconstruct.blocks;
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.iface.IServantLogic;
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -22,7 +21,6 @@ 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.blocks.logic.LavaTankLogic;
|
||||
import tconstruct.client.block.TankRender;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
@@ -38,8 +36,8 @@ public class LavaTankBlock extends BlockContainer
|
||||
setHardness(3F);
|
||||
setResistance(20F);
|
||||
setCreativeTab(TConstructRegistry.blockTab);
|
||||
setBlockName("TConstruct.LavaTank");
|
||||
stepSound = Block.soundTypeGlass;
|
||||
this.setBlockName("TConstruct.LavaTank");
|
||||
setStepSound(Block.soundTypeGrass);
|
||||
}
|
||||
|
||||
public LavaTankBlock(String prefix)
|
||||
@@ -59,14 +57,14 @@ public class LavaTankBlock extends BlockContainer
|
||||
return textureNames;
|
||||
}
|
||||
|
||||
public void registerBlockIcons (IIconRegister iconRegister)
|
||||
public void registerBlockIcons (IIconRegister IIconRegister)
|
||||
{
|
||||
String[] textureNames = getTextureNames();
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
this.icons[i] = IIconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +90,9 @@ public class LavaTankBlock extends BlockContainer
|
||||
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
//if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
|
||||
//return super. shouldSideBeRendered(world, x, y, z, side);
|
||||
Block b = world.getBlock(x, y, z);
|
||||
return b == (Block) this ? false : super.shouldSideBeRendered(world, x, y, z, side);
|
||||
//return super.shouldSideBeRendered(world, x, y, z, side);
|
||||
Block bID = world.getBlock(x, y, z);
|
||||
return bID == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
|
||||
//return true;
|
||||
}
|
||||
|
||||
@@ -151,18 +149,45 @@ public class LavaTankBlock extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World world, int metadata)
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
return new LavaTankLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ)
|
||||
public boolean onBlockActivated (World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
ItemStack heldItem = player.inventory.getCurrentItem();
|
||||
if (heldItem != null)
|
||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(player.getCurrentEquippedItem());
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
|
||||
LavaTankLogic tank = (LavaTankLogic) world.getTileEntity(i, j, k);
|
||||
|
||||
if (liquid != null)
|
||||
{
|
||||
int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
|
||||
if (qty != 0 && !entityplayer.capabilities.isCreativeMode)
|
||||
{
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**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);
|
||||
if (liquid != null)
|
||||
{
|
||||
@@ -170,34 +195,34 @@ public class LavaTankBlock extends BlockContainer
|
||||
if (amount == liquid.amount)
|
||||
{
|
||||
logic.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem));
|
||||
if (!entityplayer.capabilities.isCreativeMode)
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else if (FluidContainerRegistry.isBucket(heldItem))
|
||||
else if (FluidContainerRegistry.isFilledContainer(current))
|
||||
{
|
||||
FluidTankInfo[] tanks = logic.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
FluidStack fillFluid = tanks[0].fluid;//getFluid();
|
||||
ItemStack fillStack = FluidContainerRegistry.fillFluidContainer(fillFluid, heldItem);
|
||||
ItemStack fillStack = FluidContainerRegistry.fillFluidContainer(fillFluid, current);
|
||||
if (fillStack != null)
|
||||
{
|
||||
logic.drain(ForgeDirection.UNKNOWN, FluidContainerRegistry.getFluidForFilledItem(fillStack).amount, true);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
if (!entityplayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (heldItem.stackSize == 1)
|
||||
if (current.stackSize == 1)
|
||||
{
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, fillStack);
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, fillStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem));
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
||||
|
||||
if (!player.inventory.addItemStackToInventory(fillStack))
|
||||
if (!entityplayer.inventory.addItemStackToInventory(fillStack))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(fillStack, false);
|
||||
entityplayer.dropPlayerItemWithRandomChoice(fillStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +233,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -231,11 +256,17 @@ public class LavaTankBlock extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item i, CreativeTabs tab, List list)
|
||||
public TileEntity createNewTileEntity (World world, int test)
|
||||
{
|
||||
return createTileEntity(world, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int iter = 0; iter < 3; iter++)
|
||||
{
|
||||
list.add(new ItemStack(i, 1, iter));
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +305,7 @@ public class LavaTankBlock extends BlockContainer
|
||||
if (!player.capabilities.isCreativeMode || player.isSneaking())
|
||||
dropTankBlock(world, x, y, z, stack);
|
||||
|
||||
return WorldHelper.setBlockToAirBool(world, x, y, z);
|
||||
return world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
protected void dropTankBlock (World world, int x, int y, int z, ItemStack stack)
|
||||
@@ -310,4 +341,4 @@ public class LavaTankBlock extends BlockContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
}
|
||||
|
||||
/* Rendering */
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
@@ -269,18 +270,18 @@ public class SmelteryBlock 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 < 12; iter++)
|
||||
{
|
||||
if (iter != 3)
|
||||
list.add(new ItemStack(b, 1, iter));
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
}
|
||||
|
||||
/* Updating */
|
||||
@Override
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block block)
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block nBlockID)
|
||||
{
|
||||
//System.out.println("Neighbor changed");
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
@@ -295,14 +296,13 @@ public class SmelteryBlock extends InventoryBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock (World world, int x, int y, int z, Block block, int meta)
|
||||
public void breakBlock (World world, int x, int y, int z, Block blockID, int meta)
|
||||
{
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
if (logic instanceof IServantLogic)
|
||||
{
|
||||
((IServantLogic) logic).notifyMasterOfChange();
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
super.breakBlock(world, x, y, z, blockID, meta);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class TankAirBlock extends BlockContainer
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister par1IconRegister)
|
||||
public void registerIcons (IIconRegister par1IconRegister)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -102,8 +102,7 @@ public class TankAirBlock extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item i, CreativeTabs tab, List list)
|
||||
public void getSubBlocks (Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package tconstruct.blocks.component;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
|
||||
@@ -30,7 +30,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.component.SmelteryComponent;
|
||||
import tconstruct.blocks.component.SmelteryScan;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.AdaptiveSmelteryContainer;
|
||||
import tconstruct.library.component.IComponentHolder;
|
||||
@@ -573,8 +572,8 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
readNetworkNBT(packet.func_148857_g());
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -584,7 +583,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
writeNetworkNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
@@ -606,4 +605,4 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
public void closeInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
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;
|
||||
@@ -20,6 +17,9 @@ 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
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
{
|
||||
@@ -160,8 +159,8 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
/* Updating */
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
import mantle.blocks.iface.IServantLogic;
|
||||
import mantle.debug.DebugData;
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -46,6 +43,7 @@ import tconstruct.inventory.SmelteryContainer;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.util.SmelteryDamageSource;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
/* Simple class for storing items in the block
|
||||
*/
|
||||
@@ -677,9 +675,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
//worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
/*@Override
|
||||
public void setInventorySloTRepos (int slot, ItemStack itemstack)
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
inventory[slot] = itemstack != null ? itemstack.splitStack(1) : null; //May include unintended side effects. Possible fix for max stack size of 1?
|
||||
}*/
|
||||
@@ -717,32 +715,32 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
Block eastBlock = worldObj.getBlock(x + 1, y, z);
|
||||
Block westBlock = worldObj.getBlock(x - 1, y, z);
|
||||
|
||||
if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1))
|
||||
&& (eastBlock == null || worldObj.isAirBlock(x + 1, y, z)) && (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1)) && (eastBlock == null || worldObj.isAirBlock(x + 1, y, z))
|
||||
&& (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
{
|
||||
checkValidStructure(x, y, z);
|
||||
}
|
||||
|
||||
else if ((northBlock != null && !worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1))
|
||||
&& (eastBlock == null || worldObj.isAirBlock(x + 1, y, z)) && (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
else if ((northBlock != null && !worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1)) && (eastBlock == null || worldObj.isAirBlock(x + 1, y, z))
|
||||
&& (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
{
|
||||
checkValidStructure(x, y, z - 1);
|
||||
}
|
||||
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock != null && !worldObj.isAirBlock(x, y, z - 1))
|
||||
&& (eastBlock == null || worldObj.isAirBlock(x + 1, y, z)) && (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock != null && !worldObj.isAirBlock(x, y, z - 1)) && (eastBlock == null || worldObj.isAirBlock(x + 1, y, z))
|
||||
&& (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
{
|
||||
checkValidStructure(x, y, z + 1);
|
||||
}
|
||||
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1))
|
||||
&& (eastBlock != null && !worldObj.isAirBlock(x + 1, y, z)) && (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1)) && (eastBlock != null && !worldObj.isAirBlock(x + 1, y, z))
|
||||
&& (westBlock == null || worldObj.isAirBlock(x - 1, y, z)))
|
||||
{
|
||||
checkValidStructure(x - 1, y, z);
|
||||
}
|
||||
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1))
|
||||
&& (eastBlock == null || worldObj.isAirBlock(x + 1, y, z)) && (westBlock != null && !worldObj.isAirBlock(x - 1, y, z)))
|
||||
else if ((northBlock == null || worldObj.isAirBlock(x, y, z + 1)) && (southBlock == null || worldObj.isAirBlock(x, y, z - 1)) && (eastBlock == null || worldObj.isAirBlock(x + 1, y, z))
|
||||
&& (westBlock != null && !worldObj.isAirBlock(x - 1, y, z)))
|
||||
{
|
||||
checkValidStructure(x + 1, y, z);
|
||||
}
|
||||
@@ -929,7 +927,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
MultiServantLogic servant = (MultiServantLogic) te;
|
||||
if (servant.hasValidMaster())
|
||||
{
|
||||
if (servant.verifyMaster(this, worldObj, this.xCoord, this.yCoord, this.zCoord))
|
||||
if (servant.verifyMaster(this, this.xCoord, this.yCoord, this.zCoord))
|
||||
tempBricks++;
|
||||
}
|
||||
else if (servant.setMaster(this.xCoord, this.yCoord, this.zCoord))
|
||||
@@ -945,13 +943,13 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
return tempBricks;
|
||||
}
|
||||
|
||||
boolean validBlockID(Block blockID)
|
||||
|
||||
boolean validBlockID (Block blockID)
|
||||
{
|
||||
return blockID == TRepo.smeltery || blockID == TRepo.smelteryNether;
|
||||
}
|
||||
|
||||
boolean validTankID(Block blockID)
|
||||
|
||||
boolean validTankID (Block blockID)
|
||||
{
|
||||
return blockID == TRepo.lavaTank || blockID == TRepo.lavaTankNether;
|
||||
}
|
||||
@@ -1150,24 +1148,14 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readFromNBT(packet.func_148857_g());
|
||||
markDirty();
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
this.needsUpdate = true;
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
// IDebuggable
|
||||
@Override
|
||||
public DebugData getDebugInfo (EntityPlayer player)
|
||||
{
|
||||
List<String> str = new ArrayList<String>(Arrays.asList(super.getDebugInfo(player).strings));
|
||||
str.add("layers: " + layers + ", liquid: " + currentLiquid + "/" + maxLiquid + ", direction: " + direction);
|
||||
str.add("inUse: " + inUse + ", tick: " + tick);
|
||||
return new DebugData(player, getClass(), str.toArray(new String[str.size()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1191,4 +1179,4 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
public void openInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void markDirty()
|
||||
public void InventoryLogic()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
inventory[1] = null;
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.inventory.Container;
|
||||
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;
|
||||
@@ -191,7 +190,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
writeNetworkNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
@@ -213,5 +212,5 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
public void openInventory ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@@ -11,7 +12,7 @@ import tconstruct.library.crafting.ToolBuilder;
|
||||
/* Simple class for storing items in the block
|
||||
*/
|
||||
|
||||
public class ToolForgeLogic extends ToolStationLogic
|
||||
public class ToolForgeLogic extends ToolStationLogic implements ISidedInventory
|
||||
{
|
||||
ItemStack previousTool;
|
||||
String toolName;
|
||||
@@ -49,4 +50,4 @@ public class ToolForgeLogic extends ToolStationLogic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,6 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory
|
||||
return new ToolStationContainer(inventoryplayer, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty ()
|
||||
{
|
||||
buildTool(toolName);
|
||||
@@ -114,22 +113,22 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory
|
||||
@Override
|
||||
public String getInventoryName ()
|
||||
{
|
||||
return getDefaultName();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory ()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class CastingBasinSpecialRender extends TileEntitySpecialRenderer
|
||||
|
||||
void renderItem (CastingBasinLogic logic, ItemStack stack)
|
||||
{
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorld(), 0.0D, 0.0D, 0.0D, stack);
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
|
||||
|
||||
void renderItem (CastingTableLogic logic, ItemStack stack)
|
||||
{
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorld(), 0.0D, 0.0D, 0.0D, stack);
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -41,11 +41,11 @@ public class DryingRackSpecialRender extends TileEntitySpecialRenderer
|
||||
|
||||
void renderItem (DryingRackLogic logic, ItemStack stack)
|
||||
{
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorld(), 0.0D, 0.0D, 0.0D, stack);
|
||||
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
int meta = logic.getWorld().getBlockMetadata(logic.xCoord, logic.yCoord, logic.zCoord);
|
||||
int meta = logic.getWorldObj().getBlockMetadata(logic.xCoord, logic.yCoord, logic.zCoord);
|
||||
if (meta <= 1)
|
||||
GL11.glTranslatef(1F, -0.375F, 0.905F);
|
||||
else
|
||||
|
||||
@@ -510,6 +510,6 @@ public class AdaptiveSmelteryGui extends NewContainerGui
|
||||
public void onGuiClosed ()
|
||||
{
|
||||
super.onGuiClosed();
|
||||
logic.getWorld().markBlockForUpdate(logic.xCoord, logic.yCoord, logic.zCoord);
|
||||
logic.getWorldObj().markBlockForUpdate(logic.xCoord, logic.yCoord, logic.zCoord);
|
||||
}
|
||||
}
|
||||
@@ -485,7 +485,8 @@ public class SmelteryGui extends NewContainerGui
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new PacketSmeltery(logic.getWorld().provider.dimensionId, logic.xCoord, logic.yCoord, logic.zCoord, this.isShiftKeyDown(), fluidToBeBroughtUp));
|
||||
TConstruct.packetPipeline
|
||||
.sendToServer(new PacketSmeltery(logic.getWorldObj().provider.dimensionId, logic.xCoord, logic.yCoord, logic.zCoord, this.isShiftKeyDown(), fluidToBeBroughtUp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1372,9 +1372,6 @@ public class TRecipes
|
||||
Smeltery.addMelting(FluidType.Gold, new ItemStack(Items.golden_shovel, 1, 0), 0, TConstruct.ingotLiquidValue);
|
||||
Smeltery.addMelting(FluidType.Gold, new ItemStack(Items.golden_pickaxe, 1, 0), 0, TConstruct.ingotLiquidValue * 3);
|
||||
Smeltery.addMelting(FluidType.Gold, new ItemStack(Items.golden_axe, 1, 0), 0, TConstruct.ingotLiquidValue * 3);
|
||||
Smeltery.CheckSmeltingList();
|
||||
Smeltery.CheckTemperatureList();
|
||||
Smeltery.CheckRenderIndex();
|
||||
}
|
||||
|
||||
public void modIntegration ()
|
||||
|
||||
@@ -193,8 +193,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer
|
||||
slot = (Slot) this.inventorySlots.get(slotPos);
|
||||
slotStack = slot.getStack();
|
||||
|
||||
if (slotStack != null && slotStack == inputStack && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage())
|
||||
&& ItemStack.areItemStackTagsEqual(inputStack, slotStack))
|
||||
if (slotStack != null && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(inputStack, slotStack))
|
||||
{
|
||||
int l = slotStack.stackSize + inputStack.stackSize;
|
||||
|
||||
@@ -263,4 +262,4 @@ public class AdaptiveSmelteryContainer extends ActiveContainer
|
||||
|
||||
return merged;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class CraftingStationContainer extends Container
|
||||
|
||||
public CraftingStationContainer(InventoryPlayer inventorplayer, CraftingStationLogic logic, int x, int y, int z)
|
||||
{
|
||||
this.worldObj = logic.getWorld();
|
||||
this.worldObj = logic.getWorldObj();
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
this.posZ = z;
|
||||
|
||||
@@ -65,7 +65,8 @@ public class SlotTool extends Slot
|
||||
inventory.decrStackSize(1, amount);
|
||||
if (!player.worldObj.isRemote && full)
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "tinker:little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F);
|
||||
//player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
|
||||
MinecraftForge.EVENT_BUS.post(new ToolCraftedEvent(this.inventory, player, stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,4 @@ public class SlotToolForge extends SlotTool
|
||||
MinecraftForge.EVENT_BUS.post(new ToolCraftedEvent(this.inventory, player, stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package tconstruct.inventory;
|
||||
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
|
||||
public class SmelteryContainer extends ActiveContainer
|
||||
{
|
||||
@@ -224,8 +224,7 @@ public class SmelteryContainer extends ActiveContainer
|
||||
slot = (Slot) this.inventorySlots.get(slotPos);
|
||||
slotStack = slot.getStack();
|
||||
|
||||
if (slotStack != null && slotStack.getItem() == inputStack.getItem() && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage())
|
||||
&& ItemStack.areItemStackTagsEqual(inputStack, slotStack))
|
||||
if (slotStack != null && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(inputStack, slotStack))
|
||||
{
|
||||
int l = slotStack.stackSize + inputStack.stackSize;
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ public class ToolForgeContainer extends ToolStationContainer
|
||||
logic.decrStackSize(i, 1);
|
||||
int amount = logic.getStackInSlot(1).getItem() instanceof ToolCore ? stack.stackSize : 1;
|
||||
logic.decrStackSize(1, amount);
|
||||
if (!logic.getWorld().isRemote)
|
||||
logic.getWorld().playAuxSFX(1021, (int) logic.xCoord, (int) logic.yCoord, (int) logic.zCoord, 0);
|
||||
if (!logic.getWorldObj().isRemote)
|
||||
logic.getWorldObj().playAuxSFX(1021, (int) logic.xCoord, (int) logic.yCoord, (int) logic.zCoord, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,4 +236,4 @@ public class ToolStationContainer extends ActiveContainer
|
||||
|
||||
return failedToMerge;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -72,48 +71,10 @@ public class Smeltery
|
||||
*/
|
||||
public static void addMelting (ItemStack input, Item item, int metadata, int temperature, FluidStack liquid)
|
||||
{
|
||||
TConstruct.logger.error("I HAVE WORKED!");
|
||||
instance.smeltingList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), liquid);
|
||||
instance.temperatureList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), temperature);
|
||||
instance.renderIndex.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), new ItemStack(item, input.stackSize, metadata));
|
||||
}
|
||||
|
||||
public static void CheckSmeltingList()
|
||||
{
|
||||
if (instance.smeltingList.isEmpty())
|
||||
{
|
||||
TConstruct.logger.error("SmeltingList Empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
TConstruct.logger.error("SmeltingList not Empty!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void CheckTemperatureList()
|
||||
{
|
||||
if (instance.temperatureList.isEmpty())
|
||||
{
|
||||
TConstruct.logger.error("TemperatureList Empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
TConstruct.logger.error("TemperatureList not Empty!");
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckRenderIndex()
|
||||
{
|
||||
if (instance.renderIndex.isEmpty())
|
||||
{
|
||||
TConstruct.logger.error("RenderIndex Empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
TConstruct.logger.error("RenderIndex not Empty!");
|
||||
}
|
||||
}
|
||||
|
||||
/** Adds an alloy mixing recipe.
|
||||
* Example: Smeltery.addAlloyMixing(new FluidStack(bronzeID, 2, 0), new FluidStack(copperID, 3, 0), new FluidStack(tinID, 1, 0));
|
||||
|
||||
@@ -8,7 +8,6 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ic2.IC2;
|
||||
import tconstruct.plugins.imc.AppEng;
|
||||
import tconstruct.plugins.imc.BuildcraftTransport;
|
||||
import tconstruct.plugins.imc.Mystcraft;
|
||||
import tconstruct.plugins.imc.Thaumcraft;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -116,7 +115,7 @@ public class PluginController
|
||||
loadPlugin(new Mystcraft());
|
||||
|
||||
registerPlugin(new AppEng());
|
||||
registerPlugin(new BuildcraftTransport());
|
||||
//registerPlugin(new BuildcraftTransport());
|
||||
//registerPlugin(new ForgeMultiPart());
|
||||
registerPlugin(new IC2());
|
||||
// registerPlugin(new MineFactoryReloaded());
|
||||
|
||||
Reference in new issue
Block a user