diff --git a/src/main/java/tconstruct/blocks/component/SmelteryComponent.java b/src/main/java/tconstruct/blocks/component/SmelteryComponent.java index 779ab513..1df2885b 100644 --- a/src/main/java/tconstruct/blocks/component/SmelteryComponent.java +++ b/src/main/java/tconstruct/blocks/component/SmelteryComponent.java @@ -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 }); } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/component/SmelteryScan.java b/src/main/java/tconstruct/blocks/component/SmelteryScan.java index 0d794353..a9dea699 100644 --- a/src/main/java/tconstruct/blocks/component/SmelteryScan.java +++ b/src/main/java/tconstruct/blocks/component/SmelteryScan.java @@ -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(); diff --git a/src/main/java/tconstruct/blocks/component/TankAirComponent.java b/src/main/java/tconstruct/blocks/component/TankAirComponent.java index 703e9ac4..8bf1aede 100644 --- a/src/main/java/tconstruct/blocks/component/TankAirComponent.java +++ b/src/main/java/tconstruct/blocks/component/TankAirComponent.java @@ -20,4 +20,4 @@ public class TankAirComponent extends MultiFluidTank { fluidlist = fluids; } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/AdaptiveDrainLogic.java b/src/main/java/tconstruct/blocks/logic/AdaptiveDrainLogic.java index bea16041..04b7bbc1 100644 --- a/src/main/java/tconstruct/blocks/logic/AdaptiveDrainLogic.java +++ b/src/main/java/tconstruct/blocks/logic/AdaptiveDrainLogic.java @@ -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); } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/AdaptiveSmelteryLogic.java b/src/main/java/tconstruct/blocks/logic/AdaptiveSmelteryLogic.java index 8dd8cb7f..55c227dd 100644 --- a/src/main/java/tconstruct/blocks/logic/AdaptiveSmelteryLogic.java +++ b/src/main/java/tconstruct/blocks/logic/AdaptiveSmelteryLogic.java @@ -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 () { diff --git a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java index 48b402b0..d6453d67 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java @@ -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 diff --git a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java index d8510e2c..abd1192e 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java @@ -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) diff --git a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java index 2b531d01..e16ca186 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java @@ -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 } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java index f26160d2..cd5406d4 100644 --- a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java +++ b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java @@ -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) diff --git a/src/main/java/tconstruct/blocks/logic/FaucetLogic.java b/src/main/java/tconstruct/blocks/logic/FaucetLogic.java index cd0f3209..1e77b517 100644 --- a/src/main/java/tconstruct/blocks/logic/FaucetLogic.java +++ b/src/main/java/tconstruct/blocks/logic/FaucetLogic.java @@ -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 diff --git a/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java b/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java index ae7064bc..e6b6825f 100644 --- a/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java +++ b/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java @@ -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 diff --git a/src/main/java/tconstruct/blocks/logic/LavaTankLogic.java b/src/main/java/tconstruct/blocks/logic/LavaTankLogic.java index 0905d781..c33f98fc 100644 --- a/src/main/java/tconstruct/blocks/logic/LavaTankLogic.java +++ b/src/main/java/tconstruct/blocks/logic/LavaTankLogic.java @@ -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); } } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java b/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java index 5ab129e5..b26def6f 100644 --- a/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java +++ b/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java @@ -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); } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/RedwireLogic.java b/src/main/java/tconstruct/blocks/logic/RedwireLogic.java index b5ee6891..406e99da 100644 --- a/src/main/java/tconstruct/blocks/logic/RedwireLogic.java +++ b/src/main/java/tconstruct/blocks/logic/RedwireLogic.java @@ -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); } } diff --git a/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java b/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java index 639c4fb9..da0afbd0 100644 --- a/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java +++ b/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java @@ -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); } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java index d8249027..91ce0c6e 100644 --- a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java @@ -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 diff --git a/src/main/java/tconstruct/blocks/logic/StencilTableLogic.java b/src/main/java/tconstruct/blocks/logic/StencilTableLogic.java index c5251006..4f7fdcc0 100644 --- a/src/main/java/tconstruct/blocks/logic/StencilTableLogic.java +++ b/src/main/java/tconstruct/blocks/logic/StencilTableLogic.java @@ -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 diff --git a/src/main/java/tconstruct/blocks/logic/TankAirLogic.java b/src/main/java/tconstruct/blocks/logic/TankAirLogic.java index 32812e1b..d3049eab 100644 --- a/src/main/java/tconstruct/blocks/logic/TankAirLogic.java +++ b/src/main/java/tconstruct/blocks/logic/TankAirLogic.java @@ -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 () { } - + } diff --git a/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java b/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java index 1b5e8e9a..fb04371f 100644 --- a/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java +++ b/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java @@ -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) diff --git a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java index cb1a031a..0cf0f039 100644 --- a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java @@ -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) diff --git a/src/main/java/tconstruct/common/TRecipes.java b/src/main/java/tconstruct/common/TRecipes.java index f746cbae..62e928e8 100644 --- a/src/main/java/tconstruct/common/TRecipes.java +++ b/src/main/java/tconstruct/common/TRecipes.java @@ -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 () diff --git a/src/main/java/tconstruct/inventory/ActiveContainer.java b/src/main/java/tconstruct/inventory/ActiveContainer.java index a32e8b41..f770a638 100644 --- a/src/main/java/tconstruct/inventory/ActiveContainer.java +++ b/src/main/java/tconstruct/inventory/ActiveContainer.java @@ -24,4 +24,4 @@ public class ActiveContainer extends Container return slot; } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/inventory/InventoryCraftingStation.java b/src/main/java/tconstruct/inventory/InventoryCraftingStation.java index 0c30c8fb..98045d8b 100644 --- a/src/main/java/tconstruct/inventory/InventoryCraftingStation.java +++ b/src/main/java/tconstruct/inventory/InventoryCraftingStation.java @@ -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 () { } diff --git a/src/main/java/tconstruct/inventory/InventoryCraftingStationResult.java b/src/main/java/tconstruct/inventory/InventoryCraftingStationResult.java index e6fa0412..74817896 100644 --- a/src/main/java/tconstruct/inventory/InventoryCraftingStationResult.java +++ b/src/main/java/tconstruct/inventory/InventoryCraftingStationResult.java @@ -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 () { } diff --git a/src/main/java/tconstruct/inventory/SmelteryContainer.java b/src/main/java/tconstruct/inventory/SmelteryContainer.java index d5a55d44..549b8102 100644 --- a/src/main/java/tconstruct/inventory/SmelteryContainer.java +++ b/src/main/java/tconstruct/inventory/SmelteryContainer.java @@ -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; } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/library/component/MultiFluidTank.java b/src/main/java/tconstruct/library/component/MultiFluidTank.java index 8a56439d..e8a3c86c 100644 --- a/src/main/java/tconstruct/library/component/MultiFluidTank.java +++ b/src/main/java/tconstruct/library/component/MultiFluidTank.java @@ -205,4 +205,4 @@ public class MultiFluidTank extends LogicComponent implements IFluidTank tags.setTag("Liquids", taglist); } -} +} \ No newline at end of file diff --git a/src/main/java/tconstruct/library/component/TankLayerScan.java b/src/main/java/tconstruct/library/component/TankLayerScan.java index a9823aa9..8dc546b9 100644 --- a/src/main/java/tconstruct/library/component/TankLayerScan.java +++ b/src/main/java/tconstruct/library/component/TankLayerScan.java @@ -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(); diff --git a/src/main/java/tconstruct/library/crafting/Smeltery.java b/src/main/java/tconstruct/library/crafting/Smeltery.java index e572ed1f..7edec175 100644 --- a/src/main/java/tconstruct/library/crafting/Smeltery.java +++ b/src/main/java/tconstruct/library/crafting/Smeltery.java @@ -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.