From b593c7c2020eadc3ea9e6e21d44f8175ff53b846 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Fri, 14 Feb 2014 17:55:34 -0500 Subject: [PATCH] Updated IC2 API, added in option to disable particles/lighting updates on machines --- common/ic2/api/Direction.java | 7 +-- common/ic2/api/crops/BaseSeed.java | 38 ++++++------ common/ic2/api/crops/CropCard.java | 27 +++++---- .../ic2/api/energy/event/EnergyTileEvent.java | 6 +- .../api/energy/event/EnergyTileLoadEvent.java | 4 +- .../energy/event/EnergyTileUnloadEvent.java | 4 +- common/ic2/api/energy/prefab/BasicSink.java | 29 +++++----- common/ic2/api/energy/prefab/BasicSource.java | 35 ++++++----- common/ic2/api/energy/tile/IEnergyTile.java | 1 + common/ic2/api/event/LaserEvent.java | 58 +++++++++---------- common/ic2/api/event/PaintEvent.java | 17 +++--- common/ic2/api/event/RetextureEvent.java | 18 +++--- common/ic2/api/item/IItemHudInfo.java | 17 +++--- common/ic2/api/item/Items.java | 3 +- common/ic2/api/network/NetworkHelper.java | 1 + .../recipe/ICannerBottleRecipeManager.java | 10 ++-- .../recipe/ICannerEnrichRecipeManager.java | 12 ++-- common/ic2/api/recipe/IListRecipeManager.java | 9 ++- .../ic2/api/recipe/ISemiFluidFuelManager.java | 6 +- .../ic2/api/recipe/RecipeInputItemStack.java | 13 ++--- common/ic2/api/recipe/RecipeInputOreDict.java | 16 ++--- common/ic2/api/recipe/RecipeOutput.java | 10 ++-- common/ic2/api/recipe/Recipes.java | 5 ++ common/ic2/api/tile/ExplosionWhitelist.java | 3 +- common/mekanism/client/ClientProxy.java | 1 + common/mekanism/common/Mekanism.java | 1 + .../mekanism/common/block/BlockMachine.java | 4 +- .../mekanism/common/util/MekanismUtils.java | 2 +- 28 files changed, 187 insertions(+), 170 deletions(-) diff --git a/common/ic2/api/Direction.java b/common/ic2/api/Direction.java index 25346825d..bae04e924 100644 --- a/common/ic2/api/Direction.java +++ b/common/ic2/api/Direction.java @@ -35,8 +35,8 @@ public enum Direction { */ ZP(5); - Direction(int dir) { - this.dir = dir; + Direction(int dir1) { + this.dir = dir1; } /*public CoordinateTuple ApplyToCoordinates(CoordinateTuple coordinates) { @@ -64,9 +64,8 @@ public enum Direction { } catch (Exception e) { throw new RuntimeException("error getting TileEntity at dim "+tileEntity.worldObj.provider.dimensionId+" "+coords[0]+"/"+coords[1]+"/"+coords[2]); } - } else { - return null; } + return null; } /** diff --git a/common/ic2/api/crops/BaseSeed.java b/common/ic2/api/crops/BaseSeed.java index 11286b4b2..de6296b39 100644 --- a/common/ic2/api/crops/BaseSeed.java +++ b/common/ic2/api/crops/BaseSeed.java @@ -8,49 +8,49 @@ public class BaseSeed { * Plant ID. */ public int id; - + /** * Plant size. */ public int size; - + /** * Plant growth stat. */ public int statGrowth; - + /** * Plant gain stat. */ public int statGain; - + /** * Plant resistance stat. */ public int statResistance; - + /** * For internal usage only. */ public int stackSize; - + /** * Create a BaseSeed object. * - * @param id plant ID - * @param size plant size - * @param statGrowth plant growth stat - * @param statGain plant gain stat - * @param statResistance plant resistance stat - * @param stackSize for internal usage only + * @param id1 plant ID + * @param size1 plant size + * @param statGrowth1 plant growth stat + * @param statGain1 plant gain stat + * @param statResistance1 plant resistance stat + * @param stackSize1 for internal usage only */ - public BaseSeed(int id, int size, int statGrowth, int statGain, int statResistance, int stackSize) { + public BaseSeed(int id1, int size1, int statGrowth1, int statGain1, int statResistance1, int stackSize1) { super(); - this.id = id; - this.size = size; - this.statGrowth = statGrowth; - this.statGain = statGain; - this.statResistance = statResistance; - this.stackSize = stackSize; + this.id = id1; + this.size = size1; + this.statGrowth = statGrowth1; + this.statGain = statGain1; + this.statResistance = statResistance1; + this.stackSize = stackSize1; } } diff --git a/common/ic2/api/crops/CropCard.java b/common/ic2/api/crops/CropCard.java index c03456450..5ff822681 100644 --- a/common/ic2/api/crops/CropCard.java +++ b/common/ic2/api/crops/CropCard.java @@ -52,13 +52,10 @@ public abstract class CropCard } return s; } - else - { - if (att.length < 3) return ""; - String s = att[2]; - if (att.length >= 4) s+=", "+att[3]; - return s; - } + if (att.length < 3) return ""; + String s = att[2]; + if (att.length >= 4) s+=", "+att[3]; + return s; } /** @@ -195,6 +192,8 @@ public abstract class CropCard * Called when the plant is rightclicked by a player. * Default action is harvesting. * + * Only called Serverside. + * * @param crop reference to ICropTile * @param player player rightclicking the crop * @return Whether the plant has changed @@ -247,6 +246,8 @@ public abstract class CropCard * Called when the plant is leftclicked by a player. * Default action is picking the plant. * + * Only called Serverside. + * * @param crop reference to ICropTile * @param player player leftclicked the crop * @return Whether the plant has changed @@ -290,7 +291,9 @@ public abstract class CropCard * * @param crop reference to ICropTile */ - public void onNeighbourChange(ICropTile crop){} + public void onNeighbourChange(ICropTile crop){ + // + } /** * Check if the crop should emit redstone. @@ -304,7 +307,9 @@ public abstract class CropCard * * @param crop reference to ICropTile */ - public void onBlockDestroyed(ICropTile crop){} + public void onBlockDestroyed(ICropTile crop){ + // + } /** * Get the light value emitted by the plant. @@ -337,7 +342,9 @@ public abstract class CropCard * * @param crop reference to ICropTile */ - public void tick(ICropTile crop) {} + public void tick(ICropTile crop) { + // + } /** * Check whether this plant spreads weed to surrounding tiles. diff --git a/common/ic2/api/energy/event/EnergyTileEvent.java b/common/ic2/api/energy/event/EnergyTileEvent.java index eb245d3b5..94b1b4a12 100644 --- a/common/ic2/api/energy/event/EnergyTileEvent.java +++ b/common/ic2/api/energy/event/EnergyTileEvent.java @@ -14,10 +14,10 @@ import ic2.api.energy.tile.IEnergyTile; public class EnergyTileEvent extends WorldEvent { public final IEnergyTile energyTile; - public EnergyTileEvent(IEnergyTile energyTile) { - super(((TileEntity) energyTile).worldObj); + public EnergyTileEvent(IEnergyTile energyTile1) { + super(((TileEntity) energyTile1).worldObj); - this.energyTile = energyTile; + this.energyTile = energyTile1; } } diff --git a/common/ic2/api/energy/event/EnergyTileLoadEvent.java b/common/ic2/api/energy/event/EnergyTileLoadEvent.java index 6b342d32e..bf019ae34 100644 --- a/common/ic2/api/energy/event/EnergyTileLoadEvent.java +++ b/common/ic2/api/energy/event/EnergyTileLoadEvent.java @@ -19,8 +19,8 @@ import ic2.api.energy.tile.IEnergyTile; * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public class EnergyTileLoadEvent extends EnergyTileEvent { - public EnergyTileLoadEvent(IEnergyTile energyTile) { - super(energyTile); + public EnergyTileLoadEvent(IEnergyTile energyTile1) { + super(energyTile1); } } diff --git a/common/ic2/api/energy/event/EnergyTileUnloadEvent.java b/common/ic2/api/energy/event/EnergyTileUnloadEvent.java index 58a4a0643..2b22ae31c 100644 --- a/common/ic2/api/energy/event/EnergyTileUnloadEvent.java +++ b/common/ic2/api/energy/event/EnergyTileUnloadEvent.java @@ -20,8 +20,8 @@ import ic2.api.energy.tile.IEnergyTile; * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public class EnergyTileUnloadEvent extends EnergyTileEvent { - public EnergyTileUnloadEvent(IEnergyTile energyTile) { - super(energyTile); + public EnergyTileUnloadEvent(IEnergyTile energyTile1) { + super(energyTile1); } } diff --git a/common/ic2/api/energy/prefab/BasicSink.java b/common/ic2/api/energy/prefab/BasicSink.java index 47af8f410..c60517c2d 100644 --- a/common/ic2/api/energy/prefab/BasicSink.java +++ b/common/ic2/api/energy/prefab/BasicSink.java @@ -98,14 +98,14 @@ public class BasicSink extends TileEntity implements IEnergySink { /** * Constructor for a new BasicSink delegate. * - * @param parent TileEntity represented by this energy sink. - * @param capacity Maximum amount of eu to store. - * @param tier IC2 tier, 1=LV, 2=MV, ... + * @param parent1 TileEntity represented by this energy sink. + * @param capacity1 Maximum amount of eu to store. + * @param tier1 IC2 tier, 1=LV, 2=MV, ... */ - public BasicSink(TileEntity parent, int capacity, int tier) { - this.parent = parent; - this.capacity = capacity; - this.tier = tier; + public BasicSink(TileEntity parent1, int capacity1, int tier1) { + this.parent = parent1; + this.capacity = capacity1; + this.tier = tier1; } // in-world te forwards >> @@ -212,10 +212,10 @@ public class BasicSink extends TileEntity implements IEnergySink { /** * Set the maximum amount of energy this sink can hold in its buffer. * - * @param capacity Capacity in EU. + * @param capacity1 Capacity in EU. */ - public void setCapacity(int capacity) { - this.capacity = capacity; + public void setCapacity(int capacity1) { + this.capacity = capacity1; } /** @@ -230,10 +230,10 @@ public class BasicSink extends TileEntity implements IEnergySink { /** * Set the IC2 energy tier for this sink. * - * @param tier IC2 Tier. + * @param tier1 IC2 Tier. */ - public void setTier(int tier) { - this.tier = tier; + public void setTier(int tier1) { + this.tier = tier1; } /** @@ -278,9 +278,8 @@ public class BasicSink extends TileEntity implements IEnergySink { energyStored -= amount; return true; - } else { - return false; } + return false; } /** diff --git a/common/ic2/api/energy/prefab/BasicSource.java b/common/ic2/api/energy/prefab/BasicSource.java index 5f1de764f..f8097e60f 100644 --- a/common/ic2/api/energy/prefab/BasicSource.java +++ b/common/ic2/api/energy/prefab/BasicSource.java @@ -96,16 +96,16 @@ public class BasicSource extends TileEntity implements IEnergySource { /** * Constructor for a new BasicSource delegate. * - * @param parent Base TileEntity represented by this energy source. - * @param capacity Maximum amount of eu to store. - * @param tier IC2 tier, 1=LV, 2=MV, ... + * @param parent1 Base TileEntity represented by this energy source. + * @param capacity1 Maximum amount of eu to store. + * @param tier1 IC2 tier, 1=LV, 2=MV, ... */ - public BasicSource(TileEntity parent, int capacity, int tier) { - int power = EnergyNet.instance.getPowerFromTier(tier); + public BasicSource(TileEntity parent1, int capacity1, int tier1) { + int power = EnergyNet.instance.getPowerFromTier(tier1); - this.parent = parent; - this.capacity = capacity < power ? power : capacity; - this.tier = tier; + this.parent = parent1; + this.capacity = capacity1 < power ? power : capacity1; + this.tier = tier1; } // in-world te forwards >> @@ -212,14 +212,14 @@ public class BasicSource extends TileEntity implements IEnergySource { /** * Set the maximum amount of energy this source can hold in its buffer. * - * @param capacity Capacity in EU. + * @param capacity1 Capacity in EU. */ - public void setCapacity(int capacity) { + public void setCapacity(int capacity1) { int power = EnergyNet.instance.getPowerFromTier(tier); - if (capacity < power) capacity = power; + if (capacity1 < power) capacity1 = power; - this.capacity = capacity; + this.capacity = capacity1; } /** @@ -234,14 +234,14 @@ public class BasicSource extends TileEntity implements IEnergySource { /** * Set the IC2 energy tier for this source. * - * @param tier IC2 Tier. + * @param tier1 IC2 Tier. */ - public void setTier(int tier) { - int power = EnergyNet.instance.getPowerFromTier(tier); + public void setTier(int tier1) { + int power = EnergyNet.instance.getPowerFromTier(tier1); if (capacity < power) capacity = power; - this.tier = tier; + this.tier = tier1; } @@ -354,9 +354,8 @@ public class BasicSource extends TileEntity implements IEnergySource { if (energyStored >= power) { return power; - } else { - return 0; } + return 0; } @Override diff --git a/common/ic2/api/energy/tile/IEnergyTile.java b/common/ic2/api/energy/tile/IEnergyTile.java index 932847f85..3938190a4 100644 --- a/common/ic2/api/energy/tile/IEnergyTile.java +++ b/common/ic2/api/energy/tile/IEnergyTile.java @@ -10,5 +10,6 @@ package ic2.api.energy.tile; * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyTile { + // } diff --git a/common/ic2/api/event/LaserEvent.java b/common/ic2/api/event/LaserEvent.java index 13f080d81..a6efffd92 100644 --- a/common/ic2/api/event/LaserEvent.java +++ b/common/ic2/api/event/LaserEvent.java @@ -26,15 +26,15 @@ public class LaserEvent extends WorldEvent { // Determines whether the laser will explode upon hitting something public boolean explosive, smelt; - public LaserEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt) { - super(world); - this.lasershot = lasershot; - this.owner = owner; - this.range = range; - this.power = power; - this.blockBreaks = blockBreaks; - this.explosive = explosive; - this.smelt = smelt; + public LaserEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1) { + super(world1); + this.lasershot = lasershot1; + this.owner = owner1; + this.range = range1; + this.power = power1; + this.blockBreaks = blockBreaks1; + this.explosive = explosive1; + this.smelt = smelt1; } /** @@ -45,9 +45,9 @@ public class LaserEvent extends WorldEvent { public static class LaserShootEvent extends LaserEvent { ItemStack laseritem; - public LaserShootEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, ItemStack laseritem) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - this.laseritem = laseritem; + public LaserShootEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, ItemStack laseritem1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.laseritem = laseritem1; } } @@ -60,11 +60,11 @@ public class LaserEvent extends WorldEvent { // explosion strength, even that can be changed! public float explosionpower, explosiondroprate, explosionentitydamage; - public LaserExplodesEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, float explosionpower, float explosiondroprate, float explosionentitydamage) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - this.explosionpower = explosionpower; - this.explosiondroprate = explosiondroprate; - this.explosionentitydamage = explosionentitydamage; + public LaserExplodesEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, float explosionpower1, float explosiondroprate1, float explosionentitydamage1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.explosionpower = explosionpower1; + this.explosiondroprate = explosiondroprate1; + this.explosionentitydamage = explosionentitydamage1; } } @@ -83,15 +83,15 @@ public class LaserEvent extends WorldEvent { public boolean removeBlock, dropBlock; public float dropChance; - public LaserHitsBlockEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, int x, int y, int z, int side, float dropChance, boolean removeBlock, boolean dropBlock) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - this.x = x; - this.y = y; - this.z = z; - this.side = side; - this.removeBlock = removeBlock; - this.dropBlock = dropBlock; - this.dropChance = dropChance; + public LaserHitsBlockEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, int x1, int y1, int z1, int side1, float dropChance1, boolean removeBlock1, boolean dropBlock1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.removeBlock = removeBlock1; + this.dropBlock = dropBlock1; + this.dropChance = dropChance1; } } @@ -105,9 +105,9 @@ public class LaserEvent extends WorldEvent { // the Entity which the Laser has shot at, even the target can be changed! public Entity hitentity; - public LaserHitsEntityEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, Entity hitentity) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - this.hitentity = hitentity; + public LaserHitsEntityEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, Entity hitentity1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.hitentity = hitentity1; } } } diff --git a/common/ic2/api/event/PaintEvent.java b/common/ic2/api/event/PaintEvent.java index add12fac4..562633878 100644 --- a/common/ic2/api/event/PaintEvent.java +++ b/common/ic2/api/event/PaintEvent.java @@ -1,6 +1,7 @@ package ic2.api.event; import net.minecraft.world.World; + import net.minecraftforge.event.Cancelable; import net.minecraftforge.event.world.WorldEvent; @@ -14,17 +15,17 @@ public class PaintEvent extends WorldEvent { // color to paint the block public final int color; - + // set to true to confirm the operation public boolean painted = false; - public PaintEvent(World world, int x, int y, int z, int side, int color) { - super(world); + public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) { + super(world1); - this.x = x; - this.y = y; - this.z = z; - this.side = side; - this.color = color; + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.color = color1; } } diff --git a/common/ic2/api/event/RetextureEvent.java b/common/ic2/api/event/RetextureEvent.java index c80bcf837..57383f19a 100644 --- a/common/ic2/api/event/RetextureEvent.java +++ b/common/ic2/api/event/RetextureEvent.java @@ -21,15 +21,15 @@ public class RetextureEvent extends WorldEvent { // set to true to confirm the operation public boolean applied = false; - public RetextureEvent(World world, int x, int y, int z, int side, int referencedBlockId, int referencedMeta, int referencedSide) { - super(world); + public RetextureEvent(World world1, int x1, int y1, int z1, int side1, int referencedBlockId1, int referencedMeta1, int referencedSide1) { + super(world1); - this.x = x; - this.y = y; - this.z = z; - this.side = side; - this.referencedBlockId = referencedBlockId; - this.referencedMeta = referencedMeta; - this.referencedSide = referencedSide; + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.referencedBlockId = referencedBlockId1; + this.referencedMeta = referencedMeta1; + this.referencedSide = referencedSide1; } } diff --git a/common/ic2/api/item/IItemHudInfo.java b/common/ic2/api/item/IItemHudInfo.java index e2b8610da..fe6ec0f97 100644 --- a/common/ic2/api/item/IItemHudInfo.java +++ b/common/ic2/api/item/IItemHudInfo.java @@ -1,16 +1,15 @@ package ic2.api.item; -import java.util.LinkedList; import java.util.List; import net.minecraft.item.ItemStack; public interface IItemHudInfo { -/* + /* Add Info to Nano- and Quantum-Suit Helm Hud for itemStack - + @Override public List getHudInfo(ItemStack itemStack) { List info = new LinkedList(); @@ -18,10 +17,10 @@ public interface IItemHudInfo { info.add("and have Cool info"); return info; } - - - */ - - public List getHudInfo(ItemStack itemStack); - + + + */ + + public List getHudInfo(ItemStack itemStack); + } diff --git a/common/ic2/api/item/Items.java b/common/ic2/api/item/Items.java index 413bdd4ae..18fbd66cc 100644 --- a/common/ic2/api/item/Items.java +++ b/common/ic2/api/item/Items.java @@ -30,9 +30,8 @@ public final class Items { if (ret instanceof ItemStack) { return (ItemStack) ret; - } else { - return null; } + return null; } catch (Exception e) { System.out.println("IC2 API: Call getItem failed for "+name); diff --git a/common/ic2/api/network/NetworkHelper.java b/common/ic2/api/network/NetworkHelper.java index 48ecc2ad2..900a74287 100644 --- a/common/ic2/api/network/NetworkHelper.java +++ b/common/ic2/api/network/NetworkHelper.java @@ -154,6 +154,7 @@ public final class NetworkHelper { */ @Deprecated public static void requestInitialData(INetworkDataProvider dataProvider) { + // } /** diff --git a/common/ic2/api/recipe/ICannerBottleRecipeManager.java b/common/ic2/api/recipe/ICannerBottleRecipeManager.java index 97fd94576..415b3c38c 100644 --- a/common/ic2/api/recipe/ICannerBottleRecipeManager.java +++ b/common/ic2/api/recipe/ICannerBottleRecipeManager.java @@ -36,13 +36,13 @@ public interface ICannerBottleRecipeManager { public static class Input { - public Input(IRecipeInput container, IRecipeInput fill) { - this.container = container; - this.fill = fill; + public Input(IRecipeInput container1, IRecipeInput fill1) { + this.container = container1; + this.fill = fill1; } - public boolean matches(ItemStack container, ItemStack fill) { - return this.container.matches(container) && this.fill.matches(fill); + public boolean matches(ItemStack container1, ItemStack fill1) { + return this.container.matches(container1) && this.fill.matches(fill1); } public final IRecipeInput container; diff --git a/common/ic2/api/recipe/ICannerEnrichRecipeManager.java b/common/ic2/api/recipe/ICannerEnrichRecipeManager.java index 0f05ad79d..5eba1b68e 100644 --- a/common/ic2/api/recipe/ICannerEnrichRecipeManager.java +++ b/common/ic2/api/recipe/ICannerEnrichRecipeManager.java @@ -38,14 +38,14 @@ public interface ICannerEnrichRecipeManager { public static class Input { - public Input(FluidStack fluid, IRecipeInput additive) { - this.fluid = fluid; - this.additive = additive; + public Input(FluidStack fluid1, IRecipeInput additive1) { + this.fluid = fluid1; + this.additive = additive1; } - public boolean matches(FluidStack fluid, ItemStack additive) { - return (this.fluid == null || this.fluid.isFluidEqual(fluid)) && - this.additive.matches(additive); + public boolean matches(FluidStack fluid1, ItemStack additive1) { + return (this.fluid == null || this.fluid.isFluidEqual(fluid1)) && + this.additive.matches(additive1); } public final FluidStack fluid; diff --git a/common/ic2/api/recipe/IListRecipeManager.java b/common/ic2/api/recipe/IListRecipeManager.java index 5c0d30628..5bee9daf3 100644 --- a/common/ic2/api/recipe/IListRecipeManager.java +++ b/common/ic2/api/recipe/IListRecipeManager.java @@ -16,7 +16,7 @@ public interface IListRecipeManager extends Iterable { * @param stack Stack to add */ public void add(ItemStack stack); - + /** * Checks whether the specified stack is in the list. * @@ -24,7 +24,12 @@ public interface IListRecipeManager extends Iterable { * @return Whether the stack is in the list */ public boolean contains(ItemStack stack); - + + /** + * @return if the List is Empty + */ + public boolean isEmpty(); + /** * Gets the list of stacks. * diff --git a/common/ic2/api/recipe/ISemiFluidFuelManager.java b/common/ic2/api/recipe/ISemiFluidFuelManager.java index cf6af6542..87c34270d 100644 --- a/common/ic2/api/recipe/ISemiFluidFuelManager.java +++ b/common/ic2/api/recipe/ISemiFluidFuelManager.java @@ -21,9 +21,9 @@ public interface ISemiFluidFuelManager extends ILiquidAcceptManager { public static class BurnProperty { - public BurnProperty(int amount, double power) { - this.amount = amount; - this.power = power; + public BurnProperty(int amount1, double power1) { + this.amount = amount1; + this.power = power1; } public final int amount; diff --git a/common/ic2/api/recipe/RecipeInputItemStack.java b/common/ic2/api/recipe/RecipeInputItemStack.java index a2a9195d7..18e98ad2a 100644 --- a/common/ic2/api/recipe/RecipeInputItemStack.java +++ b/common/ic2/api/recipe/RecipeInputItemStack.java @@ -8,19 +8,18 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class RecipeInputItemStack implements IRecipeInput { - public RecipeInputItemStack(ItemStack input) { - this(input, input.stackSize); + public RecipeInputItemStack(ItemStack aInput) { + this(aInput, aInput.stackSize); } - public RecipeInputItemStack(ItemStack input, int amount) { - this.input = input; - this.amount = amount; + public RecipeInputItemStack(ItemStack aInput, int aAmount) { + input = aInput.copy(); // Never forget to copy. + amount = aAmount; } @Override public boolean matches(ItemStack subject) { - return subject.itemID == input.itemID && - (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE); + return subject.getItem() == input.getItem() && (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE); } @Override diff --git a/common/ic2/api/recipe/RecipeInputOreDict.java b/common/ic2/api/recipe/RecipeInputOreDict.java index eb804b2aa..7059059c7 100644 --- a/common/ic2/api/recipe/RecipeInputOreDict.java +++ b/common/ic2/api/recipe/RecipeInputOreDict.java @@ -7,22 +7,22 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class RecipeInputOreDict implements IRecipeInput { - public RecipeInputOreDict(String input) { - this(input, 1); + public RecipeInputOreDict(String input1) { + this(input1, 1); } - public RecipeInputOreDict(String input, int amount) { - this.input = input; - this.amount = amount; + public RecipeInputOreDict(String input1, int amount1) { + this.input = input1; + this.amount = amount1; } @Override public boolean matches(ItemStack subject) { List inputs = OreDictionary.getOres(input); - for (ItemStack input : inputs) { - if (subject.itemID == input.itemID && - (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE)) { + for (ItemStack input1 : inputs) { + if (subject.itemID == input1.itemID && + (subject.getItemDamage() == input1.getItemDamage() || input1.getItemDamage() == OreDictionary.WILDCARD_VALUE)) { return true; } } diff --git a/common/ic2/api/recipe/RecipeOutput.java b/common/ic2/api/recipe/RecipeOutput.java index e0ee71ab9..c9474cd71 100644 --- a/common/ic2/api/recipe/RecipeOutput.java +++ b/common/ic2/api/recipe/RecipeOutput.java @@ -7,13 +7,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; public final class RecipeOutput { - public RecipeOutput(NBTTagCompound metadata, List items) { - this.metadata = metadata; - this.items = items; + public RecipeOutput(NBTTagCompound metadata1, List items1) { + this.metadata = metadata1; + this.items = items1; } - public RecipeOutput(NBTTagCompound metadata, ItemStack... items) { - this(metadata, Arrays.asList(items)); + public RecipeOutput(NBTTagCompound metadata1, ItemStack... items1) { + this(metadata1, Arrays.asList(items1)); } public final List items; diff --git a/common/ic2/api/recipe/Recipes.java b/common/ic2/api/recipe/Recipes.java index 849c4cab4..4e12a03f3 100644 --- a/common/ic2/api/recipe/Recipes.java +++ b/common/ic2/api/recipe/Recipes.java @@ -48,6 +48,11 @@ public class Recipes { */ public static IScrapboxManager scrapboxDrops; public static IListRecipeManager recyclerBlacklist; + /** + * Do not add anything to this Whitelist. This is for Configuration only. + * You may need this if you have an own Recycler in your Mod, just to check if something can be recycled. but don't add anything to this List + */ + public static IListRecipeManager recyclerWhitelist; public static ICraftingRecipeManager advRecipes; public static ISemiFluidFuelManager semiFluidGenerator; diff --git a/common/ic2/api/tile/ExplosionWhitelist.java b/common/ic2/api/tile/ExplosionWhitelist.java index 01322b6c0..fa4a474a5 100644 --- a/common/ic2/api/tile/ExplosionWhitelist.java +++ b/common/ic2/api/tile/ExplosionWhitelist.java @@ -1,6 +1,7 @@ package ic2.api.tile; -import java.util.*; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; diff --git a/common/mekanism/client/ClientProxy.java b/common/mekanism/client/ClientProxy.java index 3b7cf09d1..ef37473ec 100644 --- a/common/mekanism/client/ClientProxy.java +++ b/common/mekanism/client/ClientProxy.java @@ -158,6 +158,7 @@ public class ClientProxy extends CommonProxy MekanismClient.fancyUniversalCableRender = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "FancyUniversalCableRender", true).getBoolean(true); MekanismClient.holidays = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Holidays", true).getBoolean(true); MekanismClient.baseSoundVolume = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SoundVolume", 1D).getDouble(1D); + MekanismClient.machineEffects = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MachineEffects", true).getBoolean(true); String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J").getString(); diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index 001ca177a..0a55e5569 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -297,6 +297,7 @@ public class Mekanism public static boolean voiceServerEnabled = true; public static boolean forceBuildcraft = false; public static boolean cardboardSpawners = true; + public static boolean machineEffects = true; public static int obsidianTNTBlastRadius = 12; public static int osmiumGenerationAmount = 12; public static int copperGenerationAmount = 16; diff --git a/common/mekanism/common/block/BlockMachine.java b/common/mekanism/common/block/BlockMachine.java index 9d166b49e..28e994c8a 100644 --- a/common/mekanism/common/block/BlockMachine.java +++ b/common/mekanism/common/block/BlockMachine.java @@ -258,7 +258,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds { TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z); - if(MekanismUtils.isActive(world, x, y, z) && ((IActiveState)tileEntity).renderUpdate()) + if(MekanismUtils.isActive(world, x, y, z) && ((IActiveState)tileEntity).renderUpdate() && Mekanism.machineEffects) { float xRandom = (float)x + 0.5F; float yRandom = (float)y + 0.0F + random.nextFloat() * 6.0F / 16.0F; @@ -301,7 +301,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - if(tileEntity instanceof IActiveState) + if(Mekanism.machineEffects && tileEntity instanceof IActiveState) { if(((IActiveState)tileEntity).getActive() && ((IActiveState)tileEntity).lightUpdate()) { diff --git a/common/mekanism/common/util/MekanismUtils.java b/common/mekanism/common/util/MekanismUtils.java index 1c082b7c8..19e655ad0 100644 --- a/common/mekanism/common/util/MekanismUtils.java +++ b/common/mekanism/common/util/MekanismUtils.java @@ -703,7 +703,7 @@ public final class MekanismUtils world.markBlockForRenderUpdate(x, y, z); } - if(!(world.getBlockTileEntity(x, y, z) instanceof IActiveState) || ((IActiveState)world.getBlockTileEntity(x, y, z)).lightUpdate()) + if(!(world.getBlockTileEntity(x, y, z) instanceof IActiveState) || ((IActiveState)world.getBlockTileEntity(x, y, z)).lightUpdate() && Mekanism.machineEffects) { world.updateAllLightTypes(x, y, z); }