mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 03:25:10 +00:00
remove redundant classes that are in mantle, use mantle's implementations
This commit is contained in:
1 parent
a181dc9dcf
commit
b57eb8bed1
21 files changed
+87
-239
No files matched your search
@@ -12,7 +12,7 @@ import tconstruct.blocks.logic.FurnaceLogic;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import mantle.blocks.abstracts.InventorySlab;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
|
||||
public class FurnaceSlab extends InventorySlab
|
||||
|
||||
@@ -2,6 +2,7 @@ package tconstruct.blocks.component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -14,7 +15,6 @@ import tconstruct.blocks.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.library.component.LogicComponent;
|
||||
import tconstruct.library.component.MultiFluidTank;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
|
||||
public class SmelteryComponent extends LogicComponent
|
||||
{
|
||||
@@ -138,14 +138,14 @@ public class SmelteryComponent extends LogicComponent
|
||||
if (activeLavaTank == null || fuelTicks > 0 || structure.lavaTanks.size() < 1)
|
||||
return;
|
||||
|
||||
if (!world.blockExists(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z))
|
||||
if (!world.blockExists(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z()))
|
||||
{
|
||||
fuelAmount = 0;
|
||||
fuelGague = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tankContainer = world.getBlockTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z);
|
||||
TileEntity tankContainer = world.getBlockTileEntity(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z());
|
||||
if (tankContainer == null)
|
||||
{
|
||||
fuelAmount = 0;
|
||||
@@ -182,7 +182,7 @@ public class SmelteryComponent extends LogicComponent
|
||||
while (!foundTank)
|
||||
{
|
||||
CoordTuple possibleTank = structure.lavaTanks.get(iter);
|
||||
TileEntity newTankContainer = world.getBlockTileEntity(possibleTank.x, possibleTank.y, possibleTank.z);
|
||||
TileEntity newTankContainer = world.getBlockTileEntity(possibleTank.x(), possibleTank.y(), possibleTank.z());
|
||||
if (newTankContainer instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack newliquid = ((IFluidHandler) newTankContainer).drain(ForgeDirection.UNKNOWN, drainFuelAmount(), false);
|
||||
@@ -276,6 +276,6 @@ public class SmelteryComponent extends LogicComponent
|
||||
tags.setIntArray("Melting", meltingTemps);
|
||||
tags.setInteger("Fuel", fuelAmount);
|
||||
if (activeLavaTank != null)
|
||||
tags.setIntArray("LavaTank", new int[] { activeLavaTank.x, activeLavaTank.y, activeLavaTank.z });
|
||||
tags.setIntArray("LavaTank", new int[] { activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z() });
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package tconstruct.blocks.component;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagIntArray;
|
||||
@@ -11,7 +12,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.component.TankLayerScan;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
|
||||
public class SmelteryScan extends TankLayerScan
|
||||
@@ -71,10 +71,10 @@ public class SmelteryScan extends TankLayerScan
|
||||
{
|
||||
for (CoordTuple coord : airCoords)
|
||||
{
|
||||
if (world.getBlockId(coord.x, coord.y, coord.z) != TRepo.tankAir.blockID)
|
||||
if (world.getBlockId(coord.x(), coord.y(), coord.z()) != TRepo.tankAir.blockID)
|
||||
{
|
||||
world.setBlock(coord.x, coord.y, coord.z, TRepo.tankAir.blockID);
|
||||
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
world.setBlock(coord.x(), coord.y(), coord.z(), TRepo.tankAir.blockID);
|
||||
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
servant.verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class SmelteryScan extends TankLayerScan
|
||||
super.invalidateStructure();
|
||||
for (CoordTuple coord : airCoords)
|
||||
{
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
@@ -98,10 +98,10 @@ public class SmelteryScan extends TankLayerScan
|
||||
{
|
||||
for (CoordTuple coord : airCoords)
|
||||
{
|
||||
if (coord.y < height)
|
||||
if (coord.y() < height)
|
||||
continue;
|
||||
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class SmelteryScan extends TankLayerScan
|
||||
while (i.hasNext())
|
||||
{
|
||||
CoordTuple coord = (CoordTuple) i.next();
|
||||
TileEntity te = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity te = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (te != null && te instanceof IServantLogic)
|
||||
{
|
||||
((IServantLogic) te).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
@@ -151,7 +151,7 @@ public class SmelteryScan extends TankLayerScan
|
||||
NBTTagList tanks = new NBTTagList();
|
||||
for (CoordTuple coord : lavaTanks)
|
||||
{
|
||||
tanks.appendTag(new NBTTagIntArray("coord", new int[] { coord.x, coord.y, coord.z }));
|
||||
tanks.appendTag(new NBTTagIntArray("coord", new int[] { coord.x(), coord.y(), coord.z() }));
|
||||
}
|
||||
tags.setTag("Tanks", tanks);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.fill(from, resource, doFill);
|
||||
}
|
||||
return 0;
|
||||
@@ -48,7 +48,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
// TConstruct.logger.info("Attempting drain " + hasValidMaster());
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
// TConstruct.logger.info("Found master");
|
||||
return smeltery.drain(from, maxDrain, doDrain);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.drain(from, resource, doDrain);
|
||||
}
|
||||
return null;
|
||||
@@ -71,7 +71,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster())
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.getFillState() < 2;
|
||||
}
|
||||
return false;
|
||||
@@ -82,7 +82,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster())
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.getFillState() > 0;
|
||||
}
|
||||
return false;
|
||||
@@ -93,7 +93,7 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster() && (from == getForgeDirection() || from == getForgeDirection().getOpposite() || from == ForgeDirection.UNKNOWN))
|
||||
{
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
AdaptiveSmelteryLogic smeltery = (AdaptiveSmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -32,8 +32,8 @@ import tconstruct.library.blocks.AdaptiveInventoryLogic;
|
||||
import tconstruct.library.component.IComponentHolder;
|
||||
import tconstruct.library.component.LogicComponent;
|
||||
import tconstruct.library.component.MultiFluidTank;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
|
||||
@@ -285,7 +285,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
CoordTuple air = structure.getAirByIndex(slot);
|
||||
if (air != null)
|
||||
{
|
||||
TileEntity te = worldObj.getBlockTileEntity(air.x, air.y, air.z);
|
||||
TileEntity te = worldObj.getBlockTileEntity(air.x(), air.y(), air.z());
|
||||
if (te != null && te instanceof TankAirLogic)
|
||||
{
|
||||
((TankAirLogic) te).setInventorySlotContents(0, itemstack);
|
||||
@@ -306,7 +306,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
{
|
||||
//Base calculations per liquid
|
||||
LiquidData data = new LiquidData(fluid.amount, size);
|
||||
int baseY = structure.airCoords.get(0).y;
|
||||
int baseY = structure.airCoords.get(0).y();
|
||||
int layerSize = structure.getAirLayerSize();
|
||||
|
||||
//Calculate where to distribute liquids
|
||||
@@ -314,7 +314,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
{
|
||||
LiquidDataInstance instance;
|
||||
CoordTuple coord = structure.airCoords.get(i);
|
||||
int height = 16 * (coord.y - baseY);
|
||||
int height = 16 * (coord.y() - baseY);
|
||||
int position = i % layerSize;
|
||||
|
||||
if (!airUpdates.containsKey(coord))
|
||||
@@ -407,7 +407,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
{
|
||||
Map.Entry pairs = (Map.Entry) iter.next();
|
||||
CoordTuple coord = (CoordTuple) pairs.getKey();
|
||||
TileEntity te = worldObj.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity te = worldObj.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (te instanceof TankAirLogic)
|
||||
{
|
||||
((TankAirLogic) te).overrideFluids(((LiquidDataInstance) pairs.getValue()).fluids);
|
||||
@@ -420,7 +420,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
public void updateAir ()
|
||||
{
|
||||
for (CoordTuple loc : structure.airCoords)
|
||||
worldObj.markBlockForUpdate(loc.x, loc.y, loc.z);
|
||||
worldObj.markBlockForUpdate(loc.x(), loc.y(), loc.z());
|
||||
}
|
||||
|
||||
class LiquidData
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.inventory.FrypanContainer;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import tconstruct.inventory.FurnaceContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
if (!hasMaster)
|
||||
return false;
|
||||
|
||||
if (worldObj.getBlockId(master.x, master.y, master.z) == masterID && worldObj.getBlockMetadata(master.x, master.y, master.z) == masterMeat)
|
||||
if (worldObj.getBlockId(master.x(), master.y(), master.z()) == masterID && worldObj.getBlockMetadata(master.x(), master.y(), master.z()) == masterMeat)
|
||||
return true;
|
||||
|
||||
else
|
||||
@@ -71,7 +71,7 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
@Deprecated
|
||||
public boolean setMaster (int x, int y, int z)
|
||||
{
|
||||
if (!hasMaster || worldObj.getBlockId(master.x, master.y, master.z) != masterID || (worldObj.getBlockMetadata(master.x, master.y, master.z) != masterMeat))
|
||||
if (!hasMaster || worldObj.getBlockId(master.x(), master.y(), master.z()) != masterID || (worldObj.getBlockMetadata(master.x(), master.y(), master.z()) != masterMeat))
|
||||
{
|
||||
overrideMaster(x, y, z);
|
||||
return true;
|
||||
@@ -113,7 +113,7 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
{
|
||||
if (hasValidMaster())
|
||||
{
|
||||
IMasterLogic logic = (IMasterLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
IMasterLogic logic = (IMasterLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
logic.notifyChange(this, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -137,9 +137,9 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
tags.setBoolean("TiedToMaster", hasMaster);
|
||||
if (hasMaster)
|
||||
{
|
||||
tags.setInteger("xCenter", master.x);
|
||||
tags.setInteger("yCenter", master.y);
|
||||
tags.setInteger("zCenter", master.z);
|
||||
tags.setInteger("xCenter", master.x());
|
||||
tags.setInteger("yCenter", master.y());
|
||||
tags.setInteger("zCenter", master.z());
|
||||
tags.setShort("MasterID", masterID);
|
||||
tags.setByte("masterMeat", masterMeat);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (doFill)
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.fill(resource, doFill);
|
||||
}
|
||||
else
|
||||
@@ -48,7 +48,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.drain(maxDrain, doDrain);
|
||||
}
|
||||
else
|
||||
@@ -79,7 +79,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
boolean containsFluid = fluid == null;
|
||||
if (fluid != null)
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
for (FluidStack fstack : smeltery.moltenMetal)
|
||||
{
|
||||
if (fstack.fluidID == fluid.getID())
|
||||
@@ -98,7 +98,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
{
|
||||
if (hasValidMaster() && (from == getForgeDirection() || from == getForgeDirection().getOpposite() || from == ForgeDirection.UNKNOWN))
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x(), master.y(), master.z());
|
||||
return smeltery.getMultiTankInfo();
|
||||
//return new FluidTankInfo[] { smeltery.getInfo() };
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.SmelteryContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
import tconstruct.util.SmelteryDamageSource;
|
||||
@@ -306,7 +306,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
|
||||
void detectEntities ()
|
||||
{
|
||||
AxisAlignedBB box = AxisAlignedBB.getAABBPool().getAABB(centerPos.x, centerPos.y, centerPos.z, centerPos.x + 1.0D, centerPos.y + 1.0D, centerPos.z + 1.0D).expand(1.0D, 0.0D, 1.0D);
|
||||
AxisAlignedBB box = AxisAlignedBB.getAABBPool().getAABB(centerPos.x(), centerPos.y(), centerPos.z(), centerPos.x() + 1.0D, centerPos.y() + 1.0D, centerPos.z() + 1.0D).expand(1.0D, 0.0D, 1.0D);
|
||||
|
||||
List list = worldObj.getEntitiesWithinAABB(Entity.class, box);
|
||||
for (Object o : list)
|
||||
@@ -522,14 +522,14 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (activeLavaTank == null || useTime > 0)
|
||||
return;
|
||||
|
||||
if (!worldObj.blockExists(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z))
|
||||
if (!worldObj.blockExists(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z()))
|
||||
{
|
||||
fuelAmount = 0;
|
||||
fuelGague = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tankContainer = worldObj.getBlockTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z);
|
||||
TileEntity tankContainer = worldObj.getBlockTileEntity(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z());
|
||||
if (tankContainer == null)
|
||||
{
|
||||
fuelAmount = 0;
|
||||
@@ -563,14 +563,14 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (activeLavaTank == null || useTime > 0)
|
||||
return;
|
||||
|
||||
if (!worldObj.blockExists(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z))
|
||||
if (!worldObj.blockExists(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z()))
|
||||
{
|
||||
fuelAmount = 0;
|
||||
fuelGague = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tankContainer = worldObj.getBlockTileEntity(activeLavaTank.x, activeLavaTank.y, activeLavaTank.z);
|
||||
TileEntity tankContainer = worldObj.getBlockTileEntity(activeLavaTank.x(), activeLavaTank.y(), activeLavaTank.z());
|
||||
if (tankContainer == null)
|
||||
{
|
||||
fuelAmount = 0;
|
||||
@@ -607,7 +607,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
while (!foundTank)
|
||||
{
|
||||
CoordTuple possibleTank = lavaTanks.get(iter);
|
||||
TileEntity newTankContainer = worldObj.getBlockTileEntity(possibleTank.x, possibleTank.y, possibleTank.z);
|
||||
TileEntity newTankContainer = worldObj.getBlockTileEntity(possibleTank.x(), possibleTank.y(), possibleTank.z());
|
||||
if (newTankContainer instanceof IFluidHandler)
|
||||
{
|
||||
//TConstruct.logger.info("Tank: "+possibleTank.toString());
|
||||
@@ -1113,7 +1113,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (centerPos == null)
|
||||
center = new int[] { xCoord, yCoord, zCoord };
|
||||
else
|
||||
center = new int[] { centerPos.x, centerPos.y, centerPos.z };
|
||||
center = new int[] { centerPos.x(), centerPos.y(), centerPos.z() };
|
||||
tags.setIntArray("CenterPos", center);
|
||||
|
||||
tags.setByte("Direction", direction);
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.component.TankAirComponent;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.util.CoordTuple;
|
||||
import mantle.world.CoordTuple;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.library.blocks.AdaptiveInventoryLogic;
|
||||
import tconstruct.library.util.IActiveLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
|
||||
SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z);
|
||||
if (logic.validStructure)
|
||||
{
|
||||
int posX = logic.centerPos.x - 1, posY = logic.centerPos.y, posZ = logic.centerPos.z - 1;
|
||||
int posX = logic.centerPos.x() - 1, posY = logic.centerPos.y(), posZ = logic.centerPos.z() - 1;
|
||||
//Melting
|
||||
if (logic.getSizeInventory() > 0)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package tconstruct.library.component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.util.*;
|
||||
import tconstruct.library.util.IMasterLogic;
|
||||
import tconstruct.library.util.IServantLogic;
|
||||
import mantle.world.*;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
|
||||
public class TankLayerScan extends LogicComponent
|
||||
@@ -149,7 +152,7 @@ public class TankLayerScan extends LogicComponent
|
||||
|
||||
for (CoordTuple coord : blockCoords)
|
||||
{
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
@@ -265,7 +268,7 @@ public class TankLayerScan extends LogicComponent
|
||||
{
|
||||
if (checkAir(x + offset[0], y, z + offset[1]))
|
||||
{
|
||||
addAirBlock(coord.x, y, coord.z);
|
||||
addAirBlock(coord.x(), y, coord.z());
|
||||
floodTest(x + offset[0], y, z + offset[1]);
|
||||
}
|
||||
else if (!blockCoords.contains(coord) && checkServant(x + offset[0], y, z + offset[1]))
|
||||
@@ -284,18 +287,18 @@ public class TankLayerScan extends LogicComponent
|
||||
if (i.hasNext())
|
||||
{
|
||||
CoordTuple coord = (CoordTuple) i.next();
|
||||
if (checkAir(coord.x, y, coord.z))
|
||||
if (checkAir(coord.x(), y, coord.z()))
|
||||
{
|
||||
boolean valid = true;
|
||||
addAirBlock(coord.x, y, coord.z); //Don't skip first one
|
||||
addAirBlock(coord.x(), y, coord.z()); //Don't skip first one
|
||||
|
||||
//Air blocks
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
if (checkAir(coord.x, y, coord.z))
|
||||
if (checkAir(coord.x(), y, coord.z()))
|
||||
{
|
||||
addAirBlock(coord.x, y, coord.z);
|
||||
addAirBlock(coord.x(), y, coord.z());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -309,8 +312,8 @@ public class TankLayerScan extends LogicComponent
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
if (checkServant(coord.x, y, coord.z))
|
||||
blockCoords.add(new CoordTuple(coord.x, y, coord.z));
|
||||
if (checkServant(coord.x(), y, coord.z()))
|
||||
blockCoords.add(new CoordTuple(coord.x(), y, coord.z()));
|
||||
|
||||
else
|
||||
{
|
||||
@@ -322,7 +325,7 @@ public class TankLayerScan extends LogicComponent
|
||||
if (valid)
|
||||
return recurseStructureDown(y - 1);
|
||||
}
|
||||
else if (checkServant(coord.x, y, coord.z))
|
||||
else if (checkServant(coord.x(), y, coord.z()))
|
||||
{
|
||||
//Bottom floor. All blocks, please vacate the elevator
|
||||
boolean valid = true;
|
||||
@@ -330,8 +333,8 @@ public class TankLayerScan extends LogicComponent
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
|
||||
if (checkServant(coord.x, y, coord.z))
|
||||
blockCoords.add(new CoordTuple(coord.x, y, coord.z));
|
||||
if (checkServant(coord.x(), y, coord.z()))
|
||||
blockCoords.add(new CoordTuple(coord.x(), y, coord.z()));
|
||||
|
||||
else
|
||||
{
|
||||
@@ -353,7 +356,7 @@ public class TankLayerScan extends LogicComponent
|
||||
if (i.hasNext())
|
||||
{
|
||||
CoordTuple coord = (CoordTuple) i.next();
|
||||
if (checkServant(coord.x, y, coord.z))
|
||||
if (checkServant(coord.x(), y, coord.z()))
|
||||
{
|
||||
boolean valid = true;
|
||||
|
||||
@@ -361,8 +364,8 @@ public class TankLayerScan extends LogicComponent
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
if (checkServant(coord.x, y, coord.z))
|
||||
blockCoords.add(new CoordTuple(coord.x, y, coord.z));
|
||||
if (checkServant(coord.x(), y, coord.z()))
|
||||
blockCoords.add(new CoordTuple(coord.x(), y, coord.z()));
|
||||
|
||||
else
|
||||
{
|
||||
@@ -378,9 +381,9 @@ public class TankLayerScan extends LogicComponent
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
if (checkAir(coord.x, y, coord.z))
|
||||
if (checkAir(coord.x(), y, coord.z()))
|
||||
{
|
||||
addAirBlock(coord.x, y, coord.z);
|
||||
addAirBlock(coord.x(), y, coord.z());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -411,7 +414,7 @@ public class TankLayerScan extends LogicComponent
|
||||
int height = -1;
|
||||
for (CoordTuple coord : blockCoords)
|
||||
{
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
boolean canPass = false;
|
||||
if (servant instanceof IServantLogic)
|
||||
{
|
||||
@@ -422,7 +425,7 @@ public class TankLayerScan extends LogicComponent
|
||||
if (!canPass)
|
||||
{
|
||||
System.out.println("Coord: " + coord);
|
||||
height = coord.y;
|
||||
height = coord.y();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -439,7 +442,7 @@ public class TankLayerScan extends LogicComponent
|
||||
if (structureTop == 0) //Workaround for missing data
|
||||
{
|
||||
for (CoordTuple coord : blockCoords)
|
||||
structureTop = coord.y;
|
||||
structureTop = coord.y();
|
||||
}
|
||||
structureTop = recurseStructureUp(structureTop + 1);
|
||||
finalizeStructure();
|
||||
@@ -451,7 +454,7 @@ public class TankLayerScan extends LogicComponent
|
||||
completeStructure = false;
|
||||
for (CoordTuple coord : blockCoords)
|
||||
{
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
@@ -462,10 +465,10 @@ public class TankLayerScan extends LogicComponent
|
||||
{
|
||||
for (CoordTuple coord : blockCoords)
|
||||
{
|
||||
if (coord.y < height)
|
||||
if (coord.y() < height)
|
||||
continue;
|
||||
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity servant = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
}
|
||||
@@ -478,7 +481,7 @@ public class TankLayerScan extends LogicComponent
|
||||
while (i.hasNext())
|
||||
{
|
||||
CoordTuple coord = (CoordTuple) i.next();
|
||||
TileEntity te = world.getBlockTileEntity(coord.x, coord.y, coord.z);
|
||||
TileEntity te = world.getBlockTileEntity(coord.x(), coord.y(), coord.z());
|
||||
if (te != null && te instanceof IServantLogic)
|
||||
{
|
||||
((IServantLogic) te).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
|
||||
@@ -544,21 +547,21 @@ public class TankLayerScan extends LogicComponent
|
||||
NBTTagList layerAir = new NBTTagList();
|
||||
for (CoordTuple coord : layerAirCoords)
|
||||
{
|
||||
layerAir.appendTag(new NBTTagIntArray("coord", new int[] { coord.x, coord.y, coord.z }));
|
||||
layerAir.appendTag(new NBTTagIntArray("coord", new int[] { coord.x(), coord.y(), coord.z() }));
|
||||
}
|
||||
tags.setTag("AirLayer", layerAir);
|
||||
|
||||
NBTTagList blocks = new NBTTagList();
|
||||
for (CoordTuple coord : blockCoords)
|
||||
{
|
||||
blocks.appendTag(new NBTTagIntArray("coord", new int[] { coord.x, coord.y, coord.z }));
|
||||
blocks.appendTag(new NBTTagIntArray("coord", new int[] { coord.x(), coord.y(), coord.z() }));
|
||||
}
|
||||
tags.setTag("Blocks", blocks);
|
||||
|
||||
NBTTagList air = new NBTTagList();
|
||||
for (CoordTuple coord : airCoords)
|
||||
{
|
||||
air.appendTag(new NBTTagIntArray("coord", new int[] { coord.x, coord.y, coord.z }));
|
||||
air.appendTag(new NBTTagIntArray("coord", new int[] { coord.x(), coord.y(), coord.z() }));
|
||||
}
|
||||
tags.setTag("Air", air);
|
||||
tags.setInteger("structureTop", structureTop);
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
public class CoordTuple implements Comparable
|
||||
{
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
|
||||
public CoordTuple(int posX, int posY, int posZ)
|
||||
{
|
||||
x = posX;
|
||||
y = posY;
|
||||
z = posZ;
|
||||
}
|
||||
|
||||
public CoordTuple(double posX, double posY, double posZ)
|
||||
{
|
||||
x = (int) Math.floor(posX);
|
||||
y = (int) Math.floor(posY);
|
||||
z = (int) Math.floor(posZ);
|
||||
}
|
||||
|
||||
public CoordTuple(CoordTuple tuple)
|
||||
{
|
||||
x = tuple.x;
|
||||
y = tuple.y;
|
||||
z = tuple.z;
|
||||
}
|
||||
|
||||
public boolean equalCoords (int posX, int posY, int posZ)
|
||||
{
|
||||
if (this.x == posX && this.y == posY && this.z == posZ)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals (Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
if (getClass() == obj.getClass())
|
||||
{
|
||||
CoordTuple coord = (CoordTuple) obj;
|
||||
if (this.x == coord.x && this.y == coord.y && this.z == coord.z)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode ()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + x;
|
||||
result = prime * result + y;
|
||||
result = prime * result + z;
|
||||
return result;
|
||||
}
|
||||
|
||||
public String toString ()
|
||||
{
|
||||
return "X: " + x + ", Y: " + y + ", Z: " + z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo (Object o)
|
||||
{
|
||||
if (o == null)
|
||||
throw new NullPointerException("Object cannot be null");
|
||||
|
||||
CoordTuple coord = (CoordTuple) o;
|
||||
|
||||
if (x < coord.x)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (x > coord.x)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (y < coord.y)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (y > coord.y)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (z < coord.z)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (z > coord.z)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
public class CoordTuplePair
|
||||
{
|
||||
public CoordTuple a;
|
||||
public CoordTuple b;
|
||||
|
||||
public CoordTuplePair(CoordTuple a, CoordTuple b)
|
||||
{
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
public CoordTuplePair(int aX, int aY, int aZ, int bX, int bY, int bZ)
|
||||
{
|
||||
this.a = new CoordTuple(aX, aY, aZ);
|
||||
this.b = new CoordTuple(bX, bY, bZ);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class CoordTupleSort implements Comparator
|
||||
{
|
||||
@Override
|
||||
public int compare (Object o1, Object o2)
|
||||
{
|
||||
CoordTuple c1 = (CoordTuple) o1;
|
||||
CoordTuple c2 = (CoordTuple) o2;
|
||||
|
||||
//Sort by y, then x, then z
|
||||
if (c1.y != c2.y)
|
||||
return c1.y - c2.y;
|
||||
|
||||
if (c1.x != c2.x)
|
||||
return c1.x - c2.x;
|
||||
|
||||
if (c1.z != c2.z)
|
||||
return c1.z - c2.z;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
public interface IActiveLogic
|
||||
{
|
||||
public boolean getActive ();
|
||||
|
||||
public void setActive (boolean flag);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IServantLogic
|
||||
|
||||
Reference in new issue
Block a user