Removed APIProxy.java, merged functionality into CoreProxy.java.

This commit is contained in:
SirSengir 2012-08-04 12:37:55 +02:00
parent 4e30d97f63
commit 686bde08b3
54 changed files with 231 additions and 269 deletions

View file

@ -1,55 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api;
import java.util.Random;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ModLoader;
import net.minecraft.src.World;
import net.minecraft.src.WorldClient;
public class APIProxy {
public static boolean isClient(World world) {
return world instanceof WorldClient;
}
public static boolean isServerSide() {
return false;
}
public static boolean isRemote() {
return ModLoader.getMinecraftInstance().theWorld.isRemote;
}
public static void removeEntity(Entity entity) {
entity.setDead();
if (entity.worldObj instanceof WorldClient)
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId);
}
public static Random createNewRandom(World world) {
return new Random(world.getSeed());
}
public static EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
@Override
public void func_6420_o() {
// TODO Auto-generated method stub
}
};
}
}

View file

@ -3,7 +3,6 @@ package buildcraft.builders;
import java.io.IOException;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.builders.IBuilderHook;
import buildcraft.core.BptPlayerIndex;
import buildcraft.core.BptRootIndex;
@ -15,7 +14,7 @@ public class ClientBuilderHook implements IBuilderHook {
@Override
public void rootIndexInitialized(BptRootIndex rootBptIndex) throws IOException {
if (!APIProxy.isServerSide() && !APIProxy.isClient(ModLoader.getMinecraftInstance().theWorld)) {
if (!CoreProxy.isServerSide() && !CoreProxy.isClient(ModLoader.getMinecraftInstance().theWorld)) {
// If we're on a SSP game, then pre-load the player list
BptPlayerIndex playerIndex = new BptPlayerIndex(CoreProxy.playerName() + ".list", rootBptIndex);

View file

@ -11,12 +11,14 @@ package buildcraft.core;
import java.io.File;
import java.util.Arrays;
import java.util.Random;
import buildcraft.core.ItemBlockBuildCraft;
import buildcraft.core.network.BuildCraftPacket;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IBlockAccess;
@ -27,6 +29,7 @@ import net.minecraft.src.ModLoader;
import net.minecraft.src.Packet;
import net.minecraft.src.StringTranslate;
import net.minecraft.src.World;
import net.minecraft.src.WorldClient;
import net.minecraft.src.forge.MinecraftForgeClient;
import net.minecraft.src.forge.NetworkMod;
import cpw.mods.fml.client.SpriteHelper;
@ -102,4 +105,46 @@ public class CoreProxy {
MinecraftForgeClient.bindTexture(texture);
}
/* FORMER API PROXY */
public static boolean isClient(World world) {
return world instanceof WorldClient;
}
public static boolean isServerSide() {
return false;
}
public static boolean isRemote() {
return ModLoader.getMinecraftInstance().theWorld.isRemote;
}
public static void removeEntity(Entity entity) {
entity.setDead();
if (entity.worldObj instanceof WorldClient)
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId);
}
public static Random createNewRandom(World world) {
return new Random(world.getSeed());
}
/* BUILDCRAFT PLAYER */
private static EntityPlayer buildCraftPlayer;
private static EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
@Override
public void func_6420_o() {}
};
}
public static EntityPlayer getBuildCraftPlayer(World world) {
if (CoreProxy.buildCraftPlayer == null) {
CoreProxy.buildCraftPlayer = createNewPlayer(world);
}
return CoreProxy.buildCraftPlayer;
}
}

View file

