Removed chunkloading on laser tree farm

This commit is contained in:
LemADEC 2015-07-29 23:29:23 +02:00
parent f641a83a9b
commit a286cf8103
3 changed files with 2 additions and 64 deletions

View file

@ -2,7 +2,7 @@ package cr0s.warpdrive.machines;
public abstract class TileEntityAbstractLaser extends WarpChunkTE public abstract class TileEntityAbstractLaser extends WarpEnergyTE
{ {
} }

View file

@ -10,9 +10,6 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidBlock;
import cr0s.warpdrive.PacketHandler; import cr0s.warpdrive.PacketHandler;
import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.WarpDrive;
@ -344,58 +341,6 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
return null; return null;
} }
protected void defineMiningArea(int xSize,int zSize)
{
int xmax, zmax, x1, x2, z1, z2;
int xmin, zmin;
x1 = xCoord + xSize / 2;
x2 = xCoord - xSize / 2;
if (x1 < x2)
{
xmin = x1;
xmax = x2;
}
else
{
xmin = x2;
xmax = x1;
}
z1 = zCoord + zSize / 2;
z2 = zCoord - zSize / 2;
if (z1 < z2)
{
zmin = z1;
zmax = z2;
}
else
{
zmin = z2;
zmax = z1;
}
defineMiningArea(xmin,zmin,xmax,zmax);
}
protected void defineMiningArea(int minX, int minZ, int maxX, int maxZ)
{
if(worldObj == null)
return;
ChunkCoordIntPair a = worldObj.getChunkFromBlockCoords(minX, minZ).getChunkCoordIntPair();
ChunkCoordIntPair b = worldObj.getChunkFromBlockCoords(maxX, maxZ).getChunkCoordIntPair();
if(minChunk != null && a.equals(minChunk))
if(maxChunk != null && b.equals(maxChunk))
return;
if(minChunk != null && b.equals(minChunk))
if(maxChunk != null && a.equals(maxChunk))
return;
minChunk = a;
maxChunk = b;
refreshLoading(true);
}
private static ItemStack copyWithSize(ItemStack itemStack, int newSize) private static ItemStack copyWithSize(ItemStack itemStack, int newSize)
{ {
ItemStack ret = itemStack.copy(); ItemStack ret = itemStack.copy();
@ -403,7 +348,7 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
return ret; return ret;
} }
//NBT DATA // NBT DATA
@Override @Override
public void readFromNBT(NBTTagCompound tag) public void readFromNBT(NBTTagCompound tag)
{ {

View file

@ -220,7 +220,6 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
super.readFromNBT(tag); super.readFromNBT(tag);
xSize = tag.getInteger("xSize"); xSize = tag.getInteger("xSize");
zSize = tag.getInteger("zSize"); zSize = tag.getInteger("zSize");
defineMiningArea(xSize,zSize);
doLeaves = tag.getBoolean("doLeaves"); doLeaves = tag.getBoolean("doLeaves");
active = tag.getBoolean("active"); active = tag.getBoolean("active");
@ -228,11 +227,6 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
silkTouchLeaves = tag.getBoolean("silkTouchLeaves"); silkTouchLeaves = tag.getBoolean("silkTouchLeaves");
} }
@Override
public boolean shouldChunkLoad() {
return active;
}
// OpenComputer callback methods // OpenComputer callback methods
// FIXME: implement OpenComputers... // FIXME: implement OpenComputers...
@ -262,7 +256,6 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
xSize = defSize; xSize = defSize;
zSize = defSize; zSize = defSize;
} }
defineMiningArea(xSize,zSize);
return new Integer[] { xSize , zSize }; return new Integer[] { xSize , zSize };
} else if (methodName.equals("leaves")) { } else if (methodName.equals("leaves")) {
try { try {