summaryrefslogtreecommitdiff
path: root/src/api/java/ic2
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/java/ic2')
-rw-r--r--src/api/java/ic2/api/Direction.java68
-rw-r--r--src/api/java/ic2/api/crops/BaseSeed.java36
-rw-r--r--src/api/java/ic2/api/crops/CropCard.java164
-rw-r--r--src/api/java/ic2/api/crops/Crops.java12
-rw-r--r--src/api/java/ic2/api/crops/ICropTile.java3
-rw-r--r--src/api/java/ic2/api/crops/package-info.java3
-rw-r--r--src/api/java/ic2/api/energy/EnergyNet.java7
-rw-r--r--src/api/java/ic2/api/energy/IEnergyNet.java4
-rw-r--r--src/api/java/ic2/api/energy/NodeStats.java21
-rw-r--r--src/api/java/ic2/api/energy/event/EnergyTileEvent.java20
-rw-r--r--src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java7
-rw-r--r--src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java7
-rw-r--r--src/api/java/ic2/api/energy/event/package-info.java3
-rw-r--r--src/api/java/ic2/api/energy/package-info.java3
-rw-r--r--src/api/java/ic2/api/energy/prefab/BasicSink.java157
-rw-r--r--src/api/java/ic2/api/energy/prefab/BasicSource.java173
-rw-r--r--src/api/java/ic2/api/energy/prefab/package-info.java3
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java5
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergyConductor.java4
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergyEmitter.java5
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergySink.java4
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergySource.java4
-rw-r--r--src/api/java/ic2/api/energy/tile/IEnergyTile.java4
-rw-r--r--src/api/java/ic2/api/energy/tile/IHeatSource.java11
-rw-r--r--src/api/java/ic2/api/energy/tile/IKineticSource.java5
-rw-r--r--src/api/java/ic2/api/energy/tile/IMetaDelegate.java3
-rw-r--r--src/api/java/ic2/api/energy/tile/package-info.java3
-rw-r--r--src/api/java/ic2/api/event/ExplosionEvent.java30
-rw-r--r--src/api/java/ic2/api/event/LaserEvent.java97
-rw-r--r--src/api/java/ic2/api/event/PaintEvent.java32
-rw-r--r--src/api/java/ic2/api/event/RetextureEvent.java38
-rw-r--r--src/api/java/ic2/api/event/package-info.java3
-rw-r--r--src/api/java/ic2/api/info/IEnergyValueProvider.java3
-rw-r--r--src/api/java/ic2/api/info/IFuelValueProvider.java3
-rw-r--r--src/api/java/ic2/api/info/Info.java32
-rw-r--r--src/api/java/ic2/api/info/package-info.java3
-rw-r--r--src/api/java/ic2/api/item/ElectricItem.java25
-rw-r--r--src/api/java/ic2/api/item/IBackupElectricItemManager.java3
-rw-r--r--src/api/java/ic2/api/item/IBlockCuttingBlade.java4
-rw-r--r--src/api/java/ic2/api/item/IBoxable.java4
-rw-r--r--src/api/java/ic2/api/item/IC2Items.java38
-rw-r--r--src/api/java/ic2/api/item/ICustomDamageItem.java3
-rw-r--r--src/api/java/ic2/api/item/IDebuggable.java28
-rw-r--r--src/api/java/ic2/api/item/IElectricItem.java4
-rw-r--r--src/api/java/ic2/api/item/IElectricItemManager.java3
-rw-r--r--src/api/java/ic2/api/item/IItemHudInfo.java21
-rw-r--r--src/api/java/ic2/api/item/IKineticRotor.java9
-rw-r--r--src/api/java/ic2/api/item/ILatheItem.java7
-rw-r--r--src/api/java/ic2/api/item/IMetalArmor.java3
-rw-r--r--src/api/java/ic2/api/item/ISpecialElectricItem.java3
-rw-r--r--src/api/java/ic2/api/item/ITerraformingBP.java7
-rw-r--r--src/api/java/ic2/api/item/ItemWrapper.java65
-rw-r--r--src/api/java/ic2/api/item/package-info.java3
-rw-r--r--src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java4
-rw-r--r--src/api/java/ic2/api/network/INetworkDataProvider.java4
-rw-r--r--src/api/java/ic2/api/network/INetworkItemEventListener.java4
-rw-r--r--src/api/java/ic2/api/network/INetworkTileEntityEventListener.java4
-rw-r--r--src/api/java/ic2/api/network/INetworkUpdateListener.java4
-rw-r--r--src/api/java/ic2/api/network/NetworkHelper.java138
-rw-r--r--src/api/java/ic2/api/network/package-info.java3
-rw-r--r--src/api/java/ic2/api/package-info.java3
-rw-r--r--src/api/java/ic2/api/reactor/IReactor.java4
-rw-r--r--src/api/java/ic2/api/reactor/IReactorChamber.java5
-rw-r--r--src/api/java/ic2/api/reactor/IReactorComponent.java3
-rw-r--r--src/api/java/ic2/api/reactor/package-info.java3
-rw-r--r--src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java23
-rw-r--r--src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java25
-rw-r--r--src/api/java/ic2/api/recipe/ICraftingRecipeManager.java5
-rw-r--r--src/api/java/ic2/api/recipe/IFluidHeatManager.java19
-rw-r--r--src/api/java/ic2/api/recipe/ILiquidAcceptManager.java4
-rw-r--r--src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java13
-rw-r--r--src/api/java/ic2/api/recipe/IListRecipeManager.java3
-rw-r--r--src/api/java/ic2/api/recipe/IMachineRecipeManager.java3
-rw-r--r--src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java3
-rw-r--r--src/api/java/ic2/api/recipe/IPatternStorage.java3
-rw-r--r--src/api/java/ic2/api/recipe/IRecipeInput.java3
-rw-r--r--src/api/java/ic2/api/recipe/IScrapboxManager.java3
-rw-r--r--src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java19
-rw-r--r--src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java45
-rw-r--r--src/api/java/ic2/api/recipe/RecipeInputItemStack.java38
-rw-r--r--src/api/java/ic2/api/recipe/RecipeInputOreDict.java112
-rw-r--r--src/api/java/ic2/api/recipe/RecipeOutput.java56
-rw-r--r--src/api/java/ic2/api/recipe/Recipes.java48
-rw-r--r--src/api/java/ic2/api/recipe/package-info.java3
-rw-r--r--src/api/java/ic2/api/tile/ExplosionWhitelist.java19
-rw-r--r--src/api/java/ic2/api/tile/IEnergyStorage.java3
-rw-r--r--src/api/java/ic2/api/tile/IWrenchable.java4
-rw-r--r--src/api/java/ic2/api/tile/package-info.java3
-rw-r--r--src/api/java/ic2/api/util/IKeyboard.java10
-rw-r--r--src/api/java/ic2/api/util/Keys.java8
-rw-r--r--src/api/java/ic2/api/util/package-info.java3
91 files changed, 1124 insertions, 743 deletions
diff --git a/src/api/java/ic2/api/Direction.java b/src/api/java/ic2/api/Direction.java
index b550ca3..ce0f077 100644
--- a/src/api/java/ic2/api/Direction.java
+++ b/src/api/java/ic2/api/Direction.java
@@ -5,13 +5,13 @@ import java.util.Set;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-
import net.minecraftforge.common.util.ForgeDirection;
/**
* Represents the 6 possible directions along the axis of a block.
*/
-public enum Direction {
+public enum Direction
+{
/**
* -X
*/
@@ -39,21 +39,27 @@ public enum Direction {
*/
ZP;
- private Direction() {
- int side = ordinal() / 2;
- int sign = getSign();
+ private Direction()
+ {
+ final int side = ordinal() / 2;
+ final int sign = getSign();
xOffset = side == 0 ? sign : 0;
yOffset = side == 1 ? sign : 0;
zOffset = side == 2 ? sign : 0;
}
- public static Direction fromSideValue(int side) {
+ public static Direction fromSideValue(int side)
+ {
return directions[(side + 2) % 6];
}
- public static Direction fromForgeDirection(ForgeDirection dir) {
- if (dir == ForgeDirection.UNKNOWN) return null;
+ public static Direction fromForgeDirection(ForgeDirection dir)
+ {
+ if(dir == ForgeDirection.UNKNOWN)
+ {
+ return null;
+ }
return fromSideValue(dir.ordinal());
}
@@ -64,7 +70,8 @@ public enum Direction {
* @param tileEntity tile entity to check
* @return Adjacent tile entity or null if none exists
*/
- public TileEntity applyToTileEntity(TileEntity te) {
+ public TileEntity applyToTileEntity(TileEntity te)
+ {
return applyTo(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);
}
@@ -77,16 +84,22 @@ public enum Direction {
* @param z Z coordinate to check from
* @return Adjacent tile entity or null if none exists
*/
- public TileEntity applyTo(World world, int x, int y, int z) {
- int coords[] = { x, y, z };
+ public TileEntity applyTo(World world, int x, int y, int z)
+ {
+ final int coords[] = {x, y, z};
coords[ordinal() / 2] += getSign();
- if (world != null && world.blockExists(coords[0], coords[1], coords[2])) {
- try {
+ if(world != null && world.blockExists(coords[0], coords[1], coords[2]))
+ {
+ try
+ {
return world.getTileEntity(coords[0], coords[1], coords[2]);
- } catch (Exception e) {
- throw new RuntimeException("error getting TileEntity at dim "+world.provider.dimensionId+" "+coords[0]+"/"+coords[1]+"/"+coords[2]);
+ }
+ catch(final Exception e)
+ {
+ throw new RuntimeException(
+ "error getting TileEntity at dim " + world.provider.dimensionId + " " + coords[0] + "/" + coords[1] + "/" + coords[2]);
}
}
@@ -98,7 +111,8 @@ public enum Direction {
*
* @return Inverse direction
*/
- public Direction getInverse() {
+ public Direction getInverse()
+ {
return directions[ordinal() ^ 1];
}
@@ -107,7 +121,8 @@ public enum Direction {
*
* @return Minecraft side value
*/
- public int toSideValue() {
+ public int toSideValue()
+ {
return (ordinal() + 4) % 6;
}
@@ -116,20 +131,21 @@ public enum Direction {
*
* @return -1 if the direction is negative, +1 if the direction is positive
*/
- private int getSign() {
+ private int getSign()
+ {
return (ordinal() % 2) * 2 - 1;
}
- public ForgeDirection toForgeDirection() {
+ public ForgeDirection toForgeDirection()
+ {
return ForgeDirection.getOrientation(toSideValue());
}
- public final int xOffset;
- public final int yOffset;
- public final int zOffset;
+ public final int xOffset;
+ public final int yOffset;
+ public final int zOffset;
- public static final Direction[] directions = Direction.values();
- public static final Set<Direction> noDirections = EnumSet.noneOf(Direction.class);
- public static final Set<Direction> allDirections = EnumSet.allOf(Direction.class);
+ public static final Direction[] directions = Direction.values();
+ public static final Set<Direction> noDirections = EnumSet.noneOf(Direction.class);
+ public static final Set<Direction> allDirections = EnumSet.allOf(Direction.class);
}
-
diff --git a/src/api/java/ic2/api/crops/BaseSeed.java b/src/api/java/ic2/api/crops/BaseSeed.java
index 89e7865..a7b55f6 100644
--- a/src/api/java/ic2/api/crops/BaseSeed.java
+++ b/src/api/java/ic2/api/crops/BaseSeed.java
@@ -3,7 +3,8 @@ package ic2.api.crops;
/**
* Base agriculture seed. Used to determine the state of a plant once it is planted from an item.
*/
-public class BaseSeed {
+public class BaseSeed
+{
/**
* Create a BaseSeed object.
*
@@ -15,10 +16,11 @@ public class BaseSeed {
* @param stackSize1 for internal usage only
*/
@SuppressWarnings("deprecation")
- public BaseSeed(CropCard crop, int size, int statGrowth, int statGain, int statResistance, int stackSize) {
+ public BaseSeed(CropCard crop, int size, int statGrowth, int statGain, int statResistance, int stackSize)
+ {
super();
this.crop = crop;
- this.id = Crops.instance.getIdFor(crop);
+ id = Crops.instance.getIdFor(crop);
this.size = size;
this.statGrowth = statGrowth;
this.statGain = statGain;
@@ -30,53 +32,57 @@ public class BaseSeed {
* @deprecated Use the CropCard version.
*/
@Deprecated
- public BaseSeed(int id, int size, int statGrowth, int statGain, int statResistance, int stackSize) {
+ public BaseSeed(int id, int size, int statGrowth, int statGain, int statResistance, int stackSize)
+ {
this(getCropFromId(id), size, statGrowth, statGain, statResistance, stackSize);
}
@SuppressWarnings("deprecation")
- private static CropCard getCropFromId(int id) {
- CropCard[] crops = Crops.instance.getCropList();
+ private static CropCard getCropFromId(int id)
+ {
+ final CropCard[] crops = Crops.instance.getCropList();
- if (id < 0 || id >= crops.length) return null;
+ if(id < 0 || id >= crops.length)
+ {
+ return null;
+ }
return crops[id];
}
-
/**
* Plant.
*/
- public final CropCard crop;
+ public final CropCard crop;
/**
* @deprecated IDs aren't used anymore.
*/
@Deprecated
- public int id;
+ public int id;
/**
* Plant size.
*/
- public int size;
+ public int size;
/**
* Plant growth stat.
*/
- public int statGrowth;
+ public int statGrowth;
/**
* Plant gain stat.
*/
- public int statGain;
+ public int statGain;
/**
* Plant resistance stat.
*/
- public int statResistance;
+ public int statResistance;
/**
* For internal usage only.
*/
- public int stackSize;
+ public int stackSize;
}
diff --git a/src/api/java/ic2/api/crops/CropCard.java b/src/api/java/ic2/api/crops/CropCard.java
index 1d2b640..e2a16d8 100644
--- a/src/api/java/ic2/api/crops/CropCard.java
+++ b/src/api/java/ic2/api/crops/CropCard.java
@@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.relauncher.Side;
@@ -17,8 +16,10 @@ import cpw.mods.fml.relauncher.SideOnly;
*
* Any crop extending this can be registered using registerCrop to be added into the game.
*/
-public abstract class CropCard {
- public CropCard() {
+public abstract class CropCard
+{
+ public CropCard()
+ {
modId = getModId(); // initialize mod id while we should be in the real owner's init event
}
@@ -46,7 +47,8 @@ public abstract class CropCard {
*
* @return Mod id.
*/
- public String owner() { // TODO: make abstract
+ public String owner()
+ { // TODO: make abstract
return modId;
}
@@ -59,7 +61,8 @@ public abstract class CropCard {
*
* @return Unlocalized name.
*/
- public String displayName() {
+ public String displayName()
+ {
return name(); // return the raw name for backwards compatibility
}
@@ -68,7 +71,8 @@ public abstract class CropCard {
*
* @return Your name
*/
- public String discoveredBy() {
+ public String discoveredBy()
+ {
return "unknown";
}
@@ -79,22 +83,37 @@ public abstract class CropCard {
* @param i line to get, starting from 0
* @return The line
*/
- public String desc(int i) {
- String[] att = attributes();
+ public String desc(int i)
+ {
+ final String[] att = attributes();
- if (att == null || att.length == 0) return "";
+ if(att == null || att.length == 0)
+ {
+ return "";
+ }
- if (i == 0) {
+ if(i == 0)
+ {
String s = att[0];
- if (att.length >= 2) {
- s+=", "+att[1];
- if (att.length >= 3) s+=",";
+ if(att.length >= 2)
+ {
+ s += ", " + att[1];
+ if(att.length >= 3)
+ {
+ s += ",";
+ }
}
return s;
}
- if (att.length < 3) return "";
+ if(att.length < 3)
+ {
+ return "";
+ }
String s = att[2];
- if (att.length >= 4) s+=", "+att[3];
+ if(att.length >= 4)
+ {
+ s += ", " + att[3];
+ }
return s;
}
@@ -103,7 +122,8 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return roots lengt use in isBlockBelow
*/
- public int getrootslength(ICropTile crop) { // TODO: camel case
+ public int getrootslength(ICropTile crop)
+ { // TODO: camel case
return 1;
}
@@ -155,12 +175,14 @@ public abstract class CropCard {
* ic2:crop/*, which will then read assets/yourmod/textures/blocks/crop/*.png.
*/
@SideOnly(Side.CLIENT)
- public void registerSprites(IIconRegister iconRegister) {
+ public void registerSprites(IIconRegister iconRegister)
+ {
textures = new IIcon[maxSize()];
- for (int i = 1; i <= textures.length; i++) {
+ for(int i = 1; i <= textures.length; i++)
+ {
// ic2:crop/blockCrop.NAME.n is the legacy name for backwards compatiblity
- textures[i - 1] = iconRegister.registerIcon("ic2:crop/blockCrop."+name()+"."+i);
+ textures[i - 1] = iconRegister.registerIcon("ic2:crop/blockCrop." + name() + "." + i);
}
}
@@ -171,8 +193,12 @@ public abstract class CropCard {
* @return 0-255, representing the sprite index on the crop's spritesheet.
*/
@SideOnly(Side.CLIENT)
- public IIcon getSprite(ICropTile crop) {
- if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null;
+ public IIcon getSprite(ICropTile crop)
+ {
+ if(crop.getSize() <= 0 || crop.getSize() > textures.length)
+ {
+ return null;
+ }
return textures[crop.getSize() - 1];
}
@@ -181,7 +207,8 @@ public abstract class CropCard {
* Amount of growth points needed to increase the plant's size.
* Default is 200 * tier.
*/
- public int growthDuration(ICropTile crop) {
+ public int growthDuration(ICropTile crop)
+ {
return tier() * 200;
}
@@ -214,7 +241,8 @@ public abstract class CropCard {
* @param air air quality, influences by open gardens and less crops surrounding this one
* @return 0-30
*/
- public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
+ public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air)
+ {
return (int) (humidity + nutrients + air);
}
@@ -224,11 +252,11 @@ public abstract class CropCard {
*
* @param crop crop to crossbreed with
*/
- public boolean canCross(ICropTile crop) {
+ public boolean canCross(ICropTile crop)
+ {
return crop.getSize() >= 3;
}
-
/**
* Called when the plant is rightclicked by a player.
* Default action is harvesting.
@@ -239,7 +267,8 @@ public abstract class CropCard {
* @param player player rightclicking the crop
* @return Whether the plant has changed
*/
- public boolean rightclick(ICropTile crop, EntityPlayer player) {
+ public boolean rightclick(ICropTile crop, EntityPlayer player)
+ {
return crop.harvest(true);
}
@@ -266,7 +295,8 @@ public abstract class CropCard {
*
* @return Chance to drop the gains
*/
- public float dropGainChance() { // TODO: change to double
+ public float dropGainChance()
+ { // TODO: change to double
return (float) Math.pow(0.95, tier());
}
@@ -285,8 +315,10 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Plant size after harvesting
*/
- public byte getSizeAfterHarvest(ICropTile crop) {return 1;} // TODO: change to int
-
+ public byte getSizeAfterHarvest(ICropTile crop)
+ {
+ return 1;
+ } // TODO: change to int
/**
* Called when the plant is left clicked by a player.
@@ -298,7 +330,8 @@ public abstract class CropCard {
* @param player player left clicked the crop
* @return Whether the plant has changed
*/
- public boolean leftclick(ICropTile crop, EntityPlayer player) { // TODO: camel case
+ public boolean leftclick(ICropTile crop, EntityPlayer player)
+ { // TODO: camel case
return crop.pick(true);
}
@@ -309,11 +342,21 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Chance to drop the seeds
*/
- public float dropSeedChance(ICropTile crop) {
- if (crop.getSize() == 1) return 0;
+ public float dropSeedChance(ICropTile crop)
+ {
+ if(crop.getSize() == 1)
+ {
+ return 0;
+ }
float base = 0.5F;
- if (crop.getSize() == 2) base/=2F;
- for (int i = 0; i < tier(); i++) {base*=0.8;}
+ if(crop.getSize() == 2)
+ {
+ base /= 2F;
+ }
+ for(int i = 0; i < tier(); i++)
+ {
+ base *= 0.8;
+ }
return base;
}
@@ -325,7 +368,8 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Seeds
*/
- public ItemStack getSeeds(ICropTile crop) {
+ public ItemStack getSeeds(ICropTile crop)
+ {
return crop.generateSeeds(crop.getCrop(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel());
}
@@ -334,7 +378,8 @@ public abstract class CropCard {
*
* @param crop reference to ICropTile
*/
- public void onNeighbourChange(ICropTile crop) {
+ public void onNeighbourChange(ICropTile crop)
+ {
//
}
@@ -343,14 +388,18 @@ public abstract class CropCard {
*
* @return Whether the crop should emit redstone
*/
- public int emitRedstone(ICropTile crop) {return 0;}
+ public int emitRedstone(ICropTile crop)
+ {
+ return 0;
+ }
/**
* Called when the crop is destroyed.
*
* @param crop reference to ICropTile
*/
- public void onBlockDestroyed(ICropTile crop) {
+ public void onBlockDestroyed(ICropTile crop)
+ {
//
}
@@ -360,7 +409,8 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Light value emitted
*/
- public int getEmittedLight(ICropTile crop) {
+ public int getEmittedLight(ICropTile crop)
+ {
return 0;
}
@@ -371,22 +421,24 @@ public abstract class CropCard {
* @param entity entity colliding
* @return Whether trampling calculation should happen, return false if the plant is no longer valid.
*/
- public boolean onEntityCollision(ICropTile crop, Entity entity) {
- if (entity instanceof EntityLivingBase) {
+ public boolean onEntityCollision(ICropTile crop, Entity entity)
+ {
+ if(entity instanceof EntityLivingBase)
+ {
return ((EntityLivingBase) entity).isSprinting();
}
return false;
}
-
/**
* Called every time the crop ticks.
* Should be called every 256 ticks or around 13 seconds.
*
* @param crop reference to ICropTile
*/
- public void tick(ICropTile crop) {
+ public void tick(ICropTile crop)
+ {
// nothing by default
}
@@ -397,12 +449,11 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Whether the plant spreads weed
*/
- public boolean isWeed(ICropTile crop) {
- return crop.getSize() >= 2 &&
- (crop.getCrop() == Crops.weed || crop.getGrowth() >= 24);
+ public boolean isWeed(ICropTile crop)
+ {
+ return crop.getSize() >= 2 && (crop.getCrop() == Crops.weed || crop.getGrowth() >= 24);
}
-
/**
* Get this plant's ID.
*
@@ -410,16 +461,21 @@ public abstract class CropCard {
* @deprecated IDs aren't used anymore.
*/
@Deprecated
- public final int getId() {
+ public final int getId()
+ {
return Crops.instance.getIdFor(this);
}
- private static String getModId() {
- ModContainer modContainer = Loader.instance().activeModContainer();
+ private static String getModId()
+ {
+ final ModContainer modContainer = Loader.instance().activeModContainer();
- if (modContainer != null) {
+ if(modContainer != null)
+ {
return modContainer.getModId();
- } else {
+ }
+ else
+ {
// this is bad if you are not actually IC2
assert false;
@@ -428,8 +484,8 @@ public abstract class CropCard {
}
@SideOnly(Side.CLIENT)
- protected IIcon textures[];
+ protected IIcon textures[];
- private final String modId; // TODO: make owner abstract, remove modId auto detection
+ private final String modId; // TODO: make owner abstract, remove modId auto detection
// TODO: add a clean way to obtain world reference and position
}
diff --git a/src/api/java/ic2/api/crops/Crops.java b/src/api/java/ic2/api/crops/Crops.java
index a11059a..c6f0745 100644
--- a/src/api/java/ic2/api/crops/Crops.java
+++ b/src/api/java/ic2/api/crops/Crops.java
@@ -5,19 +5,18 @@ import java.util.Collection;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
-
+import net.minecraftforge.common.BiomeDictionary.Type;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraftforge.common.BiomeDictionary.Type;
-
/**
* General management of the crop system.
*/
-public abstract class Crops {
- public static Crops instance;
+public abstract class Crops
+{
+ public static Crops instance;
- public static CropCard weed; // weed has special properties, thus it's exposed here
+ public static CropCard weed; // weed has special properties, thus it's exposed here
/**
* Adds a crop nutrient biome bonus.
@@ -39,7 +38,6 @@ public abstract class Crops {
*/
public abstract void addBiomehumidityBonus(Type type, int humidityBonus);
-
/**
* Gets the humidity bonus for a biome.
*
diff --git a/src/api/java/ic2/api/crops/ICropTile.java b/src/api/java/ic2/api/crops/ICropTile.java
index dadf691..5ad2f6f 100644
--- a/src/api/java/ic2/api/crops/ICropTile.java
+++ b/src/api/java/ic2/api/crops/ICropTile.java
@@ -9,7 +9,8 @@ import net.minecraft.world.World;
/**
* Interface implemented by the crop tile entity.
*/
-public interface ICropTile {
+public interface ICropTile
+{
/**
* Get the crop.
*
diff --git a/src/api/java/ic2/api/crops/package-info.java b/src/api/java/ic2/api/crops/package-info.java
index 04b8253..018003a 100644
--- a/src/api/java/ic2/api/crops/package-info.java
+++ b/src/api/java/ic2/api/crops/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.crops;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/energy/EnergyNet.java b/src/api/java/ic2/api/energy/EnergyNet.java
index 822bfc2..05a2b59 100644
--- a/src/api/java/ic2/api/energy/EnergyNet.java
+++ b/src/api/java/ic2/api/energy/EnergyNet.java
@@ -1,6 +1,5 @@
package ic2.api.energy;
-
/**
* Provides access to the energy network.
*
@@ -9,10 +8,10 @@ package ic2.api.energy;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public final class EnergyNet {
+public final class EnergyNet
+{
/**
* Instance of the global EnergyNet class.
*/
- public static IEnergyNet instance;
+ public static IEnergyNet instance;
}
-
diff --git a/src/api/java/ic2/api/energy/IEnergyNet.java b/src/api/java/ic2/api/energy/IEnergyNet.java
index 8f656e5..e3058ea 100644
--- a/src/api/java/ic2/api/energy/IEnergyNet.java
+++ b/src/api/java/ic2/api/energy/IEnergyNet.java
@@ -2,7 +2,6 @@ package ic2.api.energy;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-
import net.minecraftforge.common.util.ForgeDirection;
/**
@@ -10,7 +9,8 @@ import net.minecraftforge.common.util.ForgeDirection;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergyNet {
+public interface IEnergyNet
+{
/**
* Get the EnergyNet-registered tile entity at the specified position.
*
diff --git a/src/api/java/ic2/api/energy/NodeStats.java b/src/api/java/ic2/api/energy/NodeStats.java
index db33da7..e38b5e2 100644
--- a/src/api/java/ic2/api/energy/NodeStats.java
+++ b/src/api/java/ic2/api/energy/NodeStats.java
@@ -1,25 +1,30 @@
package ic2.api.energy;
-public class NodeStats {
- public NodeStats(double energyIn, double energyOut, double voltage) {
+public class NodeStats
+{
+ public NodeStats(double energyIn, double energyOut, double voltage)
+ {
this.energyIn = energyIn;
this.energyOut = energyOut;
this.voltage = voltage;
}
- public double getEnergyIn() {
+ public double getEnergyIn()
+ {
return energyIn;
}
- public double getEnergyOut() {
+ public double getEnergyOut()
+ {
return energyOut;
}
- public double getVoltage() {
+ public double getVoltage()
+ {
return voltage;
}
- protected double energyIn;
- protected double energyOut;
- protected double voltage;
+ protected double energyIn;
+ protected double energyOut;
+ protected double voltage;
}
diff --git a/src/api/java/ic2/api/energy/event/EnergyTileEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileEvent.java
index 86b8dc2..1fc04d3 100644
--- a/src/api/java/ic2/api/energy/event/EnergyTileEvent.java
+++ b/src/api/java/ic2/api/energy/event/EnergyTileEvent.java
@@ -1,25 +1,27 @@
package ic2.api.energy.event;
+import ic2.api.energy.tile.IEnergyTile;
import net.minecraft.tileentity.TileEntity;
-
import net.minecraftforge.event.world.WorldEvent;
-import ic2.api.energy.tile.IEnergyTile;
-
/**
* Base class for energy net events, don't use it directly.
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public class EnergyTileEvent extends WorldEvent {
- public final IEnergyTile energyTile;
+public class EnergyTileEvent extends WorldEvent
+{
+ public final IEnergyTile energyTile;
- public EnergyTileEvent(IEnergyTile energyTile1) {
+ public EnergyTileEvent(IEnergyTile energyTile1)
+ {
super(((TileEntity) energyTile1).getWorldObj());
- if (world == null) throw new NullPointerException("world is null");
+ if(world == null)
+ {
+ throw new NullPointerException("world is null");
+ }
- this.energyTile = energyTile1;
+ energyTile = energyTile1;
}
}
-
diff --git a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java
index bf019ae..62192f7 100644
--- a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java
+++ b/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java
@@ -18,9 +18,10 @@ 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 energyTile1) {
+public class EnergyTileLoadEvent extends EnergyTileEvent
+{
+ public EnergyTileLoadEvent(IEnergyTile energyTile1)
+ {
super(energyTile1);
}
}
-
diff --git a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java
index 2b22ae3..cf44877 100644
--- a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java
+++ b/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java
@@ -19,9 +19,10 @@ 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 energyTile1) {
+public class EnergyTileUnloadEvent extends EnergyTileEvent
+{
+ public EnergyTileUnloadEvent(IEnergyTile energyTile1)
+ {
super(energyTile1);
}
}
-
diff --git a/src/api/java/ic2/api/energy/event/package-info.java b/src/api/java/ic2/api/energy/event/package-info.java
index 40db6f8..de3bb9e 100644
--- a/src/api/java/ic2/api/energy/event/package-info.java
+++ b/src/api/java/ic2/api/energy/event/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.energy.event;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/energy/package-info.java b/src/api/java/ic2/api/energy/package-info.java
index 81d0bfe..0efa97f 100644
--- a/src/api/java/ic2/api/energy/package-info.java
+++ b/src/api/java/ic2/api/energy/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.energy;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/energy/prefab/BasicSink.java b/src/api/java/ic2/api/energy/prefab/BasicSink.java
index 48de061..4b93858 100644
--- a/src/api/java/ic2/api/energy/prefab/BasicSink.java
+++ b/src/api/java/ic2/api/energy/prefab/BasicSink.java
@@ -1,19 +1,16 @@
package ic2.api.energy.prefab;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-import cpw.mods.fml.common.FMLCommonHandler;
-
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
-
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySink;
import ic2.api.info.Info;
import ic2.api.item.ElectricItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.common.util.ForgeDirection;
+import cpw.mods.fml.common.FMLCommonHandler;
/**
* BasicSink is a simple adapter to provide an ic2 energy sink.
@@ -88,7 +85,8 @@ import ic2.api.item.ElectricItem;
* }
* @endcode
*/
-public class BasicSink extends TileEntity implements IEnergySink {
+public class BasicSink extends TileEntity implements IEnergySink
+{
// **********************************
// *** Methods for use by the mod ***
// **********************************
@@ -100,10 +98,11 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param capacity1 Maximum amount of eu to store.
* @param tier1 IC2 tier, 1 = LV, 2 = MV, ...
*/
- public BasicSink(TileEntity parent1, int capacity1, int tier1) {
- this.parent = parent1;
- this.capacity = capacity1;
- this.tier = tier1;
+ public BasicSink(TileEntity parent1, int capacity1, int tier1)
+ {
+ parent = parent1;
+ capacity = capacity1;
+ tier = tier1;
}
// in-world te forwards >>
@@ -113,18 +112,22 @@ public class BasicSink extends TileEntity implements IEnergySink {
* Either updateEntity or onLoaded have to be used.
*/
@Override
- public void updateEntity() {
- if (!addedToEnet) onLoaded();
+ public void updateEntity()
+ {
+ if(!addedToEnet)
+ {
+ onLoaded();
+ }
}
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
- public void onLoaded() {
- if (!addedToEnet &&
- !FMLCommonHandler.instance().getEffectiveSide().isClient() &&
- Info.isIc2Available()) {
+ public void onLoaded()
+ {
+ if(!addedToEnet && !FMLCommonHandler.instance().getEffectiveSide().isClient() && Info.isIc2Available())
+ {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
@@ -141,7 +144,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
* Both invalidate and onChunkUnload have to be used.
*/
@Override
- public void invalidate() {
+ public void invalidate()
+ {
super.invalidate();
onChunkUnload();
@@ -152,9 +156,10 @@ public class BasicSink extends TileEntity implements IEnergySink {
* Both invalidate and onChunkUnload have to be used.
*/
@Override
- public void onChunkUnload() {
- if (addedToEnet &&
- Info.isIc2Available()) {
+ public void onChunkUnload()
+ {
+ if(addedToEnet && Info.isIc2Available())
+ {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
@@ -167,10 +172,11 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param tag Compound tag as supplied by TileEntity.readFromNBT()
*/
@Override
- public void readFromNBT(NBTTagCompound tag) {
+ public void readFromNBT(NBTTagCompound tag)
+ {
super.readFromNBT(tag);
- NBTTagCompound data = tag.getCompoundTag("IC2BasicSink");
+ final NBTTagCompound data = tag.getCompoundTag("IC2BasicSink");
energyStored = data.getDouble("energy");
}
@@ -181,14 +187,18 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param tag Compound tag as supplied by TileEntity.writeToNBT()
*/
@Override
- public void writeToNBT(NBTTagCompound tag) {
- try {
+ public void writeToNBT(NBTTagCompound tag)
+ {
+ try
+ {
super.writeToNBT(tag);
- } catch (RuntimeException e) {
+ }
+ catch(final RuntimeException e)
+ {
// happens if this is a delegate, ignore
}
- NBTTagCompound data = new NBTTagCompound();
+ final NBTTagCompound data = new NBTTagCompound();
data.setDouble("energy", energyStored);
@@ -203,7 +213,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @return Capacity in EU.
*/
- public int getCapacity() {
+ public int getCapacity()
+ {
return capacity;
}
@@ -212,8 +223,9 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @param capacity1 Capacity in EU.
*/
- public void setCapacity(int capacity1) {
- this.capacity = capacity1;
+ public void setCapacity(int capacity1)
+ {
+ capacity = capacity1;
}
/**
@@ -221,7 +233,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @return IC2 Tier.
*/
- public int getTier() {
+ public int getTier()
+ {
return tier;
}
@@ -230,8 +243,9 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @param tier1 IC2 Tier.
*/
- public void setTier(int tier1) {
- this.tier = tier1;
+ public void setTier(int tier1)
+ {
+ tier = tier1;
}
/**
@@ -239,7 +253,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @return amount in EU, may be above capacity
*/
- public double getEnergyStored() {
+ public double getEnergyStored()
+ {
return energyStored;
}
@@ -251,7 +266,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
*
* @param amount
*/
- public void setEnergyStored(double amount) {
+ public void setEnergyStored(double amount)
+ {
energyStored = amount;
}
@@ -261,7 +277,8 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param amount in EU
* @return true if the amount is available
*/
- public boolean canUseEnergy(double amount) {
+ public boolean canUseEnergy(double amount)
+ {
return energyStored >= amount;
}
@@ -271,8 +288,10 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param amount amount to use
* @return true if the amount was available
*/
- public boolean useEnergy(double amount) {
- if (canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient()) {
+ public boolean useEnergy(double amount)
+ {
+ if(canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient())
+ {
energyStored -= amount;
return true;
@@ -287,13 +306,23 @@ public class BasicSink extends TileEntity implements IEnergySink {
* @param limit Transfer limit, values <= 0 will use the battery's limit
* @return true if energy was transferred
*/
- public boolean discharge(ItemStack stack, int limit) {
- if (stack == null || !Info.isIc2Available()) return false;
+ public boolean discharge(ItemStack stack, int limit)
+ {
+ if(stack == null || !Info.isIc2Available())
+ {
+ return false;
+ }
double amount = capacity - energyStored;
- if (amount <= 0) return false;
+ if(amount <= 0)
+ {
+ return false;
+ }
- if (limit > 0 && limit < amount) amount = limit;
+ if(limit > 0 && limit < amount)
+ {
+ amount = limit;
+ }
amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false);
@@ -307,27 +336,32 @@ public class BasicSink extends TileEntity implements IEnergySink {
// backwards compatibility (ignore these) >>
@Deprecated
- public void onUpdateEntity() {
+ public void onUpdateEntity()
+ {
updateEntity();
}
@Deprecated
- public void onInvalidate() {
+ public void onInvalidate()
+ {
invalidate();
}
@Deprecated
- public void onOnChunkUnload() {
+ public void onOnChunkUnload()
+ {
onChunkUnload();
}
@Deprecated
- public void onReadFromNbt(NBTTagCompound tag) {
+ public void onReadFromNbt(NBTTagCompound tag)
+ {
readFromNBT(tag);
}
@Deprecated
- public void onWriteToNbt(NBTTagCompound tag) {
+ public void onWriteToNbt(NBTTagCompound tag)
+ {
writeToNBT(tag);
}
@@ -340,34 +374,37 @@ public class BasicSink extends TileEntity implements IEnergySink {
// energy net interface >>
@Override
- public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) {
+ public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
+ {
return true;
}
@Override
- public double getDemandedEnergy() {
+ public double getDemandedEnergy()
+ {
return Math.max(0, capacity - energyStored);
}
@Override
- public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) {
+ public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
+ {
energyStored += amount;
return 0;
}
@Override
- public int getSinkTier() {
+ public int getSinkTier()
+ {
return tier;
}
// << energy net interface
+ public final TileEntity parent;
- public final TileEntity parent;
-
- protected int capacity;
- protected int tier;
- protected double energyStored;
- protected boolean addedToEnet;
+ protected int capacity;
+ protected int tier;
+ protected double energyStored;
+ protected boolean addedToEnet;
}
diff --git a/src/api/java/ic2/api/energy/prefab/BasicSource.java b/src/api/java/ic2/api/energy/prefab/BasicSource.java
index 011e8cd..5be7e1c 100644
--- a/src/api/java/ic2/api/energy/prefab/BasicSource.java
+++ b/src/api/java/ic2/api/energy/prefab/BasicSource.java
@@ -1,20 +1,17 @@
package ic2.api.energy.prefab;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-import cpw.mods.fml.common.FMLCommonHandler;
-
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
-
import ic2.api.energy.EnergyNet;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.info.Info;
import ic2.api.item.ElectricItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.common.util.ForgeDirection;
+import cpw.mods.fml.common.FMLCommonHandler;
/**
* BasicSource is a simple adapter to provide an ic2 energy source.
@@ -87,7 +84,8 @@ import ic2.api.item.ElectricItem;
* }
* @endcode
*/
-public class BasicSource extends TileEntity implements IEnergySource {
+public class BasicSource extends TileEntity implements IEnergySource
+{
// **********************************
// *** Methods for use by the mod ***
// **********************************
@@ -99,12 +97,13 @@ public class BasicSource extends TileEntity implements IEnergySource {
* @param capacity1 Maximum amount of eu to store.
* @param tier1 IC2 tier, 1 = LV, 2 = MV, ...
*/
- public BasicSource(TileEntity parent1, double capacity1, int tier1) {
- double power = EnergyNet.instance.getPowerFromTier(tier1);
+ public BasicSource(TileEntity parent1, double capacity1, int tier1)
+ {
+ final double power = EnergyNet.instance.getPowerFromTier(tier1);
- this.parent = parent1;
- this.capacity = capacity1 < power ? power : capacity1;
- this.tier = tier1;
+ parent = parent1;
+ capacity = capacity1 < power ? power : capacity1;
+ tier = tier1;
this.power = power;
}
@@ -115,18 +114,22 @@ public class BasicSource extends TileEntity implements IEnergySource {
* Either updateEntity or onLoaded have to be used.
*/
@Override
- public void updateEntity() {
- if (!addedToEnet) onLoaded();
+ public void updateEntity()
+ {
+ if(!addedToEnet)
+ {
+ onLoaded();
+ }
}
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
- public void onLoaded() {
- if (!addedToEnet &&
- !FMLCommonHandler.instance().getEffectiveSide().isClient() &&
- Info.isIc2Available()) {
+ public void onLoaded()
+ {
+ if(!addedToEnet && !FMLCommonHandler.instance().getEffectiveSide().isClient() && Info.isIc2Available())
+ {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
@@ -143,7 +146,8 @@ public class BasicSource extends TileEntity implements IEnergySource {
* Both invalidate and onChunkUnload have to be used.
*/
@Override
- public void invalidate() {
+ public void invalidate()
+ {
super.invalidate();
onChunkUnload();
@@ -154,9 +158,10 @@ public class BasicSource extends TileEntity implements IEnergySource {
* Both invalidate and onChunkUnload have to be used.
*/
@Override
- public void onChunkUnload() {
- if (addedToEnet &&
- Info.isIc2Available()) {
+ public void onChunkUnload()
+ {
+ if(addedToEnet && Info.isIc2Available())
+ {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
@@ -169,10 +174,11 @@ public class BasicSource extends TileEntity implements IEnergySource {
* @param tag Compound tag as supplied by TileEntity.readFromNBT()
*/
@Override
- public void readFromNBT(NBTTagCompound tag) {
+ public void readFromNBT(NBTTagCompound tag)
+ {
super.readFromNBT(tag);
- NBTTagCompound data = tag.getCompoundTag("IC2BasicSource");
+ final NBTTagCompound data = tag.getCompoundTag("IC2BasicSource");
energyStored = data.getDouble("energy");
}
@@ -183,14 +189,18 @@ public class BasicSource extends TileEntity implements IEnergySource {
* @param tag Compound tag as supplied by TileEntity.writeToNBT()
*/
@Override
- public void writeToNBT(NBTTagCompound tag) {
- try {
+ public void writeToNBT(NBTTagCompound tag)
+ {
+ try
+ {
super.writeToNBT(tag);
- } catch (RuntimeException e) {
+ }
+ catch(final RuntimeException e)
+ {
// happens if this is a delegate, ignore
}
- NBTTagCompound data = new NBTTagCompound();
+ final NBTTagCompound data = new NBTTagCompound();
data.setDouble("energy", energyStored);
@@ -205,7 +215,8 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @return Capacity in EU.
*/
- public double getCapacity() {
+ public double getCapacity()
+ {
return capacity;
}
@@ -214,10 +225,14 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @param capacity1 Capacity in EU.
*/
- public void setCapacity(double capacity1) {
- if (capacity1 < power) capacity1 = power;
+ public void setCapacity(double capacity1)
+ {
+ if(capacity1 < power)
+ {
+ capacity1 = power;
+ }
- this.capacity = capacity1;
+ capacity = capacity1;
}
/**
@@ -225,7 +240,8 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @return IC2 Tier.
*/
- public int getTier() {
+ public int getTier()
+ {
return tier;
}
@@ -234,22 +250,26 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @param tier1 IC2 Tier.
*/
- public void setTier(int tier1) {
- double power = EnergyNet.instance.getPowerFromTier(tier1);
+ public void setTier(int tier1)
+ {
+ final double power = EnergyNet.instance.getPowerFromTier(tier1);
- if (capacity < power) capacity = power;
+ if(capacity < power)
+ {
+ capacity = power;
+ }
- this.tier = tier1;
+ tier = tier1;
this.power = power;
}
-
/**
* Determine the energy stored in the source's output buffer.
*
* @return amount in EU
*/
- public double getEnergyStored() {
+ public double getEnergyStored()
+ {
return energyStored;
}
@@ -261,7 +281,8 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @param amount
*/
- public void setEnergyStored(double amount) {
+ public void setEnergyStored(double amount)
+ {
energyStored = amount;
}
@@ -270,7 +291,8 @@ public class BasicSource extends TileEntity implements IEnergySource {
*
* @return amount in EU
*/
- public double getFreeCapacity() {
+ public double getFreeCapacity()
+ {
return capacity - energyStored;
}
@@ -280,9 +302,16 @@ public class BasicSource extends TileEntity implements IEnergySource {
* @param amount maximum amount of energy to add
* @return amount added/used, NOT remaining
*/
- public double addEnergy(double amount) {
- if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return 0;
- if (amount > capacity - energyStored) amount = capacity - energyStored;
+ public double addEnergy(double amount)
+ {
+ if(FMLCommonHandler.instance().getEffectiveSide().isClient())
+ {
+ return 0;
+ }
+ if(amount > capacity - energyStored)
+ {
+ amount = capacity - energyStored;
+ }
energyStored += amount;
@@ -295,10 +324,14 @@ public class BasicSource extends TileEntity implements IEnergySource {
* @param stack ItemStack to charge (null is ignored)
* @return true if energy was transferred
*/
- public boolean charge(ItemStack stack) {
- if (stack == null || !Info.isIc2Available()) return false;
+ public boolean charge(ItemStack stack)
+ {
+ if(stack == null || !Info.isIc2Available())
+ {
+ return false;
+ }
- double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false);
+ final double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false);
energyStored -= amount;
@@ -310,27 +343,32 @@ public class BasicSource extends TileEntity implements IEnergySource {
// backwards compatibility (ignore these) >>
@Deprecated
- public void onUpdateEntity() {
+ public void onUpdateEntity()
+ {
updateEntity();
}
@Deprecated
- public void onInvalidate() {
+ public void onInvalidate()
+ {
invalidate();
}
@Deprecated
- public void onOnChunkUnload() {
+ public void onOnChunkUnload()
+ {
onChunkUnload();
}
@Deprecated
- public void onReadFromNbt(NBTTagCompound tag) {
+ public void onReadFromNbt(NBTTagCompound tag)
+ {
readFromNBT(tag);
}
@Deprecated
- public void onWriteToNbt(NBTTagCompound tag) {
+ public void onWriteToNbt(NBTTagCompound tag)
+ {
writeToNBT(tag);
}
@@ -343,33 +381,36 @@ public class BasicSource extends TileEntity implements IEnergySource {
// energy net interface >>
@Override
- public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) {
+ public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
+ {
return true;
}
@Override
- public double getOfferedEnergy() {
+ public double getOfferedEnergy()
+ {
return Math.min(energyStored, power);
}
@Override
- public void drawEnergy(double amount) {
+ public void drawEnergy(double amount)
+ {
energyStored -= amount;
}
@Override
- public int getSourceTier() {
+ public int getSourceTier()
+ {
return tier;
}
// << energy net interface
+ public final TileEntity parent;
- public final TileEntity parent;
-
- protected double capacity;
- protected int tier;
- protected double power;
- protected double energyStored;
- protected boolean addedToEnet;
+ protected double capacity;
+ protected int tier;
+ protected double power;
+ protected double energyStored;
+ protected boolean addedToEnet;
}
diff --git a/src/api/java/ic2/api/energy/prefab/package-info.java b/src/api/java/ic2/api/energy/prefab/package-info.java
index c38f7e0..a1ba4ee 100644
--- a/src/api/java/ic2/api/energy/prefab/package-info.java
+++ b/src/api/java/ic2/api/energy/prefab/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.energy.prefab;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java
index 1735ff5..55f3e97 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java
@@ -1,7 +1,6 @@
package ic2.api.energy.tile;
import net.minecraft.tileentity.TileEntity;
-
import net.minecraftforge.common.util.ForgeDirection;
/**
@@ -12,7 +11,8 @@ import net.minecraftforge.common.util.ForgeDirection;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergyAcceptor extends IEnergyTile {
+public interface IEnergyAcceptor extends IEnergyTile
+{
/**
* Determine if this acceptor can accept current from an adjacent emitter in a direction.
*
@@ -24,4 +24,3 @@ public interface IEnergyAcceptor extends IEnergyTile {
*/
boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction);
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IEnergyConductor.java b/src/api/java/ic2/api/energy/tile/IEnergyConductor.java
index 08dab88..e10430d 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergyConductor.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergyConductor.java
@@ -6,7 +6,8 @@ package ic2.api.energy.tile;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter {
+public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter
+{
/**
* Energy loss for the conductor in EU per block.
*
@@ -50,4 +51,3 @@ public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter {
*/
void removeConductor();
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java b/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java
index 013865e..d09e849 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java
@@ -1,7 +1,6 @@
package ic2.api.energy.tile;
import net.minecraft.tileentity.TileEntity;
-
import net.minecraftforge.common.util.ForgeDirection;
/**
@@ -12,7 +11,8 @@ import net.minecraftforge.common.util.ForgeDirection;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergyEmitter extends IEnergyTile {
+public interface IEnergyEmitter extends IEnergyTile
+{
/**
* Determine if this emitter can emit energy to an adjacent receiver.
*
@@ -25,4 +25,3 @@ public interface IEnergyEmitter extends IEnergyTile {
*/
boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction);
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IEnergySink.java b/src/api/java/ic2/api/energy/tile/IEnergySink.java
index 4ae8e79..1c834b7 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergySink.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergySink.java
@@ -7,7 +7,8 @@ import net.minecraftforge.common.util.ForgeDirection;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergySink extends IEnergyAcceptor {
+public interface IEnergySink extends IEnergyAcceptor
+{
/**
* Determine how much energy the sink accepts.
*
@@ -42,4 +43,3 @@ public interface IEnergySink extends IEnergyAcceptor {
*/
double injectEnergy(ForgeDirection directionFrom, double amount, double voltage);
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IEnergySource.java b/src/api/java/ic2/api/energy/tile/IEnergySource.java
index 44b952a..1d70eaa 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergySource.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergySource.java
@@ -5,7 +5,8 @@ package ic2.api.energy.tile;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergySource extends IEnergyEmitter {
+public interface IEnergySource extends IEnergyEmitter
+{
/**
* Energy output provided by the source this tick.
* This is typically Math.min(stored energy, max output/tick).
@@ -35,4 +36,3 @@ public interface IEnergySource extends IEnergyEmitter {
*/
int getSourceTier();
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IEnergyTile.java b/src/api/java/ic2/api/energy/tile/IEnergyTile.java
index 3938190..e619e29 100644
--- a/src/api/java/ic2/api/energy/tile/IEnergyTile.java
+++ b/src/api/java/ic2/api/energy/tile/IEnergyTile.java
@@ -9,7 +9,7 @@ package ic2.api.energy.tile;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IEnergyTile {
+public interface IEnergyTile
+{
//
}
-
diff --git a/src/api/java/ic2/api/energy/tile/IHeatSource.java b/src/api/java/ic2/api/energy/tile/IHeatSource.java
index 2e5db41..ceebc41 100644
--- a/src/api/java/ic2/api/energy/tile/IHeatSource.java
+++ b/src/api/java/ic2/api/energy/tile/IHeatSource.java
@@ -2,13 +2,14 @@ package ic2.api.energy.tile;
import net.minecraftforge.common.util.ForgeDirection;
-public interface IHeatSource {
-
+public interface IHeatSource
+{
+
/*
* Return max heat transmission peer Tick (only theoretical bandwidth not available amount)
*/
- int maxrequestHeatTick(ForgeDirection directionFrom);
-
+ int maxrequestHeatTick(ForgeDirection directionFrom);
+
/*
* @param requested amount of heat to transfer
*
@@ -18,6 +19,6 @@ public interface IHeatSource {
*
* requestHeat(100) : return 50 : so 50 units of heat remove from HeatSource
*/
-
+
int requestHeat(ForgeDirection directionFrom, int requestheat);
}
diff --git a/src/api/java/ic2/api/energy/tile/IKineticSource.java b/src/api/java/ic2/api/energy/tile/IKineticSource.java
index a651408..4271a67 100644
--- a/src/api/java/ic2/api/energy/tile/IKineticSource.java
+++ b/src/api/java/ic2/api/energy/tile/IKineticSource.java
@@ -2,11 +2,12 @@ package ic2.api.energy.tile;
import net.minecraftforge.common.util.ForgeDirection;
-public interface IKineticSource {
+public interface IKineticSource
+{
/*
* Return max kinetic energy transmission peer Tick (only theoretical bandwidth not available amount)
*/
- int maxrequestkineticenergyTick(ForgeDirection directionFrom);
+ int maxrequestkineticenergyTick(ForgeDirection directionFrom);
/*
* @param requested amount of kinetic energy to transfer
diff --git a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java b/src/api/java/ic2/api/energy/tile/IMetaDelegate.java
index f7319d0..c8ecc4c 100644
--- a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java
+++ b/src/api/java/ic2/api/energy/tile/IMetaDelegate.java
@@ -22,7 +22,8 @@ import net.minecraft.tileentity.TileEntity;
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
-public interface IMetaDelegate extends IEnergyTile {
+public interface IMetaDelegate extends IEnergyTile
+{
/**
* Get the sub-TileEntities belonging to this Meta TileEntity.
*
diff --git a/src/api/java/ic2/api/energy/tile/package-info.java b/src/api/java/ic2/api/energy/tile/package-info.java
index 3c60323..944249a 100644
--- a/src/api/java/ic2/api/energy/tile/package-info.java
+++ b/src/api/java/ic2/api/energy/tile/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.energy.tile;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/event/ExplosionEvent.java b/src/api/java/ic2/api/event/ExplosionEvent.java
index c2df419..f46cb71 100644
--- a/src/api/java/ic2/api/event/ExplosionEvent.java
+++ b/src/api/java/ic2/api/event/ExplosionEvent.java
@@ -3,18 +3,14 @@ package ic2.api.event;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
-
-import cpw.mods.fml.common.eventhandler.Cancelable;
-
import net.minecraftforge.event.world.WorldEvent;
+import cpw.mods.fml.common.eventhandler.Cancelable;
@Cancelable
-public class ExplosionEvent extends WorldEvent {
- public ExplosionEvent(World world, Entity entity,
- double x, double y, double z,
- double power,
- EntityLivingBase igniter,
- int radiationRange, double rangeLimit) {
+public class ExplosionEvent extends WorldEvent
+{
+ public ExplosionEvent(World world, Entity entity, double x, double y, double z, double power, EntityLivingBase igniter, int radiationRange, double rangeLimit)
+ {
super(world);
this.entity = entity;
@@ -30,15 +26,15 @@ public class ExplosionEvent extends WorldEvent {
/**
* Entity representing the explosive, may be null.
*/
- public final Entity entity;
- public double x;
- public double y;
- public double z;
- public double power;
+ public final Entity entity;
+ public double x;
+ public double y;
+ public double z;
+ public double power;
/**
* Entity causing the explosion, may be null.
*/
- public final EntityLivingBase igniter;
- public final int radiationRange;
- public final double rangeLimit;
+ public final EntityLivingBase igniter;
+ public final int radiationRange;
+ public final double rangeLimit;
}
diff --git a/src/api/java/ic2/api/event/LaserEvent.java b/src/api/java/ic2/api/event/LaserEvent.java
index 6d5ea28..226a818 100644
--- a/src/api/java/ic2/api/event/LaserEvent.java
+++ b/src/api/java/ic2/api/event/LaserEvent.java
@@ -4,38 +4,38 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-
-import cpw.mods.fml.common.eventhandler.Cancelable;
-
import net.minecraftforge.event.world.WorldEvent;
+import cpw.mods.fml.common.eventhandler.Cancelable;
/**
* A bunch of Events to handle the power of the Mining Laser.
*/
@Cancelable
-public class LaserEvent extends WorldEvent {
+public class LaserEvent extends WorldEvent
+{
// the Laser Entity
- public final Entity lasershot;
+ public final Entity lasershot;
// the following variables can be changed and the Laser will adjust to them
// the Player firing the Laser. If the Laser gets "reflected" the Player could change.
- public EntityLivingBase owner;
+ public EntityLivingBase owner;
// Range of the Laser Shot. Determine the amount of broken blocks, as well, as each broken block will subtract ~1F from range.
- public float range, power;
- public int blockBreaks;
+ public float range, power;
+ public int blockBreaks;
// Determines whether the laser will explode upon hitting something
- public boolean explosive, smelt;
+ public boolean explosive, smelt;
- public LaserEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1) {
+ 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;
+ lasershot = lasershot1;
+ owner = owner1;
+ range = range1;
+ power = power1;
+ blockBreaks = blockBreaks1;
+ explosive = explosive1;
+ smelt = smelt1;
}
/**
@@ -43,12 +43,14 @@ public class LaserEvent extends WorldEvent {
*
* The Item is the Laser Gun which the "Player" has shot
*/
- public static class LaserShootEvent extends LaserEvent {
- ItemStack laseritem;
+ public static class LaserShootEvent extends LaserEvent
+ {
+ ItemStack laseritem;
- public LaserShootEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, ItemStack laseritem1) {
+ 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;
+ laseritem = laseritem1;
}
}
@@ -57,15 +59,18 @@ public class LaserEvent extends WorldEvent {
*
* The Laser will no longer exist after this Event is posted as it either Explodes or despawns after the Event is fired.
*/
- public static class LaserExplodesEvent extends LaserEvent {
+ public static class LaserExplodesEvent extends LaserEvent
+ {
// explosion strength, even that can be changed!
- public float explosionpower, explosiondroprate, explosionentitydamage;
+ public float explosionpower, explosiondroprate,
+ 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) {
+ 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;
+ explosionpower = explosionpower1;
+ explosiondroprate = explosiondroprate1;
+ explosionentitydamage = explosionentitydamage1;
}
}
@@ -76,23 +81,25 @@ public class LaserEvent extends WorldEvent {
* Canceling this Event stops the Laser from attempting to break the Block, what is very useful for Glass.
* Use lasershot.setDead() to remove the Shot entirely.
*/
- public static class LaserHitsBlockEvent extends LaserEvent {
+ public static class LaserHitsBlockEvent extends LaserEvent
+ {
// targeted block, even that can be changed!
- public int x, y, z;
- public int side;
+ public int x, y, z;
+ public int side;
// removeBlock determines if the Block will be removed. dropBlock determines if the Block should drop something.
- public boolean removeBlock, dropBlock;
- public float dropChance;
+ public boolean removeBlock, dropBlock;
+ public float 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) {
+ 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;
+ x = x1;
+ y = y1;
+ z = z1;
+ side = side1;
+ removeBlock = removeBlock1;
+ dropBlock = dropBlock1;
+ dropChance = dropChance1;
}
}
@@ -102,13 +109,15 @@ public class LaserEvent extends WorldEvent {
* Canceling this Event ignores the Entity
* Use lasershot.setDead() to remove the Shot entirely.
*/
- public static class LaserHitsEntityEvent extends LaserEvent {
+ public static class LaserHitsEntityEvent extends LaserEvent
+ {
// the Entity which the Laser has shot at, even the target can be changed!
- public Entity hitentity;
+ public Entity hitentity;
- public LaserHitsEntityEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, Entity hitentity1) {
+ 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;
+ hitentity = hitentity1;
}
}
}
diff --git a/src/api/java/ic2/api/event/PaintEvent.java b/src/api/java/ic2/api/event/PaintEvent.java
index c6565c2..4f7e743 100644
--- a/src/api/java/ic2/api/event/PaintEvent.java
+++ b/src/api/java/ic2/api/event/PaintEvent.java
@@ -1,32 +1,32 @@
package ic2.api.event;
import net.minecraft.world.World;
-
-import cpw.mods.fml.common.eventhandler.Cancelable;
-
import net.minecraftforge.event.world.WorldEvent;
+import cpw.mods.fml.common.eventhandler.Cancelable;
@Cancelable
-public class PaintEvent extends WorldEvent {
+public class PaintEvent extends WorldEvent
+{
// target block
- public final int x;
- public final int y;
- public final int z;
- public final int side;
+ public final int x;
+ public final int y;
+ public final int z;
+ public final int side;
// color to paint the block
- public final int color;
+ public final int color;
// set to true to confirm the operation
- public boolean painted = false;
+ public boolean painted = false;
- public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) {
+ public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1)
+ {
super(world1);
- this.x = x1;
- this.y = y1;
- this.z = z1;
- this.side = side1;
- this.color = color1;
+ x = x1;
+ y = y1;
+ z = z1;
+ side = side1;
+ color = color1;
}
}
diff --git a/src/api/java/ic2/api/event/RetextureEvent.java b/src/api/java/ic2/api/event/RetextureEvent.java
index d530578..0dda540 100644
--- a/src/api/java/ic2/api/event/RetextureEvent.java
+++ b/src/api/java/ic2/api/event/RetextureEvent.java
@@ -2,36 +2,36 @@ package ic2.api.event;
import net.minecraft.block.Block;
import net.minecraft.world.World;
-
-import cpw.mods.fml.common.eventhandler.Cancelable;
-
import net.minecraftforge.event.world.WorldEvent;
+import cpw.mods.fml.common.eventhandler.Cancelable;
@Cancelable
-public class RetextureEvent extends WorldEvent {
+public class RetextureEvent extends WorldEvent
+{
// target block
- public final int x;
- public final int y;
- public final int z;
- public final int side;
+ public final int x;
+ public final int y;
+ public final int z;
+ public final int side;
// referenced block (to grab the texture from)
- public final Block referencedBlock;
- public final int referencedMeta;
- public final int referencedSide;
+ public final Block referencedBlock;
+ public final int referencedMeta;
+ public final int referencedSide;
// set to true to confirm the operation
- public boolean applied = false;
+ public boolean applied = false;
- public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1) {
+ public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1)
+ {
super(world1);
- this.x = x1;
- this.y = y1;
- this.z = z1;
- this.side = side1;
+ x = x1;
+ y = y1;
+ z = z1;
+ side = side1;
this.referencedBlock = referencedBlock;
- this.referencedMeta = referencedMeta1;
- this.referencedSide = referencedSide1;
+ referencedMeta = referencedMeta1;
+ referencedSide = referencedSide1;
}
}
diff --git a/src/api/java/ic2/api/event/package-info.java b/src/api/java/ic2/api/event/package-info.java
index d331b92..45c1338 100644
--- a/src/api/java/ic2/api/event/package-info.java
+++ b/src/api/java/ic2/api/event/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.event;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/info/IEnergyValueProvider.java b/src/api/java/ic2/api/info/IEnergyValueProvider.java
index 1e7b2cc..a66b35c 100644
--- a/src/api/java/ic2/api/info/IEnergyValueProvider.java
+++ b/src/api/java/ic2/api/info/IEnergyValueProvider.java
@@ -2,7 +2,8 @@ package ic2.api.info;
import net.minecraft.item.ItemStack;
-public interface IEnergyValueProvider {
+public interface IEnergyValueProvider
+{
/**
* Determine the energy value for a single item in the supplied stack.
* The value is used by most machines in the discharge slot.
diff --git a/src/api/java/ic2/api/info/IFuelValueProvider.java b/src/api/java/ic2/api/info/IFuelValueProvider.java
index 7c7fe0f..690a477 100644
--- a/src/api/java/ic2/api/info/IFuelValueProvider.java
+++ b/src/api/java/ic2/api/info/IFuelValueProvider.java
@@ -2,7 +2,8 @@ package ic2.api.info;
import net.minecraft.item.ItemStack;
-public interface IFuelValueProvider {
+public interface IFuelValueProvider
+{
/**
* Determine the fuel value for a single item in the supplied stack.
* The information currently applies to Generators and the Iron Furnace.
diff --git a/src/api/java/ic2/api/info/Info.java b/src/api/java/ic2/api/info/Info.java
index f8e30ad..42f8235 100644
--- a/src/api/java/ic2/api/info/Info.java
+++ b/src/api/java/ic2/api/info/Info.java
@@ -2,38 +2,44 @@ package ic2.api.info;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
-
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.LoaderState;
-public class Info {
- public static IEnergyValueProvider itemEnergy;
- public static IFuelValueProvider itemFuel;
- public static Object ic2ModInstance;
+public class Info
+{
+ public static IEnergyValueProvider itemEnergy;
+ public static IFuelValueProvider itemFuel;
+ public static Object ic2ModInstance;
/**
* Damage Sources used by IC2.
* Getting assigned in preload.
*/
- public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION;
+ public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION,
+ DMG_RADIATION;
/**
* Potions used by IC2.
* Getting assigned in preload.
*/
- public static Potion POTION_RADIATION;
+ public static Potion POTION_RADIATION;
- public static boolean isIc2Available() {
- if (ic2Available != null) return ic2Available;
+ public static boolean isIc2Available()
+ {
+ if(ic2Available != null)
+ {
+ return ic2Available;
+ }
- boolean loaded = Loader.isModLoaded("IC2");
+ final boolean loaded = Loader.isModLoaded("IC2");
- if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) {
+ if(Loader.instance().hasReachedState(LoaderState.CONSTRUCTING))
+ {
ic2Available = loaded;
}
return loaded;
}
- private static Boolean ic2Available = null;
-} \ No newline at end of file
+ private static Boolean ic2Available = null;
+}
diff --git a/src/api/java/ic2/api/info/package-info.java b/src/api/java/ic2/api/info/package-info.java
index 59936e5..126f59e 100644
--- a/src/api/java/ic2/api/info/package-info.java
+++ b/src/api/java/ic2/api/info/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.info;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/item/ElectricItem.java b/src/api/java/ic2/api/item/ElectricItem.java
index 19e5fc1..f4037a9 100644
--- a/src/api/java/ic2/api/item/ElectricItem.java
+++ b/src/api/java/ic2/api/item/ElectricItem.java
@@ -8,20 +8,21 @@ import net.minecraft.item.ItemStack;
/**
* Allows for charging, discharging and using electric items (IElectricItem).
*/
-public final class ElectricItem {
+public final class ElectricItem
+{
/**
* IElectricItemManager to use for interacting with IElectricItem ItemStacks.
*
* This manager will act as a gateway and delegate the tasks to the final implementation
* (rawManager or a custom one) as necessary.
*/
- public static IElectricItemManager manager;
+ public static IElectricItemManager manager;
/**
* Standard IElectricItemManager implementation, only call it directly from another
* IElectricItemManager. Use manager instead.
*/
- public static IElectricItemManager rawManager;
+ public static IElectricItemManager rawManager;
/**
* Register an electric item manager for items not implementing IElectricItem.
@@ -33,7 +34,8 @@ public final class ElectricItem {
*
* @param manager Manager to register.
*/
- public static void registerBackupManager(IBackupElectricItemManager manager) {
+ public static void registerBackupManager(IBackupElectricItemManager manager)
+ {
backupManagers.add(manager);
}
@@ -45,15 +47,18 @@ public final class ElectricItem {
* @param stack ItemStack to be handled.
* @return First suitable electric item manager.
*/
- public static IBackupElectricItemManager getBackupManager(ItemStack stack) {
- for (IBackupElectricItemManager manager : backupManagers) {
- if (manager.handles(stack)) return manager;
+ public static IBackupElectricItemManager getBackupManager(ItemStack stack)
+ {
+ for(final IBackupElectricItemManager manager : backupManagers)
+ {
+ if(manager.handles(stack))
+ {
+ return manager;
+ }
}
return null;
}
-
- private static final List<IBackupElectricItemManager> backupManagers = new ArrayList<IBackupElectricItemManager>();
+ private static final List<IBackupElectricItemManager> backupManagers = new ArrayList<IBackupElectricItemManager>();
}
-
diff --git a/src/api/java/ic2/api/item/IBackupElectricItemManager.java b/src/api/java/ic2/api/item/IBackupElectricItemManager.java
index 2ae254a..d53b885 100644
--- a/src/api/java/ic2/api/item/IBackupElectricItemManager.java
+++ b/src/api/java/ic2/api/item/IBackupElectricItemManager.java
@@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack;
*
* The manager implementing this has to be registered with ElectricItem.registerBackupManager().
*/
-public interface IBackupElectricItemManager extends IElectricItemManager {
+public interface IBackupElectricItemManager extends IElectricItemManager
+{
boolean handles(ItemStack stack);
}
diff --git a/src/api/java/ic2/api/item/IBlockCuttingBlade.java b/src/api/java/ic2/api/item/IBlockCuttingBlade.java
index 24a8f00..e153117 100644
--- a/src/api/java/ic2/api/item/IBlockCuttingBlade.java
+++ b/src/api/java/ic2/api/item/IBlockCuttingBlade.java
@@ -1,6 +1,6 @@
package ic2.api.item;
-
-public interface IBlockCuttingBlade {
+public interface IBlockCuttingBlade
+{
int gethardness();
}
diff --git a/src/api/java/ic2/api/item/IBoxable.java b/src/api/java/ic2/api/item/IBoxable.java
index bca2cc0..1d86e2c 100644
--- a/src/api/java/ic2/api/item/IBoxable.java
+++ b/src/api/java/ic2/api/item/IBoxable.java
@@ -2,8 +2,8 @@ package ic2.api.item;
import net.minecraft.item.ItemStack;
-
-public interface IBoxable {
+public interface IBoxable
+{
/**
* Determine whether an item can be stored in a toolbox or not.
*
diff --git a/src/api/java/ic2/api/item/IC2Items.java b/src/api/java/ic2/api/item/IC2Items.java
index 9b8c7df..78c680d 100644
--- a/src/api/java/ic2/api/item/IC2Items.java
+++ b/src/api/java/ic2/api/item/IC2Items.java
@@ -13,7 +13,8 @@ import net.minecraft.item.ItemStack;
* Blocks: Block.blocksList[x.itemID]
* Items: x.getItem()
*/
-public final class IC2Items {
+public final class IC2Items
+{
/**
* Get an ItemStack for a specific item name, example: Items.getItem("resin")
* See the list below for item names.
@@ -22,18 +23,26 @@ public final class IC2Items {
* @param name item name
* @return The item or null if the item does not exist or an error occurred
*/
- public static ItemStack getItem(String name) {
- try {
- if (Ic2Items == null) Ic2Items = Class.forName(getPackage() + ".core.Ic2Items");
+ public static ItemStack getItem(String name)
+ {
+ try
+ {
+ if(Ic2Items == null)
+ {
+ Ic2Items = Class.forName(getPackage() + ".core.Ic2Items");
+ }
- Object ret = Ic2Items.getField(name).get(null);
+ final Object ret = Ic2Items.getField(name).get(null);
- if (ret instanceof ItemStack) {
+ if(ret instanceof ItemStack)
+ {
return (ItemStack) ret;
}
return null;
- } catch (Exception e) {
- System.out.println("IC2 API: Call getItem failed for "+name);
+ }
+ catch(final Exception e)
+ {
+ System.out.println("IC2 API: Call getItem failed for " + name);
return null;
}
@@ -581,11 +590,13 @@ public final class IC2Items {
*
* @return IC2 package name, if unable to be determined defaults to ic2
*/
- private static String getPackage() {
- Package pkg = IC2Items.class.getPackage();
+ private static String getPackage()
+ {
+ final Package pkg = IC2Items.class.getPackage();
- if (pkg != null) {
- String packageName = pkg.getName();
+ if(pkg != null)
+ {
+ final String packageName = pkg.getName();
return packageName.substring(0, packageName.length() - ".api.item".length());
}
@@ -593,6 +604,5 @@ public final class IC2Items {
return "ic2";
}
- private static Class<?> Ic2Items;
+ private static Class<?> Ic2Items;
}
-
diff --git a/src/api/java/ic2/api/item/ICustomDamageItem.java b/src/api/java/ic2/api/item/ICustomDamageItem.java
index 4470fa0..56590d1 100644
--- a/src/api/java/ic2/api/item/ICustomDamageItem.java
+++ b/src/api/java/ic2/api/item/ICustomDamageItem.java
@@ -17,7 +17,8 @@ import net.minecraft.item.ItemStack;
*
* @author Player
*/
-public interface ICustomDamageItem {
+public interface ICustomDamageItem
+{
/**
* Retrieve the custom damage value for the supplied item stack.
*
diff --git a/src/api/java/ic2/api/item/IDebuggable.java b/src/api/java/ic2/api/item/IDebuggable.java
index 404c7eb..cd5159e 100644
--- a/src/api/java/ic2/api/item/IDebuggable.java
+++ b/src/api/java/ic2/api/item/IDebuggable.java
@@ -1,22 +1,22 @@
package ic2.api.item;
-
/**
* Allows a tile entity to output a debug message when the debugItem is used on it.
* Suggestions by Myrathi
*/
-public abstract interface IDebuggable {
- /**
- * Checks if the tile entity is in a state that can be debugged.
- *
- * @return True if the tile entity can be debugged
- */
- public abstract boolean isDebuggable();
+public abstract interface IDebuggable
+{
+ /**
+ * Checks if the tile entity is in a state that can be debugged.
+ *
+ * @return True if the tile entity can be debugged
+ */
+ public abstract boolean isDebuggable();
- /**
- * Gets the debug text for the tile entity.
- *
- * @return The text that the debugItem should show
- */
- public abstract String getDebugText();
+ /**
+ * Gets the debug text for the tile entity.
+ *
+ * @return The text that the debugItem should show
+ */
+ public abstract String getDebugText();
}
diff --git a/src/api/java/ic2/api/item/IElectricItem.java b/src/api/java/ic2/api/item/IElectricItem.java
index 4f546d5..14935a5 100644
--- a/src/api/java/ic2/api/item/IElectricItem.java
+++ b/src/api/java/ic2/api/item/IElectricItem.java
@@ -8,7 +8,8 @@ import net.minecraft.item.ItemStack;
*
* The item should have a maximum damage of 13.
*/
-public interface IElectricItem {
+public interface IElectricItem
+{
/**
* Determine if the item can be used in a machine or as an armor part to supply energy.
*
@@ -54,4 +55,3 @@ public interface IElectricItem {
*/
double getTransferLimit(ItemStack itemStack);
}
-
diff --git a/src/api/java/ic2/api/item/IElectricItemManager.java b/src/api/java/ic2/api/item/IElectricItemManager.java
index 5de43d7..315ce90 100644
--- a/src/api/java/ic2/api/item/IElectricItemManager.java
+++ b/src/api/java/ic2/api/item/IElectricItemManager.java
@@ -17,7 +17,8 @@ import net.minecraft.item.ItemStack;
* to minimize its dependency on its own constraints/structure and delegates most work back to the
* more atomic features in the gateway manager.
*/
-public interface IElectricItemManager {
+public interface IElectricItemManager
+{
/**
* Charge an item with a specified amount of energy.
*
diff --git a/src/api/java/ic2/api/item/IItemHudInfo.java b/src/api/java/ic2/api/item/IItemHudInfo.java
index da97318..77f0454 100644
--- a/src/api/java/ic2/api/item/IItemHudInfo.java
+++ b/src/api/java/ic2/api/item/IItemHudInfo.java
@@ -4,18 +4,19 @@ import java.util.List;
import net.minecraft.item.ItemStack;
-public interface IItemHudInfo {
+public interface IItemHudInfo
+{
/*
- Add Info to Nano- and Quantum-Suit Helm Hud
- for itemStack
+ Add Info to Nano- and Quantum-Suit Helm Hud
+ for itemStack
- @Override
- public List<String> getHudInfo(ItemStack itemStack) {
- List<String> info = new LinkedList<String>();
- info.add("i am a Cool Item");
- info.add("and have Cool info");
- return info;
- }
+ @Override
+ public List<String> getHudInfo(ItemStack itemStack) {
+ List<String> info = new LinkedList<String>();
+ info.add("i am a Cool Item");
+ info.add("and have Cool info");
+ return info;
+ }
*/
diff --git a/src/api/java/ic2/api/item/IKineticRotor.java b/src/api/java/ic2/api/item/IKineticRotor.java
index a61d162..a2547bc 100644
--- a/src/api/java/ic2/api/item/IKineticRotor.java
+++ b/src/api/java/ic2/api/item/IKineticRotor.java
@@ -3,7 +3,8 @@ package ic2.api.item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
-public interface IKineticRotor {
+public interface IKineticRotor
+{
int getDiameter(ItemStack stack);
ResourceLocation getRotorRenderTexture(ItemStack stack);
@@ -16,8 +17,8 @@ public interface IKineticRotor {
boolean isAcceptedType(ItemStack stack, GearboxType type);
- public static enum GearboxType {
- WATER,
- WIND,
+ public static enum GearboxType
+ {
+ WATER, WIND,
}
}
diff --git a/src/api/java/ic2/api/item/ILatheItem.java b/src/api/java/ic2/api/item/ILatheItem.java
index 45988c4..b98760e 100644
--- a/src/api/java/ic2/api/item/ILatheItem.java
+++ b/src/api/java/ic2/api/item/ILatheItem.java
@@ -2,14 +2,14 @@ package ic2.api.item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Interface used for Items that can be processed in the Turning Table
*/
-public interface ILatheItem {
+public interface ILatheItem
+{
/**
* Returns the radius of this Lathe Item
@@ -57,7 +57,8 @@ public interface ILatheItem {
/**
* Interface used for Tools that can be used to modify {@link ILatheItem}
*/
- public static interface ILatheTool extends ICustomDamageItem {
+ public static interface ILatheTool extends ICustomDamageItem
+ {
/**
* This is similar to the Tool HarvestLevel. Requires a different tool for a different hardness
diff --git a/src/api/java/ic2/api/item/IMetalArmor.java b/src/api/java/ic2/api/item/IMetalArmor.java
index 16ffd24..c067814 100644
--- a/src/api/java/ic2/api/item/IMetalArmor.java
+++ b/src/api/java/ic2/api/item/IMetalArmor.java
@@ -8,7 +8,8 @@ import net.minecraft.item.ItemStack;
*
* Currently used for determining which boots can be used to slide up a magnetic pole.
*/
-public interface IMetalArmor {
+public interface IMetalArmor
+{
/**
* Determine if the given armor piece is metal armor.
*
diff --git a/src/api/java/ic2/api/item/ISpecialElectricItem.java b/src/api/java/ic2/api/item/ISpecialElectricItem.java
index a7302f5..b73cf1d 100644
--- a/src/api/java/ic2/api/item/ISpecialElectricItem.java
+++ b/src/api/java/ic2/api/item/ISpecialElectricItem.java
@@ -2,7 +2,8 @@ package ic2.api.item;
import net.minecraft.item.ItemStack;
-public interface ISpecialElectricItem extends IElectricItem {
+public interface ISpecialElectricItem extends IElectricItem
+{
/**
* Supply a custom IElectricItemManager.
*
diff --git a/src/api/java/ic2/api/item/ITerraformingBP.java b/src/api/java/ic2/api/item/ITerraformingBP.java
index 59b46ba..cbb1eba 100644
--- a/src/api/java/ic2/api/item/ITerraformingBP.java
+++ b/src/api/java/ic2/api/item/ITerraformingBP.java
@@ -5,14 +5,15 @@ import net.minecraft.world.World;
/**
* Allows an item to act as a terraformer blueprint.
*/
-public interface ITerraformingBP {
+public interface ITerraformingBP
+{
/**
* Get the energy consumption per operation of the blueprint.
*
* @return Energy consumption in EU
*/
public abstract int getConsume();
-
+
/**
* Get the maximum range of the blueprint.
* Should be a divisor of 5.
@@ -20,7 +21,7 @@ public interface ITerraformingBP {
* @return Maximum range in blocks
*/
public abstract int getRange();
-
+
/**
* Perform the terraforming operation.
*
diff --git a/src/api/java/ic2/api/item/ItemWrapper.java b/src/api/java/ic2/api/item/ItemWrapper.java
index 58f8073..9a4e4d8 100644
--- a/src/api/java/ic2/api/item/ItemWrapper.java
+++ b/src/api/java/ic2/api/item/ItemWrapper.java
@@ -12,39 +12,58 @@ import com.google.common.collect.Multimap;
*
* @author Richard
*/
-public class ItemWrapper {
- private static final Multimap<Item, IBoxable> boxableItems = ArrayListMultimap.create();
- private static final Multimap<Item, IMetalArmor> metalArmorItems = ArrayListMultimap.create();
-
- public static void registerBoxable(Item item, IBoxable boxable) {
+public class ItemWrapper
+{
+ private static final Multimap<Item, IBoxable> boxableItems = ArrayListMultimap.create();
+ private static final Multimap<Item, IMetalArmor> metalArmorItems = ArrayListMultimap.create();
+
+ public static void registerBoxable(Item item, IBoxable boxable)
+ {
boxableItems.put(item, boxable);
}
-
- public static boolean canBeStoredInToolbox(ItemStack stack) {
- Item item = stack.getItem();
+
+ public static boolean canBeStoredInToolbox(ItemStack stack)
+ {
+ final Item item = stack.getItem();
// use customs first to allow for overriding behavior
- for (IBoxable boxable : boxableItems.get(item)) {
- if (boxable.canBeStoredInToolbox(stack)) return true;
+ for(final IBoxable boxable : boxableItems.get(item))
+ {
+ if(boxable.canBeStoredInToolbox(stack))
+ {
+ return true;
+ }
}
-
- if (item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack)) return true;
-
+
+ if(item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack))
+ {
+ return true;
+ }
+
return false;
}
-
- public static void registerMetalArmor(Item item, IMetalArmor armor) {
+
+ public static void registerMetalArmor(Item item, IMetalArmor armor)
+ {
metalArmorItems.put(item, armor);
}
-
- public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) {
- Item item = stack.getItem();
+
+ public static boolean isMetalArmor(ItemStack stack, EntityPlayer player)
+ {
+ final Item item = stack.getItem();
// use customs first to allow for overriding behavior
- for (IMetalArmor metalArmor : metalArmorItems.get(item)) {
- if (metalArmor.isMetalArmor(stack, player)) return true;
+ for(final IMetalArmor metalArmor : metalArmorItems.get(item))
+ {
+ if(metalArmor.isMetalArmor(stack, player))
+ {
+ return true;
+ }
}
-
- if (item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player)) return true;
-
+
+ if(item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player))
+ {
+ return true;
+ }
+
return false;
}
}
diff --git a/src/api/java/ic2/api/item/package-info.java b/src/api/java/ic2/api/item/package-info.java
index 44ecdce..f9d4d80 100644
--- a/src/api/java/ic2/api/item/package-info.java
+++ b/src/api/java/ic2/api/item/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.item;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java b/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java
index ed3ea38..000ce16 100644
--- a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java
+++ b/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java
@@ -5,7 +5,8 @@ import net.minecraft.entity.player.EntityPlayer;
/**
* Allows a tile entity to receive network events received from clients.
*/
-public interface INetworkClientTileEntityEventListener {
+public interface INetworkClientTileEntityEventListener
+{
/**
* Called when a network event is received.
*
@@ -14,4 +15,3 @@ public interface INetworkClientTileEntityEventListener {
*/
void onNetworkEvent(EntityPlayer player, int event);
}
-
diff --git a/src/api/java/ic2/api/network/INetworkDataProvider.java b/src/api/java/ic2/api/network/INetworkDataProvider.java
index c3f283e..86e58c7 100644
--- a/src/api/java/ic2/api/network/INetworkDataProvider.java
+++ b/src/api/java/ic2/api/network/INetworkDataProvider.java
@@ -7,7 +7,8 @@ import java.util.List;
*
* The fields don't update themselves, a field update must be sent every time a synchronized field changes.
*/
-public interface INetworkDataProvider {
+public interface INetworkDataProvider
+{
/**
* Get the list of synchronized fields.
*
@@ -15,4 +16,3 @@ public interface INetworkDataProvider {
*/
List<String> getNetworkedFields();
}
-
diff --git a/src/api/java/ic2/api/network/INetworkItemEventListener.java b/src/api/java/ic2/api/network/INetworkItemEventListener.java
index 5f3228c..6ddbb4b 100644
--- a/src/api/java/ic2/api/network/INetworkItemEventListener.java
+++ b/src/api/java/ic2/api/network/INetworkItemEventListener.java
@@ -6,7 +6,8 @@ import net.minecraft.item.ItemStack;
/**
* Allows an item to receive network events received from the server.
*/
-public interface INetworkItemEventListener {
+public interface INetworkItemEventListener
+{
/**
* Called when a network event is received.
*
@@ -16,4 +17,3 @@ public interface INetworkItemEventListener {
*/
void onNetworkEvent(ItemStack stack, EntityPlayer player, int event);
}
-
diff --git a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java b/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java
index fbb4753..e3cd5c3 100644
--- a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java
+++ b/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java
@@ -3,7 +3,8 @@ package ic2.api.network;
/**
* Allows a tile entity to receive network events received from the server.
*/
-public interface INetworkTileEntityEventListener {
+public interface INetworkTileEntityEventListener
+{
/**
* Called when a network event is received.
*
@@ -11,4 +12,3 @@ public interface INetworkTileEntityEventListener {
*/
void onNetworkEvent(int event);
}
-
diff --git a/src/api/java/ic2/api/network/INetworkUpdateListener.java b/src/api/java/ic2/api/network/INetworkUpdateListener.java
index 09414ae..a37fcaa 100644
--- a/src/api/java/ic2/api/network/INetworkUpdateListener.java
+++ b/src/api/java/ic2/api/network/INetworkUpdateListener.java
@@ -3,7 +3,8 @@ package ic2.api.network;
/**
* Allows a tile entity to receive field sync updates received from the server.
*/
-public interface INetworkUpdateListener {
+public interface INetworkUpdateListener
+{
/**
* Called when a field is synchronized.
*
@@ -11,4 +12,3 @@ public interface INetworkUpdateListener {
*/
void onNetworkUpdate(String field);
}
-
diff --git a/src/api/java/ic2/api/network/NetworkHelper.java b/src/api/java/ic2/api/network/NetworkHelper.java
index a91d03a..0615e35 100644
--- a/src/api/java/ic2/api/network/NetworkHelper.java
+++ b/src/api/java/ic2/api/network/NetworkHelper.java
@@ -18,10 +18,10 @@ import net.minecraft.tileentity.TileEntity;
* producing effects. Anything which is only visible inside the GUI should be synchronized through
* the Container class associated to the GUI in Container.updateProgressBar().
*/
-public final class NetworkHelper {
+public final class NetworkHelper
+{
// server -> client
-
/**
* Schedule a TileEntity's field to be updated to the clients in range.
*
@@ -53,13 +53,23 @@ public final class NetworkHelper {
* @param te TileEntity to update
* @param field Name of the field to update
*/
- public static void updateTileEntityField(TileEntity te, String field) {
- try {
- if (NetworkManager_updateTileEntityField == null) NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class);
- if (instance == null) instance = getInstance();
+ public static void updateTileEntityField(TileEntity te, String field)
+ {
+ try
+ {
+ if(NetworkManager_updateTileEntityField == null)
+ {
+ NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class);
+ }
+ if(instance == null)
+ {
+ instance = getInstance();
+ }
NetworkManager_updateTileEntityField.invoke(instance, te, field);
- } catch (Exception e) {
+ }
+ catch(final Exception e)
+ {
throw new RuntimeException(e);
}
}
@@ -75,13 +85,23 @@ public final class NetworkHelper {
* @param limitRange Limit the notification range to (currently) 20 blocks instead of the
* tracking distance if true
*/
- public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange) {
- try {
- if (NetworkManager_initiateTileEntityEvent == null) NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE);
- if (instance == null) instance = getInstance();
+ public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange)
+ {
+ try
+ {
+ if(NetworkManager_initiateTileEntityEvent == null)
+ {
+ NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE);
+ }
+ if(instance == null)
+ {
+ instance = getInstance();
+ }
NetworkManager_initiateTileEntityEvent.invoke(instance, te, event, limitRange);
- } catch (Exception e) {
+ }
+ catch(final Exception e)
+ {
throw new RuntimeException(e);
}
}
@@ -100,18 +120,27 @@ public final class NetworkHelper {
* @param limitRange Limit the notification range to (currently) 20 blocks instead of the
* tracking distance if true
*/
- public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange) {
- try {
- if (NetworkManager_initiateItemEvent == null) NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE);
- if (instance == null) instance = getInstance();
+ public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange)
+ {
+ try
+ {
+ if(NetworkManager_initiateItemEvent == null)
+ {
+ NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE);
+ }
+ if(instance == null)
+ {
+ instance = getInstance();
+ }
NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange);
- } catch (Exception e) {
+ }
+ catch(final Exception e)
+ {
throw new RuntimeException(e);
}
}
-
// client -> server
/**
@@ -122,13 +151,23 @@ public final class NetworkHelper {
* @param te TileEntity to notify, should implement INetworkClientTileEntityEventListener
* @param event Arbitrary integer to represent the event, choosing the values is up to you
*/
- public static void initiateClientTileEntityEvent(TileEntity te, int event) {
- try {
- if (NetworkManager_initiateClientTileEntityEvent == null) NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE);
- if (instance == null) instance = getInstance();
+ public static void initiateClientTileEntityEvent(TileEntity te, int event)
+ {
+ try
+ {
+ if(NetworkManager_initiateClientTileEntityEvent == null)
+ {
+ NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE);
+ }
+ if(instance == null)
+ {
+ instance = getInstance();
+ }
NetworkManager_initiateClientTileEntityEvent.invoke(instance, te, event);
- } catch (Exception e) {
+ }
+ catch(final Exception e)
+ {
throw new RuntimeException(e);
}
}
@@ -143,13 +182,23 @@ public final class NetworkHelper {
* @param itemStack ItemStack containing the item
* @param event Arbitrary integer to represent the event, choosing the values is up to you
*/
- public static void initiateClientItemEvent(ItemStack itemStack, int event) {
- try {
- if (NetworkManager_initiateClientItemEvent == null) NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE);
- if (instance == null) instance = getInstance();
+ public static void initiateClientItemEvent(ItemStack itemStack, int event)
+ {
+ try
+ {
+ if(NetworkManager_initiateClientItemEvent == null)
+ {
+ NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE);
+ }
+ if(instance == null)
+ {
+ instance = getInstance();
+ }
NetworkManager_initiateClientItemEvent.invoke(instance, itemStack, event);
- } catch (Exception e) {
+ }
+ catch(final Exception e)
+ {
throw new RuntimeException(e);
}
}
@@ -159,11 +208,13 @@ public final class NetworkHelper {
*
* @return IC2 package name, if unable to be determined defaults to ic2
*/
- private static String getPackage() {
- Package pkg = NetworkHelper.class.getPackage();
+ private static String getPackage()
+ {
+ final Package pkg = NetworkHelper.class.getPackage();
- if (pkg != null) {
- String packageName = pkg.getName();
+ if(pkg != null)
+ {
+ final String packageName = pkg.getName();
return packageName.substring(0, packageName.length() - ".api.network".length());
}
@@ -176,19 +227,22 @@ public final class NetworkHelper {
*
* @return NetworkManager instance
*/
- private static Object getInstance() {
- try {
+ private static Object getInstance()
+ {
+ try
+ {
return Class.forName(getPackage() + ".core.util.SideGateway").getMethod("get").invoke(Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null));
- } catch (Throwable e) {
+ }
+ catch(final Throwable e)
+ {
throw new RuntimeException(e);
}
}
- private static Object instance;
- private static Method NetworkManager_updateTileEntityField;
- private static Method NetworkManager_initiateTileEntityEvent;
- private static Method NetworkManager_initiateItemEvent;
- private static Method NetworkManager_initiateClientTileEntityEvent;
- private static Method NetworkManager_initiateClientItemEvent;
+ private static Object instance;
+ private static Method NetworkManager_updateTileEntityField;
+ private static Method NetworkManager_initiateTileEntityEvent;
+ private static Method NetworkManager_initiateItemEvent;
+ private static Method NetworkManager_initiateClientTileEntityEvent;
+ private static Method NetworkManager_initiateClientItemEvent;
}
-
diff --git a/src/api/java/ic2/api/network/package-info.java b/src/api/java/ic2/api/network/package-info.java
index 25ea29e..1b69df8 100644
--- a/src/api/java/ic2/api/network/package-info.java
+++ b/src/api/java/ic2/api/network/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.network;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/package-info.java b/src/api/java/ic2/api/package-info.java
index e6f1522..00ff182 100644
--- a/src/api/java/ic2/api/package-info.java
+++ b/src/api/java/ic2/api/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/reactor/IReactor.java b/src/api/java/ic2/api/reactor/IReactor.java
index 55191cc..5009b32 100644
--- a/src/api/java/ic2/api/reactor/IReactor.java
+++ b/src/api/java/ic2/api/reactor/IReactor.java
@@ -7,7 +7,8 @@ import net.minecraft.world.World;
/**
* Interface implemented by the tile entity of nuclear reactors.
*/
-public interface IReactor {
+public interface IReactor
+{
/**
* Get the reactor's position in the world.
*
@@ -67,7 +68,6 @@ public interface IReactor {
* no more magic heat disappear
*/
-
public void addEmitHeat(int heat);
/**
diff --git a/src/api/java/ic2/api/reactor/IReactorChamber.java b/src/api/java/ic2/api/reactor/IReactorChamber.java
index 4611a6a..66463b3 100644
--- a/src/api/java/ic2/api/reactor/IReactorChamber.java
+++ b/src/api/java/ic2/api/reactor/IReactorChamber.java
@@ -3,7 +3,8 @@ package ic2.api.reactor;
/**
* Interface implemented by the reactor chamber tile entity.
*/
-public interface IReactorChamber {
+public interface IReactorChamber
+{
/**
* Get the chamber's reactor.
*
@@ -15,6 +16,6 @@ public interface IReactorChamber {
* Set Redstone Signal without direct contact
*
*/
-
+
public void setRedstoneSignal(boolean redstone);
}
diff --git a/src/api/java/ic2/api/reactor/IReactorComponent.java b/src/api/java/ic2/api/reactor/IReactorComponent.java
index 84e011c..4b4d8ad 100644
--- a/src/api/java/ic2/api/reactor/IReactorComponent.java
+++ b/src/api/java/ic2/api/reactor/IReactorComponent.java
@@ -10,7 +10,8 @@ import net.minecraft.item.ItemStack;
* All IC2 ReactorComponents implement and use this Interface
*
*/
-public interface IReactorComponent {
+public interface IReactorComponent
+{
/**
* Called by reactor upon iterating through it's inventory (every cycle).
* Perform all necessary calculation/interaction here
diff --git a/src/api/java/ic2/api/reactor/package-info.java b/src/api/java/ic2/api/reactor/package-info.java
index 5194aee..7b70911 100644
--- a/src/api/java/ic2/api/reactor/package-info.java
+++ b/src/api/java/ic2/api/reactor/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.reactor;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java
index 415b3c3..6f64585 100644
--- a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java
+++ b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java
@@ -4,7 +4,8 @@ import java.util.Map;
import net.minecraft.item.ItemStack;
-public interface ICannerBottleRecipeManager {
+public interface ICannerBottleRecipeManager
+{
/**
* Adds a recipe to the machine.
*
@@ -34,18 +35,20 @@ public interface ICannerBottleRecipeManager {
*/
public Map<Input, RecipeOutput> getRecipes();
-
- public static class Input {
- public Input(IRecipeInput container1, IRecipeInput fill1) {
- this.container = container1;
- this.fill = fill1;
+ public static class Input
+ {
+ public Input(IRecipeInput container1, IRecipeInput fill1)
+ {
+ container = container1;
+ fill = fill1;
}
- public boolean matches(ItemStack container1, ItemStack fill1) {
- return this.container.matches(container1) && this.fill.matches(fill1);
+ public boolean matches(ItemStack container1, ItemStack fill1)
+ {
+ return container.matches(container1) && fill.matches(fill1);
}
- public final IRecipeInput container;
- public final IRecipeInput fill;
+ public final IRecipeInput container;
+ public final IRecipeInput fill;
}
}
diff --git a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java
index 5eba1b6..c4141ab 100644
--- a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java
+++ b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java
@@ -3,10 +3,10 @@ package ic2.api.recipe;
import java.util.Map;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.fluids.FluidStack;
-public interface ICannerEnrichRecipeManager {
+public interface ICannerEnrichRecipeManager
+{
/**
* Adds a recipe to the machine.
*
@@ -36,19 +36,20 @@ public interface ICannerEnrichRecipeManager {
*/
public Map<Input, FluidStack> getRecipes();
-
- public static class Input {
- public Input(FluidStack fluid1, IRecipeInput additive1) {
- this.fluid = fluid1;
- this.additive = additive1;
+ public static class Input
+ {
+ public Input(FluidStack fluid1, IRecipeInput additive1)
+ {
+ fluid = fluid1;
+ additive = additive1;
}
- public boolean matches(FluidStack fluid1, ItemStack additive1) {
- return (this.fluid == null || this.fluid.isFluidEqual(fluid1)) &&
- this.additive.matches(additive1);
+ public boolean matches(FluidStack fluid1, ItemStack additive1)
+ {
+ return (fluid == null || fluid.isFluidEqual(fluid1)) && additive.matches(additive1);
}
- public final FluidStack fluid;
- public final IRecipeInput additive;
+ public final FluidStack fluid;
+ public final IRecipeInput additive;
}
}
diff --git a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java b/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java
index 756eaf6..12583a9 100644
--- a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java
+++ b/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java
@@ -7,7 +7,8 @@ import net.minecraft.item.ItemStack;
*
* @author Richard
*/
-public interface ICraftingRecipeManager {
+public interface ICraftingRecipeManager
+{
/**
* Adds a shaped crafting recipe.
*
@@ -15,7 +16,7 @@ public interface ICraftingRecipeManager {
* @param input Recipe input format
*/
public void addRecipe(ItemStack output, Object... input);
-
+
/**
* Adds a shapeless crafting recipe.
*
diff --git a/src/api/java/ic2/api/recipe/IFluidHeatManager.java b/src/api/java/ic2/api/recipe/IFluidHeatManager.java
index 7ddecdc..ee8be18 100644
--- a/src/api/java/ic2/api/recipe/IFluidHeatManager.java
+++ b/src/api/java/ic2/api/recipe/IFluidHeatManager.java
@@ -4,8 +4,8 @@ import java.util.Map;
import net.minecraftforge.fluids.Fluid;
-
-public interface IFluidHeatManager extends ILiquidAcceptManager {
+public interface IFluidHeatManager extends ILiquidAcceptManager
+{
/**
* Add a new fluid to the Fluid Heat Generator.
*
@@ -19,14 +19,15 @@ public interface IFluidHeatManager extends ILiquidAcceptManager {
Map<String, BurnProperty> getBurnProperties();
-
- public static class BurnProperty {
- public BurnProperty(int amount1, int heat1) {
- this.amount = amount1;
- this.heat = heat1;
+ public static class BurnProperty
+ {
+ public BurnProperty(int amount1, int heat1)
+ {
+ amount = amount1;
+ heat = heat1;
}
- public final int amount;
- public final int heat;
+ public final int amount;
+ public final int heat;
}
}
diff --git a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java b/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java
index 4f377b9..6483c34 100644
--- a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java
+++ b/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java
@@ -4,7 +4,9 @@ import java.util.Set;
import net.minecraftforge.fluids.Fluid;
-public interface ILiquidAcceptManager {
+public interface ILiquidAcceptManager
+{
boolean acceptsFluid(Fluid fluid);
+
Set<Fluid> getAcceptedFluids();
}
diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java
index 68decbb..1fc079c 100644
--- a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java
+++ b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java
@@ -4,7 +4,8 @@ import java.util.Map;
import net.minecraftforge.fluids.Fluid;
-public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager {
+public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager
+{
/**
* Add a new fluid heatup/cooldown recipe.
@@ -26,14 +27,16 @@ public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager {
*/
ILiquidAcceptManager getSingleDirectionLiquidManager();
- public static class HeatExchangeProperty {
- public HeatExchangeProperty(Fluid outputFluid, int huPerMB) {
+ public static class HeatExchangeProperty
+ {
+ public HeatExchangeProperty(Fluid outputFluid, int huPerMB)
+ {
this.outputFluid = outputFluid;
this.huPerMB = huPerMB;
}
- public final Fluid outputFluid;
- public final int huPerMB;
+ public final Fluid outputFluid;
+ public final int huPerMB;
}
}
diff --git a/src/api/java/ic2/api/recipe/IListRecipeManager.java b/src/api/java/ic2/api/recipe/IListRecipeManager.java
index adc2291..d488335 100644
--- a/src/api/java/ic2/api/recipe/IListRecipeManager.java
+++ b/src/api/java/ic2/api/recipe/IListRecipeManager.java
@@ -9,7 +9,8 @@ import net.minecraft.item.ItemStack;
*
* @author Richard
*/
-public interface IListRecipeManager extends Iterable<IRecipeInput> {
+public interface IListRecipeManager extends Iterable<IRecipeInput>
+{
/**
* Adds a stack to the list.
*
diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java b/src/api/java/ic2/api/recipe/IMachineRecipeManager.java
index d2d4382..ff391f8 100644
--- a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java
+++ b/src/api/java/ic2/api/recipe/IMachineRecipeManager.java
@@ -10,7 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
*
* @author RichardG, Player
*/
-public interface IMachineRecipeManager { // TODO: merge with IMachineRecipeManagerExt
+public interface IMachineRecipeManager
+{ // TODO: merge with IMachineRecipeManagerExt
/**
* Adds a recipe to the machine.
*
diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java b/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java
index 9c68706..6dc4715 100644
--- a/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java
+++ b/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java
@@ -3,7 +3,8 @@ package ic2.api.recipe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-public interface IMachineRecipeManagerExt extends IMachineRecipeManager {
+public interface IMachineRecipeManagerExt extends IMachineRecipeManager
+{
/**
* Adds a recipe to the machine.
*
diff --git a/src/api/java/ic2/api/recipe/IPatternStorage.java b/src/api/java/ic2/api/recipe/IPatternStorage.java
index c9dbd8d..2b646f3 100644
--- a/src/api/java/ic2/api/recipe/IPatternStorage.java
+++ b/src/api/java/ic2/api/recipe/IPatternStorage.java
@@ -4,7 +4,8 @@ import java.util.List;
import net.minecraft.item.ItemStack;
-public interface IPatternStorage {
+public interface IPatternStorage
+{
boolean addPattern(ItemStack itemstack);
List<ItemStack> getPatterns();
diff --git a/src/api/java/ic2/api/recipe/IRecipeInput.java b/src/api/java/ic2/api/recipe/IRecipeInput.java
index 0c842d6..99249bb 100644
--- a/src/api/java/ic2/api/recipe/IRecipeInput.java
+++ b/src/api/java/ic2/api/recipe/IRecipeInput.java
@@ -4,7 +4,8 @@ import java.util.List;
import net.minecraft.item.ItemStack;
-public interface IRecipeInput {
+public interface IRecipeInput
+{
/**
* Check if subject matches this recipe input, ignoring the amount.
*
diff --git a/src/api/java/ic2/api/recipe/IScrapboxManager.java b/src/api/java/ic2/api/recipe/IScrapboxManager.java
index 41b694d..4828591 100644
--- a/src/api/java/ic2/api/recipe/IScrapboxManager.java
+++ b/src/api/java/ic2/api/recipe/IScrapboxManager.java
@@ -4,7 +4,8 @@ import java.util.Map;
import net.minecraft.item.ItemStack;
-public interface IScrapboxManager {
+public interface IScrapboxManager
+{
void addDrop(ItemStack drop, float rawChance);
ItemStack getDrop(ItemStack input, boolean adjustInput);
diff --git a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java b/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java
index 87c3427..1503a18 100644
--- a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java
+++ b/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java
@@ -4,8 +4,8 @@ import java.util.Map;
import net.minecraftforge.fluids.Fluid;
-
-public interface ISemiFluidFuelManager extends ILiquidAcceptManager {
+public interface ISemiFluidFuelManager extends ILiquidAcceptManager
+{
/**
* Add a new fluid to the semi fluid generator.
*
@@ -19,14 +19,15 @@ public interface ISemiFluidFuelManager extends ILiquidAcceptManager {
Map<String, BurnProperty> getBurnProperties();
-
- public static class BurnProperty {
- public BurnProperty(int amount1, double power1) {
- this.amount = amount1;
- this.power = power1;
+ public static class BurnProperty
+ {
+ public BurnProperty(int amount1, double power1)
+ {
+ amount = amount1;
+ power = power1;
}
- public final int amount;
- public final double power;
+ public final int amount;
+ public final double power;
}
}
diff --git a/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java b/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java
index 103d293..7f9ba8c 100644
--- a/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java
+++ b/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java
@@ -4,51 +4,64 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
import net.minecraftforge.fluids.FluidStack;
-public class RecipeInputFluidContainer implements IRecipeInput {
- public RecipeInputFluidContainer(Fluid fluid) {
+public class RecipeInputFluidContainer implements IRecipeInput
+{
+ public RecipeInputFluidContainer(Fluid fluid)
+ {
this(fluid, FluidContainerRegistry.BUCKET_VOLUME);
}
- public RecipeInputFluidContainer(Fluid fluid, int amount) {
+ public RecipeInputFluidContainer(Fluid fluid, int amount)
+ {
this.fluid = fluid;
this.amount = amount;
}
@Override
- public boolean matches(ItemStack subject) {
- FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject);
- if (fs == null) return false;
+ public boolean matches(ItemStack subject)
+ {
+ final FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject);
+ if(fs == null)
+ {
+ return false;
+ }
return fs.getFluid() == fluid;
}
@Override
- public int getAmount() {
+ public int getAmount()
+ {
return amount;
}
@Override
- public List<ItemStack> getInputs() {
- List<ItemStack> ret = new ArrayList<ItemStack>();
+ public List<ItemStack> getInputs()
+ {
+ final List<ItemStack> ret = new ArrayList<ItemStack>();
- for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer);
+ for(final FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData())
+ {
+ if(data.fluid.getFluid() == fluid)
+ {
+ ret.add(data.filledContainer);
+ }
}
return ret;
}
@Override
- public String toString() {
- return "RInputFluidContainer<"+amount+"x"+fluid.getName()+">";
+ public String toString()
+ {
+ return "RInputFluidContainer<" + amount + "x" + fluid.getName() + ">";
}
- public final Fluid fluid;
- public final int amount;
+ public final Fluid fluid;
+ public final int amount;
}
diff --git a/src/api/java/ic2/api/recipe/RecipeInputItemStack.java b/src/api/java/ic2/api/recipe/RecipeInputItemStack.java
index 84f86ea..41a6012 100644
--- a/src/api/java/ic2/api/recipe/RecipeInputItemStack.java
+++ b/src/api/java/ic2/api/recipe/RecipeInputItemStack.java
@@ -4,44 +4,52 @@ import java.util.Arrays;
import java.util.List;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.oredict.OreDictionary;
-public class RecipeInputItemStack implements IRecipeInput {
- public RecipeInputItemStack(ItemStack aInput) {
+public class RecipeInputItemStack implements IRecipeInput
+{
+ public RecipeInputItemStack(ItemStack aInput)
+ {
this(aInput, aInput.stackSize);
}
- public RecipeInputItemStack(ItemStack aInput, int aAmount) {
- if (aInput.getItem() == null) throw new IllegalArgumentException("Invalid item stack specfied");
+ public RecipeInputItemStack(ItemStack aInput, int aAmount)
+ {
+ if(aInput.getItem() == null)
+ {
+ throw new IllegalArgumentException("Invalid item stack specfied");
+ }
input = aInput.copy(); // Never forget to copy.
amount = aAmount;
}
@Override
- public boolean matches(ItemStack subject) {
- return subject.getItem() == input.getItem() &&
- (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE);
+ public boolean matches(ItemStack subject)
+ {
+ return subject.getItem() == input.getItem() && (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE);
}
@Override
- public int getAmount() {
+ public int getAmount()
+ {
return amount;
}
@Override
- public List<ItemStack> getInputs() {
+ public List<ItemStack> getInputs()
+ {
return Arrays.asList(input);
}
@Override
- public String toString() {
- ItemStack stack = input.copy();
+ public String toString()
+ {
+ final ItemStack stack = input.copy();
input.stackSize = amount;
- return "RInputItemStack<"+stack+">";
+ return "RInputItemStack<" + stack + ">";
}
- public final ItemStack input;
- public final int amount;
+ public final ItemStack input;
+ public final int amount;
}
diff --git a/src/api/java/ic2/api/recipe/RecipeInputOreDict.java b/src/api/java/ic2/api/recipe/RecipeInputOreDict.java
index e6e4695..173e6b3 100644
--- a/src/api/java/ic2/api/recipe/RecipeInputOreDict.java
+++ b/src/api/java/ic2/api/recipe/RecipeInputOreDict.java
@@ -6,39 +6,47 @@ import java.util.List;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-
import net.minecraftforge.oredict.OreDictionary;
-public class RecipeInputOreDict implements IRecipeInput {
- public RecipeInputOreDict(String input1) {
+public class RecipeInputOreDict implements IRecipeInput
+{
+ public RecipeInputOreDict(String input1)
+ {
this(input1, 1);
}
- public RecipeInputOreDict(String input1, int amount1) {
+ public RecipeInputOreDict(String input1, int amount1)
+ {
this(input1, amount1, null);
}
- public RecipeInputOreDict(String input1, int amount1, Integer meta) {
- this.input = input1;
- this.amount = amount1;
+ public RecipeInputOreDict(String input1, int amount1, Integer meta)
+ {
+ input = input1;
+ amount = amount1;
this.meta = meta;
}
@Override
- public boolean matches(ItemStack subject) {
- List<ItemStack> inputs = getOres();
- boolean useOreStackMeta = (meta == null);
- Item subjectItem = subject.getItem();
- int subjectMeta = subject.getItemDamage();
-
- for (ItemStack oreStack : inputs) {
- Item oreItem = oreStack.getItem();
- if (oreItem == null) continue; // ignore invalid
+ public boolean matches(ItemStack subject)
+ {
+ final List<ItemStack> inputs = getOres();
+ final boolean useOreStackMeta = (meta == null);
+ final Item subjectItem = subject.getItem();
+ final int subjectMeta = subject.getItemDamage();
+
+ for(final ItemStack oreStack : inputs)
+ {
+ final Item oreItem = oreStack.getItem();
+ if(oreItem == null)
+ {
+ continue; // ignore invalid
+ }
- int metaRequired = useOreStackMeta ? oreStack.getItemDamage() : meta;
+ final int metaRequired = useOreStackMeta ? oreStack.getItemDamage() : meta;
- if (subjectItem == oreItem &&
- (subjectMeta == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
+ if(subjectItem == oreItem && (subjectMeta == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE))
+ {
return true;
}
}
@@ -47,58 +55,80 @@ public class RecipeInputOreDict implements IRecipeInput {
}
@Override
- public int getAmount() {
+ public int getAmount()
+ {
return amount;
}
@Override
- public List<ItemStack> getInputs() {
- List<ItemStack> ores = getOres();
+ public List<ItemStack> getInputs()
+ {
+ final List<ItemStack> ores = getOres();
// check if we have to filter the list first
boolean hasInvalidEntries = false;
- for (ItemStack stack : ores) {
- if (stack.getItem() == null) {
+ for(final ItemStack stack : ores)
+ {
+ if(stack.getItem() == null)
+ {
hasInvalidEntries = true;
break;
}
}
- if (!hasInvalidEntries) return ores;
+ if(!hasInvalidEntries)
+ {
+ return ores;
+ }
- List<ItemStack> ret = new ArrayList<ItemStack>(ores.size());
+ final List<ItemStack> ret = new ArrayList<ItemStack>(ores.size());
- for (ItemStack stack : ores) {
- if (stack.getItem() != null) ret.add(stack); // ignore invalid
+ for(final ItemStack stack : ores)
+ {
+ if(stack.getItem() != null)
+ {
+ ret.add(stack); // ignore invalid
+ }
}
return Collections.unmodifiableList(ret);
}
@Override
- public String toString() {
- if (meta == null) {
- return "RInputOreDict<"+amount+"x"+input+">";
- } else {
- return "RInputOreDict<"+amount+"x"+input+"@"+meta+">";
+ public String toString()
+ {
+ if(meta == null)
+ {
+ return "RInputOreDict<" + amount + "x" + input + ">";
+ }
+ else
+ {
+ return "RInputOreDict<" + amount + "x" + input + "@" + meta + ">";
}
}
- private List<ItemStack> getOres() {
- if (ores != null) return ores;
+ private List<ItemStack> getOres()
+ {
+ if(ores != null)
+ {
+ return ores;
+ }
// cache the ore list by making use of the fact that forge always uses the same list,
// unless it's EMPTY_LIST, which should never happen.
- List<ItemStack> ret = OreDictionary.getOres(input);
+ final List<ItemStack> ret = OreDictionary.getOres(input);
- if (ret != OreDictionary.EMPTY_LIST) ores = ret;
+ if(ret != OreDictionary.EMPTY_LIST)
+ {
+ ores = ret;
+ }
return ret;
}
- public final String input;
- public final int amount;
- public final Integer meta;
- private List<ItemStack> ores;
+ public final String input;
+ public final int amount;
+ public final Integer meta;
+ private List<ItemStack> ores;
}
diff --git a/src/api/java/ic2/api/recipe/RecipeOutput.java b/src/api/java/ic2/api/recipe/RecipeOutput.java
index 80ad5fb..aa7839d 100644
--- a/src/api/java/ic2/api/recipe/RecipeOutput.java
+++ b/src/api/java/ic2/api/recipe/RecipeOutput.java
@@ -7,33 +7,42 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-public final class RecipeOutput {
- public RecipeOutput(NBTTagCompound metadata1, List<ItemStack> items1) {
+public final class RecipeOutput
+{
+ public RecipeOutput(NBTTagCompound metadata1, List<ItemStack> items1)
+ {
assert !items1.contains(null);
- this.metadata = metadata1;
- this.items = items1;
+ metadata = metadata1;
+ items = items1;
}
- public RecipeOutput(NBTTagCompound metadata1, ItemStack... items1) {
+ public RecipeOutput(NBTTagCompound metadata1, ItemStack... items1)
+ {
this(metadata1, Arrays.asList(items1));
}
@Override
- public boolean equals(Object obj) {
- if (obj instanceof RecipeOutput) {
- RecipeOutput ro = (RecipeOutput) obj;
-
- if (items.size() == ro.items.size() &&
- (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null && metadata.equals(ro.metadata))) {
- Iterator<ItemStack> itA = items.iterator();
- Iterator<ItemStack> itB = ro.items.iterator();
-
- while (itA.hasNext() && itB.hasNext()) {
- ItemStack stackA = itA.next();
- ItemStack stackB = itB.next();
-
- if (ItemStack.areItemStacksEqual(stackA, stackB)) return false;
+ public boolean equals(Object obj)
+ {
+ if(obj instanceof RecipeOutput)
+ {
+ final RecipeOutput ro = (RecipeOutput) obj;
+
+ if(items.size() == ro.items.size() && (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null && metadata.equals(ro.metadata)))
+ {
+ final Iterator<ItemStack> itA = items.iterator();
+ final Iterator<ItemStack> itB = ro.items.iterator();
+
+ while(itA.hasNext() && itB.hasNext())
+ {
+ final ItemStack stackA = itA.next();
+ final ItemStack stackB = itB.next();
+
+ if(ItemStack.areItemStacksEqual(stackA, stackB))
+ {
+ return false;
+ }
}
return true;
@@ -44,10 +53,11 @@ public final class RecipeOutput {
}
@Override
- public String toString() {
- return "ROutput<"+items+","+metadata+">";
+ public String toString()
+ {
+ return "ROutput<" + items + "," + metadata + ">";
}
- public final List<ItemStack> items;
- public final NBTTagCompound metadata;
+ public final List<ItemStack> items;
+ public final NBTTagCompound metadata;
}
diff --git a/src/api/java/ic2/api/recipe/Recipes.java b/src/api/java/ic2/api/recipe/Recipes.java
index 0aa0b75..0bcc71b 100644
--- a/src/api/java/ic2/api/recipe/Recipes.java
+++ b/src/api/java/ic2/api/recipe/Recipes.java
@@ -1,25 +1,25 @@
package ic2.api.recipe;
-
/**
* General recipe registry.
*
* @author Richard
*/
-public class Recipes {
- public static IMachineRecipeManager macerator;
- public static IMachineRecipeManager extractor;
- public static IMachineRecipeManager compressor;
- public static IMachineRecipeManager centrifuge;
- public static IMachineRecipeManager blockcutter;
- public static IMachineRecipeManager blastfurance;
- public static IMachineRecipeManager recycler;
- public static IMachineRecipeManager metalformerExtruding;
- public static IMachineRecipeManager metalformerCutting;
- public static IMachineRecipeManager metalformerRolling;
- public static IMachineRecipeManager oreWashing;
- public static ICannerBottleRecipeManager cannerBottle;
- public static ICannerEnrichRecipeManager cannerEnrich;
+public class Recipes
+{
+ public static IMachineRecipeManager macerator;
+ public static IMachineRecipeManager extractor;
+ public static IMachineRecipeManager compressor;
+ public static IMachineRecipeManager centrifuge;
+ public static IMachineRecipeManager blockcutter;
+ public static IMachineRecipeManager blastfurance;
+ public static IMachineRecipeManager recycler;
+ public static IMachineRecipeManager metalformerExtruding;
+ public static IMachineRecipeManager metalformerCutting;
+ public static IMachineRecipeManager metalformerRolling;
+ public static IMachineRecipeManager oreWashing;
+ public static ICannerBottleRecipeManager cannerBottle;
+ public static ICannerEnrichRecipeManager cannerEnrich;
/**
* Reference amplifier values:
@@ -33,7 +33,7 @@ public class Recipes {
* nbt.setInteger("amplification", aValue);
* matterAmplifier.addRecipe(yourStack, nbt);
*/
- public static IMachineRecipeManager matterAmplifier;
+ public static IMachineRecipeManager matterAmplifier;
/**
* Reference scrap box chance values:
*
@@ -46,23 +46,23 @@ public class Recipes {
* 4.0: Stick
* 5.0: Dirt, Wooden Hoe
*/
- public static IScrapboxManager scrapboxDrops;
- public static IListRecipeManager recyclerBlacklist;
+ 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 IListRecipeManager recyclerWhitelist;
+ public static ICraftingRecipeManager advRecipes;
- public static ISemiFluidFuelManager semiFluidGenerator;
- public static IFluidHeatManager FluidHeatGenerator;
+ public static ISemiFluidFuelManager semiFluidGenerator;
+ public static IFluidHeatManager FluidHeatGenerator;
/**
* Used by the Liquid Heat Exchanger to cool down liquids and determine the amount of hu generated for every mb.
*/
- public static ILiquidHeatExchangerManager liquidCooldownManager;
+ public static ILiquidHeatExchangerManager liquidCooldownManager;
/**
* Opposite of {@link #liquidCooldownManager}. This is for Liquids that can be heated up again.
*/
- public static ILiquidHeatExchangerManager liquidHeatupManager;
+ public static ILiquidHeatExchangerManager liquidHeatupManager;
}
diff --git a/src/api/java/ic2/api/recipe/package-info.java b/src/api/java/ic2/api/recipe/package-info.java
index 44e70e7..4974eb1 100644
--- a/src/api/java/ic2/api/recipe/package-info.java
+++ b/src/api/java/ic2/api/recipe/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.recipe;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/tile/ExplosionWhitelist.java b/src/api/java/ic2/api/tile/ExplosionWhitelist.java
index fa4a474..ea3217b 100644
--- a/src/api/java/ic2/api/tile/ExplosionWhitelist.java
+++ b/src/api/java/ic2/api/tile/ExplosionWhitelist.java
@@ -13,35 +13,38 @@ import net.minecraft.block.Block;
* invulnerable reactor chambers. Said blocks will not shield the explosion and won't get
* destroyed.
*/
-public final class ExplosionWhitelist {
+public final class ExplosionWhitelist
+{
/**
* Add a block to the whitelist.
*
* @param block block to add
*/
- public static void addWhitelistedBlock(Block block) {
+ public static void addWhitelistedBlock(Block block)
+ {
whitelist.add(block);
}
-
+
/**
* Remove a block from the whitelist.
*
* @param block block to remove
*/
- public static void removeWhitelistedBlock(Block block) {
+ public static void removeWhitelistedBlock(Block block)
+ {
whitelist.remove(block);
}
-
+
/**
* Check if a block is on the whitelist.
*
* @param block block to check if whitelisted
* @return Whether the block is whitelisted
*/
- public static boolean isBlockWhitelisted(Block block) {
+ public static boolean isBlockWhitelisted(Block block)
+ {
return whitelist.contains(block);
}
- private static Set<Block> whitelist = new HashSet<Block>();
+ private static Set<Block> whitelist = new HashSet<Block>();
}
-
diff --git a/src/api/java/ic2/api/tile/IEnergyStorage.java b/src/api/java/ic2/api/tile/IEnergyStorage.java
index 68f4270..c2ee2e4 100644
--- a/src/api/java/ic2/api/tile/IEnergyStorage.java
+++ b/src/api/java/ic2/api/tile/IEnergyStorage.java
@@ -5,7 +5,8 @@ import net.minecraftforge.common.util.ForgeDirection;
/**
* Interface implemented by the tile entity of energy storage blocks.
*/
-public interface IEnergyStorage {
+public interface IEnergyStorage
+{
/**
* Get the amount of energy currently stored in the block.
*
diff --git a/src/api/java/ic2/api/tile/IWrenchable.java b/src/api/java/ic2/api/tile/IWrenchable.java
index 8fcbea5..bd2f3f5 100644
--- a/src/api/java/ic2/api/tile/IWrenchable.java
+++ b/src/api/java/ic2/api/tile/IWrenchable.java
@@ -6,7 +6,8 @@ import net.minecraft.item.ItemStack;
/**
* Allows a tile entity to make use of the wrench's removal and rotation functions.
*/
-public interface IWrenchable {
+public interface IWrenchable
+{
/**
* Determine if the wrench can be used to set the block's facing.
* Called before wrenchCanRemove().
@@ -58,4 +59,3 @@ public interface IWrenchable {
*/
ItemStack getWrenchDrop(EntityPlayer entityPlayer);
}
-
diff --git a/src/api/java/ic2/api/tile/package-info.java b/src/api/java/ic2/api/tile/package-info.java
index 5ebc76e..26c013a 100644
--- a/src/api/java/ic2/api/tile/package-info.java
+++ b/src/api/java/ic2/api/tile/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.tile;
+
import cpw.mods.fml.common.API;
diff --git a/src/api/java/ic2/api/util/IKeyboard.java b/src/api/java/ic2/api/util/IKeyboard.java
index ff6eaea..b71a5e4 100644
--- a/src/api/java/ic2/api/util/IKeyboard.java
+++ b/src/api/java/ic2/api/util/IKeyboard.java
@@ -2,13 +2,21 @@ package ic2.api.util;
import net.minecraft.entity.player.EntityPlayer;
-public interface IKeyboard {
+public interface IKeyboard
+{
boolean isAltKeyDown(EntityPlayer player);
+
boolean isBoostKeyDown(EntityPlayer player);
+
boolean isForwardKeyDown(EntityPlayer player);
+
boolean isJumpKeyDown(EntityPlayer player);
+
boolean isModeSwitchKeyDown(EntityPlayer player);
+
boolean isSideinventoryKeyDown(EntityPlayer player);
+
boolean isHudModeKeyDown(EntityPlayer player);
+
boolean isSneakKeyDown(EntityPlayer player);
}
diff --git a/src/api/java/ic2/api/util/Keys.java b/src/api/java/ic2/api/util/Keys.java
index 84d1756..7493868 100644
--- a/src/api/java/ic2/api/util/Keys.java
+++ b/src/api/java/ic2/api/util/Keys.java
@@ -1,6 +1,6 @@
package ic2.api.util;
-
-public class Keys {
- public static IKeyboard instance;
-} \ No newline at end of file
+public class Keys
+{
+ public static IKeyboard instance;
+}
diff --git a/src/api/java/ic2/api/util/package-info.java b/src/api/java/ic2/api/util/package-info.java
index 4dd2d93..3207c5b 100644
--- a/src/api/java/ic2/api/util/package-info.java
+++ b/src/api/java/ic2/api/util/package-info.java
@@ -1,4 +1,5 @@
-@API(apiVersion="1.0", owner="IC2", provides="IC2API")
+@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API")
package ic2.api.util;
+
import cpw.mods.fml.common.API;