@ -28,7 +28,8 @@ public class GuiAutoCrafting extends GuiBuildCraft {
@Override
public void onGuiClosed() {
super.onGuiClosed();
inventorySlots.onCraftGuiClosed(mc.thePlayer);
if (this.mc.thePlayer != null)
inventorySlots.onCraftGuiClosed(mc.thePlayer);
}
@Override

View file

@ -17,7 +17,6 @@ import net.minecraft.src.ItemStack;
import org.lwjgl.opengl.GL11;
import buildcraft.api.APIProxy;
import buildcraft.api.recipes.AssemblyRecipe;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
@ -72,7 +71,7 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
updateRecipes();
// Request current selection from server
if(APIProxy.isRemote())
if(CoreProxy.isRemote())
CoreProxy.sendToServer(new PacketCoordinates(PacketIds.SELECTION_ASSEMBLY_GET, assemblyTable.xCoord,
assemblyTable.yCoord, assemblyTable.zCoord).getPacket());
}
@ -154,7 +153,7 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
ContainerAssemblyTable container = (ContainerAssemblyTable) inventorySlots;
if (APIProxy.isRemote()) {
if (CoreProxy.isRemote()) {
PacketPayload payload = TileAssemblyTable.selectionMessageWrapper.toPayload(container.x, container.y,
container.z, message);

View file

@ -14,7 +14,6 @@ import net.minecraft.src.ItemStack;
import org.lwjgl.opengl.GL11;
import buildcraft.api.APIProxy;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiAdvancedInterface;
@ -93,7 +92,7 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
filterInventory.setInventorySlotContents(position, newStack);
if (APIProxy.isRemote()) {
if (CoreProxy.isRemote()) {
PacketSlotChange packet = new PacketSlotChange(PacketIds.DIAMOND_PIPE_SELECT, filterInventory.xCoord,
filterInventory.yCoord, filterInventory.zCoord, position, newStack);
CoreProxy.sendToServer(packet.getPacket());

View file

@ -1,45 +0,0 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api;
import java.util.Random;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
public class APIProxy {
public static boolean isClient(World world) {
return false;
}
public static boolean isServerSide() {
return true;
}
public static boolean isRemote() {
return false;
}
public static void removeEntity(Entity entity) {
entity.setDead();
}
public static Random createNewRandom(World world) {
return new Random(world.getSeed());
}
public static EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
};
}
}

View file

@ -10,10 +10,12 @@
package buildcraft.core;
import java.io.File;
import java.util.Random;
import buildcraft.core.network.BuildCraftPacket;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EntityPlayerMP;
@ -105,4 +107,43 @@ public class CoreProxy {
public static void BindTexture(String texture) {
}
/* FORMER API PROXY */
public static boolean isClient(World world) {
return false;
}
public static boolean isServerSide() {
return true;
}
public static boolean isRemote() {
return false;
}
public static void removeEntity(Entity entity) {
entity.setDead();
}
public static Random createNewRandom(World world) {
return new Random(world.getSeed());
}
/* BUILDCRAFT PLAYER */
private static EntityPlayer buildCraftPlayer;
private static EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
};
}
public static EntityPlayer getBuildCraftPlayer(World world) {
if (CoreProxy.buildCraftPlayer == null) {
CoreProxy.buildCraftPlayer = createNewPlayer(world);
}
return CoreProxy.buildCraftPlayer;
}
}

View file

@ -9,12 +9,10 @@
package buildcraft.api.core;
import buildcraft.api.APIProxy;
import buildcraft.api.blueprints.BlueprintManager;
import buildcraft.api.blueprints.BptBlock;
import net.minecraft.src.Block;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
public class BuildCraftAPI {
@ -24,8 +22,6 @@ public class BuildCraftAPI {
public static final int LAST_ORIGINAL_ITEM = 126;
public static boolean[] softBlocks = new boolean[Block.blocksList.length];
private static EntityPlayer buildCraftPlayer;
/**
* Return true if the block given in parameter is pass through (e.g. air,
* water...)
@ -53,14 +49,6 @@ public class BuildCraftAPI {
world.setBlockWithNotify(x, y, z, 0);
}
public static EntityPlayer getBuildCraftPlayer(World world) {
if (buildCraftPlayer == null) {
buildCraftPlayer = APIProxy.createNewPlayer(world);
}
return buildCraftPlayer;
}
static {
for (int i = 0; i < softBlocks.length; ++i) {
softBlocks[i] = false;

View file

@ -9,25 +9,25 @@ import net.minecraft.src.World;
public abstract class PipeManager {
public static TreeMap<Integer, IPipedItem> allEntities = new TreeMap<Integer, IPipedItem>();
public static List<IExtractionHandler> extractionHandlers = new ArrayList<IExtractionHandler>();
public static void registerExtractionHandler(IExtractionHandler handler) {
extractionHandlers.add(handler);
}
public static boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) {
for(IExtractionHandler handler : extractionHandlers)
if(!handler.canExtractItems(pipe, world, i, j, k))
return false;
return true;
}
public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
for(IExtractionHandler handler : extractionHandlers)
if(!handler.canExtractLiquids(pipe, world, i, j, k))
return false;
return true;
}
public static List<IExtractionHandler> extractionHandlers = new ArrayList<IExtractionHandler>();
public static void registerExtractionHandler(IExtractionHandler handler) {
extractionHandlers.add(handler);
}
public static boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) {
for(IExtractionHandler handler : extractionHandlers)
if(!handler.canExtractItems(pipe, world, i, j, k))
return false;
return true;
}
public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
for(IExtractionHandler handler : extractionHandlers)
if(!handler.canExtractLiquids(pipe, world, i, j, k))
return false;
return true;
}
}

View file

@ -12,10 +12,10 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -92,7 +92,7 @@ public class BlockArchitect extends BlockContainer implements ITextureProvider {
return true;
} else {
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.ARCHITECT_TABLE, world, i, j, k);
return true;

View file

@ -12,7 +12,7 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
@ -47,7 +47,7 @@ public class BlockBlueprintLibrary extends BlockContainer implements ITexturePro
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k);
if (!tile.locked || entityplayer.username.equals(tile.owner))
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k);
return true;

View file

@ -12,10 +12,10 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -105,7 +105,7 @@ public class BlockBuilder extends BlockContainer implements ITextureProvider {
return true;
} else {
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BUILDER, world, i, j, k);
return true;

View file

@ -12,8 +12,8 @@ package buildcraft.builders;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -51,7 +51,7 @@ public class BlockFiller extends BlockContainer implements ITextureProvider {
if (entityplayer.isSneaking())
return false;
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.FILLER, world, i, j, k);
return true;

View file

@ -11,6 +11,7 @@ package buildcraft.builders;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IBox;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
@ -63,7 +64,7 @@ public class FillerFlattener extends FillerPattern {
}
if (lastX != Integer.MAX_VALUE && stackToPlace != null) {
stackToPlace.getItem().onItemUse(stackToPlace, BuildCraftAPI.getBuildCraftPlayer(tile.worldObj), tile.worldObj,
stackToPlace.getItem().onItemUse(stackToPlace, CoreProxy.getBuildCraftPlayer(tile.worldObj), tile.worldObj,
lastX, lastY - 1, lastZ, 1);
}

View file

@ -14,6 +14,7 @@ import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IBox;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.CoreProxy;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
@ -65,7 +66,7 @@ public abstract class FillerPattern implements IFillerPattern {
}
if (found && stackToPlace != null) {
stackToPlace.getItem().onItemUse(stackToPlace, BuildCraftAPI.getBuildCraftPlayer(world), world, xSlot, ySlot - 1,
stackToPlace.getItem().onItemUse(stackToPlace, CoreProxy.getBuildCraftPlayer(world), world, xSlot, ySlot - 1,
zSlot, 1);
}

View file

@ -10,7 +10,6 @@
package buildcraft.builders;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Orientations;
@ -19,6 +18,7 @@ import buildcraft.core.BptBase;
import buildcraft.core.BptBlueprint;
import buildcraft.core.BptContext;
import buildcraft.core.BptTemplate;
import buildcraft.core.CoreProxy;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.Utils;
import buildcraft.core.network.PacketUpdate;
@ -72,7 +72,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
}
}
if (!APIProxy.isClient(worldObj) && box.isInitialized()) {
if (!CoreProxy.isClient(worldObj) && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
}

View file

@ -14,7 +14,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
@ -30,6 +29,7 @@ import buildcraft.core.BptBuilderBase;
import buildcraft.core.BptBuilderBlueprint;
import buildcraft.core.BptBuilderTemplate;
import buildcraft.core.BptContext;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityLaser;
import buildcraft.core.EntityRobot;
@ -280,7 +280,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
@Override
public void doWork() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}
@ -589,7 +589,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
box.deleteLasers();
box.reset();
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}

View file

@ -10,7 +10,6 @@
package buildcraft.builders;
import buildcraft.BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Orientations;
@ -25,6 +24,7 @@ import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.core.ActionMachineControl;
import buildcraft.core.Box;
import buildcraft.core.CoreProxy;
import buildcraft.core.IMachine;
import buildcraft.core.StackUtil;
import buildcraft.core.TileBuildCraft;
@ -64,7 +64,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
public void initialize() {
super.initialize();
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
IAreaProvider a = Utils.getNearbyAreaProvider(worldObj, xCoord, yCoord, zCoord);
if (a != null) {
@ -74,7 +74,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
((TileMarker) a).removeFromWorld();
}
if (!APIProxy.isClient(worldObj) && box.isInitialized()) {
if (!CoreProxy.isClient(worldObj) && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
}
sendNetworkUpdate();
@ -103,7 +103,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
@Override
public void doWork() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}
@ -157,7 +157,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
}
public void computeRecipe() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}
@ -186,7 +186,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
currentPatternId = currentPattern.getId();
}
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
}

View file

@ -10,10 +10,10 @@
package buildcraft.builders;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.APIProxy;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Position;
import buildcraft.core.CoreProxy;
import buildcraft.core.EntityBlock;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.Utils;
@ -93,7 +93,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
if (signals != null) {
for (EntityBlock b : signals) {
if (b != null) {
APIProxy.removeEntity(b);
CoreProxy.removeEntity(b);
}
}
@ -124,7 +124,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
}
}
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
}
@ -153,7 +153,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
}
public void tryConnection() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}
@ -240,7 +240,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
if (lasers != null) {
for (EntityBlock entity : lasers) {
if (entity != null) {
APIProxy.removeEntity(entity);
CoreProxy.removeEntity(entity);
}
}
}
@ -394,7 +394,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
signals = null;
if (APIProxy.isServerSide() && markerOrigin != null && markerOrigin != this) {
if (CoreProxy.isServerSide() && markerOrigin != null && markerOrigin != this) {
markerOrigin.sendNetworkUpdate();
}
}

View file

@ -4,9 +4,9 @@ package buildcraft.builders;
import java.util.LinkedList;
import java.util.TreeSet;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Position;
import buildcraft.core.BlockIndex;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityLaser;
@ -55,7 +55,7 @@ public class TilePathMarker extends TileMarker {
public void createLaserAndConnect(TilePathMarker pathMarker) {
if (APIProxy.isClient(worldObj))
if (CoreProxy.isClient(worldObj))
return;
EntityLaser laser = new EntityLaser(worldObj, new Position(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5), new Position(pathMarker.xCoord + 0.5, pathMarker.yCoord + 0.5, pathMarker.zCoord + 0.5));

View file

@ -12,7 +12,6 @@ package buildcraft.core;
import java.util.ArrayList;
import java.util.List;
import buildcraft.api.APIProxy;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.IBox;
import buildcraft.api.core.LaserKind;
@ -219,7 +218,7 @@ public class Box implements IBox {
if (lasers != null) {
for (EntityBlock b : lasers)
APIProxy.removeEntity(b);
CoreProxy.removeEntity(b);
lasers = null;
}

View file

@ -13,7 +13,6 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Position;
import net.minecraft.src.Entity;
@ -91,7 +90,7 @@ public class EntityLaser extends Entity implements ISpawnHandler {
if (head == null || tail == null)
return;
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
updateData();
}

View file

@ -11,7 +11,6 @@ package buildcraft.core;
import java.util.TreeMap;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.core.SafeTimeTracker;
@ -289,7 +288,7 @@ public class EntityPassiveItem implements IPipedItem {
*/
@Override
public EntityItem toEntityItem(Orientations dir) {
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
if (getItemStack().stackSize <= 0) {
return null;
}

View file

@ -16,7 +16,6 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import buildcraft.api.APIProxy;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Position;
@ -197,7 +196,7 @@ public class EntityRobot extends Entity implements ISpawnHandler {
BptSlot target = a.slot;
if (wait <= 0) {
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
if (target.mode == Mode.ClearIfInvalid) {
@ -208,7 +207,7 @@ public class EntityRobot extends Entity implements ISpawnHandler {
worldObj.setBlockWithNotify(target.x, target.y, target.z, 0);
target.stackToUse.getItem().onItemUse(target.stackToUse,
BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1,
CoreProxy.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1,
target.z, 1);
} else {

View file

@ -13,7 +13,6 @@ import java.util.Arrays;
import java.util.LinkedList;
import buildcraft.BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Orientations;
@ -376,7 +375,7 @@ public class Utils {
public static void preDestroyBlock(World world, int i, int j, int k) {
TileEntity tile = world.getBlockTileEntity(i, j, k);
if (tile instanceof IInventory && !APIProxy.isClient(world))
if (tile instanceof IInventory && !CoreProxy.isClient(world))
if (!(tile instanceof IDropControlInventory) || ((IDropControlInventory) tile).doDrop())
dropItems(world, (IInventory) tile, i, j, k);

View file

@ -14,9 +14,9 @@ import java.util.Random;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftEnergy;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CoreProxy;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
@ -91,12 +91,12 @@ public class BlockEngine extends BlockContainer {
return false;
if (tile.engine instanceof EngineStone) {
if (!APIProxy.isClient(tile.worldObj))
if (!CoreProxy.isClient(tile.worldObj))
entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_STONE, world, i, j, k);
return true;
} else if (tile.engine instanceof EngineIron) {
if (!APIProxy.isClient(tile.worldObj))
if (!CoreProxy.isClient(tile.worldObj))
entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_IRON, world, i, j, k);
return true;
}

View file

@ -9,9 +9,9 @@
package buildcraft.energy;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.liquids.LiquidTank;
import buildcraft.core.CoreProxy;
import buildcraft.core.network.TileNetworkData;
import buildcraft.energy.ContainerEngine;
import net.minecraft.src.ICrafting;
@ -58,7 +58,7 @@ public abstract class Engine {
}
public final EnergyStage getEnergyStage() {
if (!APIProxy.isClient(tile.worldObj)) {
if (!CoreProxy.isClient(tile.worldObj)) {
computeEnergyStage();
}

View file

@ -13,7 +13,7 @@ import java.util.Random;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.APIProxy;
import buildcraft.core.CoreProxy;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
@ -29,7 +29,7 @@ public class OilPopulate {
}
if (rand == null) {
rand = APIProxy.createNewRandom(world);
rand = CoreProxy.createNewRandom(world);
}
BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(x, z);

View file

@ -13,7 +13,6 @@ import java.util.LinkedList;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.gates.IOverrideDefaultTriggers;
@ -28,6 +27,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.core.CoreProxy;
import buildcraft.core.IBuilderInventory;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.network.PacketUpdate;
@ -68,7 +68,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
@Override
public void initialize() {
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
if (engine == null) {
createEngineIfNeeded();
}
@ -87,7 +87,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
return;
}
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
if (progressPart != 0) {
engine.progress += serverPistonSpeed;
@ -364,7 +364,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
@Override
public void doWork() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}

View file

@ -12,8 +12,8 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.api.APIProxy;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.CoreProxy;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
@ -58,7 +58,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
}
}
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.AUTO_CRAFTING_TABLE, world, i, j, k);
return true;

View file

@ -4,8 +4,8 @@ import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.api.APIProxy;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.CoreProxy;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
@ -61,7 +61,7 @@ public class BlockHopper extends BlockBuildCraft {
}
}
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityPlayer.openGui(mod_BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z);
return true;

View file

@ -13,11 +13,11 @@ import java.util.ArrayList;
import buildcraft.BuildCraftFactory;
import buildcraft.mod_BuildCraftEnergy;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.Box;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
@ -135,7 +135,7 @@ public class BlockQuarry extends BlockMachineRoot implements ITextureProvider {
@Override
public void onBlockRemoval(World world, int i, int j, int k) {
if (APIProxy.isRemote()){
if (CoreProxy.isRemote()){
return;
}

View file

@ -13,13 +13,13 @@ import java.util.ArrayList;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftFactory;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.liquids.LiquidManager;
import buildcraft.api.liquids.LiquidStack;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CoreProxy;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -119,7 +119,7 @@ public class BlockRefinery extends BlockContainer {
}
}
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.REFINERY, world, i, j, k);
return true;

View file

@ -8,7 +8,6 @@
*/
package buildcraft.factory;
import buildcraft.api.APIProxy;
import buildcraft.core.BuildCraftContainer;
import buildcraft.core.CoreProxy;
import buildcraft.core.network.PacketIds;
@ -54,7 +53,7 @@ public class ContainerRefinery extends BuildCraftContainer {
refinery.setFilter(slot, liquidId);
if (APIProxy.isRemote()) {
if (CoreProxy.isRemote()) {
PacketPayload payload = new PacketPayload(3, 0, 0);
payload.intPayload[0] = slot;
payload.intPayload[1] = liquidId;

View file

@ -1,8 +1,8 @@
package buildcraft.factory;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.inventory.ISpecialInventory;
import buildcraft.core.CoreProxy;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.utils.InventoryUtil;
import buildcraft.core.utils.SidedInventoryAdapter;
@ -37,7 +37,7 @@ public class TileHopper extends TileBuildCraft implements IInventory {
@Override
public void updateEntity() {
super.updateEntity();
if (APIProxy.isClient(worldObj) || worldObj.getWorldTime() % 5 != 0)
if (CoreProxy.isClient(worldObj) || worldObj.getWorldTime() % 5 != 0)
return;
int internalSlot = _internalInventory.getIdForFirstSlot();
if (internalSlot < 0)

View file

@ -14,7 +14,6 @@ import java.util.TreeMap;
import java.util.TreeSet;
import buildcraft.BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
@ -25,6 +24,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.core.BlockIndex;
import buildcraft.core.CoreProxy;
import buildcraft.core.EntityBlock;
import buildcraft.core.IMachine;
import buildcraft.core.Utils;
@ -67,13 +67,13 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor {
return;
}
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
if (tube.posY - aimY > 0.01) {
tubeY = tube.posY - 0.01;
setTubePosition();
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
@ -98,7 +98,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor {
internalLiquid = internalLiquid += BuildCraftAPI.BUCKET_VOLUME;
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
}
@ -161,7 +161,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor {
worldObj.spawnEntityInWorld(tube);
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
}
@ -352,7 +352,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor {
@Override
public void destroy() {
if (tube != null) {
APIProxy.removeEntity(tube);
CoreProxy.removeEntity(tube);
tube = null;
tubeY = Double.NaN;
aimY = 0;

View file

@ -14,7 +14,6 @@ import java.util.List;
import buildcraft.BuildCraftBlockUtil;
import buildcraft.BuildCraftFactory;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
@ -28,6 +27,7 @@ import buildcraft.core.Box;
import buildcraft.core.BptBlueprint;
import buildcraft.core.BptBuilderBase;
import buildcraft.core.BptBuilderBlueprint;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultAreaProvider;
import buildcraft.core.EntityRobot;
import buildcraft.core.IBuilderInventory;
@ -83,7 +83,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
public void createUtilsIfNeeded() {
if (!box.isInitialized() && APIProxy.isClient(worldObj)) {
if (!box.isInitialized() && CoreProxy.isClient(worldObj)) {
return;
}
@ -169,7 +169,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
speed = arm.speed;
}
if (APIProxy.isServerSide()) {
if (CoreProxy.isServerSide()) {
sendNetworkUpdate();
}
@ -249,7 +249,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
public boolean findTarget(boolean doSet) {
if (APIProxy.isClient(worldObj))
if (CoreProxy.isClient(worldObj))
return false;
boolean[][] blockedColumns = new boolean[bluePrintBuilder.bluePrint.sizeX - 2][bluePrintBuilder.bluePrint.sizeZ - 2];
@ -378,7 +378,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
public void positionReached(EntityMechanicalArm arm) {
inProcess = false;
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
return;
}
@ -417,7 +417,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
continue;
if (entity.item.stackSize <= 0)
continue;
APIProxy.removeEntity(entity);
CoreProxy.removeEntity(entity);
mineStack(entity.item);
}
}
@ -611,7 +611,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
public void initialize() {
super.initialize();
if (!APIProxy.isClient(worldObj)) {
if (!CoreProxy.isClient(worldObj)) {
createUtilsIfNeeded();
}

View file

@ -10,7 +10,6 @@
package buildcraft.factory;
import buildcraft.BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
@ -23,6 +22,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.api.recipes.RefineryRecipe;
import buildcraft.core.CoreProxy;
import buildcraft.core.IMachine;
import buildcraft.core.network.TileNetworkData;
import net.minecraft.src.Container;
@ -166,9 +166,9 @@ public class TileRefinery extends TileMachine implements ITankContainer, IPowerR
@Override
public void updateEntity() {
if (APIProxy.isClient(worldObj)) {
if (CoreProxy.isClient(worldObj)) {
simpleAnimationIterate();
} else if (APIProxy.isServerSide() && updateNetworkTime.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) {
} else if (CoreProxy.isServerSide() && updateNetworkTime.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) {
sendNetworkUpdate();
}

View file

@ -9,7 +9,6 @@
package buildcraft.factory;
import buildcraft.BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
@ -17,6 +16,7 @@ import buildcraft.api.liquids.ILiquidTank;
import buildcraft.api.liquids.ITankContainer;
import buildcraft.api.liquids.LiquidStack;
import buildcraft.api.liquids.LiquidTank;
import buildcraft.core.CoreProxy;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.network.PacketPayload;
import buildcraft.core.network.PacketUpdate;
@ -34,12 +34,12 @@ public class TileTank extends TileBuildCraft implements ITankContainer
@Override
public void updateEntity()
{
if(APIProxy.isServerSide() && hasUpdate && tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) {
if(CoreProxy.isServerSide() && hasUpdate && tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) {
sendNetworkUpdate();
hasUpdate = false;
}
if(APIProxy.isRemote()) {
if(CoreProxy.isRemote()) {
return;
}

View file

@ -3,7 +3,7 @@ package buildcraft.silicon;
import java.util.ArrayList;
import buildcraft.mod_BuildCraftSilicon;
import buildcraft.api.APIProxy;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -48,7 +48,7 @@ public class BlockAssemblyTable extends BlockContainer implements ITextureProvid
if (entityplayer.isSneaking())
return false;
if (!APIProxy.isClient(world))
if (!CoreProxy.isClient(world))
entityplayer.openGui(mod_BuildCraftSilicon.instance, GuiIds.ASSEMBLY_TABLE, world, i, j, k);
return true;
}

View file

@ -11,7 +11,6 @@ package buildcraft.silicon;
import java.util.LinkedList;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.core.SafeTimeTracker;
@ -20,6 +19,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.core.BlockIndex;
import buildcraft.core.CoreProxy;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.network.TileNetworkData;
@ -165,7 +165,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor {
protected void createLaser() {
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
return;
laser = new EntityEnergyLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord, yCoord, zCoord));

View file

@ -14,10 +14,10 @@ import java.util.Random;
import java.util.TreeMap;
import buildcraft.BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.tools.IToolWrench;
import buildcraft.api.transport.IPipe;
import buildcraft.core.BlockIndex;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.Utils;
@ -218,7 +218,7 @@ public class BlockGenericPipe extends BlockContainer implements ITextureProvider
@Override
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int dmg) {
if (APIProxy.isClient(world))
if (CoreProxy.isClient(world))
return;
int i1 = quantityDropped(world.rand);
@ -362,7 +362,7 @@ public class BlockGenericPipe extends BlockContainer implements ITextureProvider
// Try to strip wires first, starting with yellow.
for (IPipe.WireColor color : IPipe.WireColor.values())
if (pipe.wireSet[color.reverse().ordinal()]) {
if (!APIProxy.isRemote())
if (!CoreProxy.isRemote())
dropWire(color.reverse(), pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord);
pipe.wireSet[color.reverse().ordinal()] = false;
//pipe.worldObj.markBlockNeedsUpdate(pipe.xCoord, pipe.yCoord, pipe.zCoord);
@ -372,7 +372,7 @@ public class BlockGenericPipe extends BlockContainer implements ITextureProvider
// Try to strip gate next
if (pipe.hasGate()) {
if (!APIProxy.isRemote())
if (!CoreProxy.isRemote())
pipe.gate.dropGate(pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord);
pipe.resetGate();
return true;

View file

@ -12,7 +12,6 @@ package buildcraft.transport;
import java.util.Iterator;
import java.util.LinkedList;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
@ -63,7 +62,7 @@ public class CraftingGateInterface extends BuildCraftContainer {
// Do not attempt to create a list of potential actions and triggers on
// the client.
if (!APIProxy.isRemote()) {
if (!CoreProxy.isRemote()) {
_potentialActions.addAll(pipe.getActions());
_potentialTriggers.addAll(ActionManager.getPipeTriggers(pipe));
@ -201,13 +200,13 @@ public class CraftingGateInterface extends BuildCraftContainer {
*/
public void synchronize() {
if (!isNetInitialized && APIProxy.isRemote()) {
if (!isNetInitialized && CoreProxy.isRemote()) {
isNetInitialized = true;
CoreProxy.sendToServer(new PacketCoordinates(PacketIds.GATE_REQUEST_INIT, pipe.xCoord, pipe.yCoord, pipe.zCoord)
.getPacket());
}
if (!isSynchronized && APIProxy.isRemote()) {
if (!isSynchronized && CoreProxy.isRemote()) {
isSynchronized = true;
CoreProxy.sendToServer(new PacketCoordinates(PacketIds.GATE_REQUEST_SELECTION, pipe.xCoord, pipe.yCoord, pipe.zCoord)
.getPacket());
@ -376,13 +375,13 @@ public class CraftingGateInterface extends BuildCraftContainer {
public void setTrigger(int position, ITrigger trigger, boolean notify) {
pipe.setTrigger(position, trigger);
if (APIProxy.isRemote() && notify)
if (CoreProxy.isRemote() && notify)
sendSelectionChange(position);
}
public void setTriggerParameter(int position, ITriggerParameter parameter, boolean notify) {
pipe.setTriggerParameter(position, parameter);
if (APIProxy.isRemote() && notify)
if (CoreProxy.isRemote() && notify)
sendSelectionChange(position);
}
@ -405,7 +404,7 @@ public class CraftingGateInterface extends BuildCraftContainer {
public void setAction(int position, IAction action, boolean notify) {
pipe.setAction(position, action);
if (APIProxy.isRemote() && notify)
if (CoreProxy.isRemote() && notify)
sendSelectionChange(position);
}

View file

@ -4,13 +4,13 @@ import java.util.LinkedList;
import buildcraft.BuildCraftTransport;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.gates.Action;
import buildcraft.api.gates.IAction;
import buildcraft.api.gates.ITrigger;
import buildcraft.api.gates.Trigger;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.transport.IPipe;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.Utils;
@ -64,7 +64,7 @@ public class GateVanilla extends Gate {
// GUI
@Override
public void openGui(EntityPlayer player) {
if (!APIProxy.isClient(player.worldObj))
if (!CoreProxy.isClient(player.worldObj))
player.openGui(mod_BuildCraftTransport.instance, GuiIds.GATES, pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord);
}

View file

@ -15,7 +15,6 @@ import java.util.Map;
import java.util.Random;
import buildcraft.BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
@ -29,6 +28,7 @@ import buildcraft.api.gates.Trigger;
import buildcraft.api.gates.TriggerParameter;
import buildcraft.api.transport.IPipe;
import buildcraft.core.ActionRedstoneOutput;
import buildcraft.core.CoreProxy;
import buildcraft.core.IDropControlInventory;
import buildcraft.core.Utils;
import buildcraft.core.network.IndexInPayload;
@ -177,7 +177,7 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
}
// Do not try to update gates client side.
if(APIProxy.isRemote())
if(CoreProxy.isRemote())
return;
if (actionTracker.markTimeIfDelay(worldObj, 10))

View file

@ -11,7 +11,6 @@ package buildcraft.transport;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.inventory.ISpecialInventory;
@ -44,7 +43,7 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
if (Block.blocksList[entityplayer.getCurrentEquippedItem().itemID] instanceof BlockGenericPipe)
return false;
if (!APIProxy.isClient(container.worldObj))
if (!CoreProxy.isClient(container.worldObj))
entityplayer.openGui(mod_BuildCraftTransport.instance, GuiIds.PIPE_DIAMOND, container.worldObj, container.xCoord,
container.yCoord, container.zCoord);
@ -55,7 +54,7 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
@Override
public void updateEntity() {
if (tracker.markTimeIfDelay(worldObj, 20 * BuildCraftCore.updateFactor))
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
sendFilterSet();
}
@ -97,7 +96,7 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
public ItemStack decrStackSize(int i, int j) {
ItemStack stack = filters.decrStackSize(i, j);
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
sendFilterSet();
return stack;
@ -107,7 +106,7 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
public void setInventorySlotContents(int i, ItemStack itemstack) {
filters.setInventorySlotContents(i, itemstack);
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
sendFilterSet();
}

View file

@ -10,12 +10,12 @@
package buildcraft.transport;
import buildcraft.BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.liquids.ITankContainer;
import buildcraft.api.tools.IToolWrench;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.PipeManager;
import buildcraft.core.CoreProxy;
import buildcraft.core.Utils;
import buildcraft.transport.pipes.PipeLiquidsVoid;
import buildcraft.transport.pipes.PipeLiquidsWood;
@ -87,7 +87,7 @@ public class PipeLogicWood extends PipeLogic {
public void initialize() {
super.initialize();
if (!APIProxy.isClient(worldObj))
if (!CoreProxy.isClient(worldObj))
switchSourceIfNeeded();
}
@ -108,7 +108,7 @@ public class PipeLogicWood extends PipeLogic {
public void onNeighborBlockChange(int blockId) {
super.onNeighborBlockChange(blockId);
if (!APIProxy.isClient(worldObj))
if (!CoreProxy.isClient(worldObj))
switchSourceIfNeeded();
}

View file

@ -18,7 +18,6 @@ import java.util.Vector;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.mod_BuildCraftTransport;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.gates.ITrigger;
@ -92,7 +91,7 @@ public class PipeTransportItems extends PipeTransport {
if (container.pipe instanceof IPipeTransportItemsHook)
((IPipeTransportItemsHook) container.pipe).entityEntered(item, orientation);
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
if (item.getSynchroTracker().markTimeIfDelay(worldObj, 6 * BuildCraftCore.updateFactor))
CoreProxy.sendToPlayers(createItemPacket(item, orientation), worldObj, xCoord, yCoord, zCoord,
DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftTransport.instance);
@ -250,7 +249,7 @@ public class PipeTransportItems extends PipeTransport {
} else if (tile instanceof IInventory) {
StackUtil utils = new StackUtil(data.item.getItemStack());
if (!APIProxy.isClient(worldObj))
if (!CoreProxy.isClient(worldObj))
if (utils.checkAvailableSlot((IInventory) tile, true, data.orientation.reverse()) && utils.items.stackSize == 0)
data.item.remove();
else {
@ -353,7 +352,7 @@ public class PipeTransportItems extends PipeTransport {
else {
int i;
if (APIProxy.isClient(worldObj) || APIProxy.isServerSide())
if (CoreProxy.isClient(worldObj) || CoreProxy.isServerSide())
{
i = Math.abs(data.item.getEntityId() + xCoord + yCoord + zCoord + data.item.getDeterministicRandomization())
% listOfPossibleMovements.size();

View file

@ -11,7 +11,6 @@ package buildcraft.transport;
import buildcraft.BuildCraftCore;
import buildcraft.mod_BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
@ -180,7 +179,7 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
@Override
public void updateEntity() {
if (APIProxy.isClient(worldObj))
if (CoreProxy.isClient(worldObj))
return;
moveLiquids();
@ -215,7 +214,7 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
}
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
if (tracker.markTimeIfDelay(worldObj, 1 * BuildCraftCore.updateFactor)){
PacketLiquidUpdate packet = new PacketLiquidUpdate(xCoord, yCoord, zCoord);

View file

@ -14,7 +14,6 @@ import net.minecraft.src.TileEntity;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.mod_BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.gates.ITrigger;
@ -54,7 +53,7 @@ public class PipeTransportPower extends PipeTransport {
@Override
public void updateEntity() {
if (APIProxy.isClient(worldObj))
if (CoreProxy.isClient(worldObj))
return;
step();
@ -152,7 +151,7 @@ public class PipeTransportPower extends PipeTransport {
}
}
if (APIProxy.isServerSide())
if (CoreProxy.isServerSide())
if (tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)){
PacketPowerUpdate packet = new PacketPowerUpdate(xCoord, yCoord, zCoord);

View file

@ -14,7 +14,6 @@ import java.util.LinkedList;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.mod_BuildCraftCore;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.core.SafeTimeTracker;

View file

@ -10,7 +10,6 @@ package buildcraft.transport.pipes;
import java.util.List;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.power.IPowerProvider;
@ -18,6 +17,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.api.transport.IPipedItem;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityPassiveItem;
import buildcraft.core.Utils;
@ -202,7 +202,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
}
public void pullItemIntoPipe(Entity entity, int distance) {
if (APIProxy.isClient(worldObj))
if (CoreProxy.isClient(worldObj))
return;
Orientations orientation = getOpenOrientation().reverse();
@ -223,7 +223,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
if (distance == 0 || energyUsed / distance == item.item.stackSize) {
stack = item.item;
APIProxy.removeEntity(entity);
CoreProxy.removeEntity(entity);
} else
stack = item.item.splitStack((int) (energyUsed / distance));
@ -235,7 +235,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
} else if (entity instanceof EntityArrow) {
powerProvider.useEnergy(distance, distance, true);
stack = new ItemStack(Item.arrow, 1);
APIProxy.removeEntity(entity);
CoreProxy.removeEntity(entity);
}
IPipedItem passive = new EntityPassiveItem(worldObj, xCoord + 0.5, yCoord + Utils.getPipeFloorOf(stack),

View file

@ -13,7 +13,6 @@ import java.util.TreeMap;
import buildcraft.BuildCraftBlockUtil;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.power.IPowerProvider;
@ -21,6 +20,7 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.power.PowerProvider;
import buildcraft.api.transport.IPipedItem;
import buildcraft.core.CoreProxy;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityPassiveItem;
import buildcraft.core.Utils;
@ -94,12 +94,12 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, IPower
if (convertPipe(pipe, data))
BuildCraftTransport.pipeItemsStipes.onItemUse(new ItemStack(BuildCraftTransport.pipeItemsStipes),
BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, (int) p.y - 1, (int) p.z, 1);
CoreProxy.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, (int) p.y - 1, (int) p.z, 1);
else if (worldObj.getBlockId((int) p.x, (int) p.y, (int) p.z) == 0)
data.item.getItemStack().getItem().onItemUse(data.item.getItemStack(), BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x,
data.item.getItemStack().getItem().onItemUse(data.item.getItemStack(), CoreProxy.getBuildCraftPlayer(worldObj), worldObj, (int) p.x,
(int) p.y - 1, (int) p.z, 1);
else
data.item.getItemStack().getItem().onItemUse(data.item.getItemStack(), BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x,
data.item.getItemStack().getItem().onItemUse(data.item.getItemStack(), CoreProxy.getBuildCraftPlayer(worldObj), worldObj, (int) p.x,
(int) p.y, (int) p.z, 1);
}