getWorld -> getWorldObj, remove IPowerReceptor from engines as it was not used

This commit is contained in:
Adrian Siekierka 2014-11-07 08:30:09 +01:00
parent 8f709f680f
commit 8e561241f5
10 changed files with 18 additions and 37 deletions

View file

@ -218,7 +218,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
}
private void initializeComputing() {
if (getWorld().isRemote) {
if (getWorldObj().isRemote) {
return;
}

View file

@ -411,7 +411,7 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid
}
}
if (dropBlueprint) {
InvUtils.dropItems(getWorld(), getStackInSlot(0), xCoord, yCoord, zCoord);
InvUtils.dropItems(getWorldObj(), getStackInSlot(0), xCoord, yCoord, zCoord);
}
setInventorySlotContents(0, null);
@ -586,7 +586,7 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid
iterateBpt(false);
if (getWorld().getWorldInfo().getGameType() == GameType.CREATIVE) {
if (getWorldObj().getWorldInfo().getGameType() == GameType.CREATIVE) {
build();
} else {
if (getBattery().getEnergyStored() > POWER_ACTIVATION) {

View file

@ -78,7 +78,7 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
if (currentPattern != null && currentTemplate == null) {
currentTemplate = currentPattern
.getTemplateBuilder(box, getWorld());
.getTemplateBuilder(box, getWorldObj());
context = currentTemplate.getContext();
}
@ -121,7 +121,7 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
}
if (currentPattern != null && currentTemplate == null) {
currentTemplate = currentPattern.getTemplateBuilder(box, getWorld());
currentTemplate = currentPattern.getTemplateBuilder(box, getWorldObj());
context = currentTemplate.getContext();
}

View file

@ -142,7 +142,7 @@ public class TilePathMarker extends TileMarker {
tryingToConnect = false;
sendNetworkUpdate();
getWorld().markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord,
getWorldObj().markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord,
xCoord, yCoord, zCoord);
}
}

2
common/buildcraft/commander/TileZonePlan.java Executable file → Normal file
View file

