mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-27 23:45:48 +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
@@ -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 ()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user