Merge pull request #1892 from tambry/Parameterize

Parameterize things
This commit is contained in:
SpaceToad 2014-06-15 19:48:55 +02:00
commit b9df5af112
75 changed files with 213 additions and 283 deletions

View file

@ -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); schematicToFactory.put(clas, factory);
factories.put(factory.getClass().getCanonicalName(), factory); factories.put(factory.getClass().getCanonicalName(), factory);
} }

View file

@ -26,7 +26,6 @@ import net.minecraftforge.fluids.FluidStack;
import buildcraft.api.core.JavaTools; import buildcraft.api.core.JavaTools;
public final class SchematicRegistry { public final class SchematicRegistry {
public static double BREAK_ENERGY = 10; public static double BREAK_ENERGY = 10;
@ -53,7 +52,7 @@ public final class SchematicRegistry {
public final Class<? extends Schematic> clazz; public final Class<? extends Schematic> clazz;
public final Object[] params; public final Object[] params;
private final Constructor constructor; private final Constructor<?> constructor;
SchematicConstructor(Class<? extends Schematic> clazz, Object[] params) throws IllegalArgumentException { SchematicConstructor(Class<? extends Schematic> clazz, Object[] params) throws IllegalArgumentException {
this.clazz = clazz; this.clazz = clazz;
@ -65,7 +64,7 @@ public final class SchematicRegistry {
return (Schematic) constructor.newInstance(params); return (Schematic) constructor.newInstance(params);
} }
private Constructor findConstructor() throws IllegalArgumentException { private Constructor<?> findConstructor() throws IllegalArgumentException {
for (Constructor<?> c : clazz.getConstructors()) { for (Constructor<?> c : clazz.getConstructors()) {
Class<?>[] typesSignature = c.getParameterTypes(); Class<?>[] typesSignature = c.getParameterTypes();
if (typesSignature.length != params.length) { if (typesSignature.length != params.length) {

View file

@ -12,5 +12,5 @@ public interface IRedstoneBoard<T> {
void updateBoard(T container); void updateBoard(T container);
RedstoneBoardNBT getNBTHandler(); RedstoneBoardNBT<?> getNBTHandler();
} }

View file

@ -29,7 +29,7 @@ public abstract class RedstoneBoardNBT<T> {
public abstract String getID(); 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); public abstract IRedstoneBoard<T> create(NBTTagCompound nbt, T object);
@ -81,5 +81,4 @@ public abstract class RedstoneBoardNBT<T> {
public float nextFloat(int difficulty) { public float nextFloat(int difficulty) {
return 1F - (float) Math.pow(rand.nextFloat(), 1F / difficulty); return 1F - (float) Math.pow(rand.nextFloat(), 1F / difficulty);
} }
} }

View file

@ -17,13 +17,13 @@ public abstract class RedstoneBoardRegistry {
public static RedstoneBoardRegistry instance; 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 void createRandomBoard(NBTTagCompound nbt);
public abstract RedstoneBoardNBT getRedstoneBoard(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); public abstract void registerIcons(IIconRegister par1IconRegister);
@ -34,5 +34,4 @@ public abstract class RedstoneBoardRegistry {
public abstract String getKindForParam(IBoardParameter param); public abstract String getKindForParam(IBoardParameter param);
public abstract Collection<RedstoneBoardNBT> getAllBoardNBTs(); public abstract Collection<RedstoneBoardNBT> getAllBoardNBTs();
} }

View file

@ -31,7 +31,7 @@ public final class BCLog {
logger.info("http://www.mod-buildcraft.com"); 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); StringBuilder msg = new StringBuilder(mod);
msg.append(" API error, please update your mods. Error: ").append(error); msg.append(" API error, please update your mods. Error: ").append(error);
StackTraceElement[] stackTrace = error.getStackTrace(); StackTraceElement[] stackTrace = error.getStackTrace();

View file

@ -50,10 +50,10 @@ public class JavaTools {
return c; return c;
} }
public static List<Field> getAllFields(Class clas) { public static List<Field> getAllFields(Class<?> clas) {
List<Field> result = new ArrayList<Field>(); List<Field> result = new ArrayList<Field>();
Class current = clas; Class<?> current = clas;
while (current != null && current != Object.class) { while (current != null && current != Object.class) {
for (Field f : current.getDeclaredFields()) { for (Field f : current.getDeclaredFields()) {
@ -66,10 +66,10 @@ public class JavaTools {
return result; return result;
} }
public static List<Method> getAllMethods(Class clas) { public static List<Method> getAllMethods(Class<?> clas) {
List<Method> result = new ArrayList<Method>(); List<Method> result = new ArrayList<Method>();
Class current = clas; Class<?> current = clas;
while (current != null && current != Object.class) { while (current != null && current != Object.class) {
for (Method m : current.getDeclaredMethods()) { for (Method m : current.getDeclaredMethods()) {

View file

@ -33,6 +33,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
* Joules batteries and provide different models. * Joules batteries and provide different models.
*/ */
public final class MjAPI { public final class MjAPI {
public static final String DEFAULT_POWER_FRAMEWORK = "buildcraft.kinesis"; public static final String DEFAULT_POWER_FRAMEWORK = "buildcraft.kinesis";
private static Map<BatteryHolder, BatteryField> mjBatteryFields = new HashMap<BatteryHolder, BatteryField>(); private static Map<BatteryHolder, BatteryField> mjBatteryFields = new HashMap<BatteryHolder, BatteryField>();
private static Map<String, Class<? extends IBatteryObject>> mjBatteryKinds = new HashMap<String, Class<? extends IBatteryObject>>(); 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 static final class BatteryHolder {
private String kind; private String kind;
private ForgeDirection side; private ForgeDirection side;
private Class clazz; private Class<? extends Object> clazz;
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
@ -382,7 +383,7 @@ public final class MjAPI {
public BatteryKind kind; 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(); BatteryHolder holder = new BatteryHolder();
holder.clazz = c; holder.clazz = c;
holder.kind = kind; holder.kind = kind;

View file

@ -21,6 +21,5 @@ public class CraftingResult<T> {
public ArrayList<FluidStack> usedFluids = new ArrayList<FluidStack>(); public ArrayList<FluidStack> usedFluids = new ArrayList<FluidStack>();
public double energyCost = 0; public double energyCost = 0;
public long craftingTime = 0; public long craftingTime = 0;
public IFlexibleRecipe recipe; public IFlexibleRecipe<?> recipe;
} }

View file

@ -15,5 +15,4 @@ public interface IFlexibleRecipe<T> {
CraftingResult<T> craft(IFlexibleCrafter crafter, boolean preview); CraftingResult<T> craft(IFlexibleCrafter crafter, boolean preview);
String getId(); String getId();
} }

View file

@ -269,7 +269,7 @@ public class BuildCraftSilicon extends BuildCraftMod {
private static void addGateRecipe(String materialName, double energyCost, GateMaterial material, Chipset chipset, private static void addGateRecipe(String materialName, double energyCost, GateMaterial material, Chipset chipset,
PipeWire... pipeWire) { PipeWire... pipeWire) {
List temp = new ArrayList(); List<ItemStack> temp = new ArrayList<ItemStack>();
temp.add(chipset.getStack()); temp.add(chipset.getStack());
for (PipeWire wire : pipeWire) { for (PipeWire wire : pipeWire) {
temp.add(wire.getStack()); temp.add(wire.getStack());

View file

@ -530,5 +530,4 @@ public class BuildCraftTransport extends BuildCraftMod {
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
TileFilteredBuffer.class.getCanonicalName()); TileFilteredBuffer.class.getCanonicalName());
} }
} }

View file

@ -108,7 +108,7 @@ public class BlockSpring extends Block {
// Prevents updates on chunk generation // Prevents updates on chunk generation
@Override @Override
public boolean func_149698_L () { public boolean func_149698_L() {
return false; return false;
} }

View file

@ -53,7 +53,6 @@ public class ItemMapLocation extends ItemBuildCraft {
NBTTagCompound cpt = NBTUtils.getItemData(stack); NBTTagCompound cpt = NBTUtils.getItemData(stack);
if (!cpt.hasKey("kind")) { if (!cpt.hasKey("kind")) {
} else { } else {
switch (cpt.getByte("kind")) { switch (cpt.getByte("kind")) {
case 0: { case 0: {
@ -91,7 +90,6 @@ public class ItemMapLocation extends ItemBuildCraft {
} }
if (cpt.hasKey("kind")) { if (cpt.hasKey("kind")) {
} }
} }
@ -132,7 +130,6 @@ public class ItemMapLocation extends ItemBuildCraft {
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer par2EntityPlayer, World world, int x, public boolean onItemUse(ItemStack stack, EntityPlayer par2EntityPlayer, World world, int x,
int y, int z, int side, float par8, float par9, float par10) { int y, int z, int side, float par8, float par9, float par10) {
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
NBTTagCompound cpt = NBTUtils.getItemData(stack); NBTTagCompound cpt = NBTUtils.getItemData(stack);
@ -171,8 +168,6 @@ public class ItemMapLocation extends ItemBuildCraft {
cpt.setInteger("z", z); cpt.setInteger("z", z);
} }
return true; return true;
} }
} }

View file

@ -19,7 +19,6 @@ import net.minecraft.world.World;
import buildcraft.api.boards.RedstoneBoardNBT; import buildcraft.api.boards.RedstoneBoardNBT;
import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.boards.RedstoneBoardRegistry;
import buildcraft.api.boards.RedstoneBoardRobot;
import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.boards.RedstoneBoardRobotNBT;
import buildcraft.core.robots.EntityRobot; import buildcraft.core.robots.EntityRobot;
import buildcraft.core.utils.NBTUtils; import buildcraft.core.utils.NBTUtils;
@ -32,7 +31,6 @@ public class ItemRobot extends ItemBuildCraft {
public EntityRobot createRobot(ItemStack stack, World world) { public EntityRobot createRobot(ItemStack stack, World world) {
try { try {
RedstoneBoardRobot board = null;
NBTTagCompound nbt = NBTUtils.getItemData(stack); NBTTagCompound nbt = NBTUtils.getItemData(stack);
NBTTagCompound boardCpt = nbt.getCompoundTag("board"); NBTTagCompound boardCpt = nbt.getCompoundTag("board");
@ -52,7 +50,7 @@ public class ItemRobot extends ItemBuildCraft {
return EntityRobot.ROBOT_BASE; return EntityRobot.ROBOT_BASE;
} else { } else {
NBTTagCompound board = nbt.getCompoundTag("board"); NBTTagCompound board = nbt.getCompoundTag("board");
RedstoneBoardNBT boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(board); RedstoneBoardNBT<?> boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(board);
if (boardNBT instanceof RedstoneBoardRobotNBT) { if (boardNBT instanceof RedstoneBoardRobotNBT) {
return ((RedstoneBoardRobotNBT) boardNBT).getRobotTexture(); return ((RedstoneBoardRobotNBT) boardNBT).getRobotTexture();

View file

@ -17,6 +17,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public abstract class GuiAdvancedInterface extends GuiBuildCraft { public abstract class GuiAdvancedInterface extends GuiBuildCraft {
public AdvancedSlot[] slots; public AdvancedSlot[] slots;
public GuiAdvancedInterface(BuildCraftContainer container, IInventory inventory, ResourceLocation texture) { public GuiAdvancedInterface(BuildCraftContainer container, IInventory inventory, ResourceLocation texture) {

View file

@ -96,7 +96,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
GL11.glEnable(GL11.GL_DEPTH_TEST); 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) { for (Object obj : objects) {
if (!(obj instanceof IToolTipProvider)) { if (!(obj instanceof IToolTipProvider)) {
continue; continue;

View file

@ -36,7 +36,7 @@ public final class GuiTools {
fr.drawString(s, sPos, y, color, shadow); 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; int buttonWidth = 0;
for (GuiBetterButton b : buttons) { for (GuiBetterButton b : buttons) {
buttonWidth += b.getWidth(); 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; int pointer = 0;
for (GuiBetterButton b : buttons) { for (GuiBetterButton b : buttons) {
b.xPosition = xStart + pointer; b.xPosition = xStart + pointer;
@ -60,5 +60,4 @@ public final class GuiTools {
buttonList.add(b); buttonList.add(b);
} }
} }
} }

View file

@ -21,9 +21,9 @@ import buildcraft.core.gui.tooltips.ToolTip;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiMultiButton extends GuiBetterButton { 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, ""); super(id, x, y, width, StandardButtonTextureSets.LARGE_BUTTON, "");
this.control = control; this.control = control;
} }
@ -74,7 +74,7 @@ public class GuiMultiButton extends GuiBetterButton {
return pressed; return pressed;
} }
public MultiButtonController getController() { public MultiButtonController<?> getController() {
return control; return control;
} }

View file

@ -25,11 +25,11 @@ public final class MultiButtonController<T extends IMultiButtonState> {
this.validStates = validStates; 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); return new MultiButtonController<T>(startState, validStates);
} }
public MultiButtonController copy() { public MultiButtonController<?> copy() {
return new MultiButtonController(currentState, validStates.clone()); return new MultiButtonController(currentState, validStates.clone());
} }

View file

@ -17,20 +17,19 @@ import buildcraft.transport.Pipe;
// TODO: This is not yet used // TODO: This is not yet used
public class PacketRPCPipe extends BuildCraftPacket { public class PacketRPCPipe extends BuildCraftPacket {
public Pipe pipe; public Pipe<?> pipe;
public EntityPlayer sender; public EntityPlayer sender;
private byte[] contents; private byte[] contents;
public PacketRPCPipe () { public PacketRPCPipe() {
} }
public PacketRPCPipe (byte [] bytes) { public PacketRPCPipe(byte[] bytes) {
contents = bytes; contents = bytes;
} }
public void setPipe (Pipe aPipe) { public void setPipe(Pipe<?> aPipe) {
pipe = aPipe; pipe = aPipe;
} }
@ -51,5 +50,4 @@ public class PacketRPCPipe extends BuildCraftPacket {
public void writeData(ByteBuf data) { public void writeData(ByteBuf data) {
data.writeBytes(contents); data.writeBytes(contents);
} }
} }

View file

@ -43,24 +43,25 @@ import buildcraft.transport.Pipe;
* RPCs must be sent and received by a tile entity. * RPCs must be sent and received by a tile entity.
*/ */
public final class RPCHandler { public final class RPCHandler {
public static int MAX_PACKET_SIZE = 30 * 1024; public static int MAX_PACKET_SIZE = 30 * 1024;
private static Map<String, RPCHandler> handlers = new TreeMap<String, RPCHandler>(); 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>(); private Map<String, Integer> methodsMap = new TreeMap<String, Integer>();
class MethodMapping { class MethodMapping {
Method method; Method method;
Class [] parameters; Class[] parameters;
ClassSerializer [] mappings; ClassSerializer [] mappings;
boolean hasInfo = false; boolean hasInfo = false;
} }
private MethodMapping [] methods; private MethodMapping [] methods;
private RPCHandler(Class c) { private RPCHandler(Class<? extends Object> c) {
handledClass = c; handledClass = c;
Method [] sortedMethods = JavaTools.getAllMethods (c).toArray(new Method [0]); 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(); ByteBuf data = Unpooled.buffer();
try { 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)) { if (int.class.equals(formal)) {
data.writeInt((Integer) actual); data.writeInt((Integer) actual);
} else if (float.class.equals(formal)) { } else if (float.class.equals(formal)) {
@ -318,7 +319,7 @@ public final class RPCHandler {
Utils.writeUTF(data, (String) actual); Utils.writeUTF(data, (String) actual);
} else if (formal.isArray()) { } else if (formal.isArray()) {
Object[] array = (Object[]) actual; Object[] array = (Object[]) actual;
Class componentType = formal.getComponentType(); Class<?> componentType = formal.getComponentType();
data.writeInt(array.length); data.writeInt(array.length);
for (int i = 0; i < array.length; i++) { for (int i = 0; i < array.length; i++) {
writePrimitive(data, componentType, array[i]); writePrimitive(data, componentType, array[i]);
@ -336,7 +337,7 @@ public final class RPCHandler {
MethodMapping m = methods [methodIndex]; MethodMapping m = methods [methodIndex];
Class[] formals = m.parameters; 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; 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)) { if (int.class.equals(formal)) {
actuals[i] = data.readInt(); actuals[i] = data.readInt();
} else if (float.class.equals(formal)) { } else if (float.class.equals(formal)) {
@ -382,7 +383,7 @@ public final class RPCHandler {
actuals[i] = Utils.readUTF(data); actuals[i] = Utils.readUTF(data);
} else if (formal.isArray()) { } else if (formal.isArray()) {
final int size = data.readInt(); final int size = data.readInt();
Class componentType = formal.getComponentType(); Class<?> componentType = formal.getComponentType();
Object[] a = (Object[]) Array.newInstance(componentType, size); Object[] a = (Object[]) Array.newInstance(componentType, size);
for (int z = 0; z < size; z++) { for (int z = 0; z < size; z++) {
readPrimitive(data, componentType, a, z); readPrimitive(data, componentType, a, z);

View file

@ -71,7 +71,6 @@ import buildcraft.core.utils.Utils;
*/ */
public class ClassMapping extends ClassSerializer { public class ClassMapping extends ClassSerializer {
private static SerializerObject anonymousSerializer = new SerializerObject();
private static Map<String, ClassSerializer> classes = new TreeMap<String, ClassSerializer>(); private static Map<String, ClassSerializer> classes = new TreeMap<String, ClassSerializer>();
private LinkedList<Field> floatFields = new LinkedList<Field>(); 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, private void writeArray(Object obj, ByteBuf data, SerializationContext context) throws IllegalArgumentException,
IllegalAccessException { IllegalAccessException {
Class<? extends Object> cpt = mappedClass.getComponentType();
switch (cptType) { switch (cptType) {
case Byte: { case Byte: {
byte [] arr = (byte []) obj; byte[] arr = (byte[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
data.writeBytes(arr); data.writeBytes(arr);
@ -400,7 +397,7 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Float: { case Float: {
float [] arr = (float []) obj; float[] arr = (float[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (float element : arr) { for (float element : arr) {
@ -410,7 +407,7 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Double: { case Double: {
double [] arr = (double []) obj; double[] arr = (double[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (double element : arr) { for (double element : arr) {
@ -420,7 +417,7 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Short: { case Short: {
short [] arr = (short []) obj; short[] arr = (short[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (short element : arr) { for (short element : arr) {
@ -430,7 +427,7 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Int: { case Int: {
int [] arr = (int []) obj; int[] arr = (int[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (int element : arr) { for (int element : arr) {
@ -440,7 +437,7 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Boolean: { case Boolean: {
boolean [] arr = (boolean []) obj; boolean[] arr = (boolean[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (boolean element : arr) { for (boolean element : arr) {
@ -450,10 +447,10 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Enum: { case Enum: {
Enum [] arr = (Enum []) obj; Enum[] arr = (Enum[]) obj;
data.writeInt (arr.length); data.writeInt (arr.length);
for (Enum element : arr) { for (Enum<?> element : arr) {
data.writeBoolean(element != null); data.writeBoolean(element != null);
if (element != null) { if (element != null) {
@ -464,8 +461,8 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Object: { case Object: {
Object [] arr = (Object []) obj; Object[] arr = (Object[]) obj;
data.writeInt (arr.length); data.writeInt(arr.length);
for (Object element : arr) { for (Object element : arr) {
cptMapping.write(data, element, context); cptMapping.write(data, element, context);
@ -486,12 +483,12 @@ public class ClassMapping extends ClassSerializer {
switch (cptType) { switch (cptType) {
case Byte: { case Byte: {
byte [] arr; byte[] arr;
if (obj == null) { if (obj == null) {
arr = new byte [size]; arr = new byte[size];
} else { } else {
arr = (byte []) obj; arr = (byte[]) obj;
} }
data.readBytes (arr); data.readBytes (arr);
@ -501,16 +498,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Float: { case Float: {
float [] arr; float[] arr;
if (obj == null) { if (obj == null) {
arr = new float [size]; arr = new float[size];
} else { } else {
arr = (float []) obj; arr = (float[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
arr [i] = data.readFloat(); arr[i] = data.readFloat();
} }
obj = arr; obj = arr;
@ -518,16 +515,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Double: { case Double: {
double [] arr; double[] arr;
if (obj == null) { if (obj == null) {
arr = new double [size]; arr = new double[size];
} else { } else {
arr = (double []) obj; arr = (double[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
arr [i] = data.readDouble(); arr[i] = data.readDouble();
} }
obj = arr; obj = arr;
@ -535,16 +532,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Short: { case Short: {
short [] arr; short[] arr;
if (obj == null) { if (obj == null) {
arr = new short [size]; arr = new short[size];
} else { } else {
arr = (short []) obj; arr = (short[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
arr [i] = data.readShort(); arr[i] = data.readShort();
} }
obj = arr; obj = arr;
@ -552,16 +549,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Int: { case Int: {
int [] arr; int[] arr;
if (obj == null) { if (obj == null) {
arr = new int [size]; arr = new int[size];
} else { } else {
arr = (int []) obj; arr = (int[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
arr [i] = data.readInt(); arr[i] = data.readInt();
} }
obj = arr; obj = arr;
@ -569,16 +566,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Boolean: { case Boolean: {
boolean [] arr; boolean[] arr;
if (obj == null) { if (obj == null) {
arr = new boolean [size]; arr = new boolean[size];
} else { } else {
arr = (boolean []) obj; arr = (boolean[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
arr [i] = data.readBoolean(); arr[i] = data.readBoolean();
} }
obj = arr; obj = arr;
@ -596,7 +593,7 @@ public class ClassMapping extends ClassSerializer {
for (int i = 0; i < arr.length; ++i) { for (int i = 0; i < arr.length; ++i) {
if (data.readBoolean()) { if (data.readBoolean()) {
arr[i] = (Enum) cpt.getEnumConstants()[data.readByte()]; arr[i] = (Enum<?>) cpt.getEnumConstants()[data.readByte()];
} else { } else {
arr[i] = null; arr[i] = null;
} }
@ -607,16 +604,16 @@ public class ClassMapping extends ClassSerializer {
break; break;
} }
case Object: { case Object: {
Object [] arr; Object[] arr;
if (obj == null) { if (obj == null) {
arr = (Object[]) Array.newInstance(cpt, size); arr = (Object[]) Array.newInstance(cpt, size);
} else { } else {
arr = (Object []) obj; arr = (Object[]) obj;
} }
for (int i = 0; i < arr.length; ++i) { 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; obj = arr;
@ -628,7 +625,7 @@ public class ClassMapping extends ClassSerializer {
return obj; return obj;
} }
private static void registerSerializer (Class clas, ClassSerializer s) { private static void registerSerializer (Class<?> clas, ClassSerializer s) {
try { try {
s.mappedClass = clas; s.mappedClass = clas;
classes.put(clas.getCanonicalName(), s); 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; ClassSerializer mapping;
if (Block.class.isAssignableFrom(clas)) { if (Block.class.isAssignableFrom(clas)) {

View file

@ -20,7 +20,7 @@ public class SerializerArrayList extends ClassSerializer {
public void write(ByteBuf data, Object o, SerializationContext context) public void write(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException { throws IllegalArgumentException, IllegalAccessException {
ArrayList list = (ArrayList) o; ArrayList<?> list = (ArrayList<?>) o;
if (o == null) { if (o == null) {
data.writeBoolean(false); data.writeBoolean(false);
@ -44,7 +44,7 @@ public class SerializerArrayList extends ClassSerializer {
} else { } else {
int size = data.readShort(); int size = data.readShort();
ArrayList list = new ArrayList (); ArrayList<Object> list = new ArrayList<Object> ();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
Object val = anonymousSerializer.read(data, null, context); Object val = anonymousSerializer.read(data, null, context);
@ -55,5 +55,4 @@ public class SerializerArrayList extends ClassSerializer {
return list; return list;
} }
} }
} }

View file

@ -21,8 +21,7 @@ public class SerializerHashMap extends ClassSerializer {
@Override @Override
public void write(ByteBuf data, Object o, SerializationContext context) public void write(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException { throws IllegalArgumentException, IllegalAccessException {
HashMap map = (HashMap<?, ?>) o;
HashMap map = (HashMap) o;
if (o == null) { if (o == null) {
data.writeBoolean(false); data.writeBoolean(false);
@ -43,13 +42,12 @@ public class SerializerHashMap extends ClassSerializer {
public Object read(ByteBuf data, Object o, SerializationContext context) public Object read(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException, throws IllegalArgumentException, IllegalAccessException,
InstantiationException, ClassNotFoundException { InstantiationException, ClassNotFoundException {
if (!data.readBoolean()) { if (!data.readBoolean()) {
return null; return null;
} else { } else {
int size = data.readShort(); int size = data.readShort();
HashMap map = new HashMap (); HashMap<Object, Object> map = new HashMap<Object, Object> ();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
Object key = anonymousSerializer.read(data, null, context); Object key = anonymousSerializer.read(data, null, context);
@ -61,5 +59,4 @@ public class SerializerHashMap extends ClassSerializer {
return map; return map;
} }
} }
} }

View file

@ -19,8 +19,7 @@ public class SerializerHashSet extends ClassSerializer {
@Override @Override
public void write(ByteBuf data, Object o, SerializationContext context) public void write(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException { throws IllegalArgumentException, IllegalAccessException {
HashSet<?> set = (HashSet<?>) o;
HashSet set = (HashSet) o;
if (o == null) { if (o == null) {
data.writeBoolean(false); data.writeBoolean(false);
@ -38,13 +37,12 @@ public class SerializerHashSet extends ClassSerializer {
public Object read(ByteBuf data, Object o, SerializationContext context) public Object read(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException, throws IllegalArgumentException, IllegalAccessException,
InstantiationException, ClassNotFoundException { InstantiationException, ClassNotFoundException {
if (!data.readBoolean()) { if (!data.readBoolean()) {
return null; return null;
} else { } else {
int size = data.readShort(); int size = data.readShort();
HashSet set = new HashSet(); HashSet<Object> set = new HashSet<Object>();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
Object value = anonymousSerializer.read(data, null, context); Object value = anonymousSerializer.read(data, null, context);
@ -55,5 +53,4 @@ public class SerializerHashSet extends ClassSerializer {
return set; return set;
} }
} }
} }

View file

@ -19,8 +19,7 @@ public class SerializerLinkedList extends ClassSerializer {
@Override @Override
public void write(ByteBuf data, Object o, SerializationContext context) public void write(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException { throws IllegalArgumentException, IllegalAccessException {
LinkedList<?> list = (LinkedList<?>) o;
LinkedList list = (LinkedList) o;
if (o == null) { if (o == null) {
data.writeBoolean(false); data.writeBoolean(false);
@ -38,13 +37,12 @@ public class SerializerLinkedList extends ClassSerializer {
public Object read(ByteBuf data, Object o, SerializationContext context) public Object read(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException, throws IllegalArgumentException, IllegalAccessException,
InstantiationException, ClassNotFoundException { InstantiationException, ClassNotFoundException {
if (!data.readBoolean()) { if (!data.readBoolean()) {
return null; return null;
} else { } else {
int size = data.readShort(); int size = data.readShort();
LinkedList list = new LinkedList (); LinkedList<Object> list = new LinkedList<Object>();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
Object val = anonymousSerializer.read(data, null, context); Object val = anonymousSerializer.read(data, null, context);
@ -55,5 +53,4 @@ public class SerializerLinkedList extends ClassSerializer {
return list; return list;
} }
} }
} }

View file

@ -17,12 +17,11 @@ public class SerializerObject extends ClassSerializer {
@Override @Override
public void write(ByteBuf data, Object o, SerializationContext context) public void write(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException { throws IllegalArgumentException, IllegalAccessException {
if (o == null) { if (o == null) {
data.writeBoolean(false); data.writeBoolean(false);
} else { } else {
data.writeBoolean(true); data.writeBoolean(true);
Class realClass = o.getClass(); Class<? extends Object> realClass = o.getClass();
ClassSerializer delegateMapping; ClassSerializer delegateMapping;
@ -52,7 +51,6 @@ public class SerializerObject extends ClassSerializer {
public Object read(ByteBuf data, Object o, SerializationContext context) public Object read(ByteBuf data, Object o, SerializationContext context)
throws IllegalArgumentException, IllegalAccessException, throws IllegalArgumentException, IllegalAccessException,
InstantiationException, ClassNotFoundException { InstantiationException, ClassNotFoundException {
if (!data.readBoolean()) { if (!data.readBoolean()) {
return null; return null;
} else { } else {
@ -63,7 +61,7 @@ public class SerializerObject extends ClassSerializer {
if (context.idToClass.size() < index) { if (context.idToClass.size() < index) {
String className = Utils.readUTF(data); String className = Utils.readUTF(data);
Class cls = Class.forName(className); Class<?> cls = Class.forName(className);
delegateMapping = ClassMapping.get(cls); delegateMapping = ClassMapping.get(cls);
context.idToClass.add(ClassMapping.get(cls)); context.idToClass.add(ClassMapping.get(cls));
@ -78,5 +76,4 @@ public class SerializerObject extends ClassSerializer {
} }
} }
} }
} }

View file

@ -32,15 +32,15 @@ public class AssemblyRecipeManager implements IAssemblyRecipeManager {
return; return;
} }
addRecipe(id, new FlexibleRecipe(id, output, energyCost, 0, input)); addRecipe(id, new FlexibleRecipe<ItemStack>(id, output, energyCost, 0, input));
} }
@Override @Override
public void addRecipe(IFlexibleRecipe recipe) { public void addRecipe(IFlexibleRecipe<ItemStack> recipe) {
addRecipe(recipe.getId(), recipe); addRecipe(recipe.getId(), recipe);
} }
private void addRecipe(String id, IFlexibleRecipe recipe) { private void addRecipe(String id, IFlexibleRecipe<ItemStack> recipe) {
if (assemblyRecipes.containsKey(id)) { if (assemblyRecipes.containsKey(id)) {
throw new RuntimeException("Recipe \"" + id + "\" already registered"); throw new RuntimeException("Recipe \"" + id + "\" already registered");
} }

View file

@ -90,7 +90,7 @@ public class FlexibleRecipe<T> implements IFlexibleRecipe<T> {
return null; return null;
} }
CraftingResult<T> result = new CraftingResult(); CraftingResult<T> result = new CraftingResult<T>();
result.recipe = this; result.recipe = this;
result.energyCost = energyCost; result.energyCost = energyCost;

View file

@ -131,7 +131,7 @@ public class EntityRobot extends EntityRobotBase implements
laser.tail.z = dataWatcher.getWatchableObjectFloat(14); laser.tail.z = dataWatcher.getWatchableObjectFloat(14);
laser.isVisible = dataWatcher.getWatchableObjectByte(15) == 1; laser.isVisible = dataWatcher.getWatchableObjectByte(15) == 1;
RedstoneBoardNBT boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher RedstoneBoardNBT<?> boardNBT = RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher
.getWatchableObjectString(16)); .getWatchableObjectString(16));
if (boardNBT != null) { if (boardNBT != null) {
@ -167,14 +167,14 @@ public class EntityRobot extends EntityRobotBase implements
} }
} }
public void showLaser () { public void showLaser() {
if (!laser.isVisible) { if (!laser.isVisible) {
laser.isVisible = true; laser.isVisible = true;
needsUpdate = true; needsUpdate = true;
} }
} }
public void hideLaser () { public void hideLaser() {
if (laser.isVisible) { if (laser.isVisible) {
laser.isVisible = false; laser.isVisible = false;
needsUpdate = true; needsUpdate = true;
@ -208,7 +208,7 @@ public class EntityRobot extends EntityRobotBase implements
super.onUpdate(); super.onUpdate();
} }
public void setRegularBoundingBox () { public void setRegularBoundingBox() {
width = 0.5F; width = 0.5F;
height = 0.5F; height = 0.5F;
@ -239,7 +239,7 @@ public class EntityRobot extends EntityRobotBase implements
} }
} }
public void setNullBoundingBox () { public void setNullBoundingBox() {
width = 0F; width = 0F;
height = 0F; height = 0F;
@ -252,7 +252,7 @@ public class EntityRobot extends EntityRobotBase implements
boundingBox.maxZ = posZ; boundingBox.maxZ = posZ;
} }
private void iterateBehaviorDocked () { private void iterateBehaviorDocked() {
motionX = 0F; motionX = 0F;
motionY = 0F; motionY = 0F;
motionZ = 0F; motionZ = 0F;
@ -497,8 +497,7 @@ public class EntityRobot extends EntityRobotBase implements
public boolean isItemValidForSlot(int var1, ItemStack var2) { public boolean isItemValidForSlot(int var1, ItemStack var2) {
return inv[var1] == null return inv[var1] == null
|| (inv[var1].isItemEqual(var2) && inv[var1].isStackable() && inv[var1].stackSize || (inv[var1].isItemEqual(var2) && inv[var1].isStackable() && inv[var1].stackSize
+ var2.stackSize <= inv[var1].getItem() + var2.stackSize <= inv[var1].getItem().getItemStackLimit());
.getItemStackLimit());
} }
@Override @Override

View file

@ -37,7 +37,6 @@ public class RobotIntegrationRecipe extends IntegrationTableRecipe {
@Override @Override
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA, public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
ItemStack inputB) { ItemStack inputB) {
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB); CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
if (result != null) { if (result != null) {

View file

@ -64,12 +64,9 @@ public final class BoardRobotLeaveCutterNBT extends RedstoneBoardRobotNBT {
@Override @Override
public void createRandomBoard(NBTTagCompound nbt) { public void createRandomBoard(NBTTagCompound nbt) {
} }
@Override @Override
public void createDefaultBoard(NBTTagCompound itemData) { public void createDefaultBoard(NBTTagCompound itemData) {
} }
} }

View file

@ -34,7 +34,6 @@ public final class BoardRobotLumberjackNBT extends RedstoneBoardRobotNBT {
public IIcon icon; public IIcon icon;
private BoardRobotLumberjackNBT() { private BoardRobotLumberjackNBT() {
} }
@Override @Override

View file

@ -38,7 +38,7 @@ public class BoardRobotPicker extends RedstoneBoardRobot {
private SafeTimeTracker scanTracker = new SafeTimeTracker(40, 10); private SafeTimeTracker scanTracker = new SafeTimeTracker(40, 10);
private NBTTagCompound data; private NBTTagCompound data;
private RedstoneBoardNBT board; private RedstoneBoardNBT<?> board;
private IBoardParameter[] params; private IBoardParameter[] params;
private int range; private int range;
private IStackFilter stackFilter; private IStackFilter stackFilter;

View file

@ -33,7 +33,6 @@ public final class BoardRobotPickerNBT extends RedstoneBoardRobotNBT {
public IIcon icon; public IIcon icon;
private BoardRobotPickerNBT() { private BoardRobotPickerNBT() {
} }
@Override @Override

View file

@ -64,11 +64,9 @@ public final class BoardRobotPlanterNBT extends RedstoneBoardRobotNBT {
@Override @Override
public void createRandomBoard(NBTTagCompound nbt) { public void createRandomBoard(NBTTagCompound nbt) {
} }
@Override @Override
public void createDefaultBoard(NBTTagCompound nbt) { public void createDefaultBoard(NBTTagCompound nbt) {
} }
} }

View file

@ -32,7 +32,7 @@ public abstract class BCTrigger extends BCStatement implements ITrigger {
@Override @Override
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) { public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
ITriggerParameter p = parameters[0]; ITriggerParameter p = parameters[0];
Pipe pipe = (Pipe) gate.getPipe(); Pipe<?> pipe = (Pipe<?>) gate.getPipe();
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
if (isTriggerActive(side.getOpposite(), pipe.getAdjacentTile(side), p)) { 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) { public ITriggerParameter createParameter(int index) {
return new TriggerParameter(); return new TriggerParameter();
} }
} }

View file

@ -32,10 +32,10 @@ public class TriggerRedstoneInput extends BCTrigger {
@Override @Override
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) { 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; return direction != ForgeDirection.UNKNOWN && pipe.container.redstoneInput[direction.ordinal()] > 0;
} }

View file

@ -53,7 +53,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
public Tank tankCoolant = new Tank("tankCoolant", MAX_LIQUID, this); public Tank tankCoolant = new Tank("tankCoolant", MAX_LIQUID, this);
private int burnTime = 0; private int burnTime = 0;
private TankManager tankManager = new TankManager(); private TankManager<Tank> tankManager = new TankManager<Tank>();
private Fuel currentFuel = null; private Fuel currentFuel = null;
private int penaltyCooling = 0; private int penaltyCooling = 0;
private boolean lastPowered = false; private boolean lastPowered = false;

View file

@ -35,7 +35,7 @@ import buildcraft.core.network.PacketUpdate;
public class TileTank extends TileBuildCraft implements IFluidHandler { public class TileTank extends TileBuildCraft implements IFluidHandler {
public final Tank tank = new Tank("tank", FluidContainerRegistry.BUCKET_VOLUME * 16, this); 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 boolean hasUpdate = false;
public SafeTimeTracker tracker = new SafeTimeTracker(); public SafeTimeTracker tracker = new SafeTimeTracker();
private int prevLightValue = 0; private int prevLightValue = 0;

View file

@ -96,8 +96,6 @@ public class ItemRedstoneBoard extends ItemBuildCraft {
nbtData.setString("id", nbt.getID()); nbtData.setString("id", nbt.getID());
nbt.createDefaultBoard(nbtData); nbt.createDefaultBoard(nbtData);
itemList.add(stack.copy()); itemList.add(stack.copy());
} }
} }
} }

View file

@ -135,7 +135,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
NBTTagList list = nbt.getTagList("plannedIds", Constants.NBT.TAG_STRING); NBTTagList list = nbt.getTagList("plannedIds", Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); ++i) { 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) { if (recipe != null) {
plannedOutput.add(recipe.getId()); plannedOutput.add(recipe.getId());
@ -143,7 +143,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
} }
if (nbt.hasKey("recipeId")) { if (nbt.hasKey("recipeId")) {
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(nbt.getString("recipeId")); IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(nbt.getString("recipeId"));
if (recipe != null) { if (recipe != null) {
setCurrentRecipe(recipe); setCurrentRecipe(recipe);
@ -180,7 +180,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
return recipe != null && recipe == currentRecipe; return recipe != null && recipe == currentRecipe;
} }
private void setCurrentRecipe(IFlexibleRecipe recipe) { private void setCurrentRecipe(IFlexibleRecipe<ItemStack> recipe) {
currentRecipe = recipe; currentRecipe = recipe;
if (recipe != null) { 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)) { if (recipe != null && !isPlanned(recipe)) {
plannedOutput.add(recipe.getId()); 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)) { if (isAssembling(recipe)) {
setCurrentRecipe(null); setCurrentRecipe(null);
} }
@ -235,7 +235,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
boolean takeNext = false; boolean takeNext = false;
for (String recipeId : plannedOutput) { for (String recipeId : plannedOutput) {
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId); IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
if (recipe == currentRecipe) { if (recipe == currentRecipe) {
takeNext = true; takeNext = true;
@ -246,7 +246,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
} }
for (String recipeId : plannedOutput) { for (String recipeId : plannedOutput) {
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId); IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(recipeId);
if (recipe.canBeCrafted(this)) { if (recipe.canBeCrafted(this)) {
setCurrentRecipe(recipe); setCurrentRecipe(recipe);
@ -263,7 +263,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
@RPC(RPCSide.SERVER) @RPC(RPCSide.SERVER)
private void selectRecipe(String id, boolean select) { private void selectRecipe(String id, boolean select) {
IFlexibleRecipe recipe = AssemblyRecipeManager.INSTANCE.getRecipe(id); IFlexibleRecipe<ItemStack> recipe = AssemblyRecipeManager.INSTANCE.getRecipe(id);
if (recipe != null) { if (recipe != null) {
if (select) { if (select) {
@ -330,6 +330,4 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
public int getCraftingFluidStackSize() { public int getCraftingFluidStackSize() {
return 0; return 0;
} }
} }

View file

@ -27,7 +27,7 @@ public class BoardRecipe extends FlexibleRecipe {
} }
@Override @Override
public CraftingResult craft(IFlexibleCrafter crafter, boolean preview) { public CraftingResult<ItemStack> craft(IFlexibleCrafter crafter, boolean preview) {
CraftingResult<ItemStack> result = super.craft(crafter, preview); CraftingResult<ItemStack> result = super.craft(crafter, preview);
if (result != null) { if (result != null) {
@ -41,6 +41,4 @@ public class BoardRecipe extends FlexibleRecipe {
return null; return null;
} }
} }
} }

View file

@ -24,7 +24,7 @@ import buildcraft.api.boards.RedstoneBoardRegistry;
public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry { public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
private static class BoardFactory { private static class BoardFactory {
public RedstoneBoardNBT boardNBT; public RedstoneBoardNBT<?> boardNBT;
public float probability; public float probability;
} }
@ -35,7 +35,7 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
private Random rand = new Random(); private Random rand = new Random();
@Override @Override
public void registerBoardClass(RedstoneBoardNBT redstoneBoardNBT, float probability) { public void registerBoardClass(RedstoneBoardNBT<?> redstoneBoardNBT, float probability) {
BoardFactory factory = new BoardFactory(); BoardFactory factory = new BoardFactory();
factory.boardNBT = redstoneBoardNBT; factory.boardNBT = redstoneBoardNBT;
factory.probability = probability; factory.probability = probability;
@ -62,12 +62,12 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
} }
@Override @Override
public RedstoneBoardNBT getRedstoneBoard(NBTTagCompound nbt) { public RedstoneBoardNBT<?> getRedstoneBoard(NBTTagCompound nbt) {
return getRedstoneBoard(nbt.getString("id")); return getRedstoneBoard(nbt.getString("id"));
} }
@Override @Override
public RedstoneBoardNBT getRedstoneBoard(String id) { public RedstoneBoardNBT<?> getRedstoneBoard(String id) {
BoardFactory factory = boards.get(id); BoardFactory factory = boards.get(id);
if (factory != null) { if (factory != null) {
@ -117,5 +117,4 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
return result; return result;
} }
} }

View file

@ -25,7 +25,7 @@ import buildcraft.core.utils.NBTUtils;
public class ContainerRedstoneBoard extends BuildCraftContainer { public class ContainerRedstoneBoard extends BuildCraftContainer {
private EntityPlayer player; private EntityPlayer player;
private RedstoneBoardNBT board; private RedstoneBoardNBT<?> board;
private IBoardParameter[] params; private IBoardParameter[] params;
public ContainerRedstoneBoard(EntityPlayer iPlayer, int x, int y, int z) { public ContainerRedstoneBoard(EntityPlayer iPlayer, int x, int y, int z) {

View file

@ -34,7 +34,7 @@ public class GuiRedstoneBoard extends GuiAdvancedInterface {
private World world; private World world;
private int x, y, z; private int x, y, z;
private RedstoneBoardNBT board; private RedstoneBoardNBT<?> board;
private IBoardParameter[] params; private IBoardParameter[] params;
public GuiRedstoneBoard(EntityPlayer player, int ix, int iy, int iz) { public GuiRedstoneBoard(EntityPlayer player, int ix, int iy, int iz) {

View file

@ -41,9 +41,8 @@ public class AdvancedFacadeRecipe extends IntegrationTableRecipe {
} }
@Override @Override
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA, public CraftingResult<ItemStack> craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
ItemStack inputB) { ItemStack inputB) {
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB); CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
if (result == null) { if (result == null) {

View file

@ -38,7 +38,6 @@ public class GateLogicSwapRecipe extends IntegrationTableRecipe {
@Override @Override
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA, public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
ItemStack inputB) { ItemStack inputB) {
CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB); CraftingResult<ItemStack> result = super.craft(crafter, preview, inputA, inputB);
if (result == null) { if (result == null) {

View file

@ -46,8 +46,6 @@ public abstract class IntegrationTableRecipe extends FlexibleRecipe<ItemStack> i
public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA, public CraftingResult craft(TileIntegrationTable crafter, boolean preview, ItemStack inputA,
ItemStack inputB) { ItemStack inputB) {
return super.craft(crafter, preview); return super.craft(crafter, preview);
} }
} }

View file

@ -83,7 +83,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
} }
static class RaytraceResult { static class RaytraceResult {
public final Part hitPart; public final Part hitPart;
public final MovingObjectPosition movingObjectPosition; public final MovingObjectPosition movingObjectPosition;
public final AxisAlignedBB boundingBox; public final AxisAlignedBB boundingBox;
@ -327,7 +326,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return null; return null;
} }
Pipe pipe = tileG.pipe; Pipe<?> pipe = tileG.pipe;
if (!isValid(pipe)) { if (!isValid(pipe)) {
return null; 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]); 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)) { if (!isValid(pipe)) {
return; return;
} }
@ -580,7 +579,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) { public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
if (world.isRemote) { if (world.isRemote) {
return null; return null;
} }
@ -589,7 +587,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
int count = quantityDropped(metadata, fortune, world.rand); int count = quantityDropped(metadata, fortune, world.rand);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
Pipe pipe = getPipe(world, x, y, z); Pipe<?> pipe = getPipe(world, x, y, z);
if (pipe == null) { if (pipe == null) {
pipe = pipeRemoved.get(new BlockIndex(x, y, z)); pipe = pipeRemoved.get(new BlockIndex(x, y, z));
@ -612,7 +610,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int dmg) { public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int dmg) {
if (world.isRemote) { if (world.isRemote) {
return; return;
} }
@ -623,7 +620,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
continue; continue;
} }
Pipe pipe = getPipe(world, i, j, k); Pipe<?> pipe = getPipe(world, i, j, k);
if (pipe == null) { if (pipe == null) {
pipe = pipeRemoved.get(new BlockIndex(i, j, k)); pipe = pipeRemoved.get(new BlockIndex(i, j, k));
@ -665,7 +662,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
if (rayTraceResult != null && rayTraceResult.boundingBox != null) { if (rayTraceResult != null && rayTraceResult.boundingBox != null) {
switch (rayTraceResult.hitPart) { switch (rayTraceResult.hitPart) {
case Gate: case Gate:
Pipe pipe = getPipe(world, x, y, z); Pipe<?> pipe = getPipe(world, x, y, z);
Gate gate = pipe.gates[rayTraceResult.sideHit.ordinal()]; Gate gate = pipe.gates[rayTraceResult.sideHit.ordinal()];
return gate != null ? gate.getGateItem() : null; return gate != null ? gate.getGateItem() : null;
case Plug: case Plug:
@ -693,7 +690,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
super.onNeighborBlockChange(world, x, y, z, 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)) { if (isValid(pipe)) {
pipe.container.scheduleNeighborChange(); pipe.container.scheduleNeighborChange();
@ -707,7 +704,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, float par7, float par8, int meta) { 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); 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)) { if (isValid(pipe)) {
pipe.onBlockPlaced(); pipe.onBlockPlaced();
@ -719,7 +716,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack stack) { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, placer, 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)) { if (isValid(pipe)) {
pipe.onBlockPlacedBy(placer); pipe.onBlockPlacedBy(placer);
@ -732,7 +729,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
world.notifyBlocksOfNeighborChange(x, y, z, BuildCraftTransport.genericPipeBlock); world.notifyBlocksOfNeighborChange(x, y, z, BuildCraftTransport.genericPipeBlock);
Pipe pipe = getPipe(world, x, y, z); Pipe<?> pipe = getPipe(world, x, y, z);
if (isValid(pipe)) { if (isValid(pipe)) {
ItemStack currentItem = player.getCurrentEquippedItem(); ItemStack currentItem = player.getCurrentEquippedItem();
@ -840,7 +837,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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); RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (player.isSneaking()) { if (player.isSneaking()) {
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Gate) { if (rayTraceResult != null && rayTraceResult.hitPart == Part.Gate) {
@ -857,7 +854,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; return false;
} }
private boolean addGate(EntityPlayer player, Pipe pipe, ForgeDirection side) { private boolean addGate(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
ItemStack stack = player.getCurrentEquippedItem(); ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.getItem() instanceof ItemGate && pipe.container.addGate(side, GateFactory.makeGate(pipe, stack, side))) { if (stack != null && stack.getItem() instanceof ItemGate && pipe.container.addGate(side, GateFactory.makeGate(pipe, stack, side))) {
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
@ -868,7 +865,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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 (addWire(pipe, color)) {
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
player.getCurrentEquippedItem().splitStack(1); player.getCurrentEquippedItem().splitStack(1);
@ -878,7 +875,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return player.isSneaking() && stripWire(pipe, color); 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()]) { if (!pipe.wireSet[color.ordinal()]) {
pipe.wireSet[color.ordinal()] = true; pipe.wireSet[color.ordinal()] = true;
pipe.signalStrength[color.ordinal()] = 0; pipe.signalStrength[color.ordinal()] = 0;
@ -890,7 +887,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; return false;
} }
private boolean stripWire(Pipe pipe, PipeWire color) { private boolean stripWire(Pipe<?> pipe, PipeWire color) {
if (pipe.wireSet[color.ordinal()]) { if (pipe.wireSet[color.ordinal()]) {
if (!pipe.container.getWorldObj().isRemote) { if (!pipe.container.getWorldObj().isRemote) {
dropWire(color, pipe); dropWire(color, pipe);
@ -914,7 +911,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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); RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (player.isSneaking()) { if (player.isSneaking()) {
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Facade) { if (rayTraceResult != null && rayTraceResult.hitPart == Part.Facade) {
@ -931,7 +928,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; return false;
} }
private boolean addFacade(EntityPlayer player, Pipe pipe, ForgeDirection side) { private boolean addFacade(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
ItemStack stack = player.getCurrentEquippedItem(); ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.getItem() instanceof ItemFacade && pipe.container.addFacade(side, ItemFacade.getFacadeStates(stack))) { if (stack != null && stack.getItem() instanceof ItemFacade && pipe.container.addFacade(side, ItemFacade.getFacadeStates(stack))) {
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
@ -942,7 +939,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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); RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (player.isSneaking()) { if (player.isSneaking()) {
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Plug) { if (rayTraceResult != null && rayTraceResult.hitPart == Part.Plug) {
@ -959,7 +956,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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); RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (player.isSneaking()) { if (player.isSneaking()) {
if (rayTraceResult != null && rayTraceResult.hitPart == Part.RobotStation) { if (rayTraceResult != null && rayTraceResult.hitPart == Part.RobotStation) {
@ -976,7 +973,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; return false;
} }
private boolean addPlug(EntityPlayer player, Pipe pipe, ForgeDirection side) { private boolean addPlug(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
ItemStack stack = player.getCurrentEquippedItem(); ItemStack stack = player.getCurrentEquippedItem();
if (pipe.container.addPlug(side)) { if (pipe.container.addPlug(side)) {
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
@ -987,7 +984,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; return false;
} }
private boolean addRobotStation(EntityPlayer player, Pipe pipe, ForgeDirection side) { private boolean addRobotStation(EntityPlayer player, Pipe<?> pipe, ForgeDirection side) {
ItemStack stack = player.getCurrentEquippedItem(); ItemStack stack = player.getCurrentEquippedItem();
if (pipe.container.addRobotStation(side)) { if (pipe.container.addRobotStation(side)) {
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
@ -998,7 +995,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return false; 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 // Try to strip facades first
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player); RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (rayTraceResult != null && rayTraceResult.hitPart != Part.Pipe) { if (rayTraceResult != null && rayTraceResult.hitPart != Part.Pipe) {
@ -1022,7 +1019,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
* *
* @param pipeWire * @param pipeWire
*/ */
private void dropWire(PipeWire pipeWire, Pipe pipe) { private void dropWire(PipeWire pipeWire, Pipe<?> pipe) {
pipe.dropItem(pipeWire.getStack()); 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) { public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) {
super.onEntityCollidedWithBlock(world, i, j, k, 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)) { if (isValid(pipe)) {
pipe.onEntityCollidedWithBlock(entity); pipe.onEntityCollidedWithBlock(entity);
@ -1053,7 +1050,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) { 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)) { if (isValid(pipe)) {
return pipe.canConnectRedstone(); return pipe.canConnectRedstone();
@ -1064,7 +1061,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public int isProvidingStrongPower(IBlockAccess iblockaccess, int x, int y, int z, int l) { 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)) { if (isValid(pipe)) {
return pipe.isPoweringTo(l); return pipe.isPoweringTo(l);
@ -1080,7 +1077,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@Override @Override
public int isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) { 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)) { if (isValid(pipe)) {
return pipe.isIndirectlyPoweringTo(l); return pipe.isIndirectlyPoweringTo(l);
@ -1107,7 +1104,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
pipes.put(item, clas); pipes.put(item, clas);
Pipe dummyPipe = createPipe(item); Pipe<?> dummyPipe = createPipe(item);
if (dummyPipe != null) { if (dummyPipe != null) {
item.setPipeIconIndex(dummyPipe.getIconIndexForItem()); item.setPipeIconIndex(dummyPipe.getIconIndexForItem());
TransportProxy.proxy.setIconProviderFromPipe(item, dummyPipe); TransportProxy.proxy.setIconProviderFromPipe(item, dummyPipe);
@ -1120,7 +1117,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return pipes.containsKey(key); return pipes.containsKey(key);
} }
public static Pipe createPipe(Item key) { public static Pipe<?> createPipe(Item key) {
try { try {
Class<? extends Pipe> pipe = pipes.get(key); Class<? extends Pipe> pipe = pipes.get(key);
@ -1138,7 +1135,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return null; 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) { if (world.isRemote) {
return true; return true;
} }
@ -1157,7 +1154,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
return placed; 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); TileEntity tile = blockAccess.getTileEntity(i, j, k);
if (!(tile instanceof TileGenericPipe) || tile.isInvalid()) { 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; return pipe != null && pipe.transport != null && pipe.container != null;
} }
public static boolean isValid(Pipe pipe) { public static boolean isValid(Pipe<?> pipe) {
return isFullyDefined(pipe); return isFullyDefined(pipe);
} }
@ -1182,9 +1179,11 @@ public class BlockGenericPipe extends BlockBuildCraft {
skippedFirstIconRegister = true; skippedFirstIconRegister = true;
return; return;
} }
BuildCraftTransport.instance.wireIconProvider.registerIcons(iconRegister); BuildCraftTransport.instance.wireIconProvider.registerIcons(iconRegister);
for (Item i : pipes.keySet()) { for (Item i : pipes.keySet()) {
Pipe dummyPipe = createPipe(i); Pipe<?> dummyPipe = createPipe(i);
if (dummyPipe != null) { if (dummyPipe != null) {
dummyPipe.getIconProvider().registerIcons(iconRegister); dummyPipe.getIconProvider().registerIcons(iconRegister);
} }
@ -1201,7 +1200,6 @@ public class BlockGenericPipe extends BlockBuildCraft {
for (IGateExpansion expansion : GateExpansions.getExpansions()) { for (IGateExpansion expansion : GateExpansions.getExpansions()) {
expansion.registerBlockOverlay(iconRegister); expansion.registerBlockOverlay(iconRegister);
} }
} }
@Override @Override
@ -1228,7 +1226,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
int y = target.blockY; int y = target.blockY;
int z = target.blockZ; int z = target.blockZ;
Pipe pipe = getPipe(worldObj, x, y, z); Pipe<?> pipe = getPipe(worldObj, x, y, z);
if (pipe == null) { if (pipe == null) {
return false; return false;
} }
@ -1290,7 +1288,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public boolean addDestroyEffects(World worldObj, int x, int y, int z, int meta, EffectRenderer effectRenderer) { 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) { if (pipe == null) {
return false; return false;
} }
@ -1319,17 +1317,17 @@ public class BlockGenericPipe extends BlockBuildCraft {
if (facadeRenderColor != -1) { if (facadeRenderColor != -1) {
return facadeRenderColor; return facadeRenderColor;
} }
return super.colorMultiplier(world, x, y, z); return super.colorMultiplier(world, x, y, z);
} }
public static void updateNeighbourSignalState(Pipe pipe) { public static void updateNeighbourSignalState(Pipe<?> pipe) {
TileBuffer[] neighbours = pipe.container.getTileCache(); TileBuffer[] neighbours = pipe.container.getTileCache();
if (neighbours != null) { if (neighbours != null) {
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
if (neighbours[i] != null && neighbours[i].getTile() instanceof TileGenericPipe && !neighbours[i].getTile().isInvalid()) { if (neighbours[i] != null && neighbours[i].getTile() instanceof TileGenericPipe && !neighbours[i].getTile().isInvalid()) {
((TileGenericPipe) neighbours[i].getTile()).pipe.updateSignalState(); ((TileGenericPipe) neighbours[i].getTile()).pipe.updateSignalState();
} }
} }
} }

View file

@ -49,7 +49,7 @@ import buildcraft.transport.triggers.ActionRedstoneFaderOutput;
public final class Gate implements IGate { public final class Gate implements IGate {
public final Pipe pipe; public final Pipe<?> pipe;
public final GateMaterial material; public final GateMaterial material;
public final GateLogic logic; public final GateLogic logic;
public final BiMap<IGateExpansion, GateExpansionController> expansions = HashBiMap.create(); public final BiMap<IGateExpansion, GateExpansionController> expansions = HashBiMap.create();
@ -76,7 +76,7 @@ public final class Gate implements IGate {
private ForgeDirection direction; private ForgeDirection direction;
// / CONSTRUCTOR // / 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.pipe = pipe;
this.material = material; this.material = material;
this.logic = logic; this.logic = logic;
@ -247,7 +247,7 @@ public final class Gate implements IGate {
} }
} }
// / UPDATING // UPDATING
public void tick() { public void tick() {
for (GateExpansionController expansion : expansions.values()) { for (GateExpansionController expansion : expansions.values()) {
expansion.tick(this); expansion.tick(this);
@ -419,7 +419,7 @@ public final class Gate implements IGate {
return false; return false;
} }
// / TRIGGERS // TRIGGERS
public void addTrigger(List<ITrigger> list) { public void addTrigger(List<ITrigger> list) {
for (PipeWire wire : PipeWire.VALUES) { for (PipeWire wire : PipeWire.VALUES) {
@ -434,7 +434,7 @@ public final class Gate implements IGate {
} }
} }
// / ACTIONS // ACTIONS
public void addActions(List<IAction> list) { public void addActions(List<IAction> list) {
for (PipeWire wire : PipeWire.VALUES) { for (PipeWire wire : PipeWire.VALUES) {
if (pipe.wireSet[wire.ordinal()] && material.ordinal() >= wire.ordinal()) { if (pipe.wireSet[wire.ordinal()] && material.ordinal() >= wire.ordinal()) {
@ -448,14 +448,14 @@ public final class Gate implements IGate {
} }
@Override @Override
public void setPulsing (boolean pulsing) { public void setPulsing(boolean pulsing) {
if (pulsing != isPulsing) { if (pulsing != isPulsing) {
isPulsing = pulsing; isPulsing = pulsing;
pipe.container.scheduleRenderUpdate(); pipe.container.scheduleRenderUpdate();
} }
} }
public float getPulseStage () { public float getPulseStage() {
return pulseStage; return pulseStage;
} }

View file

@ -80,7 +80,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
} }
if (world.canPlaceEntityOnSide(block, i, j, k, false, side, entityplayer, itemstack)) { if (world.canPlaceEntityOnSide(block, i, j, k, false, side, entityplayer, itemstack)) {
Pipe pipe = BlockGenericPipe.createPipe(this); Pipe<?> pipe = BlockGenericPipe.createPipe(this);
if (pipe == null) { if (pipe == null) {
BCLog.logger.log(Level.WARNING, "Pipe failed to create during placement at {0},{1},{2}", new Object[]{i, j, k}); BCLog.logger.log(Level.WARNING, "Pipe failed to create during placement at {0},{1},{2}", new Object[]{i, j, k});

View file

@ -34,26 +34,17 @@ public final class PipeConnectionBans {
static { static {
// Fluid pipes // Fluid pipes
banConnection(PipeFluidsStone.class, PipeFluidsCobblestone.class); banConnection(PipeFluidsStone.class, PipeFluidsCobblestone.class);
banConnection(PipeFluidsWood.class); banConnection(PipeFluidsWood.class);
banConnection(PipeFluidsEmerald.class); banConnection(PipeFluidsEmerald.class);
banConnection(PipeFluidsWood.class, PipeFluidsEmerald.class); banConnection(PipeFluidsWood.class, PipeFluidsEmerald.class);
banConnection(PipeFluidsEmerald.class); banConnection(PipeFluidsEmerald.class);
// Item Pipes // Item Pipes
banConnection(PipeItemsStone.class, PipeItemsCobblestone.class, PipeItemsQuartz.class); banConnection(PipeItemsStone.class, PipeItemsCobblestone.class, PipeItemsQuartz.class);
banConnection(PipeItemsWood.class); banConnection(PipeItemsWood.class);
banConnection(PipeItemsEmerald.class); banConnection(PipeItemsEmerald.class);
banConnection(PipeItemsEmzuli.class); banConnection(PipeItemsEmzuli.class);
banConnection(PipeItemsWood.class, PipeItemsEmerald.class, PipeItemsEmzuli.class); banConnection(PipeItemsWood.class, PipeItemsEmerald.class, PipeItemsEmzuli.class);
banConnection(PipeItemsObsidian.class); banConnection(PipeItemsObsidian.class);
// Power Pipes // Power Pipes

View file

@ -124,12 +124,12 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
if (this.getFluid() != null) { if (this.getFluid() != null) {
this.getFluid().writeToNBT(subTag); this.getFluid().writeToNBT(subTag);
} }
return subTag; return subTag;
} }
} }
public enum TransferState { public enum TransferState {
None, Input, Output None, Input, Output
} }
/** /**
@ -182,7 +182,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
} }
if (entity instanceof TileGenericPipe) { if (entity instanceof TileGenericPipe) {
Pipe pipe = ((TileGenericPipe) entity).pipe; Pipe<?> pipe = ((TileGenericPipe) entity).pipe;
if (pipe == null || !pipe.inputOpen(o.getOpposite())) { if (pipe == null || !pipe.inputOpen(o.getOpposite())) {
return false; return false;
@ -511,7 +511,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
@Override @Override
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe pipe2 = ((TileGenericPipe) tile).pipe; Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportFluids)) { if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportFluids)) {
return false; return false;
} }

View file

@ -504,7 +504,7 @@ public class PipeTransportItems extends PipeTransport {
@Override @Override
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe pipe2 = ((TileGenericPipe) tile).pipe; Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportItems)) { if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportItems)) {
return false; return false;
} }

View file

@ -90,7 +90,7 @@ public class PipeTransportPower extends PipeTransport {
@Override @Override
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe pipe2 = ((TileGenericPipe) tile).pipe; Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportPower)) { if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportPower)) {
return false; return false;
} }
@ -500,7 +500,7 @@ public class PipeTransportPower extends PipeTransport {
return amount; return amount;
} }
public float getPistonStage (int i) { public float getPistonStage(int i) {
if (movementStage [i] < 0.5F) { if (movementStage [i] < 0.5F) {
return movementStage [i] * 2; return movementStage [i] * 2;
} else { } else {
@ -508,7 +508,7 @@ public class PipeTransportPower extends PipeTransport {
} }
} }
public double clearInstantPower () { public double clearInstantPower() {
double amount = 0.0; double amount = 0.0;
for (int i = 0; i < internalPower.length; ++i) { for (int i = 0; i < internalPower.length; ++i) {

View file

@ -24,7 +24,7 @@ public class PipeTransportStructure extends PipeTransport {
@Override @Override
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe pipe2 = ((TileGenericPipe) tile).pipe; Pipe<?> pipe2 = ((TileGenericPipe) tile).pipe;
if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportStructure)) { if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportStructure)) {
return false; return false;

View file

@ -25,7 +25,7 @@ public class PipeTriggerProvider implements ITriggerProvider {
@Override @Override
public LinkedList<ITrigger> getPipeTriggers(IPipeTile tile) { public LinkedList<ITrigger> getPipeTriggers(IPipeTile tile) {
LinkedList<ITrigger> result = new LinkedList<ITrigger>(); LinkedList<ITrigger> result = new LinkedList<ITrigger>();
Pipe pipe = null; Pipe<?> pipe = null;
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
pipe = ((TileGenericPipe) tile).pipe; pipe = ((TileGenericPipe) tile).pipe;
} }

View file

@ -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(); this.blockType = getBlockType();
if (pipe == null) { if (pipe == null) {
@ -689,7 +689,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
if (((TileGenericPipe) with).hasBlockingPluggable(side.getOpposite())) { if (((TileGenericPipe) with).hasBlockingPluggable(side.getOpposite())) {
return false; return false;
} }
Pipe otherPipe = ((TileGenericPipe) with).pipe; Pipe<?> otherPipe = ((TileGenericPipe) with).pipe;
if (!BlockGenericPipe.isValid(otherPipe)) { if (!BlockGenericPipe.isValid(otherPipe)) {
return false; return false;

View file

@ -14,6 +14,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import buildcraft.BuildCraftTransport; import buildcraft.BuildCraftTransport;
public class TransportProxy { public class TransportProxy {
@SidedProxy(clientSide = "buildcraft.transport.TransportProxyClient", serverSide = "buildcraft.transport.TransportProxy") @SidedProxy(clientSide = "buildcraft.transport.TransportProxyClient", serverSide = "buildcraft.transport.TransportProxy")
public static TransportProxy proxy; public static TransportProxy proxy;
public static int pipeModel = -1; public static int pipeModel = -1;
@ -29,11 +30,8 @@ public class TransportProxy {
} }
public void initIconProviders(BuildCraftTransport instance){ public void initIconProviders(BuildCraftTransport instance){
} }
public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) { public void setIconProviderFromPipe(ItemPipe item, Pipe<?> dummyPipe) {
} }
} }

View file

@ -91,7 +91,7 @@ public class TransportProxyClient extends TransportProxy {
} }
@Override @Override
public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) { public void setIconProviderFromPipe(ItemPipe item, Pipe<?> dummyPipe) {
item.setPipesIcons(dummyPipe.getIconProvider()); item.setPipesIcons(dummyPipe.getIconProvider());
} }
} }

View file

@ -31,11 +31,11 @@ public final class GateFactory {
private 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); 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)) { if (stack == null || stack.stackSize <= 0 || !(stack.getItem() instanceof ItemGate)) {
return null; return null;
} }
@ -49,7 +49,7 @@ public final class GateFactory {
return gate; return gate;
} }
public static Gate makeGate(Pipe pipe, NBTTagCompound nbt) { public static Gate makeGate(Pipe<?> pipe, NBTTagCompound nbt) {
GateMaterial material = GateMaterial.REDSTONE; GateMaterial material = GateMaterial.REDSTONE;
GateLogic logic = GateLogic.AND; GateLogic logic = GateLogic.AND;
ForgeDirection direction = ForgeDirection.UNKNOWN; ForgeDirection direction = ForgeDirection.UNKNOWN;

View file

@ -53,7 +53,6 @@ public class ItemGate extends ItemBuildCraft {
public IGateExpansion[] expansions; public IGateExpansion[] expansions;
public GatePluggable() { public GatePluggable() {
} }
public GatePluggable(Gate gate) { public GatePluggable(Gate gate) {

View file

@ -46,7 +46,7 @@ public class ContainerGateInterface extends BuildCraftContainer {
public GuiGateInterface gateCallback; public GuiGateInterface gateCallback;
IInventory playerIInventory; IInventory playerIInventory;
private final Pipe pipe; private final Pipe<?> pipe;
private Gate gate; private Gate gate;
private final NavigableSet<ITrigger> potentialTriggers = new TreeSet<ITrigger>(new Comparator<ITrigger>() { private final NavigableSet<ITrigger> potentialTriggers = new TreeSet<ITrigger>(new Comparator<ITrigger>() {
@Override @Override
@ -66,7 +66,7 @@ public class ContainerGateInterface extends BuildCraftContainer {
private boolean isNetInitialized = false; private boolean isNetInitialized = false;
private int lastTriggerState = 0; private int lastTriggerState = 0;
public ContainerGateInterface(IInventory playerInventory, Pipe pipe) { public ContainerGateInterface(IInventory playerInventory, Pipe<?> pipe) {
super(0); super(0);
for (int i = 0; i < actionsState.length; ++i) { for (int i = 0; i < actionsState.length; ++i) {

View file

@ -39,19 +39,16 @@ public class GuiGateInterface extends GuiAdvancedInterface {
IInventory playerInventory; IInventory playerInventory;
private final ContainerGateInterface container; private final ContainerGateInterface container;
private final Pipe pipe; private final Pipe<?> pipe;
private Gate gate; private Gate gate;
private abstract class StatementSlot extends AdvancedSlot { private abstract class StatementSlot extends AdvancedSlot {
public Pipe pipe;
public int slot; public int slot;
public ArrayList<StatementParameterSlot> parameters = new ArrayList<StatementParameterSlot>(); 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); super(GuiGateInterface.this, x, y);
this.pipe = pipe;
this.slot = slot; this.slot = slot;
} }
@ -87,7 +84,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
} }
private class TriggerSlot extends StatementSlot { 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); super(x, y, pipe, slot);
} }
@ -98,7 +95,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
} }
private class ActionSlot extends StatementSlot { 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); super(x, y, pipe, slot);
} }
@ -110,11 +107,11 @@ public class GuiGateInterface extends GuiAdvancedInterface {
private abstract class StatementParameterSlot extends AdvancedSlot { private abstract class StatementParameterSlot extends AdvancedSlot {
public Pipe pipe; public Pipe<?> pipe;
public int slot; public int slot;
public StatementSlot statementSlot; 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); super(GuiGateInterface.this, x, y);
this.pipe = pipe; this.pipe = pipe;
@ -164,7 +161,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
} }
class TriggerParameterSlot extends StatementParameterSlot { 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); super(x, y, pipe, slot, iStatementSlot);
} }
@ -180,7 +177,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
} }
class ActionParameterSlot extends StatementParameterSlot { 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); 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); super(new ContainerGateInterface(playerInventory, pipe), null, null);
container = (ContainerGateInterface) this.inventorySlots; container = (ContainerGateInterface) this.inventorySlots;

View file

@ -38,7 +38,7 @@ public class PipeFluidsIron extends Pipe<PipeTransportFluids> {
@Override @Override
protected boolean isValidConnectingTile(TileEntity tile) { protected boolean isValidConnectingTile(TileEntity tile) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe otherPipe = ((TileGenericPipe) tile).pipe; Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
if (otherPipe instanceof PipeFluidsWood || otherPipe instanceof PipeStructureCobblestone) { if (otherPipe instanceof PipeFluidsWood || otherPipe instanceof PipeStructureCobblestone) {
return false; return false;
} else { } else {

View file

@ -49,7 +49,7 @@ public class PipeItemsDaizuli extends Pipe<PipeTransportItems> {
@Override @Override
protected boolean isValidConnectingTile(TileEntity tile) { protected boolean isValidConnectingTile(TileEntity tile) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe otherPipe = ((TileGenericPipe) tile).pipe; Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
if (otherPipe instanceof PipeItemsWood) { if (otherPipe instanceof PipeItemsWood) {
return false; return false;
} }

View file

@ -38,7 +38,7 @@ public class PipeItemsIron extends Pipe<PipeTransportItems> {
@Override @Override
protected boolean isValidConnectingTile(TileEntity tile) { protected boolean isValidConnectingTile(TileEntity tile) {
if (tile instanceof TileGenericPipe) { if (tile instanceof TileGenericPipe) {
Pipe otherPipe = ((TileGenericPipe) tile).pipe; Pipe<?> otherPipe = ((TileGenericPipe) tile).pipe;
if (otherPipe instanceof PipeItemsWood) { if (otherPipe instanceof PipeItemsWood) {
return false; return false;
} }

View file

@ -97,7 +97,6 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> {
public void eventHandler(PipeEventItem.DropItem event) { public void eventHandler(PipeEventItem.DropItem event) {
Position p = new Position(container.xCoord, container.yCoord, Position p = new Position(container.xCoord, container.yCoord,
container.zCoord, event.direction); container.zCoord, event.direction);
Position from = new Position(p);
p.moveForwards(1.0); p.moveForwards(1.0);
ItemStack stack = event.entity.getEntityItem(); ItemStack stack = event.entity.getEntityItem();
@ -231,7 +230,7 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> {
public boolean convertPipe(PipeTransportItems pipe, TravelingItem item) { public boolean convertPipe(PipeTransportItems pipe, TravelingItem item) {
if (item.getItemStack().getItem() instanceof ItemPipe) { if (item.getItemStack().getItem() instanceof ItemPipe) {
if (!(item.getItemStack().getItem() == BuildCraftTransport.pipeItemsStripes)) { if (!(item.getItemStack().getItem() == BuildCraftTransport.pipeItemsStripes)) {
Pipe newPipe = BlockGenericPipe.createPipe(item.getItemStack().getItem()); Pipe<?> newPipe = BlockGenericPipe.createPipe(item.getItemStack().getItem());
newPipe.setTile(this.container); newPipe.setTile(this.container);
this.container.pipe = newPipe; this.container.pipe = newPipe;

View file

@ -21,10 +21,10 @@ import buildcraft.transport.Pipe;
public abstract class PipeLogicIron { public abstract class PipeLogicIron {
protected final Pipe pipe; protected final Pipe<?> pipe;
private boolean lastPower = false; private boolean lastPower = false;
public PipeLogicIron(Pipe pipe) { public PipeLogicIron(Pipe<?> pipe) {
this.pipe = pipe; this.pipe = pipe;
} }

View file

@ -20,9 +20,9 @@ import buildcraft.transport.Pipe;
public abstract class PipeLogicWood { public abstract class PipeLogicWood {
protected final Pipe pipe; protected final Pipe<?> pipe;
public PipeLogicWood(Pipe pipe) { public PipeLogicWood(Pipe<?> pipe) {
this.pipe = pipe; this.pipe = pipe;
} }

View file

@ -35,7 +35,7 @@ public class SchematicPipe extends SchematicTile {
@Override @Override
public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) { 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)) { if (BlockGenericPipe.isValid(pipe)) {
return pipe.item == Item.getItemById(tileNBT.getInteger("pipeId")); return pipe.item == Item.getItemById(tileNBT.getInteger("pipeId"));
@ -90,7 +90,7 @@ public class SchematicPipe extends SchematicTile {
@Override @Override
public void writeToBlueprint(IBuilderContext context, int x, int y, int z) { public void writeToBlueprint(IBuilderContext context, int x, int y, int z) {
TileEntity tile = context.world().getTileEntity(x, y, 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)) { if (BlockGenericPipe.isValid(pipe)) {
tile.writeToNBT(tileNBT); tile.writeToNBT(tileNBT);
@ -115,8 +115,7 @@ public class SchematicPipe extends SchematicTile {
@Override @Override
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z) { 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)) { if (BlockGenericPipe.isValid(pipe)) {
ArrayList<ItemStack> items = pipe.computeItemDrop(); ArrayList<ItemStack> items = pipe.computeItemDrop();
@ -137,7 +136,7 @@ public class SchematicPipe extends SchematicTile {
} }
@Override @Override
public BuildingStage getBuildStage () { public BuildingStage getBuildStage() {
return BuildingStage.STANDALONE; return BuildingStage.STANDALONE;
} }

View file

@ -37,7 +37,6 @@ import buildcraft.transport.pipes.PipePowerWood;
public class TriggerPipeContents extends BCTrigger { public class TriggerPipeContents extends BCTrigger {
public enum PipeContents { public enum PipeContents {
empty, empty,
containsItems, containsItems,
containsFluids, containsFluids,
@ -73,7 +72,7 @@ public class TriggerPipeContents extends BCTrigger {
@Override @Override
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) { public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
Pipe pipe = (Pipe) gate.getPipe(); Pipe<?> pipe = (Pipe<?>) gate.getPipe();
ITriggerParameter parameter = parameters[0]; ITriggerParameter parameter = parameters[0];
if (pipe.transport instanceof PipeTransportItems) { if (pipe.transport instanceof PipeTransportItems) {

View file

@ -44,7 +44,7 @@ public class TriggerPipeSignal extends BCTrigger {
@Override @Override
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) { public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
Pipe pipe = (Pipe) gate.getPipe(); Pipe<?> pipe = (Pipe<?>) gate.getPipe();
if (active) { if (active) {
if (pipe.signalStrength[color.ordinal()] == 0) { if (pipe.signalStrength[color.ordinal()] == 0) {