@ -150,7 +150,7 @@ public class TileZonePlan extends TileBuildCraft implements IInventory {
int color = 0;
for (int y = getWorld().getHeight() - 1; y >= 0; --y) {
for (int y = getWorldObj().getHeight() - 1; y >= 0; --y) {
if (!chunk.getBlock(cx, y, cz).isAir(worldObj, x, y, z)) {
color = chunk.getBlock(cx, y, cz).getMapColor(0).colorIndex;
break;

View file

@ -48,7 +48,7 @@ public class RecursiveBlueprintReader {
ItemStack stack = architect.getStackInSlot(0);
if (stack != null && stack.getItem() instanceof ItemBlueprint && architect.box.isInitialized()) {
blockScanner = new BlockScanner(architect.box, architect.getWorld(), SCANNER_ITERATION);
blockScanner = new BlockScanner(architect.box, architect.getWorldObj(), SCANNER_ITERATION);
if (stack.getItem() instanceof ItemBlueprintStandard) {
writingBlueprint = new Blueprint(architect.box.sizeX(), architect.box.sizeY(), architect.box.sizeZ());
@ -56,7 +56,7 @@ public class RecursiveBlueprintReader {
writingBlueprint = new Template(architect.box.sizeX(), architect.box.sizeY(), architect.box.sizeZ());
}
writingContext = writingBlueprint.getContext(architect.getWorld(), architect.box);
writingContext = writingBlueprint.getContext(architect.getWorldObj(), architect.box);
writingContext.readConfiguration = architect.readConfiguration;
writingBlueprint.id.name = architect.name;
@ -74,7 +74,7 @@ public class RecursiveBlueprintReader {
architect = iArchitect;
if (architect.box.isInitialized()) {
blockScanner = new BlockScanner(architect.box, architect.getWorld(), SCANNER_ITERATION);
blockScanner = new BlockScanner(architect.box, architect.getWorldObj(), SCANNER_ITERATION);
if (parentBlueprint instanceof Blueprint) {
writingBlueprint = new Blueprint(architect.box.sizeX(), architect.box.sizeY(), architect.box.sizeZ());
@ -82,7 +82,7 @@ public class RecursiveBlueprintReader {
writingBlueprint = new Template(architect.box.sizeX(), architect.box.sizeY(), architect.box.sizeZ());
}
writingContext = writingBlueprint.getContext(architect.getWorld(), architect.box);
writingContext = writingBlueprint.getContext(architect.getWorldObj(), architect.box);
writingContext.readConfiguration = architect.readConfiguration;
writingBlueprint.id.name = architect.name;
@ -99,7 +99,7 @@ public class RecursiveBlueprintReader {
} else if (currentSubReader == null && subIndex < architect.subBlueprints.size()) {
BlockIndex subBlock = architect.subBlueprints.get(subIndex);
TileEntity subTile = architect.getWorld().getTileEntity(subBlock.x, subBlock.y,
TileEntity subTile = architect.getWorldObj().getTileEntity(subBlock.x, subBlock.y,
subBlock.z);
if (subTile instanceof TileArchitect) {
@ -116,7 +116,7 @@ public class RecursiveBlueprintReader {
} else if (subTile instanceof TileBuilder) {
TileBuilder builder = (TileBuilder) subTile;
blueprint = ItemBlueprint.loadBlueprint(builder.getStackInSlot(0));
orientation = ForgeDirection.values()[architect.getWorld().getBlockMetadata(subBlock.x, subBlock.y,
orientation = ForgeDirection.values()[architect.getWorldObj().getBlockMetadata(subBlock.x, subBlock.y,
subBlock.z)].getOpposite();
}
@ -143,7 +143,7 @@ public class RecursiveBlueprintReader {
currentSubReader.architect.yCoord - architect.getBox().yMin,
currentSubReader.architect.zCoord - architect.getBox().zMin,
ForgeDirection.values()[
currentSubReader.architect.getWorld().getBlockMetadata(
currentSubReader.architect.getWorldObj().getBlockMetadata(
currentSubReader.architect.xCoord,
currentSubReader.architect.yCoord,
currentSubReader.architect.zCoord)].getOpposite());
@ -171,7 +171,7 @@ public class RecursiveBlueprintReader {
writingBlueprint.translateToBlueprint(transform);
ForgeDirection o = ForgeDirection.values()[architect.getWorld().getBlockMetadata(
ForgeDirection o = ForgeDirection.values()[architect.getWorldObj().getBlockMetadata(
architect.xCoord, architect.yCoord, architect.zCoord)].getOpposite();
writingBlueprint.rotate = architect.readConfiguration.rotate;

View file

@ -53,7 +53,7 @@ public class BoardRobotBuilder extends RedstoneBoardRobot {
double minDistance = Double.MAX_VALUE;
for (TileConstructionMarker marker : TileConstructionMarker.currentMarkers) {
if (marker.getWorld() == robot.worldObj && marker.needsToBuild()) {
if (marker.getWorldObj() == robot.worldObj && marker.needsToBuild()) {
double dx = robot.posX - marker.xCoord;
double dy = robot.posY - marker.yCoord;
double dz = robot.posZ - marker.zCoord;

5
common/buildcraft/energy/TileEnergyEmitter.java Executable file → Normal file
View file

@ -191,11 +191,6 @@ public class TileEnergyEmitter extends TileBuildCraft {
}
}
@Override
public World getWorld() {
return worldObj;
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
double xMin = xCoord;

View file

@ -29,7 +29,7 @@ import buildcraft.core.TileBuffer;
import buildcraft.core.TileBuildCraft;
import buildcraft.energy.gui.ContainerEngine;
public abstract class TileEngine extends TileBuildCraft implements IPowerReceptor, IPowerEmitter,
public abstract class TileEngine extends TileBuildCraft implements IPowerEmitter,
IPipeConnection, IEnergyHandler {
// Index corresponds to metadata
public static final ResourceLocation[] BASE_TEXTURES = new ResourceLocation[]{
@ -80,7 +80,6 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
protected int progressPart = 0;
protected boolean lastPower = false;
protected PowerHandler powerHandler;
private boolean checkOrientation = false;
private TileBuffer[] tileCache;
@ -89,14 +88,11 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
private boolean isPumping = false; // Used for SMP synch
public TileEngine() {
powerHandler = new PowerHandler(this, Type.ENGINE);
powerHandler.configurePowerPerdition(1, 100);
}
@Override
public void initialize() {
if (!worldObj.isRemote) {
powerHandler.configure(minEnergyReceived() / 10, maxEnergyReceived() / 10, 1, getMaxEnergy() / 10);
checkRedstonePower();
}
}
@ -457,16 +453,6 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
/* STATE INFORMATION */
public abstract boolean isBurning();
@Override
public PowerReceiver getPowerReceiver(ForgeDirection side) {
return powerHandler.getPowerReceiver();
}
@Override
public void doWork(PowerHandler workProvider) {
}
public void addEnergy(int addition) {
energy += addition;

View file

@ -46,7 +46,7 @@ public class TileEngineCreative extends TileEngine {
@Override
public boolean onBlockActivated(EntityPlayer player, ForgeDirection side) {
if (!getWorld().isRemote) {
if (!getWorldObj().isRemote) {
Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(player, xCoord, yCoord, zCoord)) {