All this needs to be tested, but here :P

This commit is contained in:
Alexander committed 2014-02-13 23:03:13 -05:00
1 parent 0f9cca02f1
commit e0a254fd3f
28 files changed
+149 -100

No files matched your search

@@ -3,6 +3,7 @@ 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;
@@ -278,4 +279,4 @@ public class SmelteryComponent extends LogicComponent
if (activeLavaTank != null)
tags.setIntArray("LavaTank", new int[] { activeLavaTank.x, activeLavaTank.y, activeLavaTank.z });
}
}
}
@@ -128,7 +128,7 @@ public class SmelteryScan extends TankLayerScan
{
super.readNetworkNBT(tags);
NBTTagList tanks = tags.getTagList("Tanks", 11);
NBTTagList tanks = tags.getTagList("Tanks", 9);
if (tanks != null)
{
lavaTanks.clear();
@@ -20,4 +20,4 @@ public class TankAirComponent extends MultiFluidTank
{
fluidlist = fluids;
}
}
}
@@ -1,5 +1,7 @@
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;
@@ -29,7 +31,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
public boolean setPotentialMaster (IMasterLogic master, World world, int x, int y, int z)
{
// TConstruct.logger.info("Master: "+master);
return (master instanceof AdaptiveSmelteryLogic || master instanceof AdaptiveDrainLogic) && !hasValidMaster();
return (master instanceof AdaptiveSmelteryLogic || master instanceof AdaptiveDrainLogic) && !getHasMaster();
}
@Override
@@ -174,7 +176,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
@Override
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
}
}
@@ -30,6 +30,7 @@ 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;
@@ -572,8 +573,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.func_147479_m(xCoord, yCoord, zCoord);
}
@Override
@@ -583,7 +584,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
writeNetworkNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
}
@Override
public String getInventoryName ()
{
@@ -142,7 +142,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
castingDelay = recipe.coolTime;
}
renderOffset = copyLiquid.amount;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
this.liquid = copyLiquid;
needsUpdate = true;
}
@@ -164,7 +164,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
renderOffset = roomInTank;
castingDelay = TConstruct.basinCasting.getCastingDelay(this.liquid, inventory[0]);
this.liquid.amount = this.capacity;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
return roomInTank;
@@ -175,7 +175,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
if (doFill)
{
this.liquid.amount += resource.amount;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
return resource.amount;
@@ -192,14 +192,14 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
public void markDirty () //Isn't actually called?
{
super.markDirty();
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
public ItemStack decrStackSize (int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
return stack;
}
@@ -311,7 +311,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
if (renderOffset > 0)
{
renderOffset -= 6;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
tick++;
@@ -396,8 +396,8 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
@Override
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
@Override
@@ -574,7 +574,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readCustomNBT(packet.func_148857_g());
this.worldObj.func_147479_m(this.xCoord, this.yCoord, this.zCoord);
this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, xCoord, yCoord, zCoord);
}
public int convertFDToInt (ForgeDirection dir)
@@ -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
{
@@ -142,7 +142,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
castingDelay = recipe.coolTime;
}
renderOffset = copyLiquid.amount;
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
this.liquid = copyLiquid;
needsUpdate = true;
}
@@ -164,7 +164,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
renderOffset = roomInTank;
castingDelay = TConstruct.tableCasting.getCastingDelay(this.liquid, inventory[0]);
this.liquid.amount = this.capacity;
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
return roomInTank;
@@ -175,7 +175,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
if (doFill)
{
this.liquid.amount += resource.amount;
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
return resource.amount;
@@ -192,14 +192,14 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
public void markDirty () //Isn't actually called?
{
super.markDirty();
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
needsUpdate = true;
}
public ItemStack decrStackSize (int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
return stack;
}
@@ -228,7 +228,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
liquid = null;
if (doDrain)
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.getWorld(), this.xCoord, this.yCoord, this.zCoord, this));
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this));
return drained;
}
@@ -264,6 +264,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
@Override
public boolean canDrain (ForgeDirection from, Fluid fluid)
{
// TODO Auto-generated method stub
return false;
}
@@ -311,7 +312,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
if (renderOffset > 0)
{
renderOffset -= 6;
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
tick++;
@@ -319,7 +320,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
{
tick = 0;
if (needsUpdate)
getWorld().markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
@@ -332,7 +333,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
if (recipe.consumeCast)
inventory[0] = null;
liquid = null;
getWorld().markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
@@ -387,7 +388,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
public Packet getDescriptionPacket ()
{
NBTTagCompound tag = new NBTTagCompound();
readFromNBT(tag);
writeToNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
}
@@ -395,7 +396,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readFromNBT(packet.func_148857_g());
getWorld().func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
@Override
@@ -450,4 +451,4 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
// TODO Auto-generated method stub
}
}
}
@@ -115,7 +115,7 @@ public class DryingRackLogic extends InventoryLogic
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readCustomNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
@SideOnly(Side.CLIENT)
@@ -180,7 +180,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readCustomNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
@Override
@@ -296,7 +296,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readNetworkNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
@Override
@@ -13,6 +13,7 @@ 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
{
@@ -107,7 +108,6 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
int id = tank.getFluid().fluidID;
if (id < 4096)
{
//TODO check this!!
Block block = Block.getBlockById(id);
return block.getLightValue();
}
@@ -160,8 +160,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.func_147479_m(xCoord, yCoord, zCoord);
}
/* Updating */
@@ -176,7 +176,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
if (renderOffset > 0)
{
renderOffset -= 6;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
}
}
}
@@ -18,7 +18,7 @@ public class LiquidTextureLogic extends TileEntity
public void setLiquidType (int tex)
{
texturePos = tex;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
public int getLiquidType ()
@@ -59,7 +59,7 @@ public class LiquidTextureLogic extends TileEntity
@Override
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
readCustomNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
}
}
@@ -67,6 +67,6 @@ public class RedwireLogic extends TileEntity
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readCustomNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
}
@@ -1,5 +1,6 @@
package tconstruct.blocks.logic;
import tconstruct.library.crafting.AlloyMix;
import mantle.blocks.abstracts.MultiServantLogic;
import mantle.blocks.iface.IFacingLogic;
import net.minecraft.entity.EntityLivingBase;
@@ -181,6 +182,6 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
}
}
@@ -5,6 +5,7 @@ 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;
@@ -45,7 +46,6 @@ 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 +677,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
//worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
/*@Override
public void setInventorySlotContents (int slot, ItemStack itemstack)
public void setInventorySloTRepos (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 +717,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);
}
@@ -859,10 +859,10 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
Block block = worldObj.getBlock(xPos, y, zPos);
if (block != null && !worldObj.isAirBlock(xPos, y, zPos))
Block blockID = worldObj.getBlock(xPos, y, zPos);
if (blockID != null && !worldObj.isAirBlock(xPos, y, zPos))
{
if (validBlock(block))
if (validBlockID(blockID))
return validateBottom(x, y, z, count);
else
return count;
@@ -897,7 +897,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
if (validBlock(worldObj.getBlock(xPos, y, zPos)) && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2))
if (validBlockID(worldObj.getBlock(xPos, y, zPos)) && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2))
bottomBricks++;
}
}
@@ -916,8 +916,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
int checkBricks (int x, int y, int z)
{
int tempBricks = 0;
Block block = worldObj.getBlock(x, y, z);
if (validBlock(block) || validTank(block))
Block blockID = worldObj.getBlock(x, y, z);
if (validBlockID(blockID) || validTankID(blockID))
{
TileEntity te = worldObj.getTileEntity(x, y, z);
if (te == this)
@@ -945,15 +945,15 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
}
return tempBricks;
}
boolean validBlock (Block block)
boolean validBlockID(Block blockID)
{
return block == TRepo.smeltery || block == TRepo.smelteryNether;
return blockID == TRepo.smeltery || blockID == TRepo.smelteryNether;
}
boolean validTank (Block block)
boolean validTankID(Block blockID)
{
return block == TRepo.lavaTank || block == TRepo.lavaTankNether;
return blockID == TRepo.lavaTank || blockID == TRepo.lavaTankNether;
}
public int getCapacity ()
@@ -1027,7 +1027,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
}
}
needsUpdate = true;
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
}
return amount;
}
@@ -1150,14 +1150,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.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
this.needsUpdate = true;
readFromNBT(packet.func_148857_g());
}
// IDebuggable
@@ -35,11 +35,11 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory
}
/*@Override
public void onInventoryChanged()
public void markDirty()
{
if (inventory[0] == null)
inventory[1] = null;
super.onInventoryChanged();
super.markDirty();
}*/
@Override
@@ -7,12 +7,12 @@ import mantle.blocks.abstracts.InventoryLogic;
import mantle.blocks.iface.IMasterLogic;
import mantle.blocks.iface.IServantLogic;
import mantle.world.CoordTuple;
import mantle.world.WorldHelper;
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.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
@@ -71,7 +71,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
}
@Override
public String getDefaultName ()
protected String getDefaultName ()
{
return null; //Not a gui block
}
@@ -107,7 +107,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
@Override
public void invalidateMaster (IMasterLogic master, World world, int xMaster, int yMaster, int zMaster)
{
WorldHelper.setBlockToAir(world, xCoord, yCoord, zCoord);
world.setBlockToAir(xCoord, yCoord, zCoord);
}
@Override
@@ -137,7 +137,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
//DELETE
public void updateEntity ()
{
WorldHelper.setBlockToAir(worldObj, xCoord, yCoord, zCoord);
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
}
//Keep TE regardless of metadata
@@ -165,7 +165,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
@Override
public void writeToNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
super.writeToNBT(tags);
writeNetworkNBT(tags);
multitank.writeToNBT(tags);
}
@@ -179,9 +179,9 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
@Override
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
{
readNetworkNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
readNetworkNBT(packet.func_148857_g());
}
@Override
@@ -191,7 +191,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 +213,5 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
public void openInventory ()
{
}
}
@@ -256,7 +256,7 @@ public class TileEntityLandmine extends TileEntity implements IInventory
{
if (shouldUpdateLogic)
{
worldObj.func_147479_m(xCoord, yCoord, zCoord);
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
shouldUpdateLogic = false;
}
if (soundcountything > 0)
@@ -55,7 +55,8 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory
return new ToolStationContainer(inventoryplayer, this);
}
public void onInventoryChanged ()
@Override
public void markDirty ()
{
buildTool(toolName);
if (this.worldObj != null)
@@ -1335,7 +1335,7 @@ public class TRecipes
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.detector_rail), 0, TConstruct.ingotLiquidValue);
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.activator_rail), 0, TConstruct.ingotLiquidValue);
Smeltery.addMelting(FluidType.Obsidian, new ItemStack(Blocks.enchanting_table), 0, TConstruct.ingotLiquidValue * 4);
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.cauldron), 0, TConstruct.ingotLiquidValue * 7);
//Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.cauldron), 0, TConstruct.ingotLiquidValue * 7);
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.anvil, 1, 0), 200, TConstruct.ingotLiquidValue * 31);
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.anvil, 1, 1), 200, TConstruct.ingotLiquidValue * 31);
Smeltery.addMelting(FluidType.Iron, new ItemStack(Blocks.anvil, 1, 2), 200, TConstruct.ingotLiquidValue * 31);
@@ -1372,6 +1372,9 @@ 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 ()
@@ -24,4 +24,4 @@ public class ActiveContainer extends Container
return slot;
}
}
}
@@ -126,7 +126,7 @@ public class InventoryCraftingStation extends InventoryCrafting
/**
* Called when an the contents of an Inventory change, usually
*/
public void onInventoryChanged ()
public void markDirty ()
{
}
@@ -96,7 +96,7 @@ public class InventoryCraftingStationResult extends InventoryCraftResult
/**
* Called when an the contents of an Inventory change, usually
*/
public void onInventoryChanged ()
public void markDirty ()
{
}
@@ -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,7 +224,7 @@ public class SmelteryContainer extends ActiveContainer
slot = (Slot) this.inventorySlots.get(slotPos);
slotStack = slot.getStack();
if (slotStack != null && slotStack == inputStack && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage())
if (slotStack != null && slotStack.getItem() == inputStack.getItem() && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage())
&& ItemStack.areItemStackTagsEqual(inputStack, slotStack))
{
int l = slotStack.stackSize + inputStack.stackSize;
@@ -294,4 +294,4 @@ public class SmelteryContainer extends ActiveContainer
return merged;
}
}
}
@@ -205,4 +205,4 @@ public class MultiFluidTank extends LogicComponent implements IFluidTank
tags.setTag("Liquids", taglist);
}
}
}
@@ -501,7 +501,7 @@ public class TankLayerScan extends LogicComponent
public void readFromNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
NBTTagList layerAir = tags.getTagList("AirLayer", 11);
NBTTagList layerAir = tags.getTagList("AirLayer", 9);
if (layerAir != null)
{
layerAirCoords.clear();
@@ -513,7 +513,7 @@ public class TankLayerScan extends LogicComponent
}
}
NBTTagList blocks = tags.getTagList("Blocks", 11);
NBTTagList blocks = tags.getTagList("Blocks", 9);
if (blocks != null)
{
blockCoords.clear();
@@ -525,7 +525,7 @@ public class TankLayerScan extends LogicComponent
}
}
NBTTagList air = tags.getTagList("Air", 11);
NBTTagList air = tags.getTagList("Air", 9);
if (air != null)
{
airCoords.clear();
@@ -5,6 +5,7 @@ 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;
@@ -71,9 +72,47 @@ public class Smeltery
*/
public static void addMelting (ItemStack input, Item item, int metadata, int temperature, FluidStack liquid)
{
//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));
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.