commit
b9df5af112
75 changed files with 213 additions and 283 deletions
|
@ -36,7 +36,7 @@ public abstract class SchematicFactory<S extends Schematic> {
|
|||
}
|
||||
}
|
||||
|
||||
public static void registerSchematicFactory(Class<? extends Schematic> clas, SchematicFactory factory) {
|
||||
public static void registerSchematicFactory(Class<? extends Schematic> clas, SchematicFactory<?> factory) {
|
||||
schematicToFactory.put(clas, factory);
|
||||
factories.put(factory.getClass().getCanonicalName(), factory);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
|
||||
import buildcraft.api.core.JavaTools;
|
||||
|
||||
|
||||
public final class SchematicRegistry {
|
||||
|
||||
public static double BREAK_ENERGY = 10;
|
||||
|
@ -53,7 +52,7 @@ public final class SchematicRegistry {
|
|||
public final Class<? extends Schematic> clazz;
|
||||
public final Object[] params;
|
||||
|
||||
private final Constructor constructor;
|
||||
private final Constructor<?> constructor;
|
||||
|
||||
SchematicConstructor(Class<? extends Schematic> clazz, Object[] params) throws IllegalArgumentException {
|
||||
this.clazz = clazz;
|
||||
|
@ -65,7 +64,7 @@ public final class SchematicRegistry {
|
|||
return (Schematic) constructor.newInstance(params);
|
||||
}
|
||||
|
||||
private Constructor findConstructor() throws IllegalArgumentException {
|
||||
private Constructor<?> findConstructor() throws IllegalArgumentException {
|
||||
for (Constructor<?> c : clazz.getConstructors()) {
|
||||
Class<?>[] typesSignature = c.getParameterTypes();
|
||||
if (typesSignature.length != params.length) {
|
||||
|
|
|
@ -12,5 +12,5 @@ public interface IRedstoneBoard<T> {
|
|||
|
||||
void updateBoard(T container);
|
||||
|
||||
RedstoneBoardNBT getNBTHandler();
|
||||
RedstoneBoardNBT<?> getNBTHandler();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public abstract class RedstoneBoardNBT<T> {
|
|||
|
||||
public abstract String getID();
|
||||
|
||||
public abstract void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced);
|
||||
public abstract void addInformation(ItemStack stack, EntityPlayer player, List<?> list, boolean advanced);
|
||||
|
||||
public abstract IRedstoneBoard<T> create(NBTTagCompound nbt, T object);
|
||||
|
||||
|
@ -81,5 +81,4 @@ public abstract class RedstoneBoardNBT<T> {
|
|||
public float nextFloat(int difficulty) {
|
||||
return 1F - (float) Math.pow(rand.nextFloat(), 1F / difficulty);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,13 +17,13 @@ public abstract class RedstoneBoardRegistry {
|
|||
|
||||
public static RedstoneBoardRegistry instance;
|
||||
|
||||
public abstract void registerBoardClass(RedstoneBoardNBT redstoneBoardNBT, float probability);
|
||||
public abstract void registerBoardClass(RedstoneBoardNBT<?> redstoneBoardNBT, float probability);
|
||||
|
||||
public abstract void createRandomBoard(NBTTagCompound nbt);
|
||||
|
||||
public abstract RedstoneBoardNBT getRedstoneBoard(NBTTagCompound nbt);
|
||||
|
||||
public abstract RedstoneBoardNBT getRedstoneBoard(String id);
|
||||
public abstract RedstoneBoardNBT<?> getRedstoneBoard(String id);
|
||||
|
||||
public abstract void registerIcons(IIconRegister par1IconRegister);
|
||||
|
||||
|
@ -34,5 +34,4 @@ public abstract class RedstoneBoardRegistry {
|
|||
public abstract String getKindForParam(IBoardParameter param);
|
||||
|
||||
public abstract Collection<RedstoneBoardNBT> getAllBoardNBTs();
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public final class BCLog {
|
|||
logger.info("http://www.mod-buildcraft.com");
|
||||
}
|
||||
|
||||
public static void logErrorAPI(String mod, Throwable error, Class classFile) {
|
||||
public static void logErrorAPI(String mod, Throwable error, Class<?> classFile) {
|
||||
StringBuilder msg = new StringBuilder(mod);
|
||||
msg.append(" API error, please update your mods. Error: ").append(error);
|
||||
StackTraceElement[] stackTrace = error.getStackTrace();
|
||||
|
|
|
@ -50,10 +50,10 @@ public class JavaTools {
|
|||
return c;
|
||||
}
|
||||
|
||||
public static List<Field> getAllFields(Class clas) {
|
||||
public static List<Field> getAllFields(Class<?> clas) {
|
||||
List<Field> result = new ArrayList<Field>();
|
||||
|
||||
Class current = clas;
|
||||
Class<?> current = clas;
|
||||
|
||||
while (current != null && current != Object.class) {
|
||||
for (Field f : current.getDeclaredFields()) {
|
||||
|
@ -66,10 +66,10 @@ public class JavaTools {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static List<Method> getAllMethods(Class clas) {
|
||||
public static List<Method> getAllMethods(Class<?> clas) {
|
||||
List<Method> result = new ArrayList<Method>();
|
||||
|
||||
Class current = clas;
|
||||
Class<?> current = clas;
|
||||
|
||||
while (current != null && current != Object.class) {
|
||||
for (Method m : current.getDeclaredMethods()) {
|
||||
|
|
|
@ -33,6 +33,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
|
|||
* Joules batteries and provide different models.
|
||||
*/
|
||||
public final class MjAPI {
|
||||
|
||||
public static final String DEFAULT_POWER_FRAMEWORK = "buildcraft.kinesis";
|
||||
private static Map<BatteryHolder, BatteryField> mjBatteryFields = new HashMap<BatteryHolder, BatteryField>();
|
||||
private static Map<String, Class<? extends IBatteryObject>> mjBatteryKinds = new HashMap<String, Class<? extends IBatteryObject>>();
|
||||
|
@ -351,7 +352,7 @@ public final class MjAPI {
|
|||
private static final class BatteryHolder {
|
||||
private String kind;
|
||||
private ForgeDirection side;
|
||||
private Class clazz;
|
||||
private Class<? extends Object> clazz;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
@ -382,7 +383,7 @@ public final class MjAPI {
|
|||
public BatteryKind kind;
|
||||
}
|
||||
|
||||
private static BatteryField getMjBatteryField(Class c, String kind, ForgeDirection side) {
|
||||
private static BatteryField getMjBatteryField(Class<?> c, String kind, ForgeDirection side) {
|
||||
BatteryHolder holder = new BatteryHolder();
|
||||
holder.clazz = c;
|
||||
holder.kind = kind;
|
||||
|
|
|
@ -21,6 +21,5 @@ public class CraftingResult<T> {
|
|||
public ArrayList<FluidStack> usedFluids = new ArrayList<FluidStack>();
|
||||
public double energyCost = 0;
|
||||
public long craftingTime = 0;
|
||||
public IFlexibleRecipe recipe;
|
||||
|
||||
public IFlexibleRecipe<?> recipe;
|
||||
}
|
||||
|
|
|
@ -15,5 +15,4 @@ public interface IFlexibleRecipe<T> {
|
|||
CraftingResult<T> craft(IFlexibleCrafter crafter, boolean preview);
|
||||
|
||||
String getId();
|
||||
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
|||
|
||||
private static void addGateRecipe(String materialName, double energyCost, GateMaterial material, Chipset chipset,
|
||||
PipeWire... pipeWire) {
|
||||
List temp = new ArrayList();
|
||||
List<ItemStack> temp = new ArrayList<ItemStack>();
|
||||
temp.add(chipset.getStack());
|
||||
for (PipeWire wire : pipeWire) {
|
||||
temp.add(wire.getStack());
|
||||
|
|
|
@ -530,5 +530,4 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
|
||||
TileFilteredBuffer.class.getCanonicalName());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class BlockSpring extends Block {
|
|||
|
||||
// Prevents updates on chunk generation
|
||||
@Override
|
||||
public boolean func_149698_L () {
|
||||
public boolean func_149698_L() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ public class ItemMapLocation extends ItemBuildCraft {
|
|||
NBTTagCompound cpt = NBTUtils.getItemData(stack);
|
||||
|
||||
if (!cpt.hasKey("kind")) {
|
||||
|
||||
} else {
|
||||
switch (cpt.getByte("kind")) {
|
||||
case 0: {
|
||||
|
@ -91,7 +90,6 @@ public class ItemMapLocation extends ItemBuildCraft {
|
|||
}
|
||||
|
||||
if (cpt.hasKey("kind")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +130,6 @@ public class ItemMapLocation extends ItemBuildCraft {
|
|||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer par2EntityPlayer, World world, int x,
|
||||
int y, int z, int side, float par8, float par9, float par10) {
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
NBTTagCompound cpt = NBTUtils.getItemData(stack);
|
||||
|
||||
|
@ -171,8 +168,6 @@ public class ItemMapLocation extends ItemBuildCraft {
|
|||
cpt.setInteger("z", z);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.world.World;
|
|||
|
||||
import buildcraft.api.boards.RedstoneBoardNBT;
|
||||
import buildcraft.api.boards.RedstoneBoardRegistry;
|
||||
import buildcraft.api.boards.RedstoneBoardRobot;
|
||||
import buildcraft.api.boards.RedstoneBoardRobotNBT;
|
||||
import buildcraft.core.robots.EntityRobot;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
|
@ -32,7 +31,6 @@ public class ItemRobot extends ItemBuildCraft {
|
|||
|
||||
public EntityRobot createRobot(ItemStack stack, World world) {
|
||||
try {
|
||||
RedstoneBoardRobot board = null;
|
||||
NBTTagCompound nbt = NBTUtils.getItemData(stack);
|
||||
|
||||
NBTTagCompound boardCpt = nbt.getCompoundTag("board");
|
||||
|
@ -52,7 +50,7 @@ public class ItemRobot extends ItemBuildCraft {
|
|||
return EntityRobot.ROBOT_BASE;
|
||||
} else {
|
||||
NBTTagCompound board = nbt.getCompoundTag("board");
|
||||
RedstoneBoardNBT boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(board);
|
||||
RedstoneBoardNBT<?> boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(board);
|
||||
|
||||
if (boardNBT instanceof RedstoneBoardRobotNBT) {
|
||||
return ((RedstoneBoardRobotNBT) boardNBT).getRobotTexture();
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public abstract class GuiAdvancedInterface extends GuiBuildCraft {
|
||||
|
||||
public AdvancedSlot[] slots;
|
||||
|
||||
public GuiAdvancedInterface(BuildCraftContainer container, IInventory inventory, ResourceLocation texture) {
|
||||
|
|
|
@ -96,7 +96,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
|
|||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
private void drawToolTips(Collection objects, int mouseX, int mouseY) {
|
||||
private void drawToolTips(Collection<?> objects, int mouseX, int mouseY) {
|
||||
for (Object obj : objects) {
|
||||
if (!(obj instanceof IToolTipProvider)) {
|
||||
continue;
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class GuiTools {
|
|||
fr.drawString(s, sPos, y, color, shadow);
|
||||
}
|
||||
|
||||
public static void newButtonRowAuto(List buttonList, int xStart, int xSize, List<? extends GuiBetterButton> buttons) {
|
||||
public static void newButtonRowAuto(List<GuiBetterButton> buttonList, int xStart, int xSize, List<? extends GuiBetterButton> buttons) {
|
||||
int buttonWidth = 0;
|
||||
for (GuiBetterButton b : buttons) {
|
||||
buttonWidth += b.getWidth();
|
||||
|
@ -52,7 +52,7 @@ public final class GuiTools {
|
|||
}
|
||||
}
|
||||
|
||||
public static void newButtonRow(List buttonList, int xStart, int spacing, List<? extends GuiBetterButton> buttons) {
|
||||
public static void newButtonRow(List<GuiBetterButton> buttonList, int xStart, int spacing, List<? extends GuiBetterButton> buttons) {
|
||||
int pointer = 0;
|
||||
for (GuiBetterButton b : buttons) {
|
||||
b.xPosition = xStart + pointer;
|
||||
|
@ -60,5 +60,4 @@ public final class GuiTools {
|
|||
buttonList.add(b);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,9 +21,9 @@ import buildcraft.core.gui.tooltips.ToolTip;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiMultiButton extends GuiBetterButton {
|
||||
|
||||
private final MultiButtonController control;
|
||||
private final MultiButtonController<?> control;
|
||||
|
||||
public GuiMultiButton(int id, int x, int y, int width, MultiButtonController control) {
|
||||
public GuiMultiButton(int id, int x, int y, int width, MultiButtonController<?> control) {
|
||||
super(id, x, y, width, StandardButtonTextureSets.LARGE_BUTTON, "");
|
||||
this.control = control;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class GuiMultiButton extends GuiBetterButton {
|
|||
return pressed;
|
||||
}
|
||||
|
||||
public MultiButtonController getController() {
|
||||
public MultiButtonController<?> getController() {
|
||||
return control;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ public final class MultiButtonController<T extends IMultiButtonState> {
|
|||
this.validStates = validStates;
|
||||
}
|
||||
|
||||
public static <T extends IMultiButtonState> MultiButtonController getController(int startState, T... validStates) {
|
||||
public static <T extends IMultiButtonState> MultiButtonController<T> getController(int startState, T... validStates) {
|
||||
return new MultiButtonController<T>(startState, validStates);
|
||||
}
|
||||
|
||||
public MultiButtonController copy() {
|
||||
public MultiButtonController<?> copy() {
|
||||
return new MultiButtonController(currentState, validStates.clone());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,20 +17,19 @@ import buildcraft.transport.Pipe;
|
|||
// TODO: This is not yet used
|
||||
public class PacketRPCPipe extends BuildCraftPacket {
|
||||
|
||||
public Pipe pipe;
|
||||
public Pipe<?> pipe;
|
||||
public EntityPlayer sender;
|
||||
|
||||
private byte[] contents;
|
||||
|
||||
public PacketRPCPipe () {
|
||||
|
||||
public PacketRPCPipe() {
|
||||
}
|
||||
|
||||
public PacketRPCPipe (byte [] bytes) {
|
||||
public PacketRPCPipe(byte[] bytes) {
|
||||
contents = bytes;
|
||||
}
|
||||
|
||||
public void setPipe (Pipe aPipe) {
|
||||
public void setPipe(Pipe<?> aPipe) {
|
||||
pipe = aPipe;
|
||||
}
|
||||
|
||||
|
@ -51,5 +50,4 @@ public class PacketRPCPipe extends BuildCraftPacket {
|
|||
public void writeData(ByteBuf data) {
|
||||
data.writeBytes(contents);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,24 +43,25 @@ import buildcraft.transport.Pipe;
|
|||
* RPCs must be sent and received by a tile entity.
|
||||
*/
|
||||
public final class RPCHandler {
|
||||
|
||||
public static int MAX_PACKET_SIZE = 30 * 1024;
|
||||
|
||||
private static Map<String, RPCHandler> handlers = new TreeMap<String, RPCHandler>();
|
||||
|
||||
private Class handledClass;
|
||||
private Class<? extends Object> handledClass;
|
||||
|
||||
private Map<String, Integer> methodsMap = new TreeMap<String, Integer>();
|
||||
|
||||
class MethodMapping {
|
||||
Method method;
|
||||
Class [] parameters;
|
||||
Class[] parameters;
|
||||
ClassSerializer [] mappings;
|
||||
boolean hasInfo = false;
|
||||
}
|
||||
|
||||
private MethodMapping [] methods;
|
||||
|
||||
private RPCHandler(Class c) {
|
||||
private RPCHandler(Class<? extends Object> c) {
|
||||
handledClass = c;
|
||||
Method [] sortedMethods = JavaTools.getAllMethods (c).toArray(new Method [0]);
|
||||
|
||||
|
@ -194,7 +195,7 @@ public final class RPCHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private PacketRPCPipe createRCPPacketPipe (Pipe pipe, String method, Object ... actuals) {
|
||||
private PacketRPCPipe createRCPPacketPipe(Pipe<?> pipe, String method, Object ... actuals) {
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
try {
|
||||
|
@ -303,7 +304,7 @@ public final class RPCHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean writePrimitive(ByteBuf data, Class formal, Object actual) {
|
||||
private boolean writePrimitive(ByteBuf data, Class<?> formal, Object actual) {
|
||||
if (int.class.equals(formal)) {
|
||||
data.writeInt((Integer) actual);
|
||||
} else if (float.class.equals(formal)) {
|
||||
|
@ -318,7 +319,7 @@ public final class RPCHandler {
|
|||
Utils.writeUTF(data, (String) actual);
|
||||
} else if (formal.isArray()) {
|
||||
Object[] array = (Object[]) actual;
|
||||
Class componentType = formal.getComponentType();
|
||||
Class<?> componentType = formal.getComponentType();
|
||||
data.writeInt(array.length);
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
writePrimitive(data, componentType, array[i]);
|
||||
|
@ -336,7 +337,7 @@ public final class RPCHandler {
|
|||
MethodMapping m = methods [methodIndex];
|
||||
Class[] formals = m.parameters;
|
||||
|
||||
Object [] actuals = new Object [formals.length];
|
||||
Object[] actuals = new Object [formals.length];
|
||||
|
||||
int expectedParameters = m.hasInfo ? formals.length - 1 : formals.length;
|
||||
|
||||
|
@ -367,7 +368,7 @@ public final class RPCHandler {
|
|||
|
||||
}
|
||||
|
||||
private boolean readPrimitive(ByteBuf data, Class formal, Object[] actuals, int i) {
|
||||
private boolean readPrimitive(ByteBuf data, Class<?> formal, Object[] actuals, int i) {
|
||||
if (int.class.equals(formal)) {
|
||||
actuals[i] = data.readInt();
|
||||
} else if (float.class.equals(formal)) {
|
||||
|
@ -382,7 +383,7 @@ public final class RPCHandler {
|
|||
actuals[i] = Utils.readUTF(data);
|
||||
} else if (formal.isArray()) {
|
||||
final int size = data.readInt();
|
||||
Class componentType = formal.getComponentType();
|
||||
Class<?> componentType = formal.getComponentType();
|
||||
Object[] a = (Object[]) Array.newInstance(componentType, size);
|
||||
for (int z = 0; z < size; z++) {
|
||||
readPrimitive(data, componentType, a, z);
|
||||
|
|
|
@ -71,7 +71,6 @@ import buildcraft.core.utils.Utils;
|
|||
*/
|
||||
public class ClassMapping extends ClassSerializer {
|
||||
|
||||
private static SerializerObject anonymousSerializer = new SerializerObject();
|
||||
private static Map<String, ClassSerializer> classes = new TreeMap<String, ClassSerializer>();
|
||||
|
||||
private LinkedList<Field> floatFields = new LinkedList<Field>();
|
||||
|
@ -388,11 +387,9 @@ public class ClassMapping extends ClassSerializer {
|
|||
|
||||
private void writeArray(Object obj, ByteBuf data, SerializationContext context) throws IllegalArgumentException,
|
||||
IllegalAccessException {
|
||||
Class<? extends Object> cpt = mappedClass.getComponentType();
|
||||
|
||||
switch (cptType) {
|
||||
case Byte: {
|
||||
byte [] arr = (byte []) obj;
|
||||
byte[] arr = (byte[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
data.writeBytes(arr);
|
||||
|
@ -400,7 +397,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Float: {
|
||||
float [] arr = (float []) obj;
|
||||
float[] arr = (float[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (float element : arr) {
|
||||
|
@ -410,7 +407,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Double: {
|
||||
double [] arr = (double []) obj;
|
||||
double[] arr = (double[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (double element : arr) {
|
||||
|
@ -420,7 +417,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Short: {
|
||||
short [] arr = (short []) obj;
|
||||
short[] arr = (short[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (short element : arr) {
|
||||
|
@ -430,7 +427,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Int: {
|
||||
int [] arr = (int []) obj;
|
||||
int[] arr = (int[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (int element : arr) {
|
||||
|
@ -440,7 +437,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Boolean: {
|
||||
boolean [] arr = (boolean []) obj;
|
||||
boolean[] arr = (boolean[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (boolean element : arr) {
|
||||
|
@ -450,10 +447,10 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Enum: {
|
||||
Enum [] arr = (Enum []) obj;
|
||||
Enum[] arr = (Enum[]) obj;
|
||||
data.writeInt (arr.length);
|
||||
|
||||
for (Enum element : arr) {
|
||||
for (Enum<?> element : arr) {
|
||||
data.writeBoolean(element != null);
|
||||
|
||||
if (element != null) {
|
||||
|
@ -464,8 +461,8 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Object: {
|
||||
Object [] arr = (Object []) obj;
|
||||
data.writeInt (arr.length);
|
||||
Object[] arr = (Object[]) obj;
|
||||
data.writeInt(arr.length);
|
||||
|
||||
for (Object element : arr) {
|
||||
cptMapping.write(data, element, context);
|
||||
|
@ -486,12 +483,12 @@ public class ClassMapping extends ClassSerializer {
|
|||
|
||||
switch (cptType) {
|
||||
case Byte: {
|
||||
byte [] arr;
|
||||
byte[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new byte [size];
|
||||
arr = new byte[size];
|
||||
} else {
|
||||
arr = (byte []) obj;
|
||||
arr = (byte[]) obj;
|
||||
}
|
||||
|
||||
data.readBytes (arr);
|
||||
|
@ -501,16 +498,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Float: {
|
||||
float [] arr;
|
||||
float[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new float [size];
|
||||
arr = new float[size];
|
||||
} else {
|
||||
arr = (float []) obj;
|
||||
arr = (float[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = data.readFloat();
|
||||
arr[i] = data.readFloat();
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -518,16 +515,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Double: {
|
||||
double [] arr;
|
||||
double[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new double [size];
|
||||
arr = new double[size];
|
||||
} else {
|
||||
arr = (double []) obj;
|
||||
arr = (double[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = data.readDouble();
|
||||
arr[i] = data.readDouble();
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -535,16 +532,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Short: {
|
||||
short [] arr;
|
||||
short[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new short [size];
|
||||
arr = new short[size];
|
||||
} else {
|
||||
arr = (short []) obj;
|
||||
arr = (short[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = data.readShort();
|
||||
arr[i] = data.readShort();
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -552,16 +549,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Int: {
|
||||
int [] arr;
|
||||
int[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new int [size];
|
||||
arr = new int[size];
|
||||
} else {
|
||||
arr = (int []) obj;
|
||||
arr = (int[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = data.readInt();
|
||||
arr[i] = data.readInt();
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -569,16 +566,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Boolean: {
|
||||
boolean [] arr;
|
||||
boolean[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = new boolean [size];
|
||||
arr = new boolean[size];
|
||||
} else {
|
||||
arr = (boolean []) obj;
|
||||
arr = (boolean[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = data.readBoolean();
|
||||
arr[i] = data.readBoolean();
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -596,7 +593,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
if (data.readBoolean()) {
|
||||
arr[i] = (Enum) cpt.getEnumConstants()[data.readByte()];
|
||||
arr[i] = (Enum<?>) cpt.getEnumConstants()[data.readByte()];
|
||||
} else {
|
||||
arr[i] = null;
|
||||
}
|
||||
|
@ -607,16 +604,16 @@ public class ClassMapping extends ClassSerializer {
|
|||
break;
|
||||
}
|
||||
case Object: {
|
||||
Object [] arr;
|
||||
Object[] arr;
|
||||
|
||||
if (obj == null) {
|
||||
arr = (Object[]) Array.newInstance(cpt, size);
|
||||
} else {
|
||||
arr = (Object []) obj;
|
||||
arr = (Object[]) obj;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr [i] = cptMapping.read(data, arr[i], context);
|
||||
arr[i] = cptMapping.read(data, arr[i], context);
|
||||
}
|
||||
|
||||
obj = arr;
|
||||
|
@ -628,7 +625,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
return obj;
|
||||
}
|
||||
|
||||
private static void registerSerializer (Class clas, ClassSerializer s) {
|
||||
private static void registerSerializer (Class<?> clas, ClassSerializer s) {
|
||||
try {
|
||||
s.mappedClass = clas;
|
||||
classes.put(clas.getCanonicalName(), s);
|
||||
|
@ -638,7 +635,7 @@ public class ClassMapping extends ClassSerializer {
|
|||
}
|
||||
}
|
||||
|
||||
public static ClassSerializer get (Class clas) {
|
||||
public static ClassSerializer get (Class<?> clas) {
|
||||
ClassSerializer mapping;
|
||||
|
||||
if (Block.class.isAssignableFrom(clas)) {
|
||||
|
|
|
@ -20,7 +20,7 @@ public class SerializerArrayList extends ClassSerializer {
|
|||
public void write(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
ArrayList list = (ArrayList) o;
|
||||
ArrayList<?> list = (ArrayList<?>) o;
|
||||
|
||||
if (o == null) {
|
||||
data.writeBoolean(false);
|
||||
|
@ -44,7 +44,7 @@ public class SerializerArrayList extends ClassSerializer {
|
|||
} else {
|
||||
int size = data.readShort();
|
||||
|
||||
ArrayList list = new ArrayList ();
|
||||
ArrayList<Object> list = new ArrayList<Object> ();
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Object val = anonymousSerializer.read(data, null, context);
|
||||
|
@ -55,5 +55,4 @@ public class SerializerArrayList extends ClassSerializer {
|
|||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,8 +21,7 @@ public class SerializerHashMap extends ClassSerializer {
|
|||
@Override
|
||||
public void write(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
HashMap map = (HashMap) o;
|
||||
HashMap map = (HashMap<?, ?>) o;
|
||||
|
||||
if (o == null) {
|
||||
data.writeBoolean(false);
|
||||
|
@ -43,13 +42,12 @@ public class SerializerHashMap extends ClassSerializer {
|
|||
public Object read(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException,
|
||||
InstantiationException, ClassNotFoundException {
|
||||
|
||||
if (!data.readBoolean()) {
|
||||
return null;
|
||||
} else {
|
||||
int size = data.readShort();
|
||||
|
||||
HashMap map = new HashMap ();
|
||||
HashMap<Object, Object> map = new HashMap<Object, Object> ();
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Object key = anonymousSerializer.read(data, null, context);
|
||||
|
@ -61,5 +59,4 @@ public class SerializerHashMap extends ClassSerializer {
|
|||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ public class SerializerHashSet extends ClassSerializer {
|
|||
@Override
|
||||
public void write(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
HashSet set = (HashSet) o;
|
||||
HashSet<?> set = (HashSet<?>) o;
|
||||
|
||||
if (o == null) {
|
||||
data.writeBoolean(false);
|
||||
|
@ -38,13 +37,12 @@ public class SerializerHashSet extends ClassSerializer {
|
|||
public Object read(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException,
|
||||
InstantiationException, ClassNotFoundException {
|
||||
|
||||
if (!data.readBoolean()) {
|
||||
return null;
|
||||
} else {
|
||||
int size = data.readShort();
|
||||
|
||||
HashSet set = new HashSet();
|
||||
HashSet<Object> set = new HashSet<Object>();
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Object value = anonymousSerializer.read(data, null, context);
|
||||
|
@ -55,5 +53,4 @@ public class SerializerHashSet extends ClassSerializer {
|
|||
return set;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ public class SerializerLinkedList extends ClassSerializer {
|
|||
@Override
|
||||
public void write(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
LinkedList list = (LinkedList) o;
|
||||
LinkedList<?> list = (LinkedList<?>) o;
|
||||
|
||||
if (o == null) {
|
||||
data.writeBoolean(false);
|
||||
|
@ -38,13 +37,12 @@ public class SerializerLinkedList extends ClassSerializer {
|
|||
public Object read(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException,
|
||||
InstantiationException, ClassNotFoundException {
|
||||
|
||||
if (!data.readBoolean()) {
|
||||
return null;
|
||||
} else {
|
||||
int size = data.readShort();
|
||||
|
||||
LinkedList list = new LinkedList ();
|
||||
LinkedList<Object> list = new LinkedList<Object>();
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Object val = anonymousSerializer.read(data, null, context);
|
||||
|
@ -55,5 +53,4 @@ public class SerializerLinkedList extends ClassSerializer {
|
|||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,12 +17,11 @@ public class SerializerObject extends ClassSerializer {
|
|||
@Override
|
||||
public void write(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
if (o == null) {
|
||||
data.writeBoolean(false);
|
||||
} else {
|
||||
data.writeBoolean(true);
|
||||
Class realClass = o.getClass();
|
||||
Class<? extends Object> realClass = o.getClass();
|
||||
|
||||
ClassSerializer delegateMapping;
|
||||
|
||||
|
@ -52,7 +51,6 @@ public class SerializerObject extends ClassSerializer {
|
|||
public Object read(ByteBuf data, Object o, SerializationContext context)
|
||||
throws IllegalArgumentException, IllegalAccessException,
|
||||
InstantiationException, ClassNotFoundException {
|
||||
|
||||
if (!data.readBoolean()) {
|
||||
return null;
|
||||
} else {
|
||||
|
@ -63,7 +61,7 @@ public class SerializerObject extends ClassSerializer {
|
|||
if (context.idToClass.size() < index) {
|
||||
String className = Utils.readUTF(data);
|
||||
|
||||
Class cls = Class.forName(className);
|
||||
Class<?> cls = Class.forName(className);
|
||||
delegateMapping = ClassMapping.get(cls);
|
||||
|
||||
context.idToClass.add(ClassMapping.get(cls));
|
||||
|
@ -78,5 +76,4 @@ public class SerializerObject extends ClassSerializer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,15 +32,15 @@ public class AssemblyRecipeManager implements IAssemblyRecipeManager {
|
|||
return;
|
||||
}
|
||||
|
||||
addRecipe(id, new FlexibleRecipe(id, output, energyCost, 0, input));
|
||||
addRecipe(id, new FlexibleRecipe<ItemStack>(id, output, energyCost, 0, input));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(IFlexibleRecipe recipe) {
|
||||
public void addRecipe(IFlexibleRecipe<ItemStack> recipe) {
|
||||
addRecipe(recipe.getId(), recipe);
|
||||
}
|
||||
|
||||
private void addRecipe(String id, IFlexibleRecipe recipe) {
|
||||
private void addRecipe(String id, IFlexibleRecipe<ItemStack> recipe) {
|
||||
if (assemblyRecipes.containsKey(id)) {
|
||||
throw new RuntimeException("Recipe \"" + id + "\" already registered");
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class FlexibleRecipe<T> implements IFlexibleRecipe<T> {
|
|||
return null;
|
||||
}
|
||||
|
||||
CraftingResult<T> result = new CraftingResult();
|
||||
CraftingResult<T> result = new CraftingResult<T>();
|
||||
|
||||
result.recipe = this;
|
||||
result.energyCost = energyCost;
|
||||
|
|
|
@ -131,7 +131,7 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
laser.tail.z = dataWatcher.getWatchableObjectFloat(14);
|
||||
laser.isVisible = dataWatcher.getWatchableObjectByte(15) == 1;
|
||||
|
||||
RedstoneBoardNBT boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher
|
||||
RedstoneBoardNBT<?> boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher
|
||||
.getWatchableObjectString(16));
|
||||
|
||||
if (boardNBT != null) {
|
||||
|
@ -167,14 +167,14 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
}
|
||||
}
|
||||
|
||||
public void showLaser () {
|
||||
public void showLaser() {
|
||||
if (!laser.isVisible) {
|
||||
laser.isVisible = true;
|
||||
needsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void hideLaser () {
|
||||
public void hideLaser() {
|
||||
if (laser.isVisible) {
|
||||
laser.isVisible = false;
|
||||
needsUpdate = true;
|
||||
|
@ -208,7 +208,7 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
super.onUpdate();
|
||||
}
|
||||
|
||||
public void setRegularBoundingBox () {
|
||||
public void setRegularBoundingBox() {
|
||||
width = 0.5F;
|
||||
height = 0.5F;
|
||||
|
||||
|
@ -239,7 +239,7 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
}
|
||||
}
|
||||
|
||||
public void setNullBoundingBox () {
|
||||
public void setNullBoundingBox() {
|
||||
width = 0F;
|
||||
height = 0F;
|
||||
|
||||
|
@ -252,7 +252,7 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
boundingBox.maxZ = posZ;
|
||||
}
|
||||
|
||||
private void iterateBehaviorDocked () {
|
||||
private void iterateBehaviorDocked() {
|
||||
motionX = 0F;
|
||||
motionY = 0F;
|
||||
motionZ = 0F;
|
||||
|
@ -497,8 +497,7 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
public boolean isItemValidForSlot(int var1, ItemStack var2) {
|
||||
return inv[var1] == null
|
||||
|| (inv[var1].isItemEqual(var2) && inv[var1].isStackable() && inv[var1].stackSize
|
||||
+ var2.stackSize <= inv[var1].getItem()
|
||||
.getItemStackLimit());
|
||||
+ var2.stackSize <= inv[var1].getItem().getItemStackLimit());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,6 @@ public class RobotIntegrationRecipe extends IntegrationTableRecipe {
|
|||
@Override
|
||||
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
|
||||
ItemStack inputB) {
|
||||
|
||||
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
|
||||
|
||||
if (result != null) {
|
||||
|
|
|
@ -64,12 +64,9 @@ public final class BoardRobotLeaveCutterNBT extends RedstoneBoardRobotNBT {
|
|||
|
||||
@Override
|
||||
public void createRandomBoard(NBTTagCompound nbt) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDefaultBoard(NBTTagCompound itemData) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ public final class BoardRobotLumberjackNBT extends RedstoneBoardRobotNBT {
|
|||
public IIcon icon;
|
||||
|
||||
private BoardRobotLumberjackNBT() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BoardRobotPicker extends RedstoneBoardRobot {
|
|||
private SafeTimeTracker scanTracker = new SafeTimeTracker(40, 10);
|
||||
|
||||
private NBTTagCompound data;
|
||||
private RedstoneBoardNBT board;
|
||||
private RedstoneBoardNBT<?> board;
|
||||
private IBoardParameter[] params;
|
||||
private int range;
|
||||
private IStackFilter stackFilter;
|
||||
|
|
|
@ -33,7 +33,6 @@ public final class BoardRobotPickerNBT extends RedstoneBoardRobotNBT {
|
|||
public IIcon icon;
|
||||
|
||||
private BoardRobotPickerNBT() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,11 +64,9 @@ public final class BoardRobotPlanterNBT extends RedstoneBoardRobotNBT {
|
|||
|
||||
@Override
|
||||
public void createRandomBoard(NBTTagCompound nbt) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDefaultBoard(NBTTagCompound nbt) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public abstract class BCTrigger extends BCStatement implements ITrigger {
|
|||
@Override
|
||||
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
|
||||
ITriggerParameter p = parameters[0];
|
||||
Pipe pipe = (Pipe) gate.getPipe();
|
||||
Pipe<?> pipe = (Pipe<?>) gate.getPipe();
|
||||
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (isTriggerActive(side.getOpposite(), pipe.getAdjacentTile(side), p)) {
|
||||
|
@ -51,5 +51,4 @@ public abstract class BCTrigger extends BCStatement implements ITrigger {
|
|||
public ITriggerParameter createParameter(int index) {
|
||||
return new TriggerParameter();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,10 +32,10 @@ public class TriggerRedstoneInput extends BCTrigger {
|
|||
|
||||
@Override
|
||||
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
|
||||
return !(active ^ isBeingPowered((Pipe) gate.getPipe(), gate.getSide()));
|
||||
return !(active ^ isBeingPowered((Pipe<?>) gate.getPipe(), gate.getSide()));
|
||||
}
|
||||
|
||||
private boolean isBeingPowered(Pipe pipe, ForgeDirection direction) {
|
||||
private boolean isBeingPowered(Pipe<?> pipe, ForgeDirection direction) {
|
||||
return direction != ForgeDirection.UNKNOWN && pipe.container.redstoneInput[direction.ordinal()] > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
|
|||
public Tank tankCoolant = new Tank("tankCoolant", MAX_LIQUID, this);
|
||||
|
||||
private int burnTime = 0;
|
||||
private TankManager tankManager = new TankManager();
|
||||
private TankManager<Tank> tankManager = new TankManager<Tank>();
|
||||
private Fuel currentFuel = null;
|
||||
private int penaltyCooling = 0;
|
||||
private boolean lastPowered = false;
|
||||
|
|
|
@ -35,7 +35,7 @@ import buildcraft.core.network.PacketUpdate;
|
|||
public class TileTank extends TileBuildCraft implements IFluidHandler {
|
||||
|
||||
public final Tank tank = new Tank("tank", FluidContainerRegistry.BUCKET_VOLUME * 16, this);
|
||||
public final TankManager tankManager = new TankManager(tank);
|
||||
public final TankManager<Tank> tankManager = new TankManager<Tank>(tank);
|
||||
public boolean hasUpdate = false;
|
||||
public SafeTimeTracker tracker = new SafeTimeTracker();
|
||||
private int prevLightValue = 0;
|
||||
|
|
|
@ -96,8 +96,6 @@ public class ItemRedstoneBoard extends ItemBuildCraft {
|
|||
nbtData.setString("id", nbt.getID());
|
||||
nbt.createDefaultBoard(nbtData);
|
||||
itemList.add(stack.copy());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
NBTTagList list = nbt.getTagList("plannedIds", Constants.NBT.TAG_STRING);
|
||||
|
||||
for (int i = 0; i < list.tagCount(); ++i) {
|
||||
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(list.getStringTagAt(i));
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(list.getStringTagAt(i));
|
||||
|
||||
if (recipe != null) {
|
||||
plannedOutput.add(recipe.getId());
|
||||
|
@ -143,7 +143,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
}
|
||||
|
||||
if (nbt.hasKey("recipeId")) {
|
||||
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(nbt.getString("recipeId"));
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(nbt.getString("recipeId"));
|
||||
|
||||
if (recipe != null) {
|
||||
setCurrentRecipe(recipe);
|
||||
|
@ -180,7 +180,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
return recipe != null && recipe == currentRecipe;
|
||||
}
|
||||
|
||||
private void setCurrentRecipe(IFlexibleRecipe recipe) {
|
||||
private void setCurrentRecipe(IFlexibleRecipe<ItemStack> recipe) {
|
||||
currentRecipe = recipe;
|
||||
|
||||
if (recipe != null) {
|
||||
|
@ -209,7 +209,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
}
|
||||
}
|
||||
|
||||
public void planOutput(IFlexibleRecipe recipe) {
|
||||
public void planOutput(IFlexibleRecipe<ItemStack> recipe) {
|
||||
if (recipe != null && !isPlanned(recipe)) {
|
||||
plannedOutput.add(recipe.getId());
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
}
|
||||
}
|
||||
|
||||
public void cancelPlanOutput(IFlexibleRecipe recipe) {
|
||||
public void cancelPlanOutput(IFlexibleRecipe<ItemStack> recipe) {
|
||||
if (isAssembling(recipe)) {
|
||||
setCurrentRecipe(null);
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
boolean takeNext = false;
|
||||
|
||||
for (String recipeId : plannedOutput) {
|
||||
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
|
||||
|
||||
if (recipe == currentRecipe) {
|
||||
takeNext = true;
|
||||
|
@ -246,7 +246,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
}
|
||||
|
||||
for (String recipeId : plannedOutput) {
|
||||
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
|
||||
|
||||
if (recipe.canBeCrafted(this)) {
|
||||
setCurrentRecipe(recipe);
|
||||
|
@ -263,7 +263,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
|
||||
@RPC(RPCSide.SERVER)
|
||||
private void selectRecipe(String id, boolean select) {
|
||||
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(id);
|
||||
IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(id);
|
||||
|
||||
if (recipe != null) {
|
||||
if (select) {
|
||||
|
@ -330,6 +330,4 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
public int getCraftingFluidStackSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class BoardRecipe extends FlexibleRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CraftingResult craft(IFlexibleCrafter crafter, boolean preview) {
|
||||
public CraftingResult<ItemStack> craft(IFlexibleCrafter crafter, boolean preview) {
|
||||
CraftingResult<ItemStack> result = super.craft(crafter, preview);
|
||||
|
||||
if (result != null) {
|
||||
|
@ -41,6 +41,4 @@ public class BoardRecipe extends FlexibleRecipe {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import buildcraft.api.boards.RedstoneBoardRegistry;
|
|||
public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
|
||||
|
||||
private static class BoardFactory {
|
||||
public RedstoneBoardNBT boardNBT;
|
||||
public RedstoneBoardNBT<?> boardNBT;
|
||||
public float probability;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
|
|||
private Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void registerBoardClass(RedstoneBoardNBT redstoneBoardNBT, float probability) {
|
||||
public void registerBoardClass(RedstoneBoardNBT<?> redstoneBoardNBT, float probability) {
|
||||
BoardFactory factory = new BoardFactory();
|
||||
factory.boardNBT = redstoneBoardNBT;
|
||||
factory.probability = probability;
|
||||
|
@ -62,12 +62,12 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RedstoneBoardNBT getRedstoneBoard(NBTTagCompound nbt) {
|
||||
public RedstoneBoardNBT<?> getRedstoneBoard(NBTTagCompound nbt) {
|
||||
return getRedstoneBoard(nbt.getString("id"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneBoardNBT getRedstoneBoard(String id) {
|
||||
public RedstoneBoardNBT<?> getRedstoneBoard(String id) {
|
||||
BoardFactory factory = boards.get(id);
|
||||
|
||||
if (factory != null) {
|
||||
|
@ -117,5 +117,4 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import buildcraft.core.utils.NBTUtils;
|
|||
public class ContainerRedstoneBoard extends BuildCraftContainer {
|
||||
|
||||
private EntityPlayer player;
|
||||
private RedstoneBoardNBT board;
|
||||
private RedstoneBoardNBT<?> board;
|
||||
private IBoardParameter[] params;
|
||||
|
||||
public ContainerRedstoneBoard(EntityPlayer iPlayer, int x, int y, int z) {
|
||||
|
|
|
@ -34,7 +34,7 @@ public class GuiRedstoneBoard extends GuiAdvancedInterface {
|
|||
|
||||
private World world;
|
||||
private int x, y, z;
|
||||
private RedstoneBoardNBT board;
|
||||
private RedstoneBoardNBT<?> board;
|
||||
private IBoardParameter[] params;
|
||||
|
||||
public GuiRedstoneBoard(EntityPlayer player, int ix, int iy, int iz) {
|
||||
|
|
|
@ -41,9 +41,8 @@ public class AdvancedFacadeRecipe extends IntegrationTableRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
|
||||
public CraftingResult<ItemStack> craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
|
||||
ItemStack inputB) {
|
||||
|
||||
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
|
||||
|
||||
if (result == null) {
|
||||
|
|
|
@ -38,7 +38,6 @@ public class GateLogicSwapRecipe extends IntegrationTableRecipe {
|
|||
@Override
|
||||
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
|
||||
ItemStack inputB) {
|
||||
|
||||
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
|
||||
|
||||
if (result == null) {
|
||||
|
|
|
@ -46,8 +46,6 @@ public abstract class IntegrationTableRecipe extends FlexibleRecipe<ItemStack> i
|
|||
|
||||
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
|
||||
ItemStack inputB) {
|
||||
|
||||
return super.craft(crafter, preview);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
}
|
||||
|
||||
static class RaytraceResult {
|
||||
|
||||
public final Part hitPart;
|
||||
public final MovingObjectPosition movingObjectPosition;
|
||||
public final AxisAlignedBB boundingBox;
|
||||
|
@ -327,7 +326,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return null;
|
||||
}
|
||||
|
||||
Pipe pipe = tileG.pipe;
|
||||
Pipe<?> pipe = tileG.pipe;
|
||||
|
||||
if (!isValid(pipe)) {
|
||||
return null;
|
||||
|
@ -542,7 +541,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return AxisAlignedBB.getBoundingBox(bounds[0][0], bounds[1][0], bounds[2][0], bounds[0][1], bounds[1][1], bounds[2][1]);
|
||||
}
|
||||
|
||||
public static void removePipe(Pipe pipe) {
|
||||
public static void removePipe(Pipe<?> pipe) {
|
||||
if (!isValid(pipe)) {
|
||||
return;
|
||||
}
|
||||
|
@ -580,7 +579,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
|
||||
if (world.isRemote) {
|
||||
return null;
|
||||
}
|
||||
|
@ -589,7 +587,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
int count = quantityDropped(metadata, fortune, world.rand);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (pipe == null) {
|
||||
pipe = pipeRemoved.get(new BlockIndex(x, y, z));
|
||||
|
@ -612,7 +610,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int dmg) {
|
||||
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
@ -623,7 +620,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
continue;
|
||||
}
|
||||
|
||||
Pipe pipe = getPipe(world, i, j, k);
|
||||
Pipe<?> pipe = getPipe(world, i, j, k);
|
||||
|
||||
if (pipe == null) {
|
||||
pipe = pipeRemoved.get(new BlockIndex(i, j, k));
|
||||
|
@ -665,7 +662,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
if (rayTraceResult != null && rayTraceResult.boundingBox != null) {
|
||||
switch (rayTraceResult.hitPart) {
|
||||
case Gate:
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
Gate gate = pipe.gates[rayTraceResult.sideHit.ordinal()];
|
||||
return gate != null ? gate.getGateItem() : null;
|
||||
case Plug:
|
||||
|
@ -693,7 +690,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
pipe.container.scheduleNeighborChange();
|
||||
|
@ -707,7 +704,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, float par7, float par8, int meta) {
|
||||
super.onBlockPlaced(world, x, y, z, side, par6, par7, par8, meta);
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
pipe.onBlockPlaced();
|
||||
|
@ -719,7 +716,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
|
||||
super.onBlockPlacedBy(world, x, y, z, placer, stack);
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
pipe.onBlockPlacedBy(placer);
|
||||
|
@ -732,7 +729,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, BuildCraftTransport.genericPipeBlock);
|
||||
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
ItemStack currentItem = player.getCurrentEquippedItem();
|
||||
|
@ -840,7 +837,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addOrStripGate(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe pipe) {
|
||||
private boolean addOrStripGate(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe<?> pipe) {
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (player.isSneaking()) {
|
||||
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Gate) {
|
||||
|
@ -857,7 +854,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addGate(EntityPlayer player, Pipe pipe, ForgeDirection side) {
|
||||
private boolean addGate(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() instanceof ItemGate && pipe.container.addGate(side, GateFactory.makeGate(pipe, stack, side))) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
|
@ -868,7 +865,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addOrStripWire(EntityPlayer player, Pipe pipe, PipeWire color) {
|
||||
private boolean addOrStripWire(EntityPlayer player, Pipe<?> pipe, PipeWire color) {
|
||||
if (addWire(pipe, color)) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.getCurrentEquippedItem().splitStack(1);
|
||||
|
@ -878,7 +875,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return player.isSneaking() && stripWire(pipe, color);
|
||||
}
|
||||
|
||||
private boolean addWire(Pipe pipe, PipeWire color) {
|
||||
private boolean addWire(Pipe<?> pipe, PipeWire color) {
|
||||
if (!pipe.wireSet[color.ordinal()]) {
|
||||
pipe.wireSet[color.ordinal()] = true;
|
||||
pipe.signalStrength[color.ordinal()] = 0;
|
||||
|
@ -890,7 +887,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean stripWire(Pipe pipe, PipeWire color) {
|
||||
private boolean stripWire(Pipe<?> pipe, PipeWire color) {
|
||||
if (pipe.wireSet[color.ordinal()]) {
|
||||
if (!pipe.container.getWorldObj().isRemote) {
|
||||
dropWire(color, pipe);
|
||||
|
@ -914,7 +911,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addOrStripFacade(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe pipe) {
|
||||
private boolean addOrStripFacade(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe<?> pipe) {
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (player.isSneaking()) {
|
||||
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Facade) {
|
||||
|
@ -931,7 +928,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addFacade(EntityPlayer player, Pipe pipe, ForgeDirection side) {
|
||||
private boolean addFacade(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && stack.getItem() instanceof ItemFacade && pipe.container.addFacade(side, ItemFacade.getFacadeStates(stack))) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
|
@ -942,7 +939,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addOrStripPlug(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe pipe) {
|
||||
private boolean addOrStripPlug(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe<?> pipe) {
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (player.isSneaking()) {
|
||||
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Plug) {
|
||||
|
@ -959,7 +956,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addOrStripRobotStation(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe pipe) {
|
||||
private boolean addOrStripRobotStation(World world, int x, int y, int z, EntityPlayer player, ForgeDirection side, Pipe<?> pipe) {
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (player.isSneaking()) {
|
||||
if (rayTraceResult != null && rayTraceResult.hitPart == Part.RobotStation) {
|
||||
|
@ -976,7 +973,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addPlug(EntityPlayer player, Pipe pipe, ForgeDirection side) {
|
||||
private boolean addPlug(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (pipe.container.addPlug(side)) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
|
@ -987,7 +984,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean addRobotStation(EntityPlayer player, Pipe pipe, ForgeDirection side) {
|
||||
private boolean addRobotStation(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (pipe.container.addRobotStation(side)) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
|
@ -998,7 +995,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean stripEquipment(World world, int x, int y, int z, EntityPlayer player, Pipe pipe) {
|
||||
private boolean stripEquipment(World world, int x, int y, int z, EntityPlayer player, Pipe<?> pipe) {
|
||||
// Try to strip facades first
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (rayTraceResult != null && rayTraceResult.hitPart != Part.Pipe) {
|
||||
|
@ -1022,7 +1019,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
*
|
||||
* @param pipeWire
|
||||
*/
|
||||
private void dropWire(PipeWire pipeWire, Pipe pipe) {
|
||||
private void dropWire(PipeWire pipeWire, Pipe<?> pipe) {
|
||||
pipe.dropItem(pipeWire.getStack());
|
||||
}
|
||||
|
||||
|
@ -1044,7 +1041,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) {
|
||||
super.onEntityCollidedWithBlock(world, i, j, k, entity);
|
||||
|
||||
Pipe pipe = getPipe(world, i, j, k);
|
||||
Pipe<?> pipe = getPipe(world, i, j, k);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
pipe.onEntityCollidedWithBlock(entity);
|
||||
|
@ -1053,7 +1050,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
@Override
|
||||
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
Pipe<?> pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
return pipe.canConnectRedstone();
|
||||
|
@ -1064,7 +1061,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
@Override
|
||||
public int isProvidingStrongPower(IBlockAccess iblockaccess, int x, int y, int z, int l) {
|
||||
Pipe pipe = getPipe(iblockaccess, x, y, z);
|
||||
Pipe<?> pipe = getPipe(iblockaccess, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
return pipe.isPoweringTo(l);
|
||||
|
@ -1080,7 +1077,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) {
|
||||
Pipe pipe = getPipe(world, i, j, k);
|
||||
Pipe<?> pipe = getPipe(world, i, j, k);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
return pipe.isIndirectlyPoweringTo(l);
|
||||
|
@ -1107,7 +1104,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
pipes.put(item, clas);
|
||||
|
||||
Pipe dummyPipe = createPipe(item);
|
||||
Pipe<?> dummyPipe = createPipe(item);
|
||||
if (dummyPipe != null) {
|
||||
item.setPipeIconIndex(dummyPipe.getIconIndexForItem());
|
||||
TransportProxy.proxy.setIconProviderFromPipe(item, dummyPipe);
|
||||
|
@ -1120,7 +1117,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return pipes.containsKey(key);
|
||||
}
|
||||
|
||||
public static Pipe createPipe(Item key) {
|
||||
public static Pipe<?> createPipe(Item key) {
|
||||
|
||||
try {
|
||||
Class<? extends Pipe> pipe = pipes.get(key);
|
||||
|
@ -1138,7 +1135,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean placePipe(Pipe pipe, World world, int i, int j, int k, Block block, int meta) {
|
||||
public static boolean placePipe(Pipe<?> pipe, World world, int i, int j, int k, Block block, int meta) {
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
@ -1157,7 +1154,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
return placed;
|
||||
}
|
||||
|
||||
public static Pipe getPipe(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
public static Pipe<?> getPipe(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
TileEntity tile = blockAccess.getTileEntity(i, j, k);
|
||||
|
||||
if (!(tile instanceof TileGenericPipe) || tile.isInvalid()) {
|
||||
|
@ -1167,11 +1164,11 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isFullyDefined(Pipe pipe) {
|
||||
public static boolean isFullyDefined(Pipe<?> pipe) {
|
||||
return pipe != null && pipe.transport != null && pipe.container != null;
|
||||
}
|
||||
|
||||
public static boolean isValid(Pipe pipe) {
|
||||
public static boolean isValid(Pipe<?> pipe) {
|
||||
return isFullyDefined(pipe);
|
||||
}
|
||||
|
||||
|
@ -1182,9 +1179,11 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
skippedFirstIconRegister = true;
|
||||
return;
|
||||
}
|
||||
|
||||
BuildCraftTransport.instance.wireIconProvider.registerIcons(iconRegister);
|
||||
|
||||
for (Item i : pipes.keySet()) {
|
||||
Pipe dummyPipe = createPipe(i);
|
||||
Pipe<?> dummyPipe = createPipe(i);
|
||||
if (dummyPipe != null) {
|
||||
dummyPipe.getIconProvider().registerIcons(iconRegister);
|
||||
}
|
||||
|
@ -1201,7 +1200,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
for (IGateExpansion expansion : GateExpansions.getExpansions()) {
|
||||
expansion.registerBlockOverlay(iconRegister);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1228,7 +1226,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
int y = target.blockY;
|
||||
int z = target.blockZ;
|
||||
|
||||
Pipe pipe = getPipe(worldObj, x, y, z);
|
||||
Pipe<?> pipe = getPipe(worldObj, x, y, z);
|
||||
if (pipe == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1290,7 +1288,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean addDestroyEffects(World worldObj, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
|
||||
Pipe pipe = getPipe(worldObj, x, y, z);
|
||||
Pipe<?> pipe = getPipe(worldObj, x, y, z);
|
||||
if (pipe == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1319,17 +1317,17 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
if (facadeRenderColor != -1) {
|
||||
return facadeRenderColor;
|
||||
}
|
||||
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
public static void updateNeighbourSignalState(Pipe pipe) {
|
||||
public static void updateNeighbourSignalState(Pipe<?> pipe) {
|
||||
TileBuffer[] neighbours = pipe.container.getTileCache();
|
||||
|
||||
if (neighbours != null) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (neighbours[i] != null && neighbours[i].getTile() instanceof TileGenericPipe && !neighbours[i].getTile().isInvalid()) {
|
||||
((TileGenericPipe) neighbours[i].getTile()).pipe.updateSignalState();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ import buildcraft.transport.triggers.ActionRedstoneFaderOutput;
|
|||
|
||||
public final class Gate implements IGate {
|
||||
|
||||
public final Pipe pipe;
|
||||
public final Pipe<?> pipe;
|
||||
public final GateMaterial material;
|
||||
public final GateLogic logic;
|
||||
public final BiMap<IGateExpansion, GateExpansionController> expansions = HashBiMap.create();
|
||||
|
@ -76,7 +76,7 @@ public final class Gate implements IGate {
|
|||
private ForgeDirection direction;
|
||||
|
||||
// / CONSTRUCTOR
|
||||
public Gate(Pipe pipe, GateMaterial material, GateLogic logic, ForgeDirection direction) {
|
||||
public Gate(Pipe<?> pipe, GateMaterial material, GateLogic logic, ForgeDirection direction) {
|
||||
this.pipe = pipe;
|
||||
this.material = material;
|
||||
this.logic = logic;
|
||||
|
@ -247,7 +247,7 @@ public final class Gate implements IGate {
|
|||
}
|
||||
}
|
||||
|
||||
// / UPDATING
|
||||
// UPDATING
|
||||
public void tick() {
|
||||
for (GateExpansionController expansion : expansions.values()) {
|
||||
expansion.tick(this);
|
||||
|
@ -419,7 +419,7 @@ public final class Gate implements IGate {
|
|||
return false;
|
||||
}
|
||||
|
||||
// / TRIGGERS
|
||||
// TRIGGERS
|
||||
public void addTrigger(List<ITrigger> list) {
|
||||
|
||||
for (PipeWire wire : PipeWire.VALUES) {
|
||||
|
@ -434,7 +434,7 @@ public final class Gate implements IGate {
|
|||
}
|
||||
}
|
||||
|
||||
// / ACTIONS
|
||||
// ACTIONS
|
||||
public void addActions(List<IAction> list) {
|
||||
for (PipeWire wire : PipeWire.VALUES) {
|
||||
if (pipe.wireSet[wire.ordinal()] && material.ordinal() >= wire.ordinal()) {
|
||||
|
@ -448,14 +448,14 @@ public final class Gate implements IGate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setPulsing (boolean pulsing) {
|
||||
public void setPulsing(boolean pulsing) {
|
||||
if (pulsing != isPulsing) {
|
||||
isPulsing = pulsing;
|
||||
pipe.container.scheduleRenderUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public float getPulseStage () {
|
||||
public float getPulseStage() {
|
||||
return pulseStage;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
|
|||
}
|
||||
|
||||
if (world.canPlaceEntityOnSide(block, i, j, k, false, side, entityplayer, itemstack)) {
|
||||
Pipe pipe = BlockGenericPipe.createPipe(this);
|
||||
Pipe<?> pipe = BlockGenericPipe.createPipe(this);
|
||||
|
||||
if (pipe == null) {
|
||||
BCLog.logger.log(Level.WARNING, "Pipe failed to create during placement at {0},{1},{2}", new Object[]{i, j, k});
|
||||
|
|
|
@ -34,26 +34,17 @@ public final class PipeConnectionBans {
|
|||
static {
|
||||
// Fluid pipes
|
||||
banConnection(PipeFluidsStone.class, PipeFluidsCobblestone.class);
|
||||
|
||||
banConnection(PipeFluidsWood.class);
|
||||
|
||||
banConnection(PipeFluidsEmerald.class);
|
||||
|
||||
banConnection(PipeFluidsWood.class, PipeFluidsEmerald.class);
|
||||
|
||||
banConnection(PipeFluidsEmerald.class);
|
||||
|
||||
// Item Pipes
|
||||
banConnection(PipeItemsStone.class, PipeItemsCobblestone.class, PipeItemsQuartz.class);
|
||||
|
||||
banConnection(PipeItemsWood.class);
|
||||
|
||||
banConnection(PipeItemsEmerald.class);
|
||||
|
||||
banConnection(PipeItemsEmzuli.class);
|
||||
|
||||
banConnection(PipeItemsWood.class, PipeItemsEmerald.class, PipeItemsEmzuli.class);
|
||||
|
||||
banConnection(PipeItemsObsidian.class);
|
||||
|
||||
// Power Pipes
|
||||
|
|
|
@ -124,12 +124,12 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
if (this.getFluid() != null) {
|
||||
this.getFluid().writeToNBT(subTag);
|
||||
}
|
||||
|
||||
return subTag;
|
||||
}
|
||||
}
|
||||
|
||||
public enum TransferState {
|
||||
|
||||
None, Input, Output
|
||||
}
|
||||
/**
|
||||
|
@ -182,7 +182,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
}
|
||||
|
||||
if (entity instanceof TileGenericPipe) {
|
||||
Pipe pipe = ((TileGenericPipe) entity).pipe;
|
||||
Pipe<?> pipe = ((TileGenericPipe) entity).pipe;
|
||||
|
||||
if (pipe == null || !pipe.inputOpen(o.getOpposite())) {
|
||||
return false;
|
||||
|
@ -511,7 +511,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
@Override
|
||||
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportFluids)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -504,7 +504,7 @@ public class PipeTransportItems extends PipeTransport {
|
|||
@Override
|
||||
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportItems)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class PipeTransportPower extends PipeTransport {
|
|||
@Override
|
||||
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportPower)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ public class PipeTransportPower extends PipeTransport {
|
|||
return amount;
|
||||
}
|
||||
|
||||
public float getPistonStage (int i) {
|
||||
public float getPistonStage(int i) {
|
||||
if (movementStage [i] < 0.5F) {
|
||||
return movementStage [i] * 2;
|
||||
} else {
|
||||
|
@ -508,7 +508,7 @@ public class PipeTransportPower extends PipeTransport {
|
|||
}
|
||||
}
|
||||
|
||||
public double clearInstantPower () {
|
||||
public double clearInstantPower() {
|
||||
double amount = 0.0;
|
||||
|
||||
for (int i = 0; i < internalPower.length; ++i) {
|
||||
|
|
|
@ -24,7 +24,7 @@ public class PipeTransportStructure extends PipeTransport {
|
|||
@Override
|
||||
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
|
||||
|
||||
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportStructure)) {
|
||||
return false;
|
||||
|
|
|
@ -25,7 +25,7 @@ public class PipeTriggerProvider implements ITriggerProvider {
|
|||
@Override
|
||||
public LinkedList<ITrigger> getPipeTriggers(IPipeTile tile) {
|
||||
LinkedList<ITrigger> result = new LinkedList<ITrigger>();
|
||||
Pipe pipe = null;
|
||||
Pipe<?> pipe = null;
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
pipe = ((TileGenericPipe) tile).pipe;
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
}
|
||||
}
|
||||
|
||||
public void initialize(Pipe pipe) {
|
||||
public void initialize(Pipe<?> pipe) {
|
||||
this.blockType = getBlockType();
|
||||
|
||||
if (pipe == null) {
|
||||
|
@ -689,7 +689,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
if (((TileGenericPipe) with).hasBlockingPluggable(side.getOpposite())) {
|
||||
return false;
|
||||
}
|
||||
Pipe otherPipe = ((TileGenericPipe) with).pipe;
|
||||
Pipe<?> otherPipe = ((TileGenericPipe) with).pipe;
|
||||
|
||||
if (!BlockGenericPipe.isValid(otherPipe)) {
|
||||
return false;
|
||||
|
|
|
@ -14,6 +14,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
import buildcraft.BuildCraftTransport;
|
||||
|
||||
public class TransportProxy {
|
||||
|
||||
@SidedProxy(clientSide = "buildcraft.transport.TransportProxyClient", serverSide = "buildcraft.transport.TransportProxy")
|
||||
public static TransportProxy proxy;
|
||||
public static int pipeModel = -1;
|
||||
|
@ -29,11 +30,8 @@ public class TransportProxy {
|
|||
}
|
||||
|
||||
public void initIconProviders(BuildCraftTransport instance){
|
||||
|
||||
}
|
||||
|
||||
public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) {
|
||||
|
||||
public void setIconProviderFromPipe(ItemPipe item, Pipe<?> dummyPipe) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TransportProxyClient extends TransportProxy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) {
|
||||
public void setIconProviderFromPipe(ItemPipe item, Pipe<?> dummyPipe) {
|
||||
item.setPipesIcons(dummyPipe.getIconProvider());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ public final class GateFactory {
|
|||
private GateFactory() {
|
||||
}
|
||||
|
||||
public static Gate makeGate(Pipe pipe, GateMaterial material, GateLogic logic, ForgeDirection direction) {
|
||||
public static Gate makeGate(Pipe<?> pipe, GateMaterial material, GateLogic logic, ForgeDirection direction) {
|
||||
return new Gate(pipe, material, logic, direction);
|
||||
}
|
||||
|
||||
public static Gate makeGate(Pipe pipe, ItemStack stack, ForgeDirection direction) {
|
||||
public static Gate makeGate(Pipe<?> pipe, ItemStack stack, ForgeDirection direction) {
|
||||
if (stack == null || stack.stackSize <= 0 || !(stack.getItem() instanceof ItemGate)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public final class GateFactory {
|
|||
return gate;
|
||||
}
|
||||
|
||||
public static Gate makeGate(Pipe pipe, NBTTagCompound nbt) {
|
||||
public static Gate makeGate(Pipe<?> pipe, NBTTagCompound nbt) {
|
||||
GateMaterial material = GateMaterial.REDSTONE;
|
||||
GateLogic logic = GateLogic.AND;
|
||||
ForgeDirection direction = ForgeDirection.UNKNOWN;
|
||||
|
|
|
@ -53,7 +53,6 @@ public class ItemGate extends ItemBuildCraft {
|
|||
public IGateExpansion[] expansions;
|
||||
|
||||
public GatePluggable() {
|
||||
|
||||
}
|
||||
|
||||
public GatePluggable(Gate gate) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ContainerGateInterface extends BuildCraftContainer {
|
|||
public GuiGateInterface gateCallback;
|
||||
|
||||
IInventory playerIInventory;
|
||||
private final Pipe pipe;
|
||||
private final Pipe<?> pipe;
|
||||
private Gate gate;
|
||||
private final NavigableSet<ITrigger> potentialTriggers = new TreeSet<ITrigger>(new Comparator<ITrigger>() {
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class ContainerGateInterface extends BuildCraftContainer {
|
|||
private boolean isNetInitialized = false;
|
||||
private int lastTriggerState = 0;
|
||||
|
||||
public ContainerGateInterface(IInventory playerInventory, Pipe pipe) {
|
||||
public ContainerGateInterface(IInventory playerInventory, Pipe<?> pipe) {
|
||||
super(0);
|
||||
|
||||
for (int i = 0; i < actionsState.length; ++i) {
|
||||
|
|
|
@ -39,19 +39,16 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
|
||||
IInventory playerInventory;
|
||||
private final ContainerGateInterface container;
|
||||
private final Pipe pipe;
|
||||
private final Pipe<?> pipe;
|
||||
private Gate gate;
|
||||
|
||||
private abstract class StatementSlot extends AdvancedSlot {
|
||||
|
||||
public Pipe pipe;
|
||||
public int slot;
|
||||
public ArrayList<StatementParameterSlot> parameters = new ArrayList<StatementParameterSlot>();
|
||||
|
||||
public StatementSlot(int x, int y, Pipe pipe, int slot) {
|
||||
public StatementSlot(int x, int y, Pipe<?> pipe, int slot) {
|
||||
super(GuiGateInterface.this, x, y);
|
||||
|
||||
this.pipe = pipe;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
|
@ -87,7 +84,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
|
||||
private class TriggerSlot extends StatementSlot {
|
||||
public TriggerSlot(int x, int y, Pipe pipe, int slot) {
|
||||
public TriggerSlot(int x, int y, Pipe<?> pipe, int slot) {
|
||||
super(x, y, pipe, slot);
|
||||
}
|
||||
|
||||
|
@ -98,7 +95,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
|
||||
private class ActionSlot extends StatementSlot {
|
||||
public ActionSlot(int x, int y, Pipe pipe, int slot) {
|
||||
public ActionSlot(int x, int y, Pipe<?> pipe, int slot) {
|
||||
super(x, y, pipe, slot);
|
||||
}
|
||||
|
||||
|
@ -110,11 +107,11 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
|
||||
private abstract class StatementParameterSlot extends AdvancedSlot {
|
||||
|
||||
public Pipe pipe;
|
||||
public Pipe<?> pipe;
|
||||
public int slot;
|
||||
public StatementSlot statementSlot;
|
||||
|
||||
public StatementParameterSlot(int x, int y, Pipe pipe, int slot, StatementSlot iStatementSlot) {
|
||||
public StatementParameterSlot(int x, int y, Pipe<?> pipe, int slot, StatementSlot iStatementSlot) {
|
||||
super(GuiGateInterface.this, x, y);
|
||||
|
||||
this.pipe = pipe;
|
||||
|
@ -164,7 +161,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
|
||||
class TriggerParameterSlot extends StatementParameterSlot {
|
||||
public TriggerParameterSlot(int x, int y, Pipe pipe, int slot, StatementSlot iStatementSlot) {
|
||||
public TriggerParameterSlot(int x, int y, Pipe<?> pipe, int slot, StatementSlot iStatementSlot) {
|
||||
super(x, y, pipe, slot, iStatementSlot);
|
||||
}
|
||||
|
||||
|
@ -180,7 +177,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
|
||||
class ActionParameterSlot extends StatementParameterSlot {
|
||||
public ActionParameterSlot(int x, int y, Pipe pipe, int slot, StatementSlot iStatementSlot) {
|
||||
public ActionParameterSlot(int x, int y, Pipe<?> pipe, int slot, StatementSlot iStatementSlot) {
|
||||
super(x, y, pipe, slot, iStatementSlot);
|
||||
}
|
||||
|
||||
|
@ -195,7 +192,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
}
|
||||
|
||||
public GuiGateInterface(IInventory playerInventory, Pipe pipe) {
|
||||
public GuiGateInterface(IInventory playerInventory, Pipe<?> pipe) {
|
||||
super(new ContainerGateInterface(playerInventory, pipe), null, null);
|
||||
|
||||
container = (ContainerGateInterface) this.inventorySlots;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class PipeFluidsIron extends Pipe<PipeTransportFluids> {
|
|||
@Override
|
||||
protected boolean isValidConnectingTile(TileEntity tile) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
if (otherPipe instanceof PipeFluidsWood || otherPipe instanceof PipeStructureCobblestone) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -49,7 +49,7 @@ public class PipeItemsDaizuli extends Pipe<PipeTransportItems> {
|
|||
@Override
|
||||
protected boolean isValidConnectingTile(TileEntity tile) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
if (otherPipe instanceof PipeItemsWood) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class PipeItemsIron extends Pipe<PipeTransportItems> {
|
|||
@Override
|
||||
protected boolean isValidConnectingTile(TileEntity tile) {
|
||||
if (tile instanceof TileGenericPipe) {
|
||||
Pipe otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
|
||||
if (otherPipe instanceof PipeItemsWood) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,6 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> {
|
|||
public void eventHandler(PipeEventItem.DropItem event) {
|
||||
Position p = new Position(container.xCoord, container.yCoord,
|
||||
container.zCoord, event.direction);
|
||||
Position from = new Position(p);
|
||||
p.moveForwards(1.0);
|
||||
|
||||
ItemStack stack = event.entity.getEntityItem();
|
||||
|
@ -231,7 +230,7 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> {
|
|||
public boolean convertPipe(PipeTransportItems pipe, TravelingItem item) {
|
||||
if (item.getItemStack().getItem() instanceof ItemPipe) {
|
||||
if (!(item.getItemStack().getItem() == BuildCraftTransport.pipeItemsStripes)) {
|
||||
Pipe newPipe = BlockGenericPipe.createPipe(item.getItemStack().getItem());
|
||||
Pipe<?> newPipe = BlockGenericPipe.createPipe(item.getItemStack().getItem());
|
||||
newPipe.setTile(this.container);
|
||||
this.container.pipe = newPipe;
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@ import buildcraft.transport.Pipe;
|
|||
|
||||
public abstract class PipeLogicIron {
|
||||
|
||||
protected final Pipe pipe;
|
||||
protected final Pipe<?> pipe;
|
||||
private boolean lastPower = false;
|
||||
|
||||
public PipeLogicIron(Pipe pipe) {
|
||||
public PipeLogicIron(Pipe<?> pipe) {
|
||||
this.pipe = pipe;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ import buildcraft.transport.Pipe;
|
|||
|
||||
public abstract class PipeLogicWood {
|
||||
|
||||
protected final Pipe pipe;
|
||||
protected final Pipe<?> pipe;
|
||||
|
||||
public PipeLogicWood(Pipe pipe) {
|
||||
public PipeLogicWood(Pipe<?> pipe) {
|
||||
this.pipe = pipe;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class SchematicPipe extends SchematicTile {
|
|||
|
||||
@Override
|
||||
public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) {
|
||||
Pipe pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
|
||||
if (BlockGenericPipe.isValid(pipe)) {
|
||||
return pipe.item == Item.getItemById(tileNBT.getInteger("pipeId"));
|
||||
|
@ -90,7 +90,7 @@ public class SchematicPipe extends SchematicTile {
|
|||
@Override
|
||||
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
|
||||
TileEntity tile = context.world().getTileEntity(x, y, z);
|
||||
Pipe pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
|
||||
if (BlockGenericPipe.isValid(pipe)) {
|
||||
tile.writeToNBT(tileNBT);
|
||||
|
@ -115,8 +115,7 @@ public class SchematicPipe extends SchematicTile {
|
|||
|
||||
@Override
|
||||
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) {
|
||||
TileEntity tile = context.world().getTileEntity(x, y, z);
|
||||
Pipe pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);
|
||||
|
||||
if (BlockGenericPipe.isValid(pipe)) {
|
||||
ArrayList<ItemStack> items = pipe.computeItemDrop();
|
||||
|
@ -137,7 +136,7 @@ public class SchematicPipe extends SchematicTile {
|
|||
}
|
||||
|
||||
@Override
|
||||
public BuildingStage getBuildStage () {
|
||||
public BuildingStage getBuildStage() {
|
||||
return BuildingStage.STANDALONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import buildcraft.transport.pipes.PipePowerWood;
|
|||
public class TriggerPipeContents extends BCTrigger {
|
||||
|
||||
public enum PipeContents {
|
||||
|
||||
empty,
|
||||
containsItems,
|
||||
containsFluids,
|
||||
|
@ -73,7 +72,7 @@ public class TriggerPipeContents extends BCTrigger {
|
|||
|
||||
@Override
|
||||
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
|
||||
Pipe pipe = (Pipe) gate.getPipe();
|
||||
Pipe<?> pipe = (Pipe<?>) gate.getPipe();
|
||||
ITriggerParameter parameter = parameters[0];
|
||||
|
||||
if (pipe.transport instanceof PipeTransportItems) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class TriggerPipeSignal extends BCTrigger {
|
|||
|
||||
@Override
|
||||
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
|
||||
Pipe pipe = (Pipe) gate.getPipe();
|
||||
Pipe<?> pipe = (Pipe<?>) gate.getPipe();
|
||||
|
||||
if (active) {
|
||||
if (pipe.signalStrength[color.ordinal()] == 0) {
|
||||
|
|
Loading…
Reference in a new issue