More API Pruning
This commit is contained in:
parent
da3aa8374b
commit
e9c0d29032
4 changed files with 20 additions and 46 deletions
|
@ -14,35 +14,8 @@ import net.minecraft.world.World;
|
|||
|
||||
public class BuildCraftAPI {
|
||||
|
||||
@Deprecated
|
||||
// To be removed, see LiquidContainerRegistry
|
||||
public static final int BUCKET_VOLUME = 1000;
|
||||
public static final int LAST_ORIGINAL_BLOCK = 122;
|
||||
public static final int LAST_ORIGINAL_ITEM = 126;
|
||||
|
||||
public static final boolean[] softBlocks = new boolean[Block.blocksList.length];
|
||||
|
||||
@Deprecated
|
||||
// To be removed
|
||||
public static boolean softBlock(int blockId) {
|
||||
return blockId == 0 || softBlocks[blockId] || Block.blocksList[blockId] == null;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// To be removed
|
||||
public static boolean unbreakableBlock(int blockId) {
|
||||
return blockId == Block.bedrock.blockID || blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// To be removed
|
||||
public static void breakBlock(World world, int x, int y, int z) {
|
||||
int blockId = world.getBlockId(x, y, z);
|
||||
|
||||
if (blockId != 0) {
|
||||
Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,11 @@ import java.lang.reflect.Method;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* You can use this if you wish, but FML InterModComms are recommended.
|
||||
*
|
||||
* SYNTAX: add-facade:id@meta
|
||||
*/
|
||||
public class FacadeManager {
|
||||
private static Method addFacade;
|
||||
|
||||
|
|
|
@ -9,11 +9,13 @@ public interface IExtractionHandler {
|
|||
|
||||
/**
|
||||
* Can this pipe extract items from the block located at these coordinates?
|
||||
* param extractor can be null
|
||||
*/
|
||||
boolean canExtractItems(IPipe pipe, World world, int i, int j, int k);
|
||||
boolean canExtractItems(Object extractor, World world, int i, int j, int k);
|
||||
|
||||
/**
|
||||
* Can this pipe extract liquids from the block located at these coordinates?
|
||||
* param extractor can be null
|
||||
*/
|
||||
boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k);
|
||||
boolean canExtractLiquids(Object extractor, World world, int i, int j, int k);
|
||||
}
|
||||
|
|
|
@ -10,37 +10,31 @@ import cpw.mods.fml.relauncher.Side;
|
|||
|
||||
public abstract class PipeManager {
|
||||
|
||||
@Deprecated
|
||||
private static TreeMap<Integer, IPipedItem> allServerEntities = new TreeMap<Integer, IPipedItem>();
|
||||
@Deprecated
|
||||
private static TreeMap<Integer, IPipedItem> allClientEntities = 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) {
|
||||
/**
|
||||
* param extractor can be null
|
||||
*/
|
||||
public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) {
|
||||
for (IExtractionHandler handler : extractionHandlers)
|
||||
if (!handler.canExtractItems(pipe, world, i, j, k))
|
||||
if (!handler.canExtractItems(extractor, world, i, j, k))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
|
||||
|
||||
/**
|
||||
* param extractor can be null
|
||||
*/
|
||||
public static boolean canExtractLiquids(Object extractor, World world, int i, int j, int k) {
|
||||
for (IExtractionHandler handler : extractionHandlers)
|
||||
if (!handler.canExtractLiquids(pipe, world, i, j, k))
|
||||
if (!handler.canExtractLiquids(extractor, world, i, j, k))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static TreeMap<Integer, IPipedItem> getAllEntities() {
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
return allClientEntities;
|
||||
return allServerEntities;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue