diff --git a/build.gradle b/build.gradle index af50f6b6e..dfe802728 100644 --- a/build.gradle +++ b/build.gradle @@ -61,14 +61,17 @@ repositories { name 'buildcraft' url 'https://mod-buildcraft.com/maven/' } - maven { - name 'thiakil.io' - url 'https://thiakil.github.io/maven/' - } - maven { - name 'thiakil mirror' //in case GitHub doesn't like maven being hosted in GH Pages - url 'http://maven.thiakil.com' - } + maven { + name 'ic2' + url 'http://maven.ic2.player.to' + maven { + name 'thiakil.io' + url 'https://thiakil.github.io/maven/' + } + maven { + name 'thiakil mirror' //in case GitHub doesn't like maven being hosted in GH Pages + url 'http://maven.thiakil.com' + } } // Define properties file @@ -103,11 +106,12 @@ dependencies { compile "li.cil.oc:OpenComputers:MC${config.minecraft_version}-${config.opencomputers_version}:api" deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla_version}" deobfCompile "com.mod-buildcraft:buildcraft-api:${config.buildcraft_version}" - compile ("com.jaquadro.minecraft.storagedrawers:StorageDrawers:${config.minecraft_version}-${config.storagedrawers_version}:api") { - exclude module: "Chameleon" // we only use the API, which doesn't need Chameleon + compile "net.industrial-craft:industrial-craft2:${config.ic2_version}:api" + compile ("com.jaquadro.minecraft.storagedrawers:StorageDrawers:${config.minecraft_version}-${config.storagedrawers_version}:api") { + exclude module: "Chameleon" // we only use the API, which doesn't need Chameleon exclude module: "jei_1.11.2" exclude module: "Hwyla" - } + } } processResources diff --git a/build.properties b/build.properties index 5661c1a73..5fe308bc8 100644 --- a/build.properties +++ b/build.properties @@ -9,4 +9,5 @@ invtweak_version=1.62+beta.89 opencomputers_version=1.7.0.24 hwyla_version=1.8.13-B26_1.11 buildcraft_version=7.99.6 -storagedrawers_version=4.2.10 \ No newline at end of file +storagedrawers_version=4.2.10 +ic2_version=2.7.81-ex111 \ No newline at end of file diff --git a/src/api/java/ic2/api/crops/BaseSeed.class b/src/api/java/ic2/api/crops/BaseSeed.class deleted file mode 100644 index 47efa3131..000000000 Binary files a/src/api/java/ic2/api/crops/BaseSeed.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/BaseSeed.java b/src/api/java/ic2/api/crops/BaseSeed.java deleted file mode 100644 index 5f5f4446d..000000000 --- a/src/api/java/ic2/api/crops/BaseSeed.java +++ /dev/null @@ -1,57 +0,0 @@ -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 { - /** - * Create a BaseSeed object. - * - * @param crop plant - * @param size plant size - * @param statGrowth plant growth stat - * @param statGain plant gain stat - * @param statResistance plant resistance stat - * @param stackSize for internal usage only - */ - public BaseSeed(CropCard crop, int size, int statGrowth, int statGain, int statResistance) { - this.crop = crop; - this.size = size; - this.statGrowth = statGrowth; - this.statGain = statGain; - this.statResistance = statResistance; - } - - /** - * @deprecated use the other constructor instead - */ - @Deprecated - public BaseSeed(CropCard crop, int size, int statGrowth, int statGain, int statResistance, int stackSize) { - this(crop, size, statGrowth, statGain, statResistance); - } - - /** - * Plant. - */ - public final CropCard crop; - - /** - * Plant size. - */ - public int size; - - /** - * Plant growth stat. - */ - public int statGrowth; - - /** - * Plant gain stat. - */ - public int statGain; - - /** - * Plant resistance stat. - */ - public int statResistance; -} diff --git a/src/api/java/ic2/api/crops/CropCard.class b/src/api/java/ic2/api/crops/CropCard.class deleted file mode 100644 index dab248f4b..000000000 Binary files a/src/api/java/ic2/api/crops/CropCard.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/CropCard.java b/src/api/java/ic2/api/crops/CropCard.java deleted file mode 100644 index 60350036e..000000000 --- a/src/api/java/ic2/api/crops/CropCard.java +++ /dev/null @@ -1,383 +0,0 @@ -package ic2.api.crops; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -/** - * Base agriculture crop. - * - * Any crop extending this can be registered using registerCrop to be added into the game. - */ -public abstract class CropCard { - public CropCard() { - } - - /** - * Plant id for identifying this crop within your mod. - *
- * The id has to be unique within the mod and is used for saving. - *
- * By default this id will be also used to determine {@link #getUnlocalizedName()} and {@link #getTexturesLocation()}. - * - * @note changing the id or owner will cause existing crops in users' worlds to disappear. - * - * @return Plant id - */ - public abstract String getId(); - - /** - * Determine the mod owning this crop. - * - * The owner serves as a name space. With every mod using a different owner, a mod only has to - * make sure it doesn't have getId() conflicts within itself. The identifier has to be lower - * case to ensure compatibility with future versions. - *
- * It's recommended to hard code this to your lower case mod id as specified in the @Mod - * annotation, as {@link #getUnlocalizedName()} will use it by default. - *
- * Do not use IC2's mod id here. - * - * @note changing the id or owner will cause existing crops in users' worlds to disappear. - * - * @return owning mod identifier, lower case. - */ - public abstract String getOwner(); - - /** - * Translation key for display to the player. - * - * It's recommended to specify a valid key from your language file here. - *
- * e.g. Add "yourmod.crop.yourCropName = Your crop's name" to the language file, - * override {@link #getId()} to return "yourCropName" and override {@link #getOwner()} to return "yourmod". - * - * @return Unlocalized name. - */ - public String getUnlocalizedName() { - return getOwner() + ".crop." + getId(); //Good enough default - } - - /** - * Your name here, will be shown in "Discovered by:" when analyzing seeds. - * - * @return Your name - */ - public String getDiscoveredBy() { - return "unknown"; - } - - /** - * Description of your plant. Keep it short, a few characters per line for up to two lines. - * Default is showing attributes of your plant, 2 per line. - * - * @param i line to get, starting from 0 - * @return The line - */ - public String desc(int i) { - String[] att = getAttributes(); - - if (att == null || att.length == 0) return ""; - - if (i == 0) { - String s = att[0]; - if (att.length >= 2) { - s += ", " + att[1]; - if (att.length >= 3) s += ","; - } - return s; - } - if (att.length < 3) return ""; - String s = att[2]; - if (att.length >= 4) s += ", " + att[3]; - return s; - } - - /** - * Crop roots length. Maximum roots length should be 5. - * @param cropTile reference to ICropTile - * @return roots length use in isBlockBelow - */ - public int getRootsLength(ICropTile cropTile) { - return 1; - } - - /** - * Object containing the crop properties info - See {@link CropProperties} for more info. - */ - public abstract CropProperties getProperties(); - - /** - * Additional attributes of the plant, also influencing breeding. - * Plants sharing stats and attributes will tend to cross-breed more often. - * - * @return Attributes as an array of strings - */ - public String[] getAttributes() { - return new String[0]; - } - - /** - * Determine the max crop size. - * - * Currently used for texture allocation, growth and harvesting control (by default). - */ - public abstract int getMaxSize(); - - /** - * Amount of growth points needed to increase the plant's size. - * Default is 200 * tier. - */ - public int getGrowthDuration(ICropTile cropTile) { - return getProperties().getTier() * 200; - } - - /** - * Check whether the plant can grow further. - * - * Consider: - * - Humidity, nutrients and air quality - * - Current size - * - Light level - * - Special biomes or conditions, accessible through crop.worldObj - * - * This method will be called upon empty upgraded crops to check whether a neighboring plant can cross onto it! Don't check if the size is greater than 0 and if the ID is real. - * - * @param cropTile reference to ICropTile - * @return Whether the crop can grow - */ - public boolean canGrow(ICropTile cropTile) { - return cropTile.getCurrentSize() < getMaxSize(); - } - - /** - * Calculate the influence for the plant to grow based on humidity, nutrients and air. - * Normal behavior is rating the three stats "normal", with each of them ranging from 0-30. - * Basic rule: Assume everything returns 10. All together must equal 30. Add the factors to your likings, for example (humidity*0.7)+(nutrients*0.9)+(air*1.4) - * - * Default is humidity + nutrients + air (no factors). - * - * @param crop reference to ICropTile - * @param humidity ground humidity, influenced by hydration - * @param nutrients nutrient quality in ground, based on fertilizers - * @param air air quality, influences by open gardens and less crops surrounding this one - * @return 0-30 - */ - public int getWeightInfluences(ICropTile crop, int humidity, int nutrients, int air) { - return humidity + nutrients + air; - } - - /** - * Used to determine whether the plant can crossbreed with another crop. - * Default is allow crossbreeding if the size is greater or equal than 3. - * - * @param crop crop to crossbreed with - */ - public boolean canCross(ICropTile crop) { - return crop.getCurrentSize() >= 3; - } - - - /** - * Called when the plant is rightclicked by a player. - * Default action is harvesting. - * - * Only called Serverside. - * - * @param cropTile reference to ICropTile - * @param player player rightclicking the crop - * @return Whether the plant has changed - */ - public boolean onRightClick(ICropTile cropTile, EntityPlayer player) { - return cropTile.performManualHarvest(); - } - - /** - * Use in Crop Harvester with insert Cropnalyzer to get best Output. - * - * @param cropTile reference to ICropTile - * @return need crop size for best output. - */ - - public int getOptimalHarvestSize(ICropTile cropTile) { - return getMaxSize(); - } - - /** - * Check whether the crop can be harvested. - * - * @param cropTile reference to ICropTile - * @return Whether the crop can be harvested in its current state. - */ - public boolean canBeHarvested(ICropTile cropTile) { - return cropTile.getCurrentSize() == getMaxSize(); - } - - /** - * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. - * Default is 0.95^tier. - * - * @return Chance to drop the gains - */ - public double dropGainChance() { - return Math.pow(0.95, getProperties().getTier()); - } - - /** - * Item obtained from harvesting the plant. - * - * @param crop reference to ICropTile - * @return Item obtained - */ - public abstract ItemStack getGain(ICropTile crop); - - /** - * Get the size of the plant after harvesting. - * Default is 1. - * - * @param cropTile reference to ICropTile - * @return Plant size after harvesting - */ - public int getSizeAfterHarvest(ICropTile cropTile) { - return 1; - } - - - /** - * Called when the plant is left clicked by a player. - * Default action is picking the plant. - * - * Only called server side. - * - * @param cropTile reference to ICropTile - * @param player player left clicked the crop - * @return Whether the plant has changed - */ - public boolean onLeftClick(ICropTile cropTile, EntityPlayer player) { - return cropTile.pick(); - } - - /** - * Base chance for dropping seeds when the plant is picked. - * Default is 0.5*0.8^tier with a bigger chance for sizes greater than 2 and absolutely no chance for size 0. - * - * @param crop reference to ICropTile - * @return Chance to drop the seeds - */ - public float dropSeedChance(ICropTile crop) { - if (crop.getCurrentSize() == 1) return 0; - float base = 0.5F; - if (crop.getCurrentSize() == 2) base /= 2F; - for (int i = 0; i < getProperties().getTier(); i++) { - base *= 0.8; - } - return base; - } - - /** - * Obtain seeds dropped when the plant is picked. - * Multiple drops of the returned ItemStack can occur. - * Default action is generating a seed from this crop. - * - * @param crop reference to ICropTile - * @return Seeds - */ - public ItemStack getSeeds(ICropTile crop) { - return crop.generateSeeds(crop.getCrop(), crop.getStatGrowth(), crop.getStatGain(), crop.getStatResistance(), crop.getScanLevel()); - } - - /** - * Called when a neighbor block to the crop has changed. - * - * @param crop reference to ICropTile - */ - public void onNeighbourChange(ICropTile crop) { - // NO-OP - } - - /** - * Check if the crop emits a redstone signal. - * - * @return Whether the crop emits a redstone signal. - */ - public boolean isRedstoneSignalEmitter(ICropTile cropTile) { - return false; - } - - /** - * Get the emitted redstone signal strength. - * - * @return The redstone signal strength. - */ - public int getEmittedRedstoneSignal(ICropTile cropTile) { - return 0; - } - - /** - * Called when the crop is destroyed. - * - * @param crop reference to ICropTile - */ - public void onBlockDestroyed(ICropTile crop) { - // - } - - /** - * Get the light value emitted by the plant. - * - * @param crop reference to ICropTile - * @return Light value emitted - */ - public int getEmittedLight(ICropTile crop) { - return 0; - } - - /** - * Default is true if the entity is an EntityLiving in jumping or sprinting state. - * - * @param crop reference to ICropTile - * @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) { - return (entity instanceof EntityLivingBase && entity.isSprinting()); - } - - - /** - * Called every time the crop ticks. - * Should be called every 256 ticks or around 13 seconds. - * - * @param cropTile reference to ICropTile - */ - public void tick(ICropTile cropTile) { - // nothing by default - } - - /** - * Check whether this plant spreads weed to surrounding tiles. - * Default is true if the plant has a high growth stat (or is weeds) and size greater or equal than 2. - * - * @param cropTile reference to ICropTile - * @return Whether the plant spreads weed - */ - public boolean isWeed(ICropTile cropTile) { - return cropTile.getCurrentSize() >= 2 && (cropTile.getCrop() == Crops.weed || cropTile.getStatGrowth() >= 24); - } - - /** - * Retrieve the crop world. - * @param cropTile reference to ICropTile. - * @return The crop world object. - */ - public World getWorld(ICropTile cropTile) { - return cropTile.getWorldObj(); - } - - public abstract List getTexturesLocation(); -} diff --git a/src/api/java/ic2/api/crops/CropProperties.class b/src/api/java/ic2/api/crops/CropProperties.class deleted file mode 100644 index 11cd6c540..000000000 Binary files a/src/api/java/ic2/api/crops/CropProperties.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/CropProperties.java b/src/api/java/ic2/api/crops/CropProperties.java deleted file mode 100644 index 7271461d4..000000000 --- a/src/api/java/ic2/api/crops/CropProperties.java +++ /dev/null @@ -1,78 +0,0 @@ -package ic2.api.crops; - -/** - * Describe the plant through a set of properties, influencing breeding. - * Plants sharing properties and attributes will tend to cross-breed more often. - * - * Properties: - * - Tier (Tier of the plant. Ranges from 1 to 16, 0 is Weed. Valuable and powerful crops have higher tiers, useless and - * weak ones have lower tiers.) - * - Chemistry (Industrial uses based on chemical plant components) - * - Consumable (Food, potion ingredients, stuff meant to be eaten or similarly used) - * - Defensive (Plants with defense capabilities (damaging, explosive, chemical) or special abilities in general) - * - Colorful (How colorful/aesthetically/beautiful is the plant, like dye-plants or plants without actual effects) - * - Weed (Is this plant weed-like and rather unwanted/quick-spreading? Rare super-breed plants should have low values here) - * - * @author IC2 Team - */ -public class CropProperties { - - /** - * Create a CropProperties object. - * - * @param tier Tier property value - * @param chemistry Chemistry property value - * @param consumable Consumable property value - * @param defensive Defensive property value - * @param colorful Colorful property value - * @param weed Weed property value - */ - public CropProperties(int tier, int chemistry, int consumable, int defensive, - int colorful, int weed) { - this.tier = tier; - this.chemistry = chemistry; - this.consumable = consumable; - this.defensive = defensive; - this.colorful = colorful; - this.weed = weed; - } - - public int getTier() { - return this.tier; - } - - public int getChemistry() { - return this.chemistry; - } - - public int getConsumable() { - return this.consumable; - } - - public int getDefensive() { - return this.defensive; - } - - public int getColorful() { - return this.colorful; - } - - public int getWeed() { - return this.weed; - } - - public int[] getAllProperties() { - return new int[] { this.getChemistry(), this.getConsumable(), this.getDefensive(), - this.getColorful(), this.getWeed() }; - } - - /** - * Fields - */ - private final int tier; - private final int chemistry; - private final int consumable; - private final int defensive; - private final int colorful; - private final int weed; -} diff --git a/src/api/java/ic2/api/crops/CropSoilType.class b/src/api/java/ic2/api/crops/CropSoilType.class deleted file mode 100644 index fd7b99366..000000000 Binary files a/src/api/java/ic2/api/crops/CropSoilType.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/CropSoilType.java b/src/api/java/ic2/api/crops/CropSoilType.java deleted file mode 100644 index 1a8dddf50..000000000 --- a/src/api/java/ic2/api/crops/CropSoilType.java +++ /dev/null @@ -1,42 +0,0 @@ -package ic2.api.crops; - -import javax.annotation.Nonnull; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; - -/** - * List of possible blocks to be used as soil for a crop. - * @author estebes - */ -public enum CropSoilType { - //DIRT(Blocks.DIRT), - FARMLAND(Blocks.FARMLAND), - MYCELIUM(Blocks.MYCELIUM), - SAND(Blocks.SAND), - SOULSAND(Blocks.SOUL_SAND); - - private CropSoilType(@Nonnull Block block) { - this.block = block; - } - - public Block getBlock() { - return this.block; - } - - /** - * Check if a block can be used as soil. - * @param block the block - * @return true if the block is a possible crop soil - */ - public static boolean contais(Block block) { - for (CropSoilType aux : CropSoilType.values()) { - if (aux.getBlock() == block) { - return true; - } - } - return false; - } - - private final Block block; -} diff --git a/src/api/java/ic2/api/crops/Crops.class b/src/api/java/ic2/api/crops/Crops.class deleted file mode 100644 index a97ba790f..000000000 Binary files a/src/api/java/ic2/api/crops/Crops.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/Crops.java b/src/api/java/ic2/api/crops/Crops.java deleted file mode 100644 index cfaeb19f1..000000000 --- a/src/api/java/ic2/api/crops/Crops.java +++ /dev/null @@ -1,113 +0,0 @@ -package ic2.api.crops; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.Biome; - -import net.minecraftforge.common.BiomeDictionary.Type; - -/** - * General management of the crop system. - */ -public abstract class Crops { - public static Crops instance; - - public static CropCard weed; // weed has special properties, thus it's exposed here - - /** - * Adds a crop nutrient biome bonus. - * - * +10/-10 0 indicates no bonus and negative values indicate a penalty. - * - * @param type Forge biome type to apply the bonus in - * @param nutrientsBonus Nutrient stat bonus - */ - public abstract void addBiomenutrientsBonus(Type type, int nutrientsBonus); - - /** - * Adds a crop humidity biome bonus. - * - * +10/-10 0 indicates no bonus and negative values indicate a penalty. - * - * @param type Forge biome type to apply the bonus in - * @param humidityBonus Humidity stat bonus - */ - public abstract void addBiomehumidityBonus(Type type, int humidityBonus); - - - /** - * Gets the humidity bonus for a biome. - * - * @param biome Biome to check - * @return Humidity bonus or 0 if none - */ - public abstract int getHumidityBiomeBonus(Biome biome); - - /** - * Gets the nutrient bonus for a biome. - * - * @param biome Biome to check - * @return Nutrient bonus or 0 if none - */ - public abstract int getNutrientBiomeBonus(Biome biome); - - /** - * Get the crop card for the specified owner and name. - * - * @param owner CropCard owner mod id. - * @param name CropCard name. - * @return Matching CropCard. - */ - public abstract CropCard getCropCard(String owner, String name); - - /** - * Get the crop card for the specified seed item stack. - * - * @param stack ItemStack containing seeds for the crop. - * @return Matching CropCard. - */ - public abstract CropCard getCropCard(ItemStack stack); - - /** - * Returns a list of all crops. - * - * @return All registered crops. - */ - public abstract Collection getCrops(); - - /** - * Register a plant and provide a legacy id for migration. - * - * @param crop Plant to register. - */ - public abstract void registerCrop(CropCard crop); - - /** - * Registers a base seed, an item used to plant a crop. - * - * @param stack item - * @param crop crop - * @param size initial size - * @param growth initial growth stat - * @param gain initial gain stat - * @param resistance initial resistance stat - * @return True if successful - */ - public abstract boolean registerBaseSeed(ItemStack stack, CropCard crop, int size, int growth, int gain, int resistance); - - /** - * Finds a base seed from the given item. - * - * @return Base seed or null if none found - */ - public abstract BaseSeed getBaseSeed(ItemStack stack); - - /** - * Execute registerSprites for all registered crop cards. - * - * This method will get called by IC2, don't call it yourself. - */ - //@SideOnly(Side.CLIENT) - //public abstract void startSpriteRegistration(IIconRegister iconRegister); -} diff --git a/src/api/java/ic2/api/crops/ExampleCropCard.class b/src/api/java/ic2/api/crops/ExampleCropCard.class deleted file mode 100644 index 774eb7d4e..000000000 Binary files a/src/api/java/ic2/api/crops/ExampleCropCard.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/ExampleCropCard.java b/src/api/java/ic2/api/crops/ExampleCropCard.java deleted file mode 100644 index 2fc522066..000000000 --- a/src/api/java/ic2/api/crops/ExampleCropCard.java +++ /dev/null @@ -1,53 +0,0 @@ -package ic2.api.crops; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import java.util.ArrayList; -import java.util.List; - -/** - * CropCard example - * @author estebes - */ -public class ExampleCropCard extends CropCard { - @Override - public String getId() { - return "example"; - } - - @Override - public String getOwner() { - return "myaddon"; - } - - /** - * See {@link CropProperties} for more info. - */ - @Override - public CropProperties getProperties() { - return new CropProperties(1, 0, 4, 0, 0, 2); - } - - @Override - public int getMaxSize() { - return 5; - } - - @Override - public ItemStack getGain(ICropTile crop) { - return new ItemStack(Items.DIAMOND, 1); - } - - @Override - public List getTexturesLocation() { - List ret = new ArrayList(getMaxSize()); - - for (int size = 1; size <= getMaxSize(); size++) { - ret.add(new ResourceLocation("myaddon", "blocks/crop/" + getId() + "_" + size)); - } - - return ret; - } -} diff --git a/src/api/java/ic2/api/crops/ICropSeed.class b/src/api/java/ic2/api/crops/ICropSeed.class deleted file mode 100644 index 21e648ea1..000000000 Binary files a/src/api/java/ic2/api/crops/ICropSeed.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/ICropSeed.java b/src/api/java/ic2/api/crops/ICropSeed.java deleted file mode 100644 index 8140678b6..000000000 --- a/src/api/java/ic2/api/crops/ICropSeed.java +++ /dev/null @@ -1,81 +0,0 @@ -package ic2.api.crops; - -import net.minecraft.item.ItemStack; - -/** - * Interface implemented by ItemCropSeed. - * @author estebes - */ -public interface ICropSeed { - /** - * Get the seed's crop. - * @param itemStack The seed's itemstack. - * @return Seed's crop. - */ - public CropCard getCropFromStack(ItemStack itemStack); - - /** - * Set the seed's crop. - * @param itemStack The seed's itemstack. - * @param crop New CropCard object. - */ - public void setCropFromStack(ItemStack itemStack, CropCard crop); - - /** - * Get the seed's growth. - * @param itemStack The seed's itemstack. - * @return Seed's growth. - */ - public int getGrowthFromStack(ItemStack itemStack); - - /** - * Set the seed's growth. - * @param itemStack The seed's itemstack. - * @param value New growth value. - */ - public void setGrowthFromStack(ItemStack itemStack, int value); - - /** - * Get the seed's gain. - * @param itemStack The seed's itemstack. - * @return Seed's gain. - */ - public int getGainFromStack(ItemStack itemStack); - - /** - * Set the seed's growth. - * @param itemStack The seed's itemstack. - * @param value New growth value. - */ - public void setGainFromStack(ItemStack itemStack, int value); - - /** - * Get the seed's resistance. - * @param itemStack The seed's itemstack. - * @return Seed's resistance. - */ - public int getResistanceFromStack(ItemStack itemStack); - - /** - * Set the seed's resistance. - * @param itemStack The seed's itemstack. - * @param value New resistance value. - */ - public void setResistanceFromStack(ItemStack itemStack, int value); - - /** - * Get the seed's scan level. - * @param itemStack The seed's itemstack. - * @return Seed's scan level. - */ - public int getScannedFromStack(ItemStack itemStack); - - /** - * Set the seed's scan level. - * @param itemStack The seed's itemstack. - * @param value New scan level value. - */ - public void setScannedFromStack(ItemStack itemStack, int value); - - public void incrementScannedFromStack(ItemStack itemStack); -} diff --git a/src/api/java/ic2/api/crops/ICropTile.class b/src/api/java/ic2/api/crops/ICropTile.class deleted file mode 100644 index adb43df8e..000000000 Binary files a/src/api/java/ic2/api/crops/ICropTile.class and /dev/null differ diff --git a/src/api/java/ic2/api/crops/ICropTile.java b/src/api/java/ic2/api/crops/ICropTile.java deleted file mode 100644 index 21357bc7c..000000000 --- a/src/api/java/ic2/api/crops/ICropTile.java +++ /dev/null @@ -1,284 +0,0 @@ -package ic2.api.crops; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import ic2.api.info.ILocatable; - -/** - * Interface implemented by the crop tile entity. - */ -public interface ICropTile extends ILocatable { - /** - * Get the crop. - * - * @return CropCard, or null if there is no plant currently on the crop - */ - public CropCard getCrop(); - - /** - * Set the crop. - * - * @param cropCard CropCard or null for no plant - */ - public void setCrop(CropCard cropCard); - - /** - * Get the crop's plant size. - * - * @return Plant size, starting with 1 and maximum varies depending on plant - */ - public int getCurrentSize(); - - /** - * Set the crop's plant size. - * - * @param size Plant size - */ - public void setCurrentSize(int size); - - /** - * Get the crop's plant growth stat. - * Higher values indicate faster growth. - * - * @return Plant growth stat - */ - public int getStatGrowth(); - - /** - * Set the crop's plant growth stat. - * - * @param growth Plant growth stat - */ - public void setStatGrowth(int growth); - - /** - * Get the crop's plant gain stat. - * Higher values indicate more drops. - * - * @return Plant gain stat - */ - public int getStatGain(); - - /** - * Set the crop's plant gain stat. - * - * @param gain Plant gain stat - */ - public void setStatGain(int gain); - - /** - * Get the crop's plant resistance stat. - * Higher values indicate more resistance against trampling. - * - * @return Plant resistance stat - */ - public int getStatResistance(); - - /** - * Set the crop's plant resistance stat. - * - * @param resistance Plant resistance stat - */ - public void setStatResistance(int resistance); - - /** - * Get the crop's nutrient storage. - * Ranges from 0 to 100. - * - * @return Crop nutrient storage - */ - public int getStorageNutrients(); - - /** - * Set the crop's nutrient storage. - * - * @param nutrients Crop nutrient storage - */ - public void setStorageNutrients(int nutrients); - - /** - * Get the crop's hydration storage. - * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. - * - * @return Crop hydration storage - */ - public int getStorageWater(); - - /** - * Set the crop's water storage. - * - * @param water Crop water storage - */ - public void setStorageWater(int water); - - /** - * Get the crop's Weed-Ex storage. - * - * @return Crop Weed-Ex storage - */ - public int getStorageWeedEX(); - - /** - * Set the crop's Weed-Ex storage. - * - * @param weedEX Crop Weed-Ex storage - */ - public void setStorageWeedEX(int weedEX); - - /** - * Get the crop's plant scan level. - * Increases every time the seed is analyzed. - * - * @return Plant scan level - */ - public int getScanLevel(); - - /** - * Set the crop's plant scan level. - * - * @param scanLevel Plant scan level - */ - public void setScanLevel(int scanLevel); - - public int getGrowthPoints(); - - public void setGrowthPoints(int growthPoints); - - public boolean isCrossingBase(); - - public void setCrossingBase(boolean crossingBase); - - /** - * Get the crop's plant custom data, stored alongside the crop. - * Can be modified in place. - * - * @return Plant custom data - */ - public NBTTagCompound getCustomData(); - - /** - * Get the crop's humidity. - * Ranges from 0 (dry) to 10 (humid). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop humidity level - */ - public int getTerrainHumidity(); - - /** - * Get the crop's nutrient level. - * Ranges from 0 (empty) to 10 (full). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop nutrient level - */ - public int getTerrainNutrients(); - - /** - * Get the crop's air quality. - * Ranges from 0 (cluttered) to 10 (fresh). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop air quality - */ - public int getTerrainAirQuality(); - - /** - * Get the crop's world. - * @deprecated This method causes a MethodNotFoundException in a obfuscated environment. - * Use {@link #getWorldObj()} instead - * - * @return Crop world - */ - @Deprecated - public World getWorld(); - - /** - * Get the crop's location. - * @deprecated Use {@link #getPosition()} instead. - * - * @return Crop location - */ - @Deprecated - public BlockPos getLocation(); - - /** - * Get the crop's light level. - * - * @return Crop light level - */ - public int getLightLevel(); - - /** - * Pick the crop, removing and giving seeds for the plant. - * - * @return true if successfully picked - */ - public boolean pick(); - - /** - * Harvest the crop, turning it into gain and resetting its size. - * drop output on ground - */ - public boolean performManualHarvest(); - - /** - * Harvest the crop, turning it into gain and resetting its size. - * drop output on ground - * @return List of harvest output - */ - - public List performHarvest(); - - /** - * Fully clears the crop without dropping anything. - */ - public void reset(); - - /** - * Request a texture and lighting update. - */ - public void updateState(); - - /** - * Check if a block is under the farmland containing the crop. - * Searches up to 4 blocks below the farmland or an air space, whichever appears first. - * - * @param block block to search - * @return Whether the block was found - */ - public boolean isBlockBelow(Block block); - - /** - * Check if a block is under the farmland containing the crop. - * Searches up to 4 blocks below the farmland or an air space, whichever appears first. - * - * @param oreDictionaryName blocks to search - * @return Whether the blocks were found - */ - public boolean isBlockBelow(String oreDictionaryName); - - /** - * Generate plant seeds with the given parameters. - * - * @param crop plant - * @param growth plant growth stat - * @param gain plant gain stat - * @param resistance plant resistance stat - * @param scan plant scan level - * @return Plant seed item - */ - public ItemStack generateSeeds(CropCard crop, int growth, int gain, int resistance, int scan); -} diff --git a/src/api/java/ic2/api/energy/EnergyNet.class b/src/api/java/ic2/api/energy/EnergyNet.class deleted file mode 100644 index 197104654..000000000 Binary files a/src/api/java/ic2/api/energy/EnergyNet.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/EnergyNet.java b/src/api/java/ic2/api/energy/EnergyNet.java deleted file mode 100644 index 822bfc297..000000000 --- a/src/api/java/ic2/api/energy/EnergyNet.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api.energy; - - -/** - * Provides access to the energy network. - * - * The old EnergyNet methods missing in IEnergyNet have been migrated to events (load, unload) or - * removed (tiles no longer emit energy actively, the energy net implementation requests it). - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public final class EnergyNet { - /** - * Instance of the global EnergyNet class. - */ - public static IEnergyNet instance; -} - diff --git a/src/api/java/ic2/api/energy/IEnergyNet.class b/src/api/java/ic2/api/energy/IEnergyNet.class deleted file mode 100644 index 7c4869363..000000000 Binary files a/src/api/java/ic2/api/energy/IEnergyNet.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/IEnergyNet.java b/src/api/java/ic2/api/energy/IEnergyNet.java deleted file mode 100644 index 4c79aa746..000000000 --- a/src/api/java/ic2/api/energy/IEnergyNet.java +++ /dev/null @@ -1,90 +0,0 @@ -package ic2.api.energy; - -import java.io.PrintStream; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import ic2.api.energy.tile.IEnergyTile; -import ic2.api.info.ILocatable; - -/** - * Interface representing the methods provided by the global EnergyNet class. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyNet { - /** - * Get the EnergyNet-registered tile for the specified position. - * - * The returned tile is always the main tile implementing IEnergySource/-Sink/-Conductor, which - * is also what was registered to the energy net. - * - * For multi-blocks (IMetaDelegate) the connectivity handling is being done by sub tiles that - * may or may not include the main tile. Sub tiles have to be queried separately through the - * getSubTile method. - * - * As a consequence of always returning the main tile, the supplied position may not match the - * returned tile's position. - * - * Connectivity checking -> IEnergyEmitter/IEnergyAcceptor -> getSubTile - * Logic like energy I/O -> IEnergySource/IEnergySink/IEnergyConductor -> getTile - * - * @param world World containing the tile - * @param pos position - * @return main tile for the specified position or null if none is registered - */ - IEnergyTile getTile(World world, BlockPos pos); - - /** - * Get the sub tile at the specified position. - * - * See the description of {@link #getTile} about whether getTile or getSubTile is applicable. - * - * @param world World containing the tile - * @param pos position - * @return sub tile at the specified position or null if none is registered - */ - IEnergyTile getSubTile(World world, BlockPos pos); - - void addTile(T tile); - void addTile(T tile); - - void removeTile(IEnergyTile tile); - - World getWorld(IEnergyTile tile); - - BlockPos getPos(IEnergyTile tile); - - /** - * Retrieve statistics for the tile entity specified. - * - * The statistics apply to the last simulated tick. - * - * @param tile Tile entity to check. - * @return Statistics for the tile entity. - */ - NodeStats getNodeStats(IEnergyTile tile); - - boolean dumpDebugInfo(World world, BlockPos pos, PrintStream console, PrintStream chat); - - /** - * Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2. - * - * @param tier tier - * @return power in eu/t - */ - double getPowerFromTier(int tier); - - /** - * Determine minimum tier required to handle the specified power, e.g. tier 2 for 128 eu/t. - * - * @param power in eu/t - * @return tier - */ - int getTierFromPower(double power); - - void registerEventReceiver(IEnergyNetEventReceiver receiver); - void unregisterEventReceiver(IEnergyNetEventReceiver receiver); -} diff --git a/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.class b/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.class deleted file mode 100644 index c39d5b09a..000000000 Binary files a/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.java b/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.java deleted file mode 100644 index 420eb10ff..000000000 --- a/src/api/java/ic2/api/energy/IEnergyNetEventReceiver.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.energy; - -import ic2.api.energy.tile.IEnergyTile; - -/** - * Interface for handlers being invoked after energy net changes. - * - *

Normally it's enough to listen for the neighbor update, which also happens, but using this - * mechanism allows listening to events that are not adjacent. Mechanisms that inject energy over - * a distance or provide compatibility with 3rd party energy may benefit from it. - * - *

The events will be fired after validation and only for successful changes. - * - *

WARNING: The events may (and will) be invoked from arbitrary threads. It's up to the - * implementation of IEnergyNetEventReceiver to properly synchronize them. - */ -public interface IEnergyNetEventReceiver { - void onAdd(IEnergyTile tile); - void onRemove(IEnergyTile tile); -} diff --git a/src/api/java/ic2/api/energy/NodeStats.class b/src/api/java/ic2/api/energy/NodeStats.class deleted file mode 100644 index eceb34029..000000000 Binary files a/src/api/java/ic2/api/energy/NodeStats.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/NodeStats.java b/src/api/java/ic2/api/energy/NodeStats.java deleted file mode 100644 index db33da7df..000000000 --- a/src/api/java/ic2/api/energy/NodeStats.java +++ /dev/null @@ -1,25 +0,0 @@ -package ic2.api.energy; - -public class NodeStats { - public NodeStats(double energyIn, double energyOut, double voltage) { - this.energyIn = energyIn; - this.energyOut = energyOut; - this.voltage = voltage; - } - - public double getEnergyIn() { - return energyIn; - } - - public double getEnergyOut() { - return energyOut; - } - - public double getVoltage() { - return voltage; - } - - protected double energyIn; - protected double energyOut; - protected double voltage; -} diff --git a/src/api/java/ic2/api/energy/event/EnergyTileEvent.class b/src/api/java/ic2/api/energy/event/EnergyTileEvent.class deleted file mode 100644 index 5d1523da6..000000000 Binary files a/src/api/java/ic2/api/energy/event/EnergyTileEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/event/EnergyTileEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileEvent.java deleted file mode 100644 index 2bb1ac960..000000000 --- a/src/api/java/ic2/api/energy/event/EnergyTileEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -package ic2.api.energy.event; - -import net.minecraftforge.event.world.WorldEvent; - -import ic2.api.energy.EnergyNet; -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 EnergyTileEvent(IEnergyTile tile) { - super(EnergyNet.instance.getWorld(tile)); - - if (getWorld() == null) throw new NullPointerException("world is null"); - - this.tile = tile; - } - - public final IEnergyTile tile; -} - diff --git a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.class b/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.class deleted file mode 100644 index 9ccd40e3e..000000000 Binary files a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java deleted file mode 100644 index bf019ae34..000000000 --- a/src/api/java/ic2/api/energy/event/EnergyTileLoadEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package ic2.api.energy.event; - -import ic2.api.energy.tile.IEnergyTile; - -/** - * Event announcing new energy tiles. - * - * This event notifies subscribers of loaded energy tiles, e.g. after getting - * loaded through the chunk they are in or after being placed down by the - * player or another deployer mechanism. - * - * Every energy tile which wants to get connected to the IC2 Energy Network has - * to either post this event or alternatively call EnergyNet.addTileEntity(). - * - * You may use this event to build a static representation of energy tiles for - * your own energy grid implementation if you need to. It's not required if you - * always lookup energy paths on demand. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public class EnergyTileLoadEvent extends EnergyTileEvent { - public EnergyTileLoadEvent(IEnergyTile energyTile1) { - super(energyTile1); - } -} - diff --git a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.class b/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.class deleted file mode 100644 index f5e53ae50..000000000 Binary files a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java b/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java deleted file mode 100644 index 2b22ae31c..000000000 --- a/src/api/java/ic2/api/energy/event/EnergyTileUnloadEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -package ic2.api.energy.event; - -import ic2.api.energy.tile.IEnergyTile; - -/** - * Event announcing terminated energy tiles. - * - * This event notifies subscribers of unloaded energy tiles, e.g. after getting - * unloaded through the chunk they are in or after being destroyed by the - * player or another block pick/destruction mechanism. - * - * Every energy tile which wants to get disconnected from the IC2 Energy - * Network has to either post this event or alternatively call - * EnergyNet.removeTileEntity(). - * - * You may use this event to build a static representation of energy tiles for - * your own energy grid implementation if you need to. It's not required if you - * always lookup energy paths on demand. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public class EnergyTileUnloadEvent extends EnergyTileEvent { - public EnergyTileUnloadEvent(IEnergyTile energyTile1) { - super(energyTile1); - } -} - diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Sink.class b/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Sink.class deleted file mode 100644 index 566fb3c53..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Sink.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Source.class b/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Source.class deleted file mode 100644 index 69a0e5df6..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe$Source.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.class b/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.class deleted file mode 100644 index c94b587ce..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.java b/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.java deleted file mode 100644 index 6bd775a65..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicEnergyTe.java +++ /dev/null @@ -1,104 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -/** - * BasicEnergyTe.Sink and BasicEnergyTe.Source allow integrating tile entities into the energy net - * by using them as the super class. - * - *

They implement the necessary forwards to make BasicSink/BasicSource work, provided the sub - * classes always call those forwards when overriding them. - * - *

If it's not desirable to use BasicEnergyTe, the delegates like BasicSink can also be used - * directly, provided they receive the forwards like implemented here. - * - *

Example usage, machine with 10k EU buffer, tier 2, 50 EU/tick, 100 tick process time: - *


- * public class MyMachine extends BasicEnergyTe.Sink implements ITickable {
- *     public MyMachine() {
- *         super(10000, 2);
- *     }
- *
- *     {@literal @}Override
- *     public void readFromNBT(NBTTagCompound nbt) {
- *         super.readFromNbt(nbt); // important: keep super call
- *
- *         this.progess = nbt.getInteger("progress");
- *     }
- *
- *     {@literal @}Override
- *     public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
- *         nbt = super.writeToNBT(nbt); // important: keep super call
- *
- *         nbt.setInteger("progress", progress);
- *
- *         return nbt;
- *     }
- *
- *     {@literal @}Override
- *     public void update() {
- *         if (hasWork() && getEnergyBuffer().useEnergy(50) && ++progress >= 100) {
- *             progress = 0;
- *             doWork();
- *         }
- *     }
- *
- *     private int progress;
- * }
- * 
- */ -public class BasicEnergyTe extends TileEntity { - public static class Sink extends BasicEnergyTe { - public Sink(int capacity, int tier) { - energyBuffer = new BasicSink(this, capacity, tier); - } - } - - public static class Source extends BasicEnergyTe { - public Source(int capacity, int tier) { - energyBuffer = new BasicSource(this, capacity, tier); - } - } - - protected BasicEnergyTe() { } - - public T getEnergyBuffer() { - return energyBuffer; - } - - // forwards >> - - @Override - public void onLoad() { - energyBuffer.onLoad(); - } - - @Override - public void invalidate() { - super.invalidate(); - - energyBuffer.invalidate(); - } - - @Override - public void onChunkUnload() { - energyBuffer.onChunkUnload(); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - - energyBuffer.readFromNBT(nbt); - } - - @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbt) { - return energyBuffer.writeToNBT(super.writeToNBT(nbt)); - } - - // << forwards - - protected T energyBuffer; -} diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.class b/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.class deleted file mode 100644 index 66d017eef..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.java b/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.java deleted file mode 100644 index fc913bafe..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicEnergyTile.java +++ /dev/null @@ -1,309 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.common.MinecraftForge; - -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergyTile; -import ic2.api.info.ILocatable; -import ic2.api.info.Info; -import ic2.api.item.ElectricItem; - -/** - * Common functionality for BasicSink and BasicSource. - */ -abstract class BasicEnergyTile implements ILocatable, IEnergyTile { - // ********************************** - // *** Methods for use by the mod *** - // ********************************** - - /** - * Constructor for a new BasicSink delegate. - * - * @param parent TileEntity represented by this energy sink. - * @param capacity Maximum amount of eu to store. - * @param tier IC2 tier, 1 = LV, 2 = MV, ... - */ - protected BasicEnergyTile(TileEntity parent, double capacity) { - this((Object) parent, capacity); - } - - protected BasicEnergyTile(ILocatable parent, double capacity) { - this((Object) parent, capacity); - } - - private BasicEnergyTile(Object locationProvider, double capacity) { - this.locationProvider = locationProvider; - this.capacity = capacity; - } - - protected BasicEnergyTile(World world, BlockPos pos, double capacity) { - if (world == null) throw new NullPointerException("null world"); - if (pos == null) throw new NullPointerException("null pos"); - - this.locationProvider = null; - this.world = world; - this.pos = pos; - this.capacity = capacity; - } - - // in-world te forwards >> - - /** - * Forward for the base TileEntity's update(), used for creating the energy net link. - * Either update or onLoad have to be used. - */ - public void update() { - if (!addedToEnet) onLoad(); - } - - /** - * Notification that the base TileEntity is loaded, used for creating the energy net link. - * Either update or onLoad have to be used. - */ - public void onLoad() { - if (!addedToEnet - && !getWorldObj().isRemote - && Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - - addedToEnet = true; - } - } - - /** - * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - public void invalidate() { - onChunkUnload(); - } - - /** - * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - public void onChunkUnload() { - if (addedToEnet - && !getWorldObj().isRemote - && Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - - addedToEnet = false; - } - } - - /** - * Forward for the base TileEntity's readFromNBT(), used for loading the state. - * - * @param tag Compound tag as supplied by TileEntity.readFromNBT() - */ - public void readFromNBT(NBTTagCompound tag) { - NBTTagCompound data = tag.getCompoundTag(getNbtTagName()); - energyStored = data.getDouble("energy"); - } - - /** - * Forward for the base TileEntity's writeToNBT(), used for saving the state. - * - * @param tag Compound tag as supplied by TileEntity.writeToNBT() - */ - public NBTTagCompound writeToNBT(NBTTagCompound tag) { - NBTTagCompound data = new NBTTagCompound(); - - data.setDouble("energy", energyStored); - tag.setTag(getNbtTagName(), data); - - return tag; - } - - // << in-world te forwards - // methods for using this adapter >> - - /** - * Get the maximum amount of energy this sink can hold in its buffer. - * - * @return Capacity in EU. - */ - public double getCapacity() { - return capacity; - } - - /** - * Set the maximum amount of energy this sink can hold in its buffer. - * - * @param capacity1 Capacity in EU. - */ - public void setCapacity(double capacity) { - this.capacity = capacity; - } - - /** - * Determine the energy stored in this buffer. - * - * @return amount in EU, may be above capacity - */ - public double getEnergyStored() { - return energyStored; - } - - /** - * Set the stored energy to the specified amount. - * - * This is intended for server -> client synchronization, e.g. to display the stored energy in - * a GUI through getEnergyStored(). - * - * @param amount - */ - public void setEnergyStored(double amount) { - energyStored = amount; - } - - /** - * Determine the free capacity in this buffer. - * - * @return amount in EU - */ - public double getFreeCapacity() { - return capacity - energyStored; - } - - /** - * Add some energy to the output buffer. - * - * @param amount maximum amount of energy to add - * @return amount added/used, NOT remaining - */ - public double addEnergy(double amount) { - if (getWorldObj().isRemote) return 0; - if (amount > capacity - energyStored) amount = capacity - energyStored; - - energyStored += amount; - - return amount; - } - - /** - * Determine if the specified amount of energy is available. - * - * @param amount in EU - * @return true if the amount is available - */ - public boolean canUseEnergy(double amount) { - return energyStored >= amount; - } - - /** - * Use the specified amount of energy, if available. - * - * @param amount amount to use - * @return true if the amount was available - */ - public boolean useEnergy(double amount) { - if (!canUseEnergy(amount) || getWorldObj().isRemote) return false; - - energyStored -= amount; - - return true; - } - - /** - * Charge the supplied ItemStack from this energy buffer. - * - * @param stack ItemStack to charge (null is ignored) - * @return true if energy was transferred - */ - public boolean charge(ItemStack stack) { - if (stack == null || !Info.isIc2Available() || getWorldObj().isRemote) return false; - - double amount = ElectricItem.manager.charge(stack, energyStored, Math.max(getSinkTier(), getSourceTier()), false, false); - - energyStored -= amount; - - return amount > 0; - } - - /** - * Discharge the supplied ItemStack into this energy buffer. - * - * @param stack ItemStack to discharge (null is ignored) - * @param limit Transfer limit, values <= 0 will use the battery's limit - * @return true if energy was transferred - */ - public boolean discharge(ItemStack stack, double limit) { - if (stack == null || !Info.isIc2Available() || getWorldObj().isRemote) return false; - - double amount = capacity - energyStored; - if (amount <= 0) return false; - - if (limit > 0 && limit < amount) amount = limit; - - amount = ElectricItem.manager.discharge(stack, amount, Math.max(getSinkTier(), getSourceTier()), limit > 0, true, false); - - energyStored += amount; - - return amount > 0; - } - - // << methods for using this adapter - - // ****************************** - // *** Methods for use by ic2 *** - // ****************************** - - // ILocatable >> - - @Override - public World getWorldObj() { - if (world == null) initLocation(); - - return world; - } - - @Override - public BlockPos getPosition() { - if (pos == null) initLocation(); - - return pos; - } - - private void initLocation() { - if (locationProvider instanceof ILocatable) { - ILocatable provider = (ILocatable) locationProvider; - world = provider.getWorldObj(); - pos = provider.getPosition(); - } else if (locationProvider instanceof TileEntity) { - TileEntity provider = (TileEntity) locationProvider; - world = provider.getWorld(); - pos = provider.getPos(); - } else { - throw new IllegalStateException("no/incompatible location provider"); - } - } - - // << ILocatable - - protected abstract String getNbtTagName(); - - protected int getSinkTier() { - return 0; - } - - protected int getSourceTier() { - return 0; - } - - private final Object locationProvider; - protected World world; - protected BlockPos pos; - - protected double capacity; - protected double energyStored; - protected boolean addedToEnet; -} diff --git a/src/api/java/ic2/api/energy/prefab/BasicSink.class b/src/api/java/ic2/api/energy/prefab/BasicSink.class deleted file mode 100644 index 6615ef962..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicSink.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicSink.java b/src/api/java/ic2/api/energy/prefab/BasicSink.java deleted file mode 100644 index 46c27d814..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSink.java +++ /dev/null @@ -1,163 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import ic2.api.energy.tile.IEnergyEmitter; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.info.ILocatable; - -/** - * BasicSink is a simple delegate to provide an ic2 energy sink. - * - *

It's designed to be attached to a tile entity as a delegate. Functionally BasicSink acts as a - * one-time configurable input energy buffer, thus providing a common use case for machines. - * - *

A simpler alternative is to use {@link BasicSinkTe.Sink}, which requires injecting into the - * type hierarchy (using it as a super class). BasicSink however can be added to any class without - * inheritance, but needs some forwards for keeping its state and registering with the energy net. - * - *

The constraints set by BasicSink like the strict tank-like energy buffering should provide a - * more easy to use and stable interface than using IEnergySink directly while aiming for - * optimal performance. - * - *

Using BasicSink involves the following steps:

    - *
  • create a BasicSink instance in your TileEntity, typically in a field - *
  • forward onLoad (or update), invalidate, onChunkUnload, readFromNBT and writeToNBT to the BasicSink - * instance. - *
  • call useEnergy whenever appropriate. canUseEnergy determines if enough energy is available - * without consuming the energy. - *
  • optionally use getEnergyStored to display the output buffer charge level - *
  • optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container)
- * - *

Example implementation code: - *


- * public class SomeTileEntity extends TileEntity {
- *     // new basic energy sink, 1000 EU buffer, tier 1 (32 EU/t, LV)
- *     private BasicSink ic2EnergySink = new BasicSink(this, 1000, 1);
- *
- *     {@literal @}Override
- *     public void onLoad() {
- *         ic2EnergySink.onLoad(); // notify the energy sink
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void invalidate() {
- *         ic2EnergySink.invalidate(); // notify the energy sink
- *         ...
- *         super.invalidate(); // this is important for mc!
- *     }
- *
- *     {@literal @}Override
- *     public void onChunkUnload() {
- *         ic2EnergySink.onChunkUnload(); // notify the energy sink
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void readFromNBT(NBTTagCompound tag) {
- *         super.readFromNBT(tag);
- *
- *         ic2EnergySink.readFromNBT(tag);
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void writeToNBT(NBTTagCompound tag) {
- *         super.writeToNBT(tag);
- *
- *         ic2EnergySink.writeToNBT(tag);
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void update() {
- *         if (ic2EnergySink.useEnergy(5)) { // use 5 eu from the sink's buffer this tick
- *             ... // do something with the energy
- *         }
- *         ...
- *     }
- *
- *     ...
- * }
- * 
- */ -public class BasicSink extends BasicEnergyTile implements IEnergySink { - /** - * Constructor for a new BasicSink delegate. - * - * @param parent TileEntity represented by this energy sink. - * @param capacity Maximum amount of eu to store. - * @param tier IC2 tier, 1 = LV, 2 = MV, ... - */ - public BasicSink(TileEntity parent, double capacity, int tier) { - super(parent, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - } - - public BasicSink(ILocatable parent, double capacity, int tier) { - super(parent, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - } - - public BasicSink(World world, BlockPos pos, double capacity, int tier) { - super(world, pos, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - } - - /** - * Set the IC2 energy tier for this sink. - * - * @param tier IC2 Tier. - */ - public void setSinkTier(int tier) { - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - } - - // energy net interface >> - - @Override - public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { - return true; - } - - @Override - public double getDemandedEnergy() { - return Math.max(0, capacity - energyStored); - } - - @Override - public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) { - energyStored += amount; - - return 0; - } - - @Override - public int getSinkTier() { - return tier; - } - - // << energy net interface - - @Override - protected String getNbtTagName() { - return "IC2BasicSink"; - } - - protected int tier; -} diff --git a/src/api/java/ic2/api/energy/prefab/BasicSinkSource.class b/src/api/java/ic2/api/energy/prefab/BasicSinkSource.class deleted file mode 100644 index 8a313fcf6..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicSinkSource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicSinkSource.java b/src/api/java/ic2/api/energy/prefab/BasicSinkSource.java deleted file mode 100644 index 88e9939cc..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSinkSource.java +++ /dev/null @@ -1,127 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import ic2.api.energy.EnergyNet; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.energy.tile.IEnergySource; -import ic2.api.info.ILocatable; - -/** - * Combination of BasicSink and BasicSource, see their respective documentation for details. - * - *

A subclass still has to implement acceptsEnergyFrom and emitsEnergyTo. - */ -public abstract class BasicSinkSource extends BasicEnergyTile implements IEnergySink, IEnergySource { - public BasicSinkSource(TileEntity parent, double capacity, int sinkTier, int sourceTier) { - super(parent, capacity); - - if (sinkTier < 0) throw new IllegalArgumentException("invalid sink tier: "+sinkTier); - if (sourceTier < 0) throw new IllegalArgumentException("invalid source tier: "+sourceTier); - - this.sinkTier = sinkTier; - this.sourceTier = sourceTier; - double power = EnergyNet.instance.getPowerFromTier(sourceTier); - - if (getCapacity() < power) setCapacity(power); - } - - public BasicSinkSource(ILocatable parent, double capacity, int sinkTier, int sourceTier) { - super(parent, capacity); - - if (sinkTier < 0) throw new IllegalArgumentException("invalid sink tier: "+sinkTier); - if (sourceTier < 0) throw new IllegalArgumentException("invalid source tier: "+sourceTier); - - this.sinkTier = sinkTier; - this.sourceTier = sourceTier; - double power = EnergyNet.instance.getPowerFromTier(sourceTier); - - if (getCapacity() < power) setCapacity(power); - } - - public BasicSinkSource(World world, BlockPos pos, double capacity, int sinkTier, int sourceTier) { - super(world, pos, capacity); - - if (sinkTier < 0) throw new IllegalArgumentException("invalid sink tier: "+sinkTier); - if (sourceTier < 0) throw new IllegalArgumentException("invalid source tier: "+sourceTier); - - this.sinkTier = sinkTier; - this.sourceTier = sourceTier; - double power = EnergyNet.instance.getPowerFromTier(sourceTier); - - if (getCapacity() < power) setCapacity(power); - } - - /** - * Set the IC2 energy tier for this sink. - * - * @param tier IC2 Tier. - */ - public void setSinkTier(int tier) { - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.sinkTier = tier; - } - - /** - * Set the IC2 energy tier for this source. - * - * @param tier IC2 Tier. - */ - public void setSourceTier(int tier) { - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - double power = EnergyNet.instance.getPowerFromTier(tier); - - if (getCapacity() < power) setCapacity(power); - - this.sourceTier = tier; - } - - // energy net interface >> - - @Override - public double getDemandedEnergy() { - return Math.max(0, capacity - energyStored); - } - - @Override - public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) { - energyStored += amount; - - return 0; - } - - @Override - public int getSinkTier() { - return sinkTier; - } - - @Override - public double getOfferedEnergy() { - return energyStored; - } - - @Override - public void drawEnergy(double amount) { - energyStored -= amount; - } - - @Override - public int getSourceTier() { - return sourceTier; - } - - // << energy net interface - - @Override - protected String getNbtTagName() { - return "IC2BasicSinkSource"; - } - - protected int sinkTier; - protected int sourceTier; -} diff --git a/src/api/java/ic2/api/energy/prefab/BasicSource.class b/src/api/java/ic2/api/energy/prefab/BasicSource.class deleted file mode 100644 index fb1c81ef4..000000000 Binary files a/src/api/java/ic2/api/energy/prefab/BasicSource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/prefab/BasicSource.java b/src/api/java/ic2/api/energy/prefab/BasicSource.java deleted file mode 100644 index dde127fa6..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSource.java +++ /dev/null @@ -1,173 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import ic2.api.energy.EnergyNet; -import ic2.api.energy.tile.IEnergyAcceptor; -import ic2.api.energy.tile.IEnergySource; -import ic2.api.info.ILocatable; - -/** - * BasicSource is a simple delegate to add an ic2 energy source. - * - *

It's designed to be attached to a tile entity as a delegate. Functionally BasicSource acts as a - * one-time configurable output energy buffer, thus providing a common use case for generators. - * - *

A simpler alternative is to use {@link BasicSinkTe.Source}, which requires injecting into the - * type hierarchy (using it as a super class). BasicSource however can be added to any class without - * inheritance, but needs some forwards for keeping its state and registering with the energy net. - * - *

The constraints set by BasicSource like the strict tank-like energy buffering should provide a - * more easy to use and stable interface than using IEnergySource directly while aiming for - * optimal performance. - * - *

Using BasicSource involves the following steps:

    - *
  • create a BasicSource instance in your TileEntity, typically in a field - *
  • forward onLoad (or update), invalidate, onChunkUnload, readFromNBT ans writeToNBT to the BasicSource - * instance. - *
  • call addEnergy whenever appropriate, using getFreeCapacity may determine if e.g. the generator - * should run - *
  • optionally use getEnergyStored to display the output buffer charge level - *
  • optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container)
- * - *

Example implementation code: - *


- * public class SomeTileEntity extends TileEntity {
- *     // new basic energy source, 1000 EU buffer, tier 1 (32 EU/t, LV)
- *     private BasicSource ic2EnergySource = new BasicSource(this, 1000, 1);
- *
- *     {@literal @}Override
- *     public void onLoad() {
- *         ic2EnergySource.onLoad(); // notify the energy source
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void invalidate() {
- *         ic2EnergySource.invalidate(); // notify the energy source
- *         ...
- *         super.invalidate(); // this is important for mc!
- *     }
- *
- *     {@literal @}Override
- *     public void onChunkUnload() {
- *         ic2EnergySource.onChunkUnload(); // notify the energy source
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void readFromNBT(NBTTagCompound tag) {
- *         super.readFromNBT(tag);
- *
- *         ic2EnergySource.readFromNBT(tag);
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void writeToNBT(NBTTagCompound tag) {
- *         super.writeToNBT(tag);
- *
- *         ic2EnergySource.writeToNBT(tag);
- *         ...
- *     }
- *
- *     {@literal @}Override
- *     public void update() {
- *         ic2EnergySource.addEnergy(5); // add 5 eu to the source's buffer this tick
- *         ...
- *     }
- *
- *     ...
- * }
- * 
- */ -public class BasicSource extends BasicEnergyTile implements IEnergySource { - /** - * Constructor for a new BasicSource delegate. - * - * @param parent1 Base TileEntity represented by this energy source. - * @param capacity1 Maximum amount of eu to store. - * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... - */ - public BasicSource(TileEntity parent, double capacity, int tier) { - super(parent, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - double power = EnergyNet.instance.getPowerFromTier(tier); - - if (getCapacity() < power) setCapacity(power); - } - - public BasicSource(ILocatable parent, double capacity, int tier) { - super(parent, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - double power = EnergyNet.instance.getPowerFromTier(tier); - - if (getCapacity() < power) setCapacity(power); - } - - public BasicSource(World world, BlockPos pos, double capacity, int tier) { - super(world, pos, capacity); - - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - this.tier = tier; - double power = EnergyNet.instance.getPowerFromTier(tier); - - if (getCapacity() < power) setCapacity(power); - } - - /** - * Set the IC2 energy tier for this source. - * - * @param tier1 IC2 Tier. - */ - public void setSourceTier(int tier) { - if (tier < 0) throw new IllegalArgumentException("invalid tier: "+tier); - - double power = EnergyNet.instance.getPowerFromTier(tier); - - if (getCapacity() < power) setCapacity(power); - - this.tier = tier; - } - - // energy net interface >> - - @Override - public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { - return true; - } - - @Override - public double getOfferedEnergy() { - return energyStored; - } - - @Override - public void drawEnergy(double amount) { - energyStored -= amount; - } - - @Override - public int getSourceTier() { - return tier; - } - - // << energy net interface - - @Override - protected String getNbtTagName() { - return "IC2BasicSource"; - } - - protected int tier; -} diff --git a/src/api/java/ic2/api/energy/tile/IChargingSlot.class b/src/api/java/ic2/api/energy/tile/IChargingSlot.class deleted file mode 100644 index 761910731..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IChargingSlot.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IChargingSlot.java b/src/api/java/ic2/api/energy/tile/IChargingSlot.java deleted file mode 100644 index 2238326ea..000000000 --- a/src/api/java/ic2/api/energy/tile/IChargingSlot.java +++ /dev/null @@ -1,16 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Represents a slot (or set of slots) that can have electric items in them to be charged - * - * @author Chocohead - */ -public interface IChargingSlot { - /** - * Called when the energy component is ticked to fill the slots - * - * @param amount The amount of energy available for the slot(s) - * @return The amount of energy used charging the items in the slot(s) - */ - public double charge(double amount); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.class b/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.class deleted file mode 100644 index b364517df..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.java b/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.java deleted file mode 100644 index 2ad9c42c8..000000000 --- a/src/api/java/ic2/api/energy/tile/IColoredEnergyTile.java +++ /dev/null @@ -1,21 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.EnumFacing; - -/** - * Interface, that allows Blocks to be colored and have their connectivity based on that color. - * This allows for any Energy Tile to be colored. (Conductors, Sinks, Sources) - * @author Aroma1997 - */ -public interface IColoredEnergyTile extends IEnergyTile { - - /** - * This is to get a Energy Tile's color for the given side. Mainly used for checking connectivity. - * @param side The side you want to get the color from. - * @return The color of the Energy Tile at the given side or null, if it's uncolored. - */ - EnumDyeColor getColor(EnumFacing side); - - -} diff --git a/src/api/java/ic2/api/energy/tile/IDischargingSlot.class b/src/api/java/ic2/api/energy/tile/IDischargingSlot.class deleted file mode 100644 index 06518bd86..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IDischargingSlot.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IDischargingSlot.java b/src/api/java/ic2/api/energy/tile/IDischargingSlot.java deleted file mode 100644 index 64ea69bd8..000000000 --- a/src/api/java/ic2/api/energy/tile/IDischargingSlot.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Represents a slot (or set of slots) that can have electric items in them to be discharged - * - * @author Chocohead - */ -public interface IDischargingSlot { - /** - * Called when the energy component is ticked to empty the slots - * - * @param space The amount of free space for energy that can be stored - * @param ignoreLimit Whether to ignore the discharge limit of the item in the slot(s) - * @return The amount of energy discharged from the items in the slot(s) - */ - public double discharge(double space, boolean ignoreLimit); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.class b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.class deleted file mode 100644 index 5347aea0c..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java deleted file mode 100644 index 652330116..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java +++ /dev/null @@ -1,25 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.util.EnumFacing; - -/** - * For internal/multi-block usage only. - * - * @see IEnergySink - * @see IEnergyConductor - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyAcceptor extends IEnergyTile { - /** - * Determine if this acceptor can accept current from an adjacent emitter in a direction. - * - * The TileEntity in the emitter parameter is what was originally added to the energy net, - * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. - * - * @param emitter energy emitter, may also be null or an IMetaDelegate - * @param side side the energy is being received from - */ - boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing side); -} - diff --git a/src/api/java/ic2/api/energy/tile/IEnergyConductor.class b/src/api/java/ic2/api/energy/tile/IEnergyConductor.class deleted file mode 100644 index 4b2c8f5af..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergyConductor.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergyConductor.java b/src/api/java/ic2/api/energy/tile/IEnergyConductor.java deleted file mode 100644 index 08dab8896..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergyConductor.java +++ /dev/null @@ -1,53 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Tile entities which conduct energy pulses without buffering (mostly cables) have to implement this - * interface. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter { - /** - * Energy loss for the conductor in EU per block. - * - * @return Energy loss - */ - double getConductionLoss(); - - /** - * Amount of energy the insulation will handle before shocking nearby players and mobs. - * - * @return Insulation energy absorption in EU - */ - double getInsulationEnergyAbsorption(); - - /** - * Amount of energy the insulation will handle before it is destroyed. - * Ensure that this value is greater than the insulation energy absorption + 64. - * - * @return Insulation-destroying energy in EU - */ - double getInsulationBreakdownEnergy(); - - /** - * Amount of energy the conductor will handle before it melts. - * - * @return Conductor-destroying energy in EU - */ - double getConductorBreakdownEnergy(); - - /** - * Remove the conductor's insulation if the insulation breakdown energy was exceeded. - * - * @see #getInsulationBreakdownEnergy() - */ - void removeInsulation(); - - /** - * Remove the conductor if the conductor breakdown energy was exceeded. - * - * @see #getConductorBreakdownEnergy() - */ - void removeConductor(); -} - diff --git a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.class b/src/api/java/ic2/api/energy/tile/IEnergyEmitter.class deleted file mode 100644 index a7394c855..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java b/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java deleted file mode 100644 index 10fbeabe5..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.java +++ /dev/null @@ -1,26 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.util.EnumFacing; - -/** - * For internal/multi-block usage only. - * - * @see IEnergySource - * @see IEnergyConductor - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyEmitter extends IEnergyTile { - /** - * Determine if this emitter can emit energy to an adjacent receiver. - * - * The TileEntity in the receiver parameter is what was originally added to the energy net, - * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. - * - * @param receiver receiver, may also be null or an IMetaDelegate - * @param side side the energy is to be sent to - * @return Whether energy should be emitted - */ - boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side); -} - diff --git a/src/api/java/ic2/api/energy/tile/IEnergySink.class b/src/api/java/ic2/api/energy/tile/IEnergySink.class deleted file mode 100644 index 0ca533026..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergySink.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergySink.java b/src/api/java/ic2/api/energy/tile/IEnergySink.java deleted file mode 100644 index 827425467..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergySink.java +++ /dev/null @@ -1,45 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.util.EnumFacing; - -/** - * Allows a tile entity (mostly a machine) to receive energy. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergySink extends IEnergyAcceptor { - /** - * Determine how much energy the sink accepts. - * - * Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0. - * - * @note Modifying the energy net from this method is disallowed. - * - * @return max accepted input in eu - */ - double getDemandedEnergy(); - - /** - * Determine the tier of this energy sink. - * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. - * - * @note Modifying the energy net from this method is disallowed. - * @note Return Integer.MAX_VALUE to allow any voltage. - * - * @return tier of this energy sink - */ - int getSinkTier(); - - /** - * Transfer energy to the sink. - * - * It's highly recommended to accept all energy by letting the internal buffer overflow to - * increase the performance and accuracy of the distribution simulation. - * - * @param directionFrom direction from which the energy comes from - * @param amount energy to be transferred - * @return Energy not consumed (leftover) - */ - double injectEnergy(EnumFacing directionFrom, double amount, double voltage); -} - diff --git a/src/api/java/ic2/api/energy/tile/IEnergySource.class b/src/api/java/ic2/api/energy/tile/IEnergySource.class deleted file mode 100644 index 41ca6cff4..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergySource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergySource.java b/src/api/java/ic2/api/energy/tile/IEnergySource.java deleted file mode 100644 index 03c1ebd0f..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergySource.java +++ /dev/null @@ -1,40 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Allows a tile entity (mostly a generator) to emit energy. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergySource extends IEnergyEmitter { - /** - * Maximum energy output provided by the source this tick, typically the stored energy. - * - *

The value will be limited to the source tier's power multiplied with the packet count - * (see {@link IMultiEnergySource}, default 1). - * - * @note Modifying the energy net from this method is disallowed. - * - * @return Energy offered this tick - */ - double getOfferedEnergy(); - - /** - * Draw energy from this source's buffer. - * - *

If the source doesn't have a buffer, this may be a no-op. - * - * @param amount amount of EU to draw, may be negative - */ - void drawEnergy(double amount); - - /** - * Determine the tier of this energy source. - * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. - * - * @note Modifying the energy net from this method is disallowed. - * - * @return tier of this energy source - */ - int getSourceTier(); -} - diff --git a/src/api/java/ic2/api/energy/tile/IEnergyTile.class b/src/api/java/ic2/api/energy/tile/IEnergyTile.class deleted file mode 100644 index 087633b0f..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IEnergyTile.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IEnergyTile.java b/src/api/java/ic2/api/energy/tile/IEnergyTile.java deleted file mode 100644 index 3938190a4..000000000 --- a/src/api/java/ic2/api/energy/tile/IEnergyTile.java +++ /dev/null @@ -1,15 +0,0 @@ -package ic2.api.energy.tile; - -/** - * For internal usage only, base class for all energy tiles. - * - * @see IEnergySink - * @see IEnergySource - * @see IEnergyConductor - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyTile { - // -} - diff --git a/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.class b/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.class deleted file mode 100644 index e478add70..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.java b/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.java deleted file mode 100644 index 02144e4f1..000000000 --- a/src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.java +++ /dev/null @@ -1,25 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Implement with an {@link IEnergySink} tile entity to change the force of the explosion when overpowered. - */ -public interface IExplosionPowerOverride { - - /** - * Checks if the electric tile should explode. If you return false here, - * the explosion will just not happen at all and the block will stay. - * This is NOT recommended. - * @return Whether the block should explode. - * - * @note It should not be dependent on the tier of the power injected, consider {@link IOverloadHandler} if necessary. - */ - boolean shouldExplode(); - - /** - * The explosion force when too much power is received. - * @param tier The tier of power, that was injected into the energy sink, that caused it to explode. - * @param defaultPower The default explosion power. - * @return The explosion power - */ - float getExplosionPower(int tier, float defaultPower); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/IHeatSource.class b/src/api/java/ic2/api/energy/tile/IHeatSource.class deleted file mode 100644 index 34f9e1e6a..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IHeatSource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IHeatSource.java b/src/api/java/ic2/api/energy/tile/IHeatSource.java deleted file mode 100644 index c442d10fd..000000000 --- a/src/api/java/ic2/api/energy/tile/IHeatSource.java +++ /dev/null @@ -1,23 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.util.EnumFacing; - -public interface IHeatSource { - - /* - * Return max heat transmission peer Tick (only theoretical bandwidth not available amount) - */ - int maxrequestHeatTick(EnumFacing directionFrom); - - /* - * @param requested amount of heat to transfer - * - * @return transmitted amount of heat - * - * example: You Request 100 units of heat but the Source have only 50 units left - * - * requestHeat(100) : return 50 : so 50 units of heat remove from HeatSource - */ - - int requestHeat(EnumFacing directionFrom, int requestheat); -} diff --git a/src/api/java/ic2/api/energy/tile/IKineticSource.class b/src/api/java/ic2/api/energy/tile/IKineticSource.class deleted file mode 100644 index 05257b06f..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IKineticSource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IKineticSource.java b/src/api/java/ic2/api/energy/tile/IKineticSource.java deleted file mode 100644 index 37b0226c8..000000000 --- a/src/api/java/ic2/api/energy/tile/IKineticSource.java +++ /dev/null @@ -1,22 +0,0 @@ -package ic2.api.energy.tile; - -import net.minecraft.util.EnumFacing; - -public interface IKineticSource { - /* - * Return max kinetic energy transmission peer Tick (only theoretical bandwidth not available amount) - */ - int maxrequestkineticenergyTick(EnumFacing directionFrom); - - /* - * @param requested amount of kinetic energy to transfer - * - * @return transmitted amount of kineticenergy - * - * example: You Request 100 units of kinetic energy but the Source have only 50 units left - * - * requestkineticenergy(100) : return 50 : so 50 units of kinetic energy remove from KineticSource - */ - - int requestkineticenergy(EnumFacing directionFrom, int requestkineticenergy); -} diff --git a/src/api/java/ic2/api/energy/tile/IMetaDelegate.class b/src/api/java/ic2/api/energy/tile/IMetaDelegate.class deleted file mode 100644 index 16e51c133..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IMetaDelegate.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java b/src/api/java/ic2/api/energy/tile/IMetaDelegate.java deleted file mode 100644 index 1bb9b1e92..000000000 --- a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java +++ /dev/null @@ -1,34 +0,0 @@ -package ic2.api.energy.tile; - -import java.util.List; - -/** - * Interface for grouping multi-block structures to a single energy net delegate. - * - * The energy net uses TileEntity to refer to a specific xyz+world position. If multiple of those - * positions should belong to the same functional structure, i.e. they consume or produce energy - * only once for the whole multi-block instead of once per every single block, this interface - * allows to do so. - * - * The tile entity implementing IMetaDelegate has to be added/removed to/from the energy net - * instead of every single sub-TileEntity. The energy net interaction will be handled by the - * IMetaDelegate TileEntity as well. - * - * The sub tile array TileEntity[] just provides optional connectivity (IEnergyAcceptor, - * IEnergyEmitter) and mandatory position (x, y, z, World) data. - * If the connectivity data on the sub tile is missing, the meta delegate is queried instead. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IMetaDelegate extends IEnergyTile { - /** - * Get the sub-Tiles belonging to this Meta Tile. - * - * @note The list has to be consistent between the EnergyNet Load and Unload events. - * @note The list must have at least 1 element. - * @note The parent tile implementing IMetaDelegate isn't automatically included. - * - * @return sub-Tile array - */ - List getSubTiles(); -} diff --git a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.class b/src/api/java/ic2/api/energy/tile/IMultiEnergySource.class deleted file mode 100644 index 09b4b0f78..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java b/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java deleted file mode 100644 index ef63f1927..000000000 --- a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java +++ /dev/null @@ -1,24 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Allows an {@link IEnergySource} to emit more than one EU packet per tick. - * Note: support for this will be dropped in a future version of IC2. - * @author Aroma1997 - */ -public interface IMultiEnergySource extends IEnergySource -{ - - /** - * If you want your machine to emit more than one EU packets per tick return true here. - * @return if the machine in its current state can emit more than one EU packet per tick. - */ - public boolean sendMultipleEnergyPackets(); - - /** - * If {@link #sendMultipleEnergyPackets()} returned true, this will get called. - * The value returned by this method will determine the amount of EU packets, this machine can emit. - * @return the amount of EU packets, this machine can emit per tick. - */ - public int getMultipleEnergyPacketAmount(); - -} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/IOverloadHandler.class b/src/api/java/ic2/api/energy/tile/IOverloadHandler.class deleted file mode 100644 index 46ed18ca7..000000000 Binary files a/src/api/java/ic2/api/energy/tile/IOverloadHandler.class and /dev/null differ diff --git a/src/api/java/ic2/api/energy/tile/IOverloadHandler.java b/src/api/java/ic2/api/energy/tile/IOverloadHandler.java deleted file mode 100644 index ebaeb9e83..000000000 --- a/src/api/java/ic2/api/energy/tile/IOverloadHandler.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Complete control for when an {@link IEnergySink} is overloaded. - */ -public interface IOverloadHandler { - - /** - * Called when overloaded. This will override the default explosion. - * The default explosion will therefore NOT happen, when you return true here. - * If you return false, you can use this as a onExplode hook, but still let the default explosion happen. - * @note Will set the block to air and cause an explosion of power 2.5 if false is returned - * @param tier The tier of power, that was injected into the energy sink, that caused it to explode. - * @return Whether the default explosion should be cancelled. - */ - boolean onOverload(int tier); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/usage.txt b/src/api/java/ic2/api/energy/usage.txt deleted file mode 100644 index bad72a93d..000000000 --- a/src/api/java/ic2/api/energy/usage.txt +++ /dev/null @@ -1,148 +0,0 @@ --------------------------------- --- Energy Network Description -- --------------------------------- - -There are currently three different types of energy network blocks: -- energy sources, e.g. generators or the output side of a storage block/transformer -- energy sinks, e.g. machines or the input side of a storage block/transformer -- conductors, e.g. cables - -Note that storage blocks or transformers are both sources and sinks. - -All those blocks have to have a tile entity which has to implement the interface corresponding to -its function and also post events to the Forge event bus. - -The energy generation, distribution and consumption is strictly limited to the simulating (server) -side, use the proper side checks before posting the related events. One possibility is to check for -FMLCommonHandler.instance().getEffectiveSide().isClient() being false. - -The energy network works by calculating the energy flow between the sources which offer energy -through getOfferedEnergy() and the sinks which request energy through demandedEnergyUnits(). -Conductors will carry the energy over a distance. Once the energy distribution is calculated, the -energy net will update the sources and sinks through drawEnergy() and injectEnergyUnits() respectively. - - ---------------------------- --- Energy Network Events -- ---------------------------- - -The energy network currently requires 2 events to manage its internal representation of the grids: - --- EnergyTileLoadEvent -- - -For all energy network tiles (sources, sinks, conductors) you have to post an EnergyTileLoadEvent. - -The event has to be posted as soon as the implementing tile entity is fully loaded, usually after -loading the chunk which contains it or after the user placing the block. - -The energy net implementation will use the event to add it to its energy grid map, taking it into -account for further energy transfers. - -You can detect the loading by either using the 1st iteration of update() or by waiting for -the next world tick after TileEntity.validate(). The 2nd approach is obviously more sophisticated -and requires to use some tick queuing mechanism. - -The event can by posted as following: - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - --- EnergyTileUnloadEvent -- - -Another event every energy tile has to post is the EnergyTileUnloadEvent. - -The event has to be posted as soon as the implementing tile entity is being unloaded, either by -unloading the containing chunk or by destroying the block containing it. - -It's possible to detect the unloading by triggering on both the beginning of -TileEntity.invalidate() and the beginning of TileEntity.onChunkUnload(). - -It is important that the tile entity is still properly linked to the world while posting the unload -event, otherwise the energy net can't find all affected connections. - - --------------------------------------- --- Participating Block Requirements -- --------------------------------------- - -The energy net blocks have to do the following to work properly: - --- energy source -- - -An energy source has to post the following events: - - EnergyTileLoadEvent on load - - EnergyTileUnloadEvent on unload - -Additionally the interface IEnergySource has to be implemented. - --- energy sink -- - -An energy sink has to post the following events: - - EnergyTileLoadEvent on load - - EnergyTileUnloadEvent on unload - -Additionally the interface IEnergySink has to be implemented. - --- energy conductor -- - -An energy conductor has to post the following events: - - EnergyTileLoadEvent on load - - EnergyTileUnloadEvent on unload - -Additionally the interface IEnergyConductor has to be implemented. - --- general --- -Optionally, you can implement the interface IColoredEnergyTile, which allows for some basic color-based -connectivity. This can be used for IEnergyConductors, but is not limited to them. - - ------------------------------- --- Energy Network Delegates -- ------------------------------- - -A delegate is a separate object which performs tasks for the original object, in this case handling -the energy net interaction. - -The TileEntity instances used by the events don't have to be the same as the in-world TileEntity -instance for the corresponding position, it can be delegated to a separate TileEntity instance. -This separate instance (delegate) needs to have its world and xyz coordinate fields set to match -the in-world instance. The delegate implements the energy net interfaces and is added and removed -to/from the energy net through EnergyTileLoadEvent and EnergyTileUnloadEvent. - -Separating the interfaces through a delegate allows to isolate the IC2 API usage into separate -classes an potentially share common code like an input buffer with battery discharging outside the -class hierarchy. -It's even possible to use an ic2 energy net delegate alongside an in-world TileEntity which isn't -designed to work with ic2 energy at all, like making a furnace electric by receiving energy through -a delegate and adding the corresponding fuel amount to the in-world furnace TileEntity. - -Getting the in-world TileEntity for a delegate involves calling World.getBlockTileEntity() with the -delegate's world and xyz coordinate information. - - ------------------- --- Multi Blocks -- ------------------- - -Multi blocks are a group of blocks which act as one functional entity. - -The IMetaDelegate interface groups multiple TileEntity instances (=sub tiles) representing the -individual blocks to a single Energy Net relevant node. The sub tiles may be normal in-world or -delegate TileEntity instances. - -The meta delegate is added to energy net once for the whole multi block structure and implements -the energy net interfaces as well. The sub tiles may optionally implement IEnergyEmitter and/or -IEnergyAcceptor to specify their connectivity rules independently, otherwise the meta delegate will -be queried. - - --------------------------------------------------- --- How to implement/add your own energy network -- --------------------------------------------------- - -If you want to create an alternative way of distributing energy, e.g. to have different -distribution rules or to use energy networks provided by other mods, you can register to the energy -tile events and use the interfaces to handle the energy distribution yourself. It's no longer -required to use conversion blocks. - -IC2's EnergyNet itself is built on top of the api events and interfaces, providing their default -use case. - diff --git a/src/api/java/ic2/api/event/ExplosionEvent.class b/src/api/java/ic2/api/event/ExplosionEvent.class deleted file mode 100644 index 59a2f8c0d..000000000 Binary files a/src/api/java/ic2/api/event/ExplosionEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/ExplosionEvent.java b/src/api/java/ic2/api/event/ExplosionEvent.java deleted file mode 100644 index 7d670aa97..000000000 --- a/src/api/java/ic2/api/event/ExplosionEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -package ic2.api.event; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.Cancelable; - -@Cancelable -public class ExplosionEvent extends WorldEvent { - public ExplosionEvent(World world, Entity entity, - Vec3d pos, - double power, - EntityLivingBase igniter, - int radiationRange, double rangeLimit) { - super(world); - - this.entity = entity; - this.pos = pos;; - this.power = power; - this.igniter = igniter; - this.radiationRange = radiationRange; - this.rangeLimit = rangeLimit; - } - - /** - * Entity representing the explosive, may be null. - */ - public final Entity entity; - public final Vec3d pos; - public final double power; - /** - * Entity causing the explosion, may be null. - */ - public final EntityLivingBase igniter; - public final int radiationRange; - public final double rangeLimit; -} diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserExplodesEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserExplodesEvent.class deleted file mode 100644 index ea9d54941..000000000 Binary files a/src/api/java/ic2/api/event/LaserEvent$LaserExplodesEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserHitsBlockEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserHitsBlockEvent.class deleted file mode 100644 index 1b3b0d955..000000000 Binary files a/src/api/java/ic2/api/event/LaserEvent$LaserHitsBlockEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserHitsEntityEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserHitsEntityEvent.class deleted file mode 100644 index deec489bf..000000000 Binary files a/src/api/java/ic2/api/event/LaserEvent$LaserHitsEntityEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserShootEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserShootEvent.class deleted file mode 100644 index 08d6cbc30..000000000 Binary files a/src/api/java/ic2/api/event/LaserEvent$LaserShootEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/LaserEvent.class b/src/api/java/ic2/api/event/LaserEvent.class deleted file mode 100644 index 8c8a55cf1..000000000 Binary files a/src/api/java/ic2/api/event/LaserEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/LaserEvent.java b/src/api/java/ic2/api/event/LaserEvent.java deleted file mode 100644 index 6564a1a25..000000000 --- a/src/api/java/ic2/api/event/LaserEvent.java +++ /dev/null @@ -1,118 +0,0 @@ -package ic2.api.event; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.Cancelable; - -/** - * A bunch of Events to handle the power of the Mining Laser. - */ -@Cancelable -public class LaserEvent extends WorldEvent { - // the Laser Entity - 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; - // 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; - // Determines whether the laser will explode upon hitting something - public boolean explosive, smelt; - - public LaserEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt) { - super(world); - - this.lasershot = lasershot; - this.owner = owner; - this.range = range; - this.power = power; - this.blockBreaks = blockBreaks; - this.explosive = explosive; - this.smelt = smelt; - } - - /** - * Event when the Laser is getting shot by a Player. - * - * The Item is the Laser Gun which the "Player" has shot - */ - public static class LaserShootEvent extends LaserEvent { - ItemStack laserItem; - - public LaserShootEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, ItemStack laseritem) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - - this.laserItem = laseritem; - } - } - - /** - * Event when the Laser is exploding for some Reason. - * - * 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 { - // explosion strength, even that can be changed! - public float explosionPower, explosionDropRate, explosionEntityDamage; - - public LaserExplodesEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, float explosionpower1, float explosiondroprate1, float explosionentitydamage1) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - - this.explosionPower = explosionpower1; - this.explosionDropRate = explosiondroprate1; - this.explosionEntityDamage = explosionentitydamage1; - } - } - - /** - * Event when the Laser is hitting a Block - * x, y and z are the Coords of the Block. - * - * 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 { - // targeted block, even that can be changed! - public BlockPos pos; - public EnumFacing 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 LaserHitsBlockEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive1, boolean smelt1, BlockPos pos, EnumFacing side, float dropChance, boolean removeBlock, boolean dropBlock) { - super(world, lasershot, owner, range, power, blockBreaks, explosive1, smelt1); - - this.pos = pos; - this.side = side; - this.removeBlock = removeBlock; - this.dropBlock = dropBlock; - this.dropChance = dropChance; - } - } - - /** - * Event when the Laser is getting at a Living Entity - * - * Canceling this Event ignores the Entity - * Use lasershot.setDead() to remove the Shot entirely. - */ - public static class LaserHitsEntityEvent extends LaserEvent { - // the Entity which the Laser has shot at, even the target can be changed! - public Entity hitEntity; - - public LaserHitsEntityEvent(World world, Entity lasershot, EntityLivingBase owner, float range, float power, int blockBreaks, boolean explosive, boolean smelt, Entity hitentity) { - super(world, lasershot, owner, range, power, blockBreaks, explosive, smelt); - - this.hitEntity = hitentity; - } - } -} diff --git a/src/api/java/ic2/api/event/RetextureEvent.class b/src/api/java/ic2/api/event/RetextureEvent.class deleted file mode 100644 index be92cb32a..000000000 Binary files a/src/api/java/ic2/api/event/RetextureEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/RetextureEvent.java b/src/api/java/ic2/api/event/RetextureEvent.java deleted file mode 100644 index 195f0d3f4..000000000 --- a/src/api/java/ic2/api/event/RetextureEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -package ic2.api.event; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.Cancelable; - -@Cancelable -public class RetextureEvent extends WorldEvent { - public RetextureEvent(World world, BlockPos pos, IBlockState state, EnumFacing side, EntityPlayer player, - IBlockState refState, String refVariant, EnumFacing refSide, int[] refColorMultipliers) { - super(world); - - if (world == null) throw new NullPointerException("null world"); - if (world.isRemote) throw new IllegalStateException("remote world"); - if (pos == null) throw new NullPointerException("null pos"); - if (state == null) throw new NullPointerException("null state"); - if (side == null) throw new NullPointerException("null side"); - if (refState == null) throw new NullPointerException("null refState"); - if (refVariant == null) throw new NullPointerException("null refVariant"); - if (refSide == null) throw new NullPointerException("null refSide"); - if (refColorMultipliers == null) throw new NullPointerException("null refColorMultipliers"); - - this.pos = pos; - this.state = state; - this.side = side; - this.player = player; - this.refState = refState; - this.refVariant = refVariant; - this.refSide = refSide; - this.refColorMultipliers = refColorMultipliers; - } - - // target block - public final BlockPos pos; - public final IBlockState state; - public final EnumFacing side; - - // player causing the action, may be null - public final EntityPlayer player; - - // referenced block (to grab the texture from) - public final IBlockState refState; - public final String refVariant; - public final EnumFacing refSide; - public final int[] refColorMultipliers; - - // set to true to confirm the operation - public boolean applied = false; -} diff --git a/src/api/java/ic2/api/event/TeBlockFinalCallEvent.class b/src/api/java/ic2/api/event/TeBlockFinalCallEvent.class deleted file mode 100644 index 98ae85734..000000000 Binary files a/src/api/java/ic2/api/event/TeBlockFinalCallEvent.class and /dev/null differ diff --git a/src/api/java/ic2/api/event/TeBlockFinalCallEvent.java b/src/api/java/ic2/api/event/TeBlockFinalCallEvent.java deleted file mode 100644 index 3b1958d4f..000000000 --- a/src/api/java/ic2/api/event/TeBlockFinalCallEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.event; - -import net.minecraftforge.fml.common.eventhandler.Event; - -import ic2.api.info.ITeBlock; - -/** This event is a notification for an internal event you might will to subscribe to if you're using ITeBlock, hence it is empty. - *

- * For more information such as why this event exists, when it's posted, and how to react to it properly, see {@link ITeBlock}. - *

- * - * @see ITeBlock - * - * @since IC2 2.6.67 - * @version 1.0 - * - * @author Chocohead - */ -public final class TeBlockFinalCallEvent extends Event { -} \ No newline at end of file diff --git a/src/api/java/ic2/api/info/IInfoProvider.class b/src/api/java/ic2/api/info/IInfoProvider.class deleted file mode 100644 index 95ce6945f..000000000 Binary files a/src/api/java/ic2/api/info/IInfoProvider.class and /dev/null differ diff --git a/src/api/java/ic2/api/info/IInfoProvider.java b/src/api/java/ic2/api/info/IInfoProvider.java deleted file mode 100644 index c4e8f6dc6..000000000 --- a/src/api/java/ic2/api/info/IInfoProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -package ic2.api.info; - -import net.minecraft.item.ItemStack; - -public interface IInfoProvider { - /** - * Determine the energy value for a single item in the supplied stack. - * The value is used by most machines in the discharge slot. - * - * This only applies to basic single use items, others are to be queried - * through e.g. ElectricItem.manager.getCharge(). - * - * @param stack ItemStack containing the item to evaluate. - * @return energy in EU - */ - double getEnergyValue(ItemStack stack); - - /** - * Determine the fuel value for a single item in the supplied stack. - * The information currently applies to Generators and the Iron Furnace. - * - * @param stack ItemStack containing the item to evaluate. - * @param allowLava Determine if lava has a fuel value, currently only true for the Iron Furnace. - * @return fuel value - */ - int getFuelValue(ItemStack stack, boolean allowLava); -} diff --git a/src/api/java/ic2/api/info/ILocatable.class b/src/api/java/ic2/api/info/ILocatable.class deleted file mode 100644 index 9f77e09d6..000000000 Binary files a/src/api/java/ic2/api/info/ILocatable.class and /dev/null differ diff --git a/src/api/java/ic2/api/info/ILocatable.java b/src/api/java/ic2/api/info/ILocatable.java deleted file mode 100644 index 47bc34428..000000000 --- a/src/api/java/ic2/api/info/ILocatable.java +++ /dev/null @@ -1,24 +0,0 @@ -package ic2.api.info; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** - * Interface for things, that have a location. - * The function names are the way they are, because of obfuscation issues. - * See https://github.com/md-5/SpecialSource/issues/12 - * @author Aroma1997 - */ -public interface ILocatable { - - /** - * @return the position of the object. - */ - BlockPos getPosition(); - - /** - * @return the world of this object. - */ - World getWorldObj(); - -} diff --git a/src/api/java/ic2/api/info/ITeBlock.class b/src/api/java/ic2/api/info/ITeBlock.class deleted file mode 100644 index 5de8990ad..000000000 Binary files a/src/api/java/ic2/api/info/ITeBlock.class and /dev/null differ diff --git a/src/api/java/ic2/api/info/ITeBlock.java b/src/api/java/ic2/api/info/ITeBlock.java deleted file mode 100644 index 7fc6665a4..000000000 --- a/src/api/java/ic2/api/info/ITeBlock.java +++ /dev/null @@ -1,317 +0,0 @@ -package ic2.api.info; - -import net.minecraft.block.material.Material; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.common.MinecraftForge; - -import ic2.api.event.TeBlockFinalCallEvent; -import ic2.api.item.ITeBlockSpecialItem; -import ic2.api.tile.IWrenchable; - -/** First of all, yes this class is empty. It's public documentation for the actual internal interface ITeBlock. Use the internal one not this! - *

- * You may be asking, why would an internal interface need documenting? Well, the answer is so people can use TileEntityBlock. - * That class is the base for all IC2 tile entities, so by being able to use that you're level to IC2. - * Many methods are protected in there too, as they're only designed to be called by BlockTileEntity (which is the block all IC2 tile entities will be on), - * by being able to extend it means all those methods you can now extend and be confident they will be called correctly. - *

- *

- * Because it allows effectively level control to IC2 itself, this gives you near total control of your tile entities: - *

- * You can pick whether each of your tile entity items show up in creative, and the order in which they do.
- * There is a proper separation between each registered ITeBlock by resource location, rather than everything being inserted into a single enum. - * You also receive your own instance of BlockTileEntity and ItemBlockTileEntity rather than having to use IC2's own one.
- * All the language keys and blockstate file are in your own assets (which you can, and in fact have to, pick). - * You can have custom item models with non-standard model locations. - *
- * The event allows you to properly register your own version of TeBlock in a way that will be as fully supported as is physically possible. - * It's not in the actual API itself as it's heavily dependent on internal classes, so you have this instead. - * This is also probably the most documented thing in the entire IC2 API. I'm too kind really. ;) - *

- *
- *

- * So that's all well and good, but what you really want is an example of how to do it properly. Good idea, let's go. - *


- *import net.minecraftforge.common.MinecraftForge;
- *import net.minecraftforge.fml.common.Mod;
- *import net.minecraftforge.fml.common.Mod.EventHandler;
- *import net.minecraftforge.fml.common.event.FMLConstructionEvent;
- *import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- *import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- *
- *import ic2.api.event.TeBlockFinalCallEvent;
- *import ic2.core.block.TeBlockRegistry;
- *
- *{@literal @}Mod(modId="ExampleIC2Addon")
- *public class ExampleIC2Addon {
- *	{@literal @}EventHandler
- *	public void start(FMLConstructionEvent event) {
- *		MinecraftForge.EVENT_BUS.register(this);
- *	}
- *
- *	{@literal @}SubscribeEvent
- *	public void register(TeBlockFinalCallEvent event) {
- *		TeBlockRegistry.addAll(MyTeBlock.class, MyTeBlock.IDENTITY);
- *
- *		MinecraftForge.EVENT_BUS.unregister(this);
- *	}
- *
- *	{@literal @}EventHandler
- *	public void init(FMLInitializationEvent event) {
- *		MyTeBlock.buildDummies();
- *	}
- *}
- *
- *
- *import net.minecraft.block.material.Material;
- *import net.minecraft.creativetab.CreativeTabs;
- *import net.minecraft.item.EnumRarity;
- *import net.minecraft.item.ItemStack;
- *import net.minecraft.tileentity.TileEntity;
- *import net.minecraft.util.EnumFacing;
- *import net.minecraft.util.ResourceLocation;
- *
- *import ic2.core.block.BlockTileEntity;
- *import ic2.core.block.ITeBlock;
- *import ic2.core.block.TileEntityBlock;
- *import ic2.core.item.block.ItemBlockTileEntity;
- *import ic2.core.ref.TeBlock.DefaultDrop;
- *import ic2.core.ref.TeBlock.HarvestTool;
- *import ic2.core.ref.TeBlock.ITePlaceHandler;
- *import ic2.core.util.Util;
- *
- *public enum MyTeBlock implements ITeBlock {
- *	my_machine_name(MyMachineTileEntity.class, 0, false, Util.noFacings, false, HarvestTool.Pickaxe, DefaultDrop.Machine, 5, 10, EnumRarity.UNCOMMON, Material.IRON, false);
- *
- *	private MyTeBlock(Class teClass, int ID,
- *			boolean hasActive, Set{@literal <}EnumFacing{@literal >} possibleFacings, boolean canBeWrenched,
- *			HarvestTool tool, DefaultDrop drop,
- *			float hardness, float explosionResistance, EnumRarity rarity, Material material, boolean isTransparent) {
- *		this.teClass = teClass;
- *		this.ID = ID;
- *		this.hasActive = hasActive;
- *		this.possibleFacings = possibleFacings;
- *		this.canBeWrenched = canBeWrenched;
- *		this.tool = tool;
- *		this.drop = drop;
- *		this.hardness = hardness;
- *		this.explosionResistance = explosionResistance;
- *		this.rarity = rarity;
- *		this.material = material;
- *		this.isTransparent = isTransparent;
- *
- *		TileEntity.addMapping(block.teClass, IDENTITY.getResourceDomain() + ':' + block.getName());
- *	}
- *
- *	{@literal @}Override
- *	public boolean hasItem() {
- *		return teClass != null && itemMeta != -1;
- *	}
- *
- *	{@literal @}Override
- *	public String getName() {
- *		return name();
- *	}
- *
- *	{@literal @}Override
- *	public ResourceLocation getIdentifier() {
- *		return IDENTITY;
- *	}
- *
- *	{@literal @}Override
- *	public Class getTeClass() {
- *		return teClass;
- *	}
- *
- *	{@literal @}Override
- *	public boolean hasActive() {
- *		return hasActive;
- *	}
- *
- *	{@literal @}Override
- *	public int getId() {
- *		return ID;
- *	}
- *
- *	{@literal @}Override
- *	public float getHardness() {
- *		return hardness;
- *	}
- *
- *	{@literal @}Override
- *	public HarvestTool getHarvestTool() {
- *		return tool;
- *	}
- *
- *	{@literal @}Override
- *	public DefaultDrop getDefaultDrop() {
- *		return drop;
- *	}
- *
- *	{@literal @}Override
- *	public float getExplosionResistance() {
- *		return explosionResistance;
- *	}
- *
- *	{@literal @}Override
- *	public boolean allowWrenchRotating() {
- *		return canBeWrenched;
- *	}
- *
- *	{@literal @}Override
- *	public Set{@literal <}EnumFacing{@literal >} getSupportedFacings() {
- *		return possibleFacings;
- *	}
- *
- *	{@literal @}Override
- *	public EnumRarity getRarity() {
- *		return rarity;
- *	}
- *
- *	{@literal @}Override
- *	public Material getMaterial() {
- *		return material;
- *	}
- *
- *	{@literal @}Override
- *	public boolean isTransparent() {
- *		return isTransparent;
- *	}
- *
- *	{@literal @}Override
- *	public void setPlaceHandler(ITePlaceHandler handler) {
- *		this.placeHandler = handler;
- *	}
- *
- *	{@literal @}Override
- *	public ITePlaceHandler getPlaceHandler() {
- *		return placeHandler;
- *	}
- *
- *	public static void buildDummies() {
- *		for (MyTeBlock block : values()) {
- *			//System.out.printf("Building %s (with teClass %s)%n", block.getName(), block.teClass);
- *			if (block.teClass != null) {
- *				try {
- *					block.dummyTe = block.teClass.newInstance();
- *				} catch (Exception e) {
- *					e.printStackTrace();
- *				}
- *			}
- *		}
- *	}
- *
- *	{@literal @}Override
- *	public TileEntityBlock getDummyTe() {
- *		return dummyTe;
- *	}
- *
- *	private final Class teClass;
- *	private final int ID;
- *	private final boolean hasActive;
- *	private final Set{@literal <}EnumFacing{@literal >} possibleFacings;
- *	private final boolean canBeWrenched;
- *	private final HarvestTool tool;
- *	private final DefaultDrop drop;
- *	private final float hardness;
- *	private final float explosionResistance;
- *	private final EnumRarity rarity;
- *	private final Material material;
- *	private final boolean isTransparent;
- *	private TileEntityBlock dummyTe;
- *	private ITePlaceHandler placeHandler;
- *
- *	public static final ResourceLocation IDENTITY = new ResourceLocation("ExampleIC2Addon", "machines");
- *}
- *  
- * And that's it, you now have my_machine_name registered with the MyMachineTileEntity tile entity class, - * the language key to translate it's name being ExampleIC2Addon.machines.my_machine_name and - * the blockstate being in machines.json file in your mod's assets. - *

- *
- *

- * But hang on, what are all the parameters of our new enum and what does ITeBlock do with them? What are dummy tile entities for? - * Don't worry, it's quite simple (once you know it at least). - *

- *

- * First we'll start on what {@link TeBlockFinalCallEvent} is. It's posted on the {@link MinecraftForge#EVENT_BUS} just before the blocks are built, - * after which point any further attempts to register ITeBlocks will fail, as we can't inject them late due to the model generating. - * It is best to hook into this to register your ITeBlocks, as it will be guaranteed to be posted at the right time. - *

- * In terms of ITeBlock, there's quite a bit of information it needs in order to function. We'll go through each parameter (or getter method most cases too) in turn: - *

    - *
  • name: The name the new tile entity. This is important as the localisation and resource names depend on it, as well as some network syncing code.
  • - *
  • teClass: The class of your tile entity, it must extend TileEntityBlock otherwise it would miss critical methods to work. - * If extending that is a problem then using ITeBlock isn't what you should be doing.
  • - *
  • itemMeta: The ID of the new instance. This is utterly critical, as it's the thing used to detect which ITeBlock an item is. - * That's very important as the tile entity class is worked out by the ID when a block's being placed in ItemBlockTileEntity. - * Changing this will cause everyone's items to change and there is no stopping that if you do. - * The ID you pick should start at 0, and go up to {@link Short#MAX_VALUE}. - * Use -1 if the tile entity doesn't have an item form (or is placed using an item other than ItemBlockTileEntity).
  • - *
  • identifier: The resource location associated with the ITeBlock. - * The language keys, translations and internal mappings all use this, so it's best to store it as a static final variable and use that. - *
  • hasActive: If the tile entity has an active state too, which is based off whether TileEntityBlock#getActive() returns true or not. - * The models for that will be at name_active, you can check te.json for an example if you wish.
  • - *
  • supportedFacings: A set of EnumFacings that the block can face, used for rotating by the wrench for example. - * IC2 has some useful constants relating to that in Util (allFacings, horizontalFacings, downSideFacings and noFacings).
  • - *
  • allowWrenchRotating: Whether the tile entity can be rotated with a wrench (for {@link IWrenchable}).
  • - *
  • harvestTool: The tool used to harvest the tile entity, currently only None, Pickaxe, Shovel and Axe. - * More can be added on request, but support has to be specifically added, so there's no nice way via EnumHelper unfortunately.
  • - *
  • defaultDrop: The item(s) that will drop when the block is broken using the correct tool. Currently only Self, None, Generator, Machine, and AdvMachine. - * Like harvestTool, more can be added upon request.
  • - *
  • hardness: The hardness the block should have with the tile entity, IC2 normally uses 5.
  • - *
  • explosionResistance: The explosionResistance the block should have with the tile entity, IC2 normally uses 10.
  • - *
  • rarity: The EnumRarity that the item will have for the tile entity.
  • - *
  • material: The {@link Material} that the block representing the tile entity should have. Maximum of 8 different ones per ITeBlock registration.
  • - *
  • isTransparent: Whether the block should be rendered with {@link BlockRenderLayer#CUTOUT} or {@link BlockRenderLayer#SOLID} - * (which controls whether transparency can be in the texture).
  • - *
  • placeHandler: Custom placement logic, used for things like Reactor Chambers within IC2 itself. - * Returning null for this uses the default logic (placing like a normal block).
  • - *
  • dummyTe: An instance of the tile entity never registered to the world (don't try doing that) used for getting additional information about the Tile Entity. - * Mostly an internal thing, only exposed in case your Tile Entity uses a special constructor.
  • - *
- * IMPORTANT THINGS TO NOTE - *
- *
Getting your instance of BlockTileEntity and ItemBlockTileEntity
- *
For BlockTileEntity, use {@link TeBlockRegistry#get(ResourceLocation)}.
- * For ItemBlockTileEntity, use {@link BlockTileEntity#getItem()}.
- *
Using a custom item model for your ITeBlock
- *
Implement ITeBlockSpecialItem along with ITeBlock, then the item model will be what's provided rather than the block model.
- *
The default implementation for adding ITeBlocks to creative
- *
The default logic adds all registered ITeBlocks that return true for {@link ic2.core.ref.TeBlock#hasItem()}.
- *
- * More will be added to this list if questions keep re-occurring, or are about a suitably important topic. - *

- *
- *

- * There, that should be everything you need to utilise ITeBlock to add your own tile entities using IC2's very flexible framework. - * I'll be happy to answer any questions you have on it, your best bet is to ask me (Chocohead) on the IC2 forums, - * although if you post in the support section other people might be able to help before I see your post. - * I'll certainly take suggestions too, this is mostly just based on what IC2 uses/needs, so there might well be things missed that might be useful. - *
- * Goodness I spent too long on this again... - *

- * - * - * @see {@link TeBlockFinalCallEvent} for the event you'll need to subscribe to. - * @see {@link ic2.core.ref.TeBlock} for how all the IC2 implements {@link ITeBlock}. - * @see {@link ic2.core.ref.TeBlock.HarvestTool} for the currently available tools (you'll need this for adding new tile entities). - * @see {@link ic2.core.ref.TeBlock.DefaultDrop} for the currently available drops (you'll need this for adding new tile entities too). - * @see {@link ic2.core.block.ITeBlock.ITeBlockCreativeRegisterer} for customising what blocks are added to creative past the default implementation - * @see {@link ic2.core.ref.TeBlock.ITePlaceHandler} for making your own block placement handler (example in {@link ic2.core.item.ItemHandlers#reactorChamberPlace}). - * @see {@link ic2.core.util.Util} for the useful facings you might want for supportedFacings. - * @see {@link ic2.core.block.TileEntityBlock} for the base tile entity. - * @see {@link ic2.core.block.BlockTileEntity} for the base block (you'll never need to construct this yourself). - * @see {@link ic2.core.item.block.ItemBlockTileEntity} for the base item (you shouldn't need to construct this yourself either). - * @see {@link ITeBlockSpecialItem} for the interface used to have a custom item location. - * - * - * @since IC2 2.7.14 - * @version 2.0 - * - * @author Chocohead - */ -public interface ITeBlock { -} \ No newline at end of file diff --git a/src/api/java/ic2/api/info/Info.class b/src/api/java/ic2/api/info/Info.class deleted file mode 100644 index 9682d4754..000000000 Binary files a/src/api/java/ic2/api/info/Info.class and /dev/null differ diff --git a/src/api/java/ic2/api/info/Info.java b/src/api/java/ic2/api/info/Info.java deleted file mode 100644 index 619e04e53..000000000 --- a/src/api/java/ic2/api/info/Info.java +++ /dev/null @@ -1,39 +0,0 @@ -package ic2.api.info; - -import net.minecraft.potion.Potion; -import net.minecraft.util.DamageSource; - -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.LoaderState; - -public class Info { - public static IInfoProvider itemInfo; - public static Object ic2ModInstance; - - /** - * Damage Sources used by IC2. - * Getting assigned in preload. - */ - 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 boolean isIc2Available() { - if (ic2Available != null) return ic2Available; - - boolean loaded = Loader.isModLoaded(MOD_ID); - - if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) { - ic2Available = loaded; - } - - return loaded; - } - - public static String MOD_ID = "ic2"; - private static Boolean ic2Available = null; -} \ No newline at end of file diff --git a/src/api/java/ic2/api/item/ElectricItem.class b/src/api/java/ic2/api/item/ElectricItem.class deleted file mode 100644 index ad45f925c..000000000 Binary files a/src/api/java/ic2/api/item/ElectricItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ElectricItem.java b/src/api/java/ic2/api/item/ElectricItem.java deleted file mode 100644 index 19e5fc1b9..000000000 --- a/src/api/java/ic2/api/item/ElectricItem.java +++ /dev/null @@ -1,59 +0,0 @@ -package ic2.api.item; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Allows for charging, discharging and using electric items (IElectricItem). - */ -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; - - /** - * Standard IElectricItemManager implementation, only call it directly from another - * IElectricItemManager. Use manager instead. - */ - public static IElectricItemManager rawManager; - - /** - * Register an electric item manager for items not implementing IElectricItem. - * - * This method is only designed for special purposes, implementing IElectricItem or - * ISpecialElectricItem instead of using this is faster. - * - * Managers used with ISpecialElectricItem shouldn't be registered. - * - * @param manager Manager to register. - */ - public static void registerBackupManager(IBackupElectricItemManager manager) { - backupManagers.add(manager); - } - - /** - * Get the electric item manager suitable for the supplied item stack. - * - * This method is for internal use only. - * - * @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; - } - - return null; - } - - - private static final List backupManagers = new ArrayList(); -} - diff --git a/src/api/java/ic2/api/item/HudMode.class b/src/api/java/ic2/api/item/HudMode.class deleted file mode 100644 index 200362d96..000000000 Binary files a/src/api/java/ic2/api/item/HudMode.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/HudMode.java b/src/api/java/ic2/api/item/HudMode.java deleted file mode 100644 index d78c60210..000000000 --- a/src/api/java/ic2/api/item/HudMode.java +++ /dev/null @@ -1,37 +0,0 @@ -package ic2.api.item; - -public enum HudMode { - DISABLED("ic2.hud.disabled"), BASIC("ic2.hud.basic"), EXTENDED("ic2.hud.extended"), ADVANCED("ic2.hud.advanced"); - - private HudMode(String key) { - translationKey = key; - } - - private final String translationKey; - - public boolean shouldDisplay() { - return this != DISABLED; - } - - public boolean hasTooltip() { - return this == EXTENDED || this == ADVANCED; - } - - public String getTranslationKey() { - return translationKey; - } - - public int getID() { - return ordinal(); - } - - public static HudMode getFromID(int ID) { - return VALUES[ID % VALUES.length]; - } - - public static int getMaxMode() { - return VALUES.length - 1; - } - - private static final HudMode[] VALUES = values(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/item/IBackupElectricItemManager.class b/src/api/java/ic2/api/item/IBackupElectricItemManager.class deleted file mode 100644 index fc7f1ad23..000000000 Binary files a/src/api/java/ic2/api/item/IBackupElectricItemManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IBackupElectricItemManager.java b/src/api/java/ic2/api/item/IBackupElectricItemManager.java deleted file mode 100644 index 2ae254acd..000000000 --- a/src/api/java/ic2/api/item/IBackupElectricItemManager.java +++ /dev/null @@ -1,12 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -/** - * This interface specifies a manager applicable to items not implementing IElectricItem. - * - * The manager implementing this has to be registered with ElectricItem.registerBackupManager(). - */ -public interface IBackupElectricItemManager extends IElectricItemManager { - boolean handles(ItemStack stack); -} diff --git a/src/api/java/ic2/api/item/IBlockCuttingBlade.class b/src/api/java/ic2/api/item/IBlockCuttingBlade.class deleted file mode 100644 index 6602efc17..000000000 Binary files a/src/api/java/ic2/api/item/IBlockCuttingBlade.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IBlockCuttingBlade.java b/src/api/java/ic2/api/item/IBlockCuttingBlade.java deleted file mode 100644 index 0c2e53deb..000000000 --- a/src/api/java/ic2/api/item/IBlockCuttingBlade.java +++ /dev/null @@ -1,7 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -public interface IBlockCuttingBlade { - int getHardness(ItemStack stack); -} diff --git a/src/api/java/ic2/api/item/IBoxable.class b/src/api/java/ic2/api/item/IBoxable.class deleted file mode 100644 index e28c75435..000000000 Binary files a/src/api/java/ic2/api/item/IBoxable.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IBoxable.java b/src/api/java/ic2/api/item/IBoxable.java deleted file mode 100644 index 3204a3844..000000000 --- a/src/api/java/ic2/api/item/IBoxable.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - - -public interface IBoxable { - /** - * Determine whether an item can be stored in a toolbox or not. - * - * @param stack item to be stored - * @return Whether to store the item in the toolbox or not - */ - public abstract boolean canBeStoredInToolbox(ItemStack stack); -} diff --git a/src/api/java/ic2/api/item/IC2Items.class b/src/api/java/ic2/api/item/IC2Items.class deleted file mode 100644 index 95a0eb820..000000000 Binary files a/src/api/java/ic2/api/item/IC2Items.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IC2Items.java b/src/api/java/ic2/api/item/IC2Items.java deleted file mode 100644 index cee186861..000000000 --- a/src/api/java/ic2/api/item/IC2Items.java +++ /dev/null @@ -1,865 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; - -import ic2.api.info.Info; - - -/** - * Provides access to IC2 blocks and items. - * - * Some items can be acquired through the ore dictionary which is the - * recommended way. The items are initialized while IC2 is being loaded - try to - * use ModsLoaded() or load your mod after IC2. Some blocks/items can be - * disabled by a config setting, so it's recommended to check if they're null - * first. - * - * Getting the associated Block/Item for an ItemStack x: Blocks: - * ((ItemBlock)x.getItem).getBlock() Items: x.getItem() - * Alternatively, you can directly call IC2Items.instance.getItem(name) or IC2Items.instance.getBlock(name) - * - * It is recommended, that you keep a reference to the Items you get here. - * - * @author Aroma1997 - */ -public final class IC2Items { - - /* - * To find out the name and variant of an Item/ItemStack - * have that Item in your hand in-game and type "/ic2 itemNameWithVariant" - */ - - /** - * Get an ItemStack for a specific item name. - * - * @param name - * item name - * @param variant - * the variant/subtype for the Item. - * @return The item or null if the item does not exist or an error occurred - */ - public static ItemStack getItem(String name, String variant) { - if (instance == null) { - return null; - } - return instance.getItemStack(name, variant); - } - - /** - * Get an ItemStack for a specific item name. - * - * @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) { - return getItem(name, null); - } - - /** - * Get the ItemAPI Instance. - * @return the ItemAPI instance. - */ - public static IItemAPI getItemAPI() { - return instance; - } - - - private static IItemAPI instance; - - /** - * Sets the internal IItemAPI instance. - * ONLY IC2 CAN DO THIS!!!!!!! - */ - public static void setInstance(IItemAPI api) { - ModContainer mc = Loader.instance().activeModContainer(); - - if (mc == null || !Info.MOD_ID.equals(mc.getModId())) { - throw new IllegalAccessError("invoked from "+mc); - } - - instance = api; - } - -} - -/* -================================================= -Info -================================================= - -The different Items are separaed by an empty line. -The first entry is always the itemname followed by a ":" -If you only want to access the Item, you have to use getItemAPI().getItem() with that name. -If you only want to access the Block, you have to use getItemAPI().getBlock() with that name. -Then come the different variants as follows: -If the item has variants, it is displayed like that: -itemname,variant Display name -Otherwise, it is displayed like that: -itemname Display name -You can access ItemStacks of Items without variants using the variant null - - -================================================= -Items -================================================= - -boat: -boat,broken_rubber Damaged Rubber Dinghy -boat,rubber Rubber Dinghy -boat,carbon Carbon Fiber Canoe -boat,electric Electric Boat - -crushed: -crushed,copper Crushed Copper Ore -crushed,gold Crushed Gold Ore -crushed,iron Crushed Iron Ore -crushed,lead Crushed Lead Ore -crushed,silver Crushed Silver Ore -crushed,tin Crushed Tin Ore -crushed,uranium Crushed Uranium Ore - -purified: -purified,copper Purified Crushed Copper Ore -purified,gold Purified Crushed Gold Ore -purified,iron Purified Crushed Iron Ore -purified,lead Purified Crushed Lead Ore -purified,silver Purified Crushed Silver Ore -purified,tin Purified Crushed Tin Ore -purified,uranium Purified Crushed Uranium Ore - -dust: -dust,bronze Bronze Dust -dust,clay Clay Dust -dust,coal Coal Dust -dust,coal_fuel Hydrated Coal Dust -dust,copper Copper Dust -dust,diamond Diamond Dust -dust,energium Energium Dust -dust,gold Gold Dust -dust,iron Iron Dust -dust,lapis Lapis Lazuli Dust -dust,lead Lead Dust -dust,lithium Lithium Dust -dust,obsidian Obsidian Dust -dust,silicon_dioxide Silicon Dioxide -dust,silver Silver Dust -dust,stone Stone Dust -dust,sulfur Sulfur Dust -dust,tin Tin Dust -dust,small_bronze Tiny Pile of Bronze Dust -dust,small_copper Tiny Pile of Copper Dust -dust,small_gold Tiny Pile of Gold Dust -dust,small_iron Tiny Pile of Iron Dust -dust,small_lapis Tiny Pile of Lapis Dust -dust,small_lead Tiny Pile of Lead Dust -dust,small_lithium Tiny Pile of Lithium Dust -dust,small_obsidian Tiny Pile of Obsidian Dust -dust,small_silver Tiny Pile of Silver Dust -dust,small_sulfur Tiny Pile of Sulfur Dust -dust,small_tin Tiny Pile of Tin Dust -dust,tin_hydrated Hydrated Tin Dust - -ingot: -ingot,alloy Mixed Metal Ingot -ingot,bronze Bronze Ingot -ingot,copper Copper Ingot -ingot,lead Lead Ingot -ingot,silver Silver Ingot -ingot,steel Steel Ingot -ingot,tin Tin Ingot - -plate: -plate,bronze Bronze Plate -plate,copper Copper Plate -plate,gold Gold Plate -plate,iron Iron Plate -plate,lapis Lapis Lazuli Plate -plate,lead Lead Plate -plate,obsidian Obsidian Plate -plate,steel Steel Plate -plate,tin Tin Plate -plate,dense_bronze Dense Bronze Plate -plate,dense_copper Dense Copper Plate -plate,dense_gold Dense Gold Plate -plate,dense_iron Dense Iron Plate -plate,dense_lapis Dense Lapis Lazuli Plate -plate,dense_lead Dense Lead Plate -plate,dense_obsidian Dense Obsidian Plate -plate,dense_steel Dense Steel Plate -plate,dense_tin Dense Tin Plate - -casing: -casing,bronze Bronze Item Casing -casing,copper Copper Item Casing -casing,gold Gold Item Casing -casing,iron Iron Item Casing -casing,lead Lead Item Casing -casing,steel Steel Item Casing -casing,tin Tin Item Casing - -nuclear: -nuclear,uranium Enriched Uranium Nuclear Fuel -nuclear,uranium_235 Uranium 235 -nuclear,uranium_238 Uranium 238 -nuclear,plutonium Plutonium -nuclear,mox MOX Nuclear Fuel -nuclear,small_uranium_235 Tiny Pile of Uranium 235 -nuclear,small_uranium_238 Tiny Pile of Uranium 238 -nuclear,small_plutonium Tiny Pile of Plutonium -nuclear,uranium_pellet Pellets of Enriched Uranium Nuclear Fuel -nuclear,mox_pellet Pellets of MOX Nuclear Fuel -nuclear,rtg_pellet Pellets of RTG Fuel -nuclear,depleted_uranium Fuel Rod (Depleted Uranium) -nuclear,depleted_dual_uranium Dual Fuel Rod (Depleted Uranium) -nuclear,depleted_quad_uranium Quad Fuel Rod (Depleted Uranium) -nuclear,depleted_mox Fuel Rod (Depleted MOX) -nuclear,depleted_dual_mox Dual Fuel Rod (Depleted MOX) -nuclear,depleted_quad_mox Quad Fuel Rod (Depleted MOX) - -misc_resource: -misc_resource,ashes Ashes -misc_resource,iridium_ore Iridium Ore -misc_resource,iridium_shard Iridium Shard -misc_resource,matter UU-Matter -misc_resource,resin Sticky Resin -misc_resource,slag Slag -misc_resource,iodine Iodine - -block_cutting_blade: -block_cutting_blade,iron Block Cutting Blade (Iron) -block_cutting_blade,steel Block Cutting Blade (Steel) -block_cutting_blade,diamond Block Cutting Blade (Diamond) - -crafting: -crafting,rubber Rubber -crafting,circuit Electronic Circuit -crafting,advanced_circuit Advanced Circuit -crafting,alloy Advanced Alloy -crafting,iridium Iridium Reinforced Plate -crafting,coil Coil -crafting,electric_motor Electric Motor -crafting,heat_conductor Heat Conductor -crafting,copper_boiler Copper Boiler -crafting,fuel_rod Fuel Rod (Empty) -crafting,tin_can Tin Can -crafting,small_power_unit Small Power Unit -crafting,power_unit Power Unit -crafting,carbon_fibre Raw Carbon Fibre -crafting,carbon_mesh Raw Carbon Mesh -crafting,carbon_plate Carbon Plate -crafting,coal_ball Coal Ball -crafting,coal_block Compressed Coal Ball -crafting,coal_chunk Coal Chunk -crafting,industrial_diamond Industrial Diamond -crafting,plant_ball Plantball -crafting,bio_chaff Bio Chaff -crafting,compressed_hydrated_coal H. Coal -crafting,scrap Scrap -crafting,scrap_box Scrap Box -crafting,cf_powder CF Powder -crafting,pellet CF Pellet -crafting,raw_crystal_memory Crystal Memory (raw) -crafting,iron_shaft Shaft (Iron) -crafting,steel_shaft Shaft (Steel) -crafting,wood_rotor_blade Wood Rotor Blade -crafting,iron_rotor_blade Iron Rotor Blade -crafting,steel_rotor_blade Steel Rotor Blade -crafting,carbon_rotor_blade Carbon Rotor Blade -crafting,steam_turbine_blade Steam Turbine Blade -crafting,steam_turbine Steam Turbine -crafting,jetpack_attachment_plate Jetpack Attachment Plate -crafting,coin Industrial Credit - -crystal_memory: -crystal_memory Crystal Memory - -upgrade_kit: -upgrade_kit,mfsu MFSU Upgrade Kit - -crop_res: -crop_res,coffee_beans Coffee Beans -crop_res,coffee_powder Coffee Powder -crop_res,fertilizer Fertilizer -crop_res,grin_powder Grin Powder -crop_res,hops Hops -crop_res,weed Weed - -terra_wart: -terra_wart Terra Wart - -re_battery: -re_battery RE-Battery - -advanced_re_battery: -advanced_re_battery Advanced RE-Battery - -energy_crystal: -energy_crystal Energy Crystal - -lapotron_crystal: -lapotron_crystal Lapotron Crystal - -single_use_battery: -single_use_battery Single-Use Battery - -charging_re_battery: -charging_re_battery Charging RE Battery - -advanced_charging_re_battery: -advanced_charging_re_battery Advanced Charging Battery - -charging_energy_crystal: -charging_energy_crystal Charging Energy Crystal - -charging_lapotron_crystal: -charging_lapotron_crystal Charging Lapotron Crystal - -heat_storage: -heat_storage 10k Coolant Cell - -tri_heat_storage: -tri_heat_storage 30k Coolant Cell - -hex_heat_storage: -hex_heat_storage 60k Coolant Cell - -plating: -plating Reactor Plating - -heat_plating: -heat_plating Heat-Capacity Reactor Plating - -containment_plating: -containment_plating Containment Reactor Plating - -heat_exchanger: -heat_exchanger Heat Exchanger - -reactor_heat_exchanger: -reactor_heat_exchanger Reactor Heat Exchanger - -component_heat_exchanger: -component_heat_exchanger Component Heat Exchanger - -advanced_heat_exchanger: -advanced_heat_exchanger Advanced Heat Exchanger - -heat_vent: -heat_vent Heat Vent - -reactor_heat_vent: -reactor_heat_vent Reactor Heat Vent - -overclocked_heat_vent: -overclocked_heat_vent Overclocked Heat Vent - -component_heat_vent: -component_heat_vent Component Heat Vent - -advanced_heat_vent: -advanced_heat_vent Advanced Heat Vent - -neutron_reflector: -neutron_reflector Neutron Reflector - -thick_neutron_reflector: -thick_neutron_reflector Thick Neutron Reflector - -iridium_reflector: -iridium_reflector Iridium Neutron Reflector - -rsh_condensator: -rsh_condensator RSH-Condensator - -lzh_condensator: -lzh_condensator LZH-Condensator - -uranium_fuel_rod: -uranium_fuel_rod Fuel Rod (Uranium) - -dual_uranium_fuel_rod: -dual_uranium_fuel_rod Dual Fuel Rod (Uranium) - -quad_uranium_fuel_rod: -quad_uranium_fuel_rod Quad Fuel Rod (Uranium) - -mox_fuel_rod: -mox_fuel_rod Fuel Rod (MOX) - -dual_mox_fuel_rod: -dual_mox_fuel_rod Dual Fuel Rod (MOX) - -quad_mox_fuel_rod: -quad_mox_fuel_rod Quad Fuel Rod (MOX) - -lithium_fuel_rod: -lithium_fuel_rod Fuel Rod (Lithium) - -tfbp: -tfbp,blank TFBP - Empty -tfbp,chilling TFBP - Chilling -tfbp,cultivation TFBP - Cultivation -tfbp,desertification TFBP - Desertification -tfbp,flatification TFBP - Flatification -tfbp,irrigation TFBP - Irrigation -tfbp,mushroom TFBP - Mushroom - -bronze_axe: -bronze_axe Bronze Axe - -bronze_hoe: -bronze_hoe Bronze Hoe - -bronze_pickaxe: -bronze_pickaxe Bronze Pickaxe - -bronze_shovel: -bronze_shovel Bronze Shovel - -bronze_sword: -bronze_sword Bronze Sword - -containment_box: -containment_box Containment Box - -cutter: -cutter Cutter - -debug_item: -debug_item Debug Item - -foam_sprayer: -foam_sprayer CF Sprayer -foam_sprayer,ic2construction_foam CF Sprayer - -forge_hammer: -forge_hammer Forge Hammer - -frequency_transmitter: -frequency_transmitter Frequency Transmitter - -meter: -meter EU-Reader - -remote: -remote Dynamite-O-Mote - -tool_box: -tool_box Tool Box - -treetap: -treetap Treetap - -wrench: -wrench Wrench - -barrel: -barrel Empty Booze Barrel - -booze_mug: -booze_mug Zero - -mug: -mug,empty Stone Mug -mug,cold_coffee Cold Coffee -mug,dark_coffee Dark Coffee -mug,coffee Coffee - -crop_stick: -crop_stick Crop - -cropnalyzer: -cropnalyzer Cropnalyzer - -crop_seed_bag: -crop_seed_bag * Seeds - -weeding_trowel: -weeding_trowel Weeding Trowel - -advanced_scanner: -advanced_scanner OV Scanner - -chainsaw: -chainsaw Chainsaw - -diamond_drill: -diamond_drill Diamond Drill - -drill: -drill Mining Drill - -electric_hoe: -electric_hoe Electric Hoe - -electric_treetap: -electric_treetap Electric Treetap - -electric_wrench: -electric_wrench Electric Wrench - -iridium_drill: -iridium_drill Iridium Drill - -mining_laser: -mining_laser Mining Laser - -nano_saber: -nano_saber Nano Saber - -obscurator: -obscurator Obscurator - -scanner: -scanner OD Scanner - -wind_meter: -wind_meter Windmeter - -painter: -painter Painter -painter,black Black Painter -painter,blue Blue Painter -painter,brown Brown Painter -painter,cyan Cyan Painter -painter,gray Dark Grey Painter -painter,green Green Painter -painter,light_blue Light Blue Painter -painter,light_gray Light Grey Painter -painter,lime Lime Painter -painter,magenta Magenta Painter -painter,orange Orange Painter -painter,pink Pink Painter -painter,purple Purple Painter -painter,red Red Painter -painter,white White Painter -painter,yellow Yellow Painter - -fluid_cell: -fluid_cell Universal Fluid Cell -fluid_cell,ic2air Universal Fluid Cell -fluid_cell,ic2biogas Universal Fluid Cell -fluid_cell,ic2biomass Universal Fluid Cell -fluid_cell,ic2construction_foam Universal Fluid Cell -fluid_cell,ic2coolant Universal Fluid Cell -fluid_cell,ic2distilled_water Universal Fluid Cell -fluid_cell,ic2heavy_water Universal Fluid Cell -fluid_cell,ic2hot_coolant Universal Fluid Cell -fluid_cell,ic2hot_water Universal Fluid Cell -fluid_cell,ic2hydrogen Universal Fluid Cell -fluid_cell,ic2oxygen Universal Fluid Cell -fluid_cell,ic2pahoehoe_lava Universal Fluid Cell -fluid_cell,ic2steam Universal Fluid Cell -fluid_cell,ic2superheated_steam Universal Fluid Cell -fluid_cell,ic2uu_matter Universal Fluid Cell -fluid_cell,ic2weed_ex Universal Fluid Cell -fluid_cell,lava Universal Fluid Cell -fluid_cell,water Universal Fluid Cell - -cable: -cable,type:copper,insulation:0 Copper Cable -cable,type:copper,insulation:1 Insulated Copper Cable -cable,type:glass,insulation:0 Glass Fibre Cable -cable,type:gold,insulation:0 Gold Cable -cable,type:gold,insulation:1 Insulated Gold Cable -cable,type:gold,insulation:2 2x Ins. Gold Cable -cable,type:iron,insulation:0 HV Cable -cable,type:iron,insulation:1 Insulated HV Cable -cable,type:iron,insulation:2 2x Ins. HV Cable -cable,type:iron,insulation:3 3x Ins. HV Cable -cable,type:tin,insulation:0 Tin Cable -cable,type:tin,insulation:1 Insulated Tin Cable -cable,type:detector,insulation:0 EU-Detector Cable -cable,type:splitter,insulation:0 EU-Splitter Cable - -upgrade: -upgrade,overclocker Overclocker Upgrade -upgrade,transformer Transformer Upgrade -upgrade,energy_storage Energy Storage Upgrade -upgrade,redstone_inverter Redstone Signal Inverter Upgrade -upgrade,ejector Ejector Upgrade -upgrade,advanced_ejector Advanced Ejector Upgrade -upgrade,pulling Pulling Upgrade -upgrade,advanced_pulling Advanced Pulling Upgrade -upgrade,fluid_ejector Fluid Ejector Upgrade -upgrade,fluid_pulling Fluid Pulling Upgrade - -advanced_batpack: -advanced_batpack Adv.Batpack - -alloy_chestplate: -alloy_chestplate Composite Vest - -batpack: -batpack BatPack - -bronze_boots: -bronze_boots Bronze Boots - -bronze_chestplate: -bronze_chestplate Bronze Chestplate - -bronze_helmet: -bronze_helmet Bronze Helmet - -bronze_leggings: -bronze_leggings Bronze Leggings - -cf_pack: -cf_pack CF Backpack -cf_pack CF Backpack - -energy_pack: -energy_pack Energypack - -hazmat_chestplate: -hazmat_chestplate Hazmat Suit - -hazmat_helmet: -hazmat_helmet Scuba Helmet - -hazmat_leggings: -hazmat_leggings Hazmat Suit Leggings - -jetpack: -jetpack Jetpack -jetpack Jetpack - -jetpack_electric: -jetpack_electric Electric Jetpack - -lappack: -lappack Lappack - -nano_boots: -nano_boots NanoSuit Boots - -nano_chestplate: -nano_chestplate NanoSuit Bodyarmor - -nano_helmet: -nano_helmet NanoSuit Helmet - -nano_leggings: -nano_leggings NanoSuit Leggings - -nightvision_goggles: -nightvision_goggles Nightvision Goggles - -quantum_boots: -quantum_boots QuantumSuit Boots - -quantum_chestplate: -quantum_chestplate QuantumSuit Bodyarmor - -quantum_helmet: -quantum_helmet QuantumSuit Helmet - -quantum_leggings: -quantum_leggings QuantumSuit Leggings - -rubber_boots: -rubber_boots Rubber Boots - -solar_helmet: -solar_helmet Solar Helmet - -static_boots: -static_boots Static Boots - -filled_tin_can: -filled_tin_can (Filled) Tin Can - -iodine_tablet: -iodine_tablet Iodine Tablet - -rotor_wood: -rotor_wood Kinetic Gearbox Rotor (Wood) - -rotor_iron: -rotor_iron Kinetic Gearbox Rotor (Iron) - -rotor_carbon: -rotor_carbon Kinetic Gearbox Rotor (Carbon) - -rotor_steel: -rotor_steel Kinetic Gearbox Rotor (Steel) - -dynamite: -dynamite Dynamite - -dynamite_sticky: -dynamite_sticky Sticky Dynamite - - -================================================= -Blocks: -================================================= - -te: -te,itnt Industrial TNT -te,nuke Nuke -te,generator Generator -te,geo_generator Geothermal Generator -te,kinetic_generator Kinetic Generator -te,rt_generator Radioisotope Thermoelectric Generator -te,semifluid_generator Semifluid Generator -te,solar_generator Solar Panel -te,stirling_generator Stirling Generator -te,water_generator Water Mill -te,wind_generator Wind Mill -te,electric_heat_generator Electric Heater -te,fluid_heat_generator Liquid Fuel Firebox -te,rt_heat_generator Radioisotope Heat Generator -te,solid_heat_generator Solid Fuel Firebox -te,electric_kinetic_generator Electric Motor -te,manual_kinetic_generator Manual Kinetic Generator -te,steam_kinetic_generator Steam Turbine -te,stirling_kinetic_generator Stirling Kinetic Generator -te,water_kinetic_generator Water Turbine -te,wind_kinetic_generator Wind Turbine -te,nuclear_reactor Nuclear Reactor -te,reactor_access_hatch Reactor Access Hatch -te,reactor_chamber Reactor Chamber -te,reactor_fluid_port Reactor Fluid Port -te,reactor_redstone_port Reactor Redstone Port -te,condenser Condenser -te,fluid_bottler Bottling Plant -te,fluid_distributor Fluid Distributor -te,fluid_regulator Fluid Regulator -te,liquid_heat_exchanger Liquid Heat Exchanger -te,pump Pump -te,solar_distiller Solar Distiller -te,steam_generator Steam Boiler -te,item_buffer Item Buffer -te,luminator_flat Luminator -te,magnetizer Magnetizer -te,sorting_machine Electric Sorting Machine -te,teleporter Teleporter -te,terraformer Terraformer -te,tesla_coil Tesla Coil -te,canner Fluid/Solid Canning Machine -te,compressor Compressor -te,electric_furnace Electric Furnace -te,extractor Extractor -te,iron_furnace Iron Furnace -te,macerator Macerator -te,recycler Recycler -te,solid_canner Solid Canning Machine -te,blast_furnace Blast Furnace -te,block_cutter Block Cutting Machine -te,centrifuge Thermal Centrifuge -te,fermenter Fermenter -te,induction_furnace Induction Furnace -te,metal_former Metal Former -te,ore_washing_plant Ore Washing Plant -te,advanced_miner Advanced Miner -te,crop_harvester Crop Harvester -te,cropmatron Crop-Matron -te,miner Miner -te,matter_generator Mass Fabricator -te,pattern_storage Pattern Storage -te,replicator Replicator -te,scanner Scanner -te,energy_o_mat Energy-O-Mat -te,personal_chest Personal Safe -te,trade_o_mat Trade-O-Mat -te,chargepad_batbox Charge Pad (BatBox) -te,chargepad_cesu Charge Pad (CESU) -te,chargepad_mfe Charge Pad (MFE) -te,chargepad_mfsu Charge Pad (MFSU) -te,batbox BatBox -te,cesu CESU -te,mfe MFE -te,mfsu MFSU -te,electrolyzer Electrolyzer -te,lv_transformer LV-Transformer -te,mv_transformer MV-Transformer -te,hv_transformer HV-Transformer -te,ev_transformer EV-Transformer -te,tank Tank -te,chunk_loader Chunk Loader -te,item_buffer_2 Compact Item Buffer -te,rci_rsh Reactor Coolant Injector (RSH) -te,rci_lzh Reactor Coolant Injector (LZH) -te,creative_generator Creative Generator -te,steam_repressurizer Steam Re-Pressurizer -te,industrial_workbench Industrial Workbench -te,batch_crafter Batch Crafter - -resource: -resource,basalt Basalt -resource,copper_ore Copper Ore -resource,lead_ore Lead Ore -resource,tin_ore Tin Ore -resource,uranium_ore Uranium Ore -resource,bronze_block Bronze Block -resource,copper_block Copper Block -resource,lead_block Lead Block -resource,steel_block Steel Block -resource,tin_block Tin Block -resource,uranium_block Uranium Block -resource,reinforced_stone Reinforced Stone -resource,machine Basic Machine Casing -resource,advanced_machine Advanced Machine Casing -resource,reactor_vessel Reactor Pressure Vessel - -leaves: -leaves Rubber Tree Leaves - -rubber_wood: -rubber_wood Rubber Wood - -sapling: -sapling Rubber Tree Sapling - -scaffold: -scaffold,wood Scaffold -scaffold,reinforced_wood Reinforced Scaffold -scaffold,iron Iron Scaffold -scaffold,reinforced_iron Reinforced Iron Scaffold - -foam: -foam,normal Construction Foam -foam,reinforced Reinforced Construction Foam - -fence: -fence,iron Iron Fence - -sheet: -sheet,resin Resin Sheet -sheet,rubber Rubber Sheet -sheet,wool Wool Sheet - -glass: -glass,reinforced Reinforced Glass - -wall: -wall,black Construction Foam Wall (Black) -wall,blue Construction Foam Wall (Blue) -wall,brown Construction Foam Wall (Brown) -wall,cyan Construction Foam Wall (Cyan) -wall,gray Construction Foam Wall (Gray) -wall,green Construction Foam Wall (Green) -wall,light_blue Construction Foam Wall (Light Blue) -wall,light_gray Construction Foam Wall (Light Gray) -wall,lime Construction Foam Wall (Lime) -wall,magenta Construction Foam Wall (Magenta) -wall,orange Construction Foam Wall (Orange) -wall,pink Construction Foam Wall (Pink) -wall,purple Construction Foam Wall (Purple) -wall,red Construction Foam Wall (Red) -wall,white Construction Foam Wall (White) -wall,yellow Construction Foam Wall (Yellow) - -mining_pipe: -mining_pipe,pipe Mining Pipe - -reinforced_door: -reinforced_door Reinforced Door - - */ diff --git a/src/api/java/ic2/api/item/ICustomDamageItem.class b/src/api/java/ic2/api/item/ICustomDamageItem.class deleted file mode 100644 index 80020b849..000000000 Binary files a/src/api/java/ic2/api/item/ICustomDamageItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ICustomDamageItem.java b/src/api/java/ic2/api/item/ICustomDamageItem.java deleted file mode 100644 index 4470fa0db..000000000 --- a/src/api/java/ic2/api/item/ICustomDamageItem.java +++ /dev/null @@ -1,56 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * ICustomDamageItem allows items to have custom damage handling without the massive overhead of - * Item.getDamage() / Item.setDamage(), which turn ItemStack.getItemDamage into virtual calls. - * - * The custom damage value is typically stored in the item stacks nbt data. - * - * If an Item implements ICusomDamageItem, the normal ItemStack damage won't be changed by IC2. - * It's up to the implementer to potentially manipulate it for suitable visual effect on the - * rendered damage bar or to provide a suitable item renderer. - * - * Item.isDamageable() still applies. - * - * @author Player - */ -public interface ICustomDamageItem { - /** - * Retrieve the custom damage value for the supplied item stack. - * - * @param stack ItemStack to be queried. - * @return Custom damage value. - */ - int getCustomDamage(ItemStack stack); - - /** - * Retrieve the maximum custom damage value for the supplied item stack. - * @param stack ItemStack to be queried. - * @return Custom damage value limit. - */ - int getMaxCustomDamage(ItemStack stack); - - /** - * Set the custom damage value for the supplied item stack. - * - * @param stack ItemStack to be manipulated. - * @param damage New damage value. - */ - void setCustomDamage(ItemStack stack, int damage); - - /** - * Increase the custom damage value for the supplied item stack. - * - * It's up to the implementation to not apply any damage, e.g. based on some randomness or - * properties of src. - * - * @param stack ItemStack to be manipulated. - * @param damage Extra damage to be applied. - * @param src Entity damaging the item, may be null. - * @return true if damage was applied. - */ - boolean applyCustomDamage(ItemStack stack, int damage, EntityLivingBase src); -} diff --git a/src/api/java/ic2/api/item/IDebuggable.class b/src/api/java/ic2/api/item/IDebuggable.class deleted file mode 100644 index 13c992baf..000000000 Binary files a/src/api/java/ic2/api/item/IDebuggable.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IDebuggable.java b/src/api/java/ic2/api/item/IDebuggable.java deleted file mode 100644 index 404c7eb72..000000000 --- a/src/api/java/ic2/api/item/IDebuggable.java +++ /dev/null @@ -1,22 +0,0 @@ -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(); - - /** - * 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.class b/src/api/java/ic2/api/item/IElectricItem.class deleted file mode 100644 index 4ca3a7eed..000000000 Binary files a/src/api/java/ic2/api/item/IElectricItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IElectricItem.java b/src/api/java/ic2/api/item/IElectricItem.java deleted file mode 100644 index b94634a63..000000000 --- a/src/api/java/ic2/api/item/IElectricItem.java +++ /dev/null @@ -1,42 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Provides the ability to store energy on the implementing item. - * - * The item should have a maximum damage of 13. - */ -public interface IElectricItem { - /** - * Determine if the item can be used in a machine or as an armor part to supply energy. - * - * @return Whether the item can supply energy - */ - boolean canProvideEnergy(ItemStack stack); - - /** - * Get the item's maximum charge energy in EU. - * - * @return Maximum charge energy - */ - double getMaxCharge(ItemStack stack); - - /** - * Get the item's tier, lower tiers can't send energy to higher ones. - * - * Batteries are Tier 1, Advanced Batteries are Tier 2, Energy Crystals are Tier 3, Lapotron - * Crystals are Tier 4. - * - * @return Item's tier - */ - int getTier(ItemStack stack); - - /** - * Get the item's transfer limit in EU per transfer operation. - * - * @return Transfer limit - */ - double getTransferLimit(ItemStack stack); -} - diff --git a/src/api/java/ic2/api/item/IElectricItemManager.class b/src/api/java/ic2/api/item/IElectricItemManager.class deleted file mode 100644 index dc89a3a67..000000000 Binary files a/src/api/java/ic2/api/item/IElectricItemManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IElectricItemManager.java b/src/api/java/ic2/api/item/IElectricItemManager.java deleted file mode 100644 index 3c890d88f..000000000 --- a/src/api/java/ic2/api/item/IElectricItemManager.java +++ /dev/null @@ -1,126 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * This interface specifies a manager to handle the various tasks for electric items. - * - * The default implementation does the following: - * - store and retrieve the charge - * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account - * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId()) - * - update and manage the damage value for the visual charge indicator - * - * Implementation hints: - * - operations require the tier to be at least as high as the item being manipulated - * - ignoreTransferLimit = true should allow the total charge to be transferred in one pass - * - externally = false should always allow discharging - * - all simulated operations should be deterministic and repeatable until a non-simulated - * operation happens or the item had a chance to be manipulated elsewhere. - * - usually getCharge(stack) mirrors - * discharge(stack, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false, true) - * - usually getMaxCharge(stack) mirrors - * getCharge(stack) + charge(stack, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, true) - * - * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the - * default implementations through ElectricItem.rawManager. The default implementation is designed - * 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 { - /** - * Charge an item with a specified amount of energy. - * - * @param stack electric item's stack - * @param amount max amount of energy to charge in EU - * @param tier tier of the charging device, has to be at least as high as the item to charge - * @param ignoreTransferLimit ignore any transfer limits, infinite charge rate - * @param simulate don't actually change the item, just determine the return value - * @return Energy transferred into the electric item - */ - double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); - - /** - * Discharge an item by a specified amount of energy - * - * The externally parameter is used to prevent non-battery-like items from providing power. For - * example discharge slots set externally to true, but items using energy for themselves don't. - * Special cases like the nano saber hitting armor will discharge with externally = false. - * - * @param stack electric item's stack - * @param amount max amount of energy to discharge in EU - * @param tier tier of the discharging device, has to be at least as high as the item to discharge - * @param ignoreTransferLimit ignore any transfer limits, infinite discharge rate - * @param externally use the supplied item externally, i.e. to power something else as if it was a battery - * @param simulate don't actually discharge the item, just determine the return value - * @return Energy retrieved from the electric item - */ - double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate); - - /** - * Determine the charge level for the specified item. - * - * @param stack ItemStack containing the electric item - * @return charge level in EU - */ - double getCharge(ItemStack stack); - - /** - * Determine the charge level for the specified item. - * - * The item may not actually be chargeable to the returned level, e.g. if it is a - * non-rechargeable single use battery. - * - * @param stack ItemStack containing the electric item - * @return maximum charge level in EU - */ - double getMaxCharge(ItemStack stack); - - /** - * Determine if the specified electric item has at least a specific amount of EU. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * BatPacks are not taken into account. - * - * @param stack electric item's stack - * @param amount minimum amount of energy required - * @return true if there's enough energy - */ - boolean canUse(ItemStack stack, double amount); - - /** - * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * - * @param stack electric item's stack - * @param amount amount of energy to discharge in EU - * @param entity entity holding the item, may be null - * @return true if the operation succeeded - */ - boolean use(ItemStack stack, double amount, EntityLivingBase entity); - - /** - * Charge an item from the BatPack a player is wearing. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * use() already contains this functionality. - * - * @param stack electric item's stack - * @param entity entity holding the item - */ - void chargeFromArmor(ItemStack stack, EntityLivingBase entity); - - /** - * Get the tool tip to display for electric items. - * - * @param stack ItemStack to determine the tooltip for - * @return tool tip string or null for none - */ - String getToolTip(ItemStack stack); - - /** - * Get the tier of the specified item. - * @param stack the item to get the tier from. - * @return The tier of the item. - */ - int getTier(ItemStack stack); -} diff --git a/src/api/java/ic2/api/item/IItemAPI.class b/src/api/java/ic2/api/item/IItemAPI.class deleted file mode 100644 index 18bc079bd..000000000 Binary files a/src/api/java/ic2/api/item/IItemAPI.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IItemAPI.java b/src/api/java/ic2/api/item/IItemAPI.java deleted file mode 100644 index 9b72459d0..000000000 --- a/src/api/java/ic2/api/item/IItemAPI.java +++ /dev/null @@ -1,55 +0,0 @@ -package ic2.api.item; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * A simple interface for the ItemAPI. - * @author Aroma1997 - * - */ -public interface IItemAPI { - - /** - * Get the default blockstate for a specific block name and variant.
- * For machines etc, you might want to make your detection a bit more fuzzy, - * because the BlockState also contains properties like the facing and the active - * state of a machine. - * @param name The name of the block. - * @param variant The variant of the block. - * @return The default state of the block with that variant. - */ - IBlockState getBlockState(String name, String variant); - - /** - * Get an ItemStack for a specific item name. - * - * @param name - * item name - * @param variant - * the variant/subtype for the Item. - * @return The item or null if the item does not exist or an error occurred - */ - ItemStack getItemStack(String name, String variant); - - /** - * Get a Block for a specific block name. - * - * @param name - * block name - * @return The Block or null if the block does not exist or an error occurred - */ - Block getBlock(String name); - - /** - * Get an Item for a specific block name. - * - * @param name - * item name - * @return The Item or null if the block does not exist or an error occurred - */ - Item getItem(String name); - -} diff --git a/src/api/java/ic2/api/item/IItemHudInfo.class b/src/api/java/ic2/api/item/IItemHudInfo.class deleted file mode 100644 index 4602f697b..000000000 Binary files a/src/api/java/ic2/api/item/IItemHudInfo.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IItemHudInfo.java b/src/api/java/ic2/api/item/IItemHudInfo.java deleted file mode 100644 index 112d69102..000000000 --- a/src/api/java/ic2/api/item/IItemHudInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package ic2.api.item; - -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * An interface to allow the applied {@link Item} to override the overlay HUD text (which otherwise defaults to it's tooltip). - * - * @author Thunderdark - */ -public interface IItemHudInfo { - /** - *

Adds info to {@link IItemHudProvider}s for the given stack. - * Return an empty list not null if no info is given.

- * - *

-	 *	{@literal @}override
-	 *	public List{@literal <}String{@literal >} getHudInfo(ItemStack stack, boolean advanced) {
-	 *		List{@literal <}String{@literal >} info = new LinkedList{@literal <}String{@literal >}();
-	 *		info.add("I am a cool item");
-	 *		info.add("and have cool info.");
-	 * 		return info;
-	 * 	}
-	 *	
- * - * @param stack The stack to get information for - * @param advanced Whether the HUD is in extended or advanced display mode - * @return A list of strings to draw in the overlay - */ - public List getHudInfo(ItemStack stack, boolean advanced); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/item/IItemHudProvider$IItemHudBarProvider.class b/src/api/java/ic2/api/item/IItemHudProvider$IItemHudBarProvider.class deleted file mode 100644 index f8ee4fcbd..000000000 Binary files a/src/api/java/ic2/api/item/IItemHudProvider$IItemHudBarProvider.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IItemHudProvider.class b/src/api/java/ic2/api/item/IItemHudProvider.class deleted file mode 100644 index 98e3cc056..000000000 Binary files a/src/api/java/ic2/api/item/IItemHudProvider.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IItemHudProvider.java b/src/api/java/ic2/api/item/IItemHudProvider.java deleted file mode 100644 index baeb68306..000000000 --- a/src/api/java/ic2/api/item/IItemHudProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * An interface to show that an {@link Item} can display the HUD overlay if worn. - * - * @author Chocohead - */ -public interface IItemHudProvider { - /** - * Whether the given stack should display the HUD overlay. - * - * @param stack The stack currently being worn - * @return Whether the HUD overlay should be drawn - */ - boolean doesProvideHUD(ItemStack stack); - - /** - * Gets the current {@link HudMode} of the worn stack (probably stored as NBT) - * - * @param stack The stack currently being worn - * @return The HUD overlay mode - */ - HudMode getHudMode(ItemStack stack); - - /** - *

Override the percent shown by the HUD overlay for the applied item.

- * - *

By default, {@link IElectricItem}s have the percentage charged shown, - * damageable items have their {@link Item#getDurabilityForDisplay(ItemStack)} values shown - * and items that don't apply to either aren't shown at all.

- * - * @author Chocohead - */ - public static interface IItemHudBarProvider { - /** - * Get the percent to show in the overlay HUD for the given stack. - * - * @param stack The stack to get the percent for. - * @return A number between 0 and 100, less than 0 will not render the item at all. - */ - int getBarPercent(ItemStack stack); - } -} \ No newline at end of file diff --git a/src/api/java/ic2/api/item/IKineticRotor$GearboxType.class b/src/api/java/ic2/api/item/IKineticRotor$GearboxType.class deleted file mode 100644 index 4c6ab9db6..000000000 Binary files a/src/api/java/ic2/api/item/IKineticRotor$GearboxType.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IKineticRotor.class b/src/api/java/ic2/api/item/IKineticRotor.class deleted file mode 100644 index 4bba1ebde..000000000 Binary files a/src/api/java/ic2/api/item/IKineticRotor.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IKineticRotor.java b/src/api/java/ic2/api/item/IKineticRotor.java deleted file mode 100644 index a61d1622c..000000000 --- a/src/api/java/ic2/api/item/IKineticRotor.java +++ /dev/null @@ -1,23 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -public interface IKineticRotor { - int getDiameter(ItemStack stack); - - ResourceLocation getRotorRenderTexture(ItemStack stack); - - float getEfficiency(ItemStack stack); - - int getMinWindStrength(ItemStack stack); - - int getMaxWindStrength(ItemStack stack); - - boolean isAcceptedType(ItemStack stack, GearboxType type); - - public static enum GearboxType { - WATER, - WIND, - } -} diff --git a/src/api/java/ic2/api/item/IMetalArmor.class b/src/api/java/ic2/api/item/IMetalArmor.class deleted file mode 100644 index 426278ae3..000000000 Binary files a/src/api/java/ic2/api/item/IMetalArmor.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/IMetalArmor.java b/src/api/java/ic2/api/item/IMetalArmor.java deleted file mode 100644 index 16ffd24e5..000000000 --- a/src/api/java/ic2/api/item/IMetalArmor.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Armor items implementing this can be considered metal armor. - * - * Currently used for determining which boots can be used to slide up a magnetic pole. - */ -public interface IMetalArmor { - /** - * Determine if the given armor piece is metal armor. - * - * @param itemstack Armor piece as worn by the player - * @param player The player - * @return Whether the armor piece is metal armor - */ - public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player); -} diff --git a/src/api/java/ic2/api/item/ISpecialElectricItem.class b/src/api/java/ic2/api/item/ISpecialElectricItem.class deleted file mode 100644 index b21e26d12..000000000 Binary files a/src/api/java/ic2/api/item/ISpecialElectricItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ISpecialElectricItem.java b/src/api/java/ic2/api/item/ISpecialElectricItem.java deleted file mode 100644 index 14218d8c1..000000000 --- a/src/api/java/ic2/api/item/ISpecialElectricItem.java +++ /dev/null @@ -1,13 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -public interface ISpecialElectricItem { - /** - * Supply a custom IElectricItemManager. - * - * @param stack ItemStack to get the manager for - * @return IElectricItemManager instance - */ - IElectricItemManager getManager(ItemStack stack); -} diff --git a/src/api/java/ic2/api/item/ITeBlockSpecialItem.class b/src/api/java/ic2/api/item/ITeBlockSpecialItem.class deleted file mode 100644 index 5d2b1a280..000000000 Binary files a/src/api/java/ic2/api/item/ITeBlockSpecialItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ITeBlockSpecialItem.java b/src/api/java/ic2/api/item/ITeBlockSpecialItem.java deleted file mode 100644 index 7d9ca63eb..000000000 --- a/src/api/java/ic2/api/item/ITeBlockSpecialItem.java +++ /dev/null @@ -1,35 +0,0 @@ -package ic2.api.item; - -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.ItemStack; - -import ic2.api.info.ITeBlock; - -/** - * Change the default icon for an {@link ITeBlock} by implementing this. - * - * @since IC2 2.6.85 - * @version 1.0 - * - * @see {@link ITeBlock} for more information - * - * @author Chocohead - */ -public interface ITeBlockSpecialItem { - /** - * Should the model be delegated to the {@link ITeBlock} or the default used? - * - * @param stack The itemstack being rendered - * @return Whether the {@link ITeBlock} will return an {@link ModelResourceLocation} - */ - boolean doesOverrideDefault(ItemStack stack); - - /** - * The {@link ModelResourceLocation} for the given stack. - * Will still use the default even if {@link #doesOverrideDefault(ItemStack)} returns true if this returns null. - * - * @param stack The itemstack being rendered - * @return The model location to be used - */ - ModelResourceLocation getModelLocation(ItemStack stack); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/item/ITerraformingBP.class b/src/api/java/ic2/api/item/ITerraformingBP.class deleted file mode 100644 index d244d1fc5..000000000 Binary files a/src/api/java/ic2/api/item/ITerraformingBP.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ITerraformingBP.java b/src/api/java/ic2/api/item/ITerraformingBP.java deleted file mode 100644 index 9b27279fe..000000000 --- a/src/api/java/ic2/api/item/ITerraformingBP.java +++ /dev/null @@ -1,42 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** - * Allows an item to act as a terraformer blueprint. - */ -public interface ITerraformingBP { - /** - * Get the energy consumption per operation of the blueprint. - * @param stack TODO - * - * @return Energy consumption in EU - */ - double getConsume(ItemStack stack); - - /** - * Get the maximum range of the blueprint. - * Should be a divisor of 5. - * @param stack TODO - * - * @return Maximum range in blocks - */ - int getRange(ItemStack stack); - - boolean canInsert(ItemStack stack, EntityPlayer player, World world, BlockPos pos); - - /** - * Perform the terraforming operation. - * @param stack TODO - * @param world world to terraform - * @param x X position to terraform - * @param z Z position to terraform - * @param yCoord Y position of the terraformer - * - * @return Whether the operation was successful and the terraformer should consume energy. - */ - boolean terraform(ItemStack stack, World world, BlockPos pos); -} diff --git a/src/api/java/ic2/api/item/ItemWrapper.class b/src/api/java/ic2/api/item/ItemWrapper.class deleted file mode 100644 index 5454f5eff..000000000 Binary files a/src/api/java/ic2/api/item/ItemWrapper.class and /dev/null differ diff --git a/src/api/java/ic2/api/item/ItemWrapper.java b/src/api/java/ic2/api/item/ItemWrapper.java deleted file mode 100644 index 6859d29c1..000000000 --- a/src/api/java/ic2/api/item/ItemWrapper.java +++ /dev/null @@ -1,50 +0,0 @@ -package ic2.api.item; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * Wrapper for inserting interfaces into items you don't own. - * - * @author Richard - */ -public class ItemWrapper { - private static final Multimap boxableItems = ArrayListMultimap.create(); - private static final Multimap 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(); - // use customs first to allow for overriding behavior - for (IBoxable boxable : boxableItems.get(item)) { - if (boxable.canBeStoredInToolbox(stack)) return true; - } - - if (item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack)) return true; - - return false; - } - - public static void registerMetalArmor(Item item, IMetalArmor armor) { - metalArmorItems.put(item, armor); - } - - public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) { - 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; - } - - if (item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player)) return true; - - return false; - } -} diff --git a/src/api/java/ic2/api/network/ClientModifiable.class b/src/api/java/ic2/api/network/ClientModifiable.class deleted file mode 100644 index dea7b6fc1..000000000 Binary files a/src/api/java/ic2/api/network/ClientModifiable.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/ClientModifiable.java b/src/api/java/ic2/api/network/ClientModifiable.java deleted file mode 100644 index a950cbf03..000000000 --- a/src/api/java/ic2/api/network/ClientModifiable.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.network; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface ClientModifiable { } diff --git a/src/api/java/ic2/api/network/IGrowingBuffer.class b/src/api/java/ic2/api/network/IGrowingBuffer.class deleted file mode 100644 index 416349df7..000000000 Binary files a/src/api/java/ic2/api/network/IGrowingBuffer.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/IGrowingBuffer.java b/src/api/java/ic2/api/network/IGrowingBuffer.java deleted file mode 100644 index 6b2353d57..000000000 --- a/src/api/java/ic2/api/network/IGrowingBuffer.java +++ /dev/null @@ -1,36 +0,0 @@ -package ic2.api.network; - -import java.io.DataInput; -import java.io.DataOutput; - -public interface IGrowingBuffer extends DataInput, DataOutput { - /** - * Write a number of variable size to the buffer - * - * @param i The number to write - */ - void writeVarInt(int i); - - /** - * Write a string directly to the buffer, - * opposed to {@link DataOutput#writeUTF(String)} that properly encodes Unicode characters first - * - * @param s The string to write - */ - void writeString(String s); - - /** - * Read a number of variable size to the buffer - * - * @return The variably sized number stored on the buffer - */ - int readVarInt(); - - /** - * Read a string directly from the buffer, - * opposed to {@link DataInput#readUTF()} that properly decodes Unicode characters first - * - * @return The string stored on the buffer - */ - String readString(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.class b/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.class deleted file mode 100644 index 3234025c1..000000000 Binary files a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java b/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java deleted file mode 100644 index ed3ea38fe..000000000 --- a/src/api/java/ic2/api/network/INetworkClientTileEntityEventListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Allows a tile entity to receive network events received from clients. - */ -public interface INetworkClientTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param player client which sent the event - * @param event event ID - */ - void onNetworkEvent(EntityPlayer player, int event); -} - diff --git a/src/api/java/ic2/api/network/INetworkCustomEncoder.class b/src/api/java/ic2/api/network/INetworkCustomEncoder.class deleted file mode 100644 index 64885fcfb..000000000 Binary files a/src/api/java/ic2/api/network/INetworkCustomEncoder.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkCustomEncoder.java b/src/api/java/ic2/api/network/INetworkCustomEncoder.java deleted file mode 100644 index 86885139c..000000000 --- a/src/api/java/ic2/api/network/INetworkCustomEncoder.java +++ /dev/null @@ -1,36 +0,0 @@ -package ic2.api.network; - -import java.io.IOException; - -/** - * Allow extensions to {@link ic2.core.network.DataEncoder} for encoding custom data types not already handled by IC2. - * Register this to DataEncoder itself using #addNetworkEncoder(Class, INetworkCustomEncoder). - * - * @author Chocohead - */ -public interface INetworkCustomEncoder { - /** - * Encode the given instance into the buffer - * - * @param buffer The network buffer - * @param instance The instance being encoded - * - * @throws IOException Because {@link ic2.core.network.DataEncoder#encode(IGrowingBuffer, Object, boolean)} does. - */ - void encode(IGrowingBuffer buffer, Object instance) throws IOException; - - /** - * @param buffer The network buffer - * - * @return The instance the information on the network represents - * - * @throws IOException Because {@link ic2.core.network.DataEncoder#decode(IGrowingBuffer, ic2.core.network.DataEncoder.EncodedType)} does. - */ - Object decode(IGrowingBuffer buffer) throws IOException; - - /** - * @return false the type accesses the world or otherwise requires to be run on the main thread, - * true if it doesn't. - */ - boolean isThreadSafe(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/network/INetworkDataProvider.class b/src/api/java/ic2/api/network/INetworkDataProvider.class deleted file mode 100644 index e0773c476..000000000 Binary files a/src/api/java/ic2/api/network/INetworkDataProvider.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkDataProvider.java b/src/api/java/ic2/api/network/INetworkDataProvider.java deleted file mode 100644 index f5a3d24b9..000000000 --- a/src/api/java/ic2/api/network/INetworkDataProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package ic2.api.network; - -import java.util.List; - -/** - * Tile entities which want to synchronized specific fields between client and server have to implement this. - * - * The fields don't update themselves, a field update must be sent every time a synchronized field changes. - */ -public interface INetworkDataProvider { - /** - * Get the list of synchronized fields. - * - * If a name contains =, the name will be split into the actual name and the value, avoiding a - * field read. - * - * @return Names of the synchronized fields - */ - List getNetworkedFields(); -} - diff --git a/src/api/java/ic2/api/network/INetworkItemEventListener.class b/src/api/java/ic2/api/network/INetworkItemEventListener.class deleted file mode 100644 index 30dcc22e0..000000000 Binary files a/src/api/java/ic2/api/network/INetworkItemEventListener.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkItemEventListener.java b/src/api/java/ic2/api/network/INetworkItemEventListener.java deleted file mode 100644 index 7c59a270e..000000000 --- a/src/api/java/ic2/api/network/INetworkItemEventListener.java +++ /dev/null @@ -1,19 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Allows an item to receive network events received from the server. - */ -public interface INetworkItemEventListener { - /** - * Called when a network event is received. - * - * @param stack item stack - * @param player player containing the item - * @param event event ID - */ - void onNetworkEvent(ItemStack stack, EntityPlayer player, int event); -} - diff --git a/src/api/java/ic2/api/network/INetworkManager.class b/src/api/java/ic2/api/network/INetworkManager.class deleted file mode 100644 index aee59174e..000000000 Binary files a/src/api/java/ic2/api/network/INetworkManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkManager.java b/src/api/java/ic2/api/network/INetworkManager.java deleted file mode 100644 index 81a55f778..000000000 --- a/src/api/java/ic2/api/network/INetworkManager.java +++ /dev/null @@ -1,30 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * This is just here for the API functions. - * Do not implement by yourself. - * - * @see NetworkHelper - * - * @author Aroma1997 - * - */ -public interface INetworkManager { - - void updateTileEntityField(TileEntity te, String field); - - void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange); - - void initiateItemEvent(EntityPlayer player, ItemStack stack, int event, boolean limitRange); - - void initiateClientTileEntityEvent(TileEntity te, int event); - - void initiateClientItemEvent(ItemStack stack, int event); - - void sendInitialData(TileEntity te); - -} diff --git a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.class b/src/api/java/ic2/api/network/INetworkTileEntityEventListener.class deleted file mode 100644 index d7f438676..000000000 Binary files a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java b/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java deleted file mode 100644 index fbb4753c5..000000000 --- a/src/api/java/ic2/api/network/INetworkTileEntityEventListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.network; - -/** - * Allows a tile entity to receive network events received from the server. - */ -public interface INetworkTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param event Event ID - */ - void onNetworkEvent(int event); -} - diff --git a/src/api/java/ic2/api/network/INetworkUpdateListener.class b/src/api/java/ic2/api/network/INetworkUpdateListener.class deleted file mode 100644 index db801296f..000000000 Binary files a/src/api/java/ic2/api/network/INetworkUpdateListener.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/INetworkUpdateListener.java b/src/api/java/ic2/api/network/INetworkUpdateListener.java deleted file mode 100644 index 09414ae38..000000000 --- a/src/api/java/ic2/api/network/INetworkUpdateListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.network; - -/** - * Allows a tile entity to receive field sync updates received from the server. - */ -public interface INetworkUpdateListener { - /** - * Called when a field is synchronized. - * - * @param field field synchronized - */ - void onNetworkUpdate(String field); -} - diff --git a/src/api/java/ic2/api/network/NetworkHelper.class b/src/api/java/ic2/api/network/NetworkHelper.class deleted file mode 100644 index 87e27c3be..000000000 Binary files a/src/api/java/ic2/api/network/NetworkHelper.class and /dev/null differ diff --git a/src/api/java/ic2/api/network/NetworkHelper.java b/src/api/java/ic2/api/network/NetworkHelper.java deleted file mode 100644 index 9e7bcfea1..000000000 --- a/src/api/java/ic2/api/network/NetworkHelper.java +++ /dev/null @@ -1,170 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.relauncher.Side; - -import ic2.api.info.Info; - -/** - * Provides methods to initiate events and synchronize tile entity fields in SMP. - * - * The methods are transparent between singleplayer and multiplayer - if a method is called in - * singleplayer, the associated callback will be locally executed. The implementation is different - * between the client and server versions of IC2. - * - * You'll usually want to use the server->client methods defined here to synchronize information - * which is needed by the clients outside the GUI, such as rendering the block, playing sounds or - * producing effects. Anything which is only visible inside the GUI should be synchronized through - * the Container class associated to the GUI in Container.updateProgressBar(). - * - * All methods in this class use the current effective side to determine the Network Manager to use. - * If you do not want it to use the effective side, use {@link #getNetworkManager(Side)} to get the - * Network Manager for a specific side. - */ -public final class NetworkHelper { - // server -> client - - - /** - * Schedule a TileEntity's field to be updated to the clients in range. - * - * The updater will query the field's value during the next update, updates happen usually - * every 2 ticks. If low latency is important use initiateTileEntityEvent instead. - * - * IC2's network updates have to get triggered every time, it doesn't continuously poll/send - * the field value. Just call updateTileEntityField after every change to a field which needs - * network synchronization. - * - * The following field data types are currently supported: - * - int, int[], short, short[], byte, byte[], long, long[] - * - float, float[], double, double[] - * - boolean, boolean[] - * - String, String[] - * - ItemStack - * - NBTBase (includes NBTTagCompound) - * - Block, Item, Achievement, Potion, Enchantment - * - BlockPos, ChunkCoordIntPair - * - TileEntity (does not sync the actual tile entity, instead looks up the tile entity by its position in the client world) - * - World (does not sync the actual world, instead looks up the world by its dimension ID) - * - * Once the update has been processed by the client, it'll call onNetworkUpdate on the client- - * side TileEntity if it implements INetworkUpdateListener. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkUpdateListener.onNetworkUpdate (if implemented by the te). - * - * @param te TileEntity to update - * @param field Name of the field to update - */ - public static void updateTileEntityField(TileEntity te, String field) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).updateTileEntityField(te, field); - } - - /** - * Immediately send an event for the specified TileEntity to the clients in range. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkTileEntityEventListener.onNetworkEvent (if implemented by the te). - * - * @param te TileEntity to notify, should implement INetworkTileEntityEventListener - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @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) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateTileEntityEvent(te, event, limitRange); - } - - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkItemEventListener.onNetworkEvent (if implemented by the item). - * - * @param player EntityPlayer holding the item - * @param stack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @param limitRange Limit the notification range to (currently) 20 blocks instead of the - * tracking distance if true - */ - public static void initiateItemEvent(EntityPlayer player, ItemStack stack, int event, boolean limitRange) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateItemEvent(player, stack, event, limitRange); - } - - /** - * Send initial TileEntity data to the clients. Requires the te to implement - * {@link INetworkDataProvider}. - * @param te The te to send the initial data for. - */ - public static void sendInitialData(TileEntity te) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).sendInitialData(te); - } - - - // client -> server - - /** - * Immediately send an event for the specified TileEntity to the server. - * - * This method doesn't do anything if executed on the server. - * - * @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) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateClientTileEntityEvent(te, event); - } - - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * This method doesn't do anything if executed on the server. - * - * @param stack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - */ - public static void initiateClientItemEvent(ItemStack stack, int event) { - getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateClientItemEvent(stack, event); - } - - /** - * This will return the NetworkManager for the given side. - * @param side the side to get the NetworkManager for. - * @return The NetworkManager for the given side. - */ - public static INetworkManager getNetworkManager(Side side) { - if (side.isClient()) { - return clientInstance; - } - else { - return serverInstance; - } - } - - private static INetworkManager serverInstance; - private static INetworkManager clientInstance; - - /** - * Sets the internal INetworkManager instance. - * ONLY IC2 CAN DO THIS!!!!!!! - */ - public static void setInstance(INetworkManager server, INetworkManager client) { - ModContainer mc = Loader.instance().activeModContainer(); - if (mc == null || !Info.MOD_ID.equals(mc.getModId())) { - throw new IllegalAccessError(); - } - serverInstance = server; - clientInstance = client; - } -} - diff --git a/src/api/java/ic2/api/reactor/IBaseReactorComponent.class b/src/api/java/ic2/api/reactor/IBaseReactorComponent.class deleted file mode 100644 index 2c33a15c6..000000000 Binary files a/src/api/java/ic2/api/reactor/IBaseReactorComponent.class and /dev/null differ diff --git a/src/api/java/ic2/api/reactor/IBaseReactorComponent.java b/src/api/java/ic2/api/reactor/IBaseReactorComponent.java deleted file mode 100644 index 7e5383b9e..000000000 --- a/src/api/java/ic2/api/reactor/IBaseReactorComponent.java +++ /dev/null @@ -1,21 +0,0 @@ -package ic2.api.reactor; - -import net.minecraft.item.ItemStack; - -/** - * Items implementing this class will not get spilled out of the reactor, when they are in one. - * @author Aroma1997 - */ -public interface IBaseReactorComponent { - - /** - * This is to determine if the given Item can be put into a reactor.
- * Items already in the reactor won't get spilled out. This only gets called, - * when placing the item in. - * @param stack The given reactor component. - * @param reactor The specific reactor to place the item in. - * @return If the item is accepted in the reactor. - */ - boolean canBePlacedIn(ItemStack stack, IReactor reactor); - -} diff --git a/src/api/java/ic2/api/reactor/IReactor.class b/src/api/java/ic2/api/reactor/IReactor.class deleted file mode 100644 index 7878499fb..000000000 Binary files a/src/api/java/ic2/api/reactor/IReactor.class and /dev/null differ diff --git a/src/api/java/ic2/api/reactor/IReactor.java b/src/api/java/ic2/api/reactor/IReactor.java deleted file mode 100644 index 963cfa951..000000000 --- a/src/api/java/ic2/api/reactor/IReactor.java +++ /dev/null @@ -1,148 +0,0 @@ -package ic2.api.reactor; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import ic2.api.info.ILocatable; - -/** - * Interface implemented nuclear reactors, expected to be a {@link TileEntity}, but does not have to be. - */ -public interface IReactor extends ILocatable { - /** - * Return the tile entity representing the reactor core. - *
- * If null, {@link #getReactorWorld()} and {@link #getReactorPos()} can still be used if it's world and/or position are desired. - * - * @return the reactor core's TE or null. - */ - public TileEntity getCoreTe(); - - /** - * Get the reactor's heat. - * - * @return The reactor's heat - */ - public int getHeat(); - - /** - * Set the reactor's heat. - * - * @param heat reactor heat - */ - public void setHeat(int heat); - - /** - * Increase the reactor's heat. - * - * Use negative values to decrease. - * - * @param amount amount of heat to add - * @return The reactor's heat after adding the specified amount - */ - public int addHeat(int amount); - - /** - * Get the reactor's maximum heat before exploding. - * - * @return Maximum heat value - */ - public int getMaxHeat(); - - /** - * Set the reactor's stored maxHeat variable. - * Used by plating to increase the reactors MaxHeat capacity. - * Needs to be called during each cycle process. - */ - public void setMaxHeat(int newMaxHeat); - - /** - * add Heat to a EmitHeat Buffer - * for use in Reactor operation.. need to be use - * for all Componetents with self-cooling - * no more magic heat disappear - */ - - - public void addEmitHeat(int heat); - - /** - * Get's the reactor's HEM (Heat Effect Modifier) - * Basic value is 1.0F. - * Reducing the value causes a weakening/reduction of the heat-based sideeffects of reactors - * (F.e. water evaporation, melting, damaging entitys, etc) - * - * @return HEM - */ - public float getHeatEffectModifier(); - - /** - * Set's the reactor's HEM - * Needs to be called during each cycle process. - */ - public void setHeatEffectModifier(float newHEM); - - /** - * Get the reactor's energy output. - * - * @return Energy output, not multiplied by the base EU/t value - */ - public float getReactorEnergyOutput(); - - /** - * Get the reactor's energy output. - * - * @return Energy output, multiplied with base EU/t value and MainConfig.get().getFloat("balance/energy/generator/nuclear") - */ - public double getReactorEUEnergyOutput(); - - /** - * Add's the given amount of energy to the Reactor's output. - * - * @return Energy output after adding the value, not multiplied by the base EU/t value - */ - public float addOutput(float energy); - - /** - * Get the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds returns null - * @param y Y position of the item, out of bounds returns null - * @return The item or null if there is no item - */ - public ItemStack getItemAt(int x, int y); - - /** - * Set the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds is a no-op - * @param y Y position of the item, out of bounds is a no-op - * @param item The item to set. - */ - public void setItemAt(int x, int y, ItemStack item); - - /** - * Explode the reactor. - */ - public void explode(); - - /** - * Get the reactor's tick rate (game ticks per reactor tick). - * - * @return Tick rate - */ - public int getTickRate(); - - /** - * Get whether the reactor is active and supposed to produce energy - * @return Whether the reactor is active - */ - public boolean produceEnergy(); - - // TODO: add the rs modifier capability to the api somehow - - /** - * @return true if the reactor is FluidCooled - */ - public boolean isFluidCooled(); -} diff --git a/src/api/java/ic2/api/reactor/IReactorChamber.class b/src/api/java/ic2/api/reactor/IReactorChamber.class deleted file mode 100644 index 4fe583e52..000000000 Binary files a/src/api/java/ic2/api/reactor/IReactorChamber.class and /dev/null differ diff --git a/src/api/java/ic2/api/reactor/IReactorChamber.java b/src/api/java/ic2/api/reactor/IReactorChamber.java deleted file mode 100644 index e0fb5d1c2..000000000 --- a/src/api/java/ic2/api/reactor/IReactorChamber.java +++ /dev/null @@ -1,22 +0,0 @@ -package ic2.api.reactor; - -/** - * Interface implemented nuclear reactor chambers - */ -public interface IReactorChamber { - /** - * Return the {@link IReactor} this chamber is for - * - * @return The reactor - */ - public IReactor getReactorInstance(); - - /** - * Returns true if the chamber is a reactor wall opposed to an actual chamber of items - *
- * eg: {@link TileEntityReactorChamberElectric} returns false, but {@link TileEntityReactorVessel} returns true - * - * @return If the chamber is a wall or not - */ - public boolean isWall(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/reactor/IReactorComponent.class b/src/api/java/ic2/api/reactor/IReactorComponent.class deleted file mode 100644 index 8a7a6fccd..000000000 Binary files a/src/api/java/ic2/api/reactor/IReactorComponent.class and /dev/null differ diff --git a/src/api/java/ic2/api/reactor/IReactorComponent.java b/src/api/java/ic2/api/reactor/IReactorComponent.java deleted file mode 100644 index 7916cc17b..000000000 --- a/src/api/java/ic2/api/reactor/IReactorComponent.java +++ /dev/null @@ -1,98 +0,0 @@ -package ic2.api.reactor; - -import net.minecraft.item.ItemStack; - -/** - * Design custom Reactor components by implementing this Interface - * Items implementing the interface will not be ejected from Reactors in their clean-up - * and can/will be interacted with by other elements, f.e. Uranium Cells. - * - * All IC2 ReactorComponents implement and use this Interface - * - */ -public interface IReactorComponent extends IBaseReactorComponent { - /** - * Called by reactor upon iterating through it's inventory (every cycle). - * Perform all necessary calculation/interaction here - * - * @param stack Reference to the specific instance of called ItemStack - * @param reactor Reference to the Reactor - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heatrun every Stack will cycle 2 time (true, false) first run for heat, sec for Eu calculation - */ - public void processChamber(ItemStack stack, IReactor reactor, int x, int y, boolean heatrun); - - /** - * Can be called by Uranium-Components who attempt to generate energy by pulsing to other components. - * Uranium-Uranium interaction (f.e.) uses this method. - * @param stack Reference to the specific instance of called ItemStack - * @param reactor Reference to the Reactor - * @param pulsingStack Reference to the specific instance of pulsing ItemStack - * @param youX X-coordinate of your stack in the grid - * @param youY Y-coordinate of your stack in the grid - * @param pulseX X-coordinate of pulsing stack in the grid - * @param pulseY Y-coordinate of pulsing stack in the grid - * @param heatrun true for only create heat not EU, false for only EU not heat - * @return true if this component reacts to the pulse (and pulse is therefore meant to produce heat) - */ - public boolean acceptUraniumPulse(ItemStack stack, IReactor reactor, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun); - - /** - * Called by components to determine whether your component can be heated. - * @param stack Reference to the specific instance of iterated ItemStack - * @param reactor Reference to the Reactor - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return true if your component can take heat - */ - public boolean canStoreHeat(ItemStack stack, IReactor reactor, int x, int y); - - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the maximum capacity of your heat-containing component here. - * @param stack Reference to the specific instance of iterated ItemStack - * @param reactor Reference to the Reactor - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Maximum heat - */ - public int getMaxHeat(ItemStack stack, IReactor reactor, int x, int y); - - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the current amount of heat stored in this component - * @param stack Reference to the specific instance of iterated ItemStack - * @param reactor Reference to the Reactor - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Current Heat - */ - public int getCurrentHeat(ItemStack stack, IReactor reactor, int x, int y); - - /** - * Called by components to distribute heat to your component. - * Perform heating-calculations and increase your heat (dmg) level accordingly. - * This method will as well be called to REDUCE heat, by providing a negative amount. - * - * @param stack Reference to the specific instance of iterated ItemStack - * @param reactor Reference to the Reactor - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heat Amount of heat to be added (may be negative to subtract heat) - * @return 0 if the 'order' was accepted, return >0 to indicate the 'remaining' heat which couldn't be absorbed (and vice versa for <0) - */ - public int alterHeat(ItemStack stack, IReactor reactor, int x, int y, int heat); - - /** - * Called upon reactor explosion - * Alter the explosion size. - * Returning a float 0 < f < 1 will be counted as multiplier. - * Anything else will be counted as a flat addition (in case of <0 = reduction). - * - * @param stack Reference to the specific instance of iterated ItemStack - * @param reactor Reference to the Reactor - * @return your explosion modifier - */ - public float influenceExplosion(ItemStack stack, IReactor reactor); -} diff --git a/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.class b/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.class deleted file mode 100644 index 31608e783..000000000 Binary files a/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.java b/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.java deleted file mode 100644 index 86e725c0e..000000000 --- a/src/api/java/ic2/api/recipe/IBasicMachineRecipeManager.java +++ /dev/null @@ -1,13 +0,0 @@ -package ic2.api.recipe; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public interface IBasicMachineRecipeManager extends IMachineRecipeManager, ItemStack> { - boolean addRecipe(IRecipeInput input, NBTTagCompound metadata, boolean replace, ItemStack... outputs); - - @Deprecated - RecipeOutput getOutputFor(ItemStack input, boolean adjustInput); -} diff --git a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$Input.class b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$Input.class deleted file mode 100644 index 4b88cdf18..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$Input.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$RawInput.class b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$RawInput.class deleted file mode 100644 index f7edd9fed..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager$RawInput.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.class b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.class deleted file mode 100644 index fc1013660..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java b/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java deleted file mode 100644 index 6471e475e..000000000 --- a/src/api/java/ic2/api/recipe/ICannerBottleRecipeManager.java +++ /dev/null @@ -1,57 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.item.ItemStack; - -import ic2.api.recipe.ICannerBottleRecipeManager.Input; -import ic2.api.recipe.ICannerBottleRecipeManager.RawInput; - -public interface ICannerBottleRecipeManager extends IMachineRecipeManager { - /** - * Adds a recipe to the machine. - * - * @param container Container to be filled - * @param fill Item to fill into the container - * @param output Filled container - * @return - */ - boolean addRecipe(IRecipeInput container, IRecipeInput fill, ItemStack output, boolean replace); - - @Deprecated - void addRecipe(IRecipeInput container, IRecipeInput fill, ItemStack output); - - /** - * Gets the recipe output for the given input. - * - * @param container Container to be filled - * @param fill Item to fill into the container - * @param adjustInput modify the input according to the recipe's requirements - * @param acceptTest allow either container or fill to be null to see if either of them is part of a recipe - * @return Recipe output, or null if none - */ - @Deprecated - RecipeOutput getOutputFor(ItemStack container, ItemStack fill, boolean adjustInput, boolean acceptTest); - - public static class Input { - public Input(IRecipeInput container, IRecipeInput fill) { - this.container = container; - this.fill = fill; - } - - public boolean matches(ItemStack container, ItemStack fill) { - return this.container.matches(container) && this.fill.matches(fill); - } - - public final IRecipeInput container; - public final IRecipeInput fill; - } - - public static class RawInput { - public RawInput(ItemStack container, ItemStack fill) { - this.container = container; - this.fill = fill; - } - - public final ItemStack container; - public final ItemStack fill; - } -} diff --git a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$Input.class b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$Input.class deleted file mode 100644 index 8a00f0bcc..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$Input.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$RawInput.class b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$RawInput.class deleted file mode 100644 index 6d01f5efd..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager$RawInput.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.class b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.class deleted file mode 100644 index 73118021f..000000000 Binary files a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java b/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java deleted file mode 100644 index f87a860be..000000000 --- a/src/api/java/ic2/api/recipe/ICannerEnrichRecipeManager.java +++ /dev/null @@ -1,56 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -import ic2.api.recipe.ICannerEnrichRecipeManager.Input; -import ic2.api.recipe.ICannerEnrichRecipeManager.RawInput; - -public interface ICannerEnrichRecipeManager extends IMachineRecipeManager { - /** - * Adds a recipe to the machine. - * - * @param input Fluid input - * @param additive Item to enrich the fluid with - * @param output Output fluid - */ - @Deprecated - public void addRecipe(FluidStack input, IRecipeInput additive, FluidStack output); - - /** - * Gets the recipe output for the given input. - * - * @param input Fluid input - * @param additive Item to enrich the fluid with - * @param adjustInput modify the input according to the recipe's requirements - * @param acceptTest allow input or additive to be null to see if either of them is part of a recipe - * @return Recipe output, or null if none, output fluid in nbt - */ - @Deprecated - public RecipeOutput getOutputFor(FluidStack input, ItemStack additive, boolean adjustInput, boolean acceptTest); - - public static class Input { - public Input(FluidStack fluid, IRecipeInput additive) { - this.fluid = fluid; - this.additive = additive; - } - - public boolean matches(FluidStack fluid, ItemStack additive) { - return this.fluid.isFluidEqual(fluid) && this.additive.matches(additive); - } - - public final FluidStack fluid; - public final IRecipeInput additive; - } - - public static class RawInput { - public RawInput(FluidStack fluid, ItemStack additive) { - this.fluid = fluid; - this.additive = additive; - } - - public final FluidStack fluid; - public final ItemStack additive; - } -} diff --git a/src/api/java/ic2/api/recipe/ICraftingRecipeManager$AttributeContainer.class b/src/api/java/ic2/api/recipe/ICraftingRecipeManager$AttributeContainer.class deleted file mode 100644 index 26f2e3b87..000000000 Binary files a/src/api/java/ic2/api/recipe/ICraftingRecipeManager$AttributeContainer.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.class b/src/api/java/ic2/api/recipe/ICraftingRecipeManager.class deleted file mode 100644 index abf33e484..000000000 Binary files a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java b/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java deleted file mode 100644 index 7ff754571..000000000 --- a/src/api/java/ic2/api/recipe/ICraftingRecipeManager.java +++ /dev/null @@ -1,45 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.item.ItemStack; - -/** - * Recipe manager interface for crafting recipes. - * - * @author Richard - */ -public interface ICraftingRecipeManager { - /** - * Adds a shaped crafting recipe. - * - * @param output Recipe output - * @param input Recipe input format - */ - public void addRecipe(ItemStack output, Object... input); - - /** - * Adds a shapeless crafting recipe. - * - * @param output Recipe output - * @param input Recipe input - */ - public void addShapelessRecipe(ItemStack output, Object... input); - - /** - * Attribute container to pass additional information to AdvRecipe and AdvShapelessRecipe - * - * @author Chocohead - */ - public static class AttributeContainer { - public final boolean hidden; - public final boolean consuming; - - /** - * @param hidden Whether the recipe is hidden from JEI by default - * @param consuming Whether containers should be consumed or returned empty - */ - public AttributeContainer(boolean hidden, boolean consuming) { - this.hidden = hidden; - this.consuming = consuming; - } - } -} \ No newline at end of file diff --git a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerOutput.class b/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerOutput.class deleted file mode 100644 index e0fe95255..000000000 Binary files a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerOutput.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerRecipe.class b/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerRecipe.class deleted file mode 100644 index 8896a87a8..000000000 Binary files a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager$ElectrolyzerRecipe.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.class b/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.class deleted file mode 100644 index a41162e9a..000000000 Binary files a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.java b/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.java deleted file mode 100644 index 3b2917c57..000000000 --- a/src/api/java/ic2/api/recipe/IElectrolyzerRecipeManager.java +++ /dev/null @@ -1,120 +0,0 @@ -package ic2.api.recipe; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Nonnull; -import javax.annotation.ParametersAreNonnullByDefault; - -import org.apache.commons.lang3.tuple.Pair; - -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -/** - * Electrolyzer recipe manager, similar to {@link ISemiFluidFuelManager} and {@link IFermenterRecipeManager}, - * but more sided to fit how the Electrolyzer now works - * - * @author Chocohead - */ -public interface IElectrolyzerRecipeManager extends ILiquidAcceptManager { - /** - * Add a new recipe to the electrolyzer. - * - * @param input The name of the fluid being electrolyzed - * @param inputAmount The amount of input fluid used per operation (in millibuckets) - * @param EUaTick The EU used per tick - * @param outputs The output fluids, with a given direction for the tank to fill - */ - void addRecipe(@Nonnull String input, int inputAmount, int EUaTick, @Nonnull ElectrolyzerOutput... outputs); - - /** - * Add a new recipe to the electrolyzer. - * - * @param input The name of the fluid being electrolyzed - * @param inputAmount The amount of input fluid used per operation (in millibuckets) - * @param EUaTick The EU used per tick - * @param ticksNeeded The number of ticks each operation takes, will default to 200 if not given - * @param outputs The output fluids, with a given direction for the tank to fill - */ - void addRecipe(@Nonnull String input, int inputAmount, int EUaTick, int ticksNeeded, @Nonnull ElectrolyzerOutput... outputs); - - /** - * Get an electrolyzer recipe for the given fluid - * - * @param Input fluid - * @return The found recipe or null if no recipe is found - */ - ElectrolyzerRecipe getElectrolysisInformation(Fluid fluid); - - /** - * Get the {@link ElectrolyzerOutput}s for the given input fluid - * - * @param Input fluid - * @return Outputs and tank directions - */ - ElectrolyzerOutput[] getOutput(Fluid input); - - /** - * Gets the whole current fluid mappings - * @return The current fluid map - */ - Map getRecipeMap(); - - @ParametersAreNonnullByDefault - public static final class ElectrolyzerOutput { - /** - * @param fluidName The name of the output fluid - * @param fluidAmount The amount of the fluid produced per operation (in millibuckets) - * @param tankDirection The direction relative to the electrolyzer that the output tank should be - */ - public ElectrolyzerOutput(String fluidName, int fluidAmount, EnumFacing tankDirection) { - this.fluidName = fluidName; - this.fluidAmount = fluidAmount; - this.tankDirection = tankDirection; - } - - public FluidStack getOutput() { - return FluidRegistry.getFluid(fluidName) == null ? null : new FluidStack(FluidRegistry.getFluid(this.fluidName), this.fluidAmount); - } - - public Pair getFullOutput() { - return Pair.of(getOutput(), tankDirection); - } - - public final String fluidName; - public final int fluidAmount; - public final EnumFacing tankDirection; - } - - public static final class ElectrolyzerRecipe { - public ElectrolyzerRecipe(int inputAmount, int EUaTick, int ticksNeeded, ElectrolyzerOutput... outputs) { - this.inputAmount = inputAmount; - this.EUaTick = EUaTick; - this.ticksNeeded = ticksNeeded; - this.outputs = validateOutputs(outputs); - } - - private ElectrolyzerOutput[] validateOutputs(ElectrolyzerOutput[] outputs) { - if (outputs.length < 1 || outputs.length > 5) { - throw new RuntimeException("Cannot have "+outputs.length+" outputs of an Electrolzer recipe, must be between 1 and 5"); - } - Set directions = new HashSet(outputs.length * 2, 0.5F); - for (ElectrolyzerOutput output : outputs) { - if (!directions.add(output.tankDirection)) { - throw new RuntimeException("Duplicate direction in Electrolzer outputs ("+output.tankDirection+')'); - } - } - return outputs; - } - - public final int inputAmount; - public final int EUaTick; - public final int ticksNeeded; - public final ElectrolyzerOutput[] outputs; - } -} \ No newline at end of file diff --git a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager$Output.class b/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager$Output.class deleted file mode 100644 index 24704809b..000000000 Binary files a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager$Output.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.class b/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.class deleted file mode 100644 index 722df6032..000000000 Binary files a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.java b/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.java deleted file mode 100644 index d301b41a5..000000000 --- a/src/api/java/ic2/api/recipe/IEmptyFluidContainerRecipeManager.java +++ /dev/null @@ -1,25 +0,0 @@ -package ic2.api.recipe; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -import ic2.api.recipe.IEmptyFluidContainerRecipeManager.Output; -import ic2.api.util.FluidContainerOutputMode; - -public interface IEmptyFluidContainerRecipeManager extends IMachineRecipeManager { - MachineRecipeResult apply(ItemStack input, Fluid requiredFluid, FluidContainerOutputMode outputMode, boolean acceptTest); - - public static class Output { - public Output(Collection container, FluidStack fluid) { - this.container = container; - this.fluid = fluid; - } - - public final Collection container; - public final FluidStack fluid; - } -} diff --git a/src/api/java/ic2/api/recipe/IFermenterRecipeManager$FermentationProperty.class b/src/api/java/ic2/api/recipe/IFermenterRecipeManager$FermentationProperty.class deleted file mode 100644 index 4b8138fe0..000000000 Binary files a/src/api/java/ic2/api/recipe/IFermenterRecipeManager$FermentationProperty.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.class b/src/api/java/ic2/api/recipe/IFermenterRecipeManager.class deleted file mode 100644 index 450f09a43..000000000 Binary files a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java b/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java deleted file mode 100644 index 87fcba699..000000000 --- a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java +++ /dev/null @@ -1,64 +0,0 @@ -package ic2.api.recipe; - -import java.util.Map; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -/** - * Fermenter recipe manager, very closely based off of {@link ISemiFluidFuelManager} - * - * @author Chocohead - */ -public interface IFermenterRecipeManager extends ILiquidAcceptManager { - /** - * Add a new recipe to the fermenter. - * - * @param input The name of the fluid to ferment - * @param inputAmount The amount of input fluid used per operation (in millibuckets) - * @param heat The total amount of heat needed to convert the input into the output - * @param output The name of the fluid that is being fermented into - * @param outputAmount The amount of output fluid produced per operation - */ - void addRecipe(String input, int inputAmount, int heat, String output, int outputAmount); - - /** - * Get a fermenter recipe for the given fluid - * - * @return The found recipe or null if no recipe is found - */ - FermentationProperty getFermentationInformation(Fluid fluid); - - /** - * Get the {@link FluidStack} output for the given input fluid - * - * @param Input fluid - * @return Output fluid + amount - */ - FluidStack getOutput(Fluid input); - - /** - * Gets the whole current fluid mappings - * @return The current fluid map - */ - Map getRecipeMap(); - - public static final class FermentationProperty { - public FermentationProperty(int inputAmount, int heat, String output, int outputAmount) { - this.inputAmount = inputAmount; - this.heat = heat; - this.output = output; - this.outputAmount = outputAmount; - } - - public FluidStack getOutput() { - return FluidRegistry.getFluid(this.output) == null ? null : new FluidStack(FluidRegistry.getFluid(this.output), this.outputAmount); - } - - public final int inputAmount; - public final int heat; - public final String output; - public final int outputAmount; - } -} \ No newline at end of file diff --git a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager$Input.class b/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager$Input.class deleted file mode 100644 index 9f813eba2..000000000 Binary files a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager$Input.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.class b/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.class deleted file mode 100644 index 42ddd10a7..000000000 Binary files a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.java b/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.java deleted file mode 100644 index 840fed83e..000000000 --- a/src/api/java/ic2/api/recipe/IFillFluidContainerRecipeManager.java +++ /dev/null @@ -1,24 +0,0 @@ -package ic2.api.recipe; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -import ic2.api.recipe.IFillFluidContainerRecipeManager.Input; -import ic2.api.util.FluidContainerOutputMode; - -public interface IFillFluidContainerRecipeManager extends IMachineRecipeManager, Input> { - MachineRecipeResult, Input> apply(Input input, FluidContainerOutputMode outputMode, boolean acceptTest); - - public static class Input { - public Input(ItemStack container, FluidStack fluid) { - this.container = container; - this.fluid = fluid; - } - - public final ItemStack container; - public final FluidStack fluid; - } -} diff --git a/src/api/java/ic2/api/recipe/IFluidHeatManager$BurnProperty.class b/src/api/java/ic2/api/recipe/IFluidHeatManager$BurnProperty.class deleted file mode 100644 index 6367f30bf..000000000 Binary files a/src/api/java/ic2/api/recipe/IFluidHeatManager$BurnProperty.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFluidHeatManager.class b/src/api/java/ic2/api/recipe/IFluidHeatManager.class deleted file mode 100644 index 30a7fee0d..000000000 Binary files a/src/api/java/ic2/api/recipe/IFluidHeatManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IFluidHeatManager.java b/src/api/java/ic2/api/recipe/IFluidHeatManager.java deleted file mode 100644 index 7ddecdce4..000000000 --- a/src/api/java/ic2/api/recipe/IFluidHeatManager.java +++ /dev/null @@ -1,32 +0,0 @@ -package ic2.api.recipe; - -import java.util.Map; - -import net.minecraftforge.fluids.Fluid; - - -public interface IFluidHeatManager extends ILiquidAcceptManager { - /** - * Add a new fluid to the Fluid Heat Generator. - * - * @param fluidName the fluid to burn - * @param amount amount of fluid to consume per tick - * @param heat amount of heat generated per tick - */ - void addFluid(String fluidName, int amount, int heat); - - BurnProperty getBurnProperty(Fluid fluid); - - Map getBurnProperties(); - - - public static class BurnProperty { - public BurnProperty(int amount1, int heat1) { - this.amount = amount1; - this.heat = heat1; - } - - public final int amount; - public final int heat; - } -} diff --git a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.class b/src/api/java/ic2/api/recipe/ILiquidAcceptManager.class deleted file mode 100644 index 2ccadae70..000000000 Binary files a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java b/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java deleted file mode 100644 index 4f377b904..000000000 --- a/src/api/java/ic2/api/recipe/ILiquidAcceptManager.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.recipe; - -import java.util.Set; - -import net.minecraftforge.fluids.Fluid; - -public interface ILiquidAcceptManager { - boolean acceptsFluid(Fluid fluid); - Set getAcceptedFluids(); -} diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class deleted file mode 100644 index 374f186d7..000000000 Binary files a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class deleted file mode 100644 index b58008d86..000000000 Binary files a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java deleted file mode 100644 index 68decbb39..000000000 --- a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java +++ /dev/null @@ -1,39 +0,0 @@ -package ic2.api.recipe; - -import java.util.Map; - -import net.minecraftforge.fluids.Fluid; - -public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager { - - /** - * Add a new fluid heatup/cooldown recipe. - * - * @param fluidName the fluid to heat up/cool down - * @param fluidOutput the fluid the above fluid turns into - * @param huPerMB the Thermal Energy difference in hU for the conversion of one mB fluid - */ - void addFluid(String fluidName, String fluidOutput, int huPerMB); - - HeatExchangeProperty getHeatExchangeProperty(Fluid fluid); - - Map getHeatExchangeProperties(); - - /** - * This returns an ILiquidAcceptManager that only accepts fluids, that can be heated up / cooled down, but not both. - * You can basically use this to check if the liquid resulting from this conversion can be reprocessed into the first one. - * @return Returns the SingleDirectionManager. - */ - ILiquidAcceptManager getSingleDirectionLiquidManager(); - - public static class HeatExchangeProperty { - public HeatExchangeProperty(Fluid outputFluid, int huPerMB) { - this.outputFluid = outputFluid; - this.huPerMB = huPerMB; - } - - public final Fluid outputFluid; - public final int huPerMB; - } - -} diff --git a/src/api/java/ic2/api/recipe/IListRecipeManager.class b/src/api/java/ic2/api/recipe/IListRecipeManager.class deleted file mode 100644 index 77f1a930a..000000000 Binary files a/src/api/java/ic2/api/recipe/IListRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IListRecipeManager.java b/src/api/java/ic2/api/recipe/IListRecipeManager.java deleted file mode 100644 index adc22912a..000000000 --- a/src/api/java/ic2/api/recipe/IListRecipeManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package ic2.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Recipe manager interface for basic lists. - * - * @author Richard - */ -public interface IListRecipeManager extends Iterable { - /** - * Adds a stack to the list. - * - * @param stack Stack to add - */ - public void add(IRecipeInput input); - - /** - * Checks whether the specified stack is in the list. - * - * @param stack Stack to check - * @return Whether the stack is in the list - */ - public boolean contains(ItemStack stack); - - /** - * @return if the List is Empty - */ - public boolean isEmpty(); - - /** - * Gets the list of stacks. - * - * You're a mad evil scientist if you ever modify this. - * - * @return List of stacks - */ - public List getInputs(); -} diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManager.class b/src/api/java/ic2/api/recipe/IMachineRecipeManager.class deleted file mode 100644 index c3832b7e6..000000000 Binary files a/src/api/java/ic2/api/recipe/IMachineRecipeManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java b/src/api/java/ic2/api/recipe/IMachineRecipeManager.java deleted file mode 100644 index 7126ad6b5..000000000 --- a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java +++ /dev/null @@ -1,56 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Recipe manager interface for basic machines. - * - * @author Player, RichardG - */ -public interface IMachineRecipeManager { - /** - * Adds a recipe to the machine. - * - * Meta data format: - * - thermal centrifuge: {"minHeat": 1-xxx} - * - ore washing plant: {"amount": 1-8000} - * - * @note Replace is only as reliable as IRecipeInput.getInputs(). - * - * @param input Recipe input - * @param output Recipe outputs, zero or more depending on the machine. - * @param metadata Meta data for additional recipe properties, may be null. - * @param replace Replace conflicting existing recipes, not recommended, may be ignored. - * @return true on success, false otherwise, e.g. on conflicts. - */ - boolean addRecipe(RI input, RO output, NBTTagCompound metadata, boolean replace); - - /** - * Gets the recipe result for the given input. - * - * @param input Recipe input (not modified) - * @param acceptTest If true the manager will accept partially missing ingredients or - * ingredients with insufficient quantities. This is primarily used to check whether a - * slot/tank/etc can accept the input while trying to supply a machine with resources. - * @return Recipe result, or null if none - */ - MachineRecipeResult apply(I input, boolean acceptTest); - - /** - * Get all registered recipes (optional operation). - * - * The method is only available if {@link #isIterable()} is true. - * You're a mad evil scientist if you ever modify this. - * - * @return Iterable of all recipes registered to the manager. - * @throws UnsupportedOperationException if {@link #isIterable()} is false. - */ - Iterable> getRecipes(); - - /** - * Determine whether the recipes can be iterated. - * - * @return true if {@link #getRecipes()} is implemented, false otherwise. - */ - boolean isIterable(); -} diff --git a/src/api/java/ic2/api/recipe/IPatternStorage.class b/src/api/java/ic2/api/recipe/IPatternStorage.class deleted file mode 100644 index 5b7210064..000000000 Binary files a/src/api/java/ic2/api/recipe/IPatternStorage.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IPatternStorage.java b/src/api/java/ic2/api/recipe/IPatternStorage.java deleted file mode 100644 index c9dbd8d73..000000000 --- a/src/api/java/ic2/api/recipe/IPatternStorage.java +++ /dev/null @@ -1,11 +0,0 @@ -package ic2.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IPatternStorage { - boolean addPattern(ItemStack itemstack); - - List getPatterns(); -} diff --git a/src/api/java/ic2/api/recipe/IRecipeInput.class b/src/api/java/ic2/api/recipe/IRecipeInput.class deleted file mode 100644 index 6d159b49b..000000000 Binary files a/src/api/java/ic2/api/recipe/IRecipeInput.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IRecipeInput.java b/src/api/java/ic2/api/recipe/IRecipeInput.java deleted file mode 100644 index dd49f757a..000000000 --- a/src/api/java/ic2/api/recipe/IRecipeInput.java +++ /dev/null @@ -1,36 +0,0 @@ -package ic2.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Interface for recipe ingredient matchers. - * - * See {@link Recipes#inputFactory} for some default factory methods. - */ -public interface IRecipeInput { - /** - * Check if subject matches this recipe input, ignoring the amount. - * - * @param subject ItemStack to check - * @return true if it matches the requirement - */ - boolean matches(ItemStack subject); - - /** - * Determine the minimum input stack size. - * - * @return input amount required - */ - int getAmount(); - - /** - * List all possible inputs (best effort). - * - * The stack size has to match getAmount(). - * - * @return list of inputs, may be incomplete - */ - List getInputs(); -} diff --git a/src/api/java/ic2/api/recipe/IRecipeInputFactory.class b/src/api/java/ic2/api/recipe/IRecipeInputFactory.class deleted file mode 100644 index b6e90226b..000000000 Binary files a/src/api/java/ic2/api/recipe/IRecipeInputFactory.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IRecipeInputFactory.java b/src/api/java/ic2/api/recipe/IRecipeInputFactory.java deleted file mode 100644 index f802ebb2f..000000000 --- a/src/api/java/ic2/api/recipe/IRecipeInputFactory.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.Fluid; - -public interface IRecipeInputFactory { - IRecipeInput forStack(ItemStack stack); - IRecipeInput forStack(ItemStack stack, int amount); - IRecipeInput forOreDict(String name); - IRecipeInput forOreDict(String name, int amount); - IRecipeInput forOreDict(String name, int amount, int metaOverride); - IRecipeInput forFluidContainer(Fluid fluid); - IRecipeInput forFluidContainer(Fluid fluid, int amount); - IRecipeInput forAny(IRecipeInput... options); - IRecipeInput forAny(Iterable options); -} diff --git a/src/api/java/ic2/api/recipe/IScrapboxManager.class b/src/api/java/ic2/api/recipe/IScrapboxManager.class deleted file mode 100644 index 80cf6ffd4..000000000 Binary files a/src/api/java/ic2/api/recipe/IScrapboxManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/IScrapboxManager.java b/src/api/java/ic2/api/recipe/IScrapboxManager.java deleted file mode 100644 index f379e8dab..000000000 --- a/src/api/java/ic2/api/recipe/IScrapboxManager.java +++ /dev/null @@ -1,13 +0,0 @@ -package ic2.api.recipe; - -import java.util.Map; - -import net.minecraft.item.ItemStack; - -public interface IScrapboxManager extends IBasicMachineRecipeManager { - void addDrop(ItemStack drop, float rawChance); - - ItemStack getDrop(ItemStack input, boolean adjustInput); - - Map getDrops(); -} diff --git a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager$BurnProperty.class b/src/api/java/ic2/api/recipe/ISemiFluidFuelManager$BurnProperty.class deleted file mode 100644 index 890fd21cd..000000000 Binary files a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager$BurnProperty.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.class b/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.class deleted file mode 100644 index 3d867b887..000000000 Binary files a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java b/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java deleted file mode 100644 index f9313d1d2..000000000 --- a/src/api/java/ic2/api/recipe/ISemiFluidFuelManager.java +++ /dev/null @@ -1,32 +0,0 @@ -package ic2.api.recipe; - -import java.util.Map; - -import net.minecraftforge.fluids.Fluid; - - -public interface ISemiFluidFuelManager extends ILiquidAcceptManager { - /** - * Add a new fluid to the semi fluid generator. - * - * @param fluidName the fluid to burn - * @param amount amount of fluid to consume per tick - * @param power amount of energy generated per tick - */ - void addFluid(String fluidName, int amount, double power); - - BurnProperty getBurnProperty(Fluid fluid); - - Map getBurnProperties(); - - - public static final class BurnProperty { - public BurnProperty(int amount, double power) { - this.amount = amount; - this.power = power; - } - - public final int amount; - public final double power; - } -} diff --git a/src/api/java/ic2/api/recipe/MachineRecipe.class b/src/api/java/ic2/api/recipe/MachineRecipe.class deleted file mode 100644 index d8e05cb51..000000000 Binary files a/src/api/java/ic2/api/recipe/MachineRecipe.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/MachineRecipe.java b/src/api/java/ic2/api/recipe/MachineRecipe.java deleted file mode 100644 index af24cb654..000000000 --- a/src/api/java/ic2/api/recipe/MachineRecipe.java +++ /dev/null @@ -1,35 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.nbt.NBTTagCompound; - -public class MachineRecipe { - public MachineRecipe(I input, O output) { - this(input, output, null); - } - - public MachineRecipe(I input, O output, NBTTagCompound meta) { - this.input = input; - this.output = output; - this.meta = meta; - } - - public I getInput() { - return input; - } - - public O getOutput() { - return output; - } - - public NBTTagCompound getMetaData() { - return meta; - } - - public MachineRecipeResult getResult(AI adjustedInput) { - return new MachineRecipeResult(this, adjustedInput); - } - - private final I input; - private final O output; - private final NBTTagCompound meta; -} diff --git a/src/api/java/ic2/api/recipe/MachineRecipeResult.class b/src/api/java/ic2/api/recipe/MachineRecipeResult.class deleted file mode 100644 index 09bb88f04..000000000 Binary files a/src/api/java/ic2/api/recipe/MachineRecipeResult.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/MachineRecipeResult.java b/src/api/java/ic2/api/recipe/MachineRecipeResult.java deleted file mode 100644 index 9ed1a6f02..000000000 --- a/src/api/java/ic2/api/recipe/MachineRecipeResult.java +++ /dev/null @@ -1,23 +0,0 @@ -package ic2.api.recipe; - -public class MachineRecipeResult { - public MachineRecipeResult(MachineRecipe recipe, I adjustedInput) { - this.recipe = recipe; - this.adjustedInput = adjustedInput; - } - - public MachineRecipe getRecipe() { - return recipe; - } - - public RO getOutput() { - return recipe.getOutput(); - } - - public I getAdjustedInput() { - return adjustedInput; - } - - private final MachineRecipe recipe; - private final I adjustedInput; -} diff --git a/src/api/java/ic2/api/recipe/RecipeOutput.class b/src/api/java/ic2/api/recipe/RecipeOutput.class deleted file mode 100644 index 0c83c13a1..000000000 Binary files a/src/api/java/ic2/api/recipe/RecipeOutput.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/RecipeOutput.java b/src/api/java/ic2/api/recipe/RecipeOutput.java deleted file mode 100644 index 0f2fe1cba..000000000 --- a/src/api/java/ic2/api/recipe/RecipeOutput.java +++ /dev/null @@ -1,54 +0,0 @@ -package ic2.api.recipe; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -@Deprecated -public final class RecipeOutput { - public RecipeOutput(NBTTagCompound metadata1, List items1) { - assert !items1.contains(null); - - this.metadata = metadata1; - this.items = 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 itA = items.iterator(); - Iterator itB = ro.items.iterator(); - - while (itA.hasNext() && itB.hasNext()) { - ItemStack stackA = itA.next(); - ItemStack stackB = itB.next(); - - if (ItemStack.areItemStacksEqual(stackA, stackB)) return false; - } - - return true; - } - } - - return false; - } - - @Override - public String toString() { - return "ROutput<"+items+","+metadata+">"; - } - - public final List items; - public final NBTTagCompound metadata; -} diff --git a/src/api/java/ic2/api/recipe/Recipes.class b/src/api/java/ic2/api/recipe/Recipes.class deleted file mode 100644 index 1921c1c5b..000000000 Binary files a/src/api/java/ic2/api/recipe/Recipes.class and /dev/null differ diff --git a/src/api/java/ic2/api/recipe/Recipes.java b/src/api/java/ic2/api/recipe/Recipes.java deleted file mode 100644 index c6cc0d753..000000000 --- a/src/api/java/ic2/api/recipe/Recipes.java +++ /dev/null @@ -1,190 +0,0 @@ -package ic2.api.recipe; - -import net.minecraft.item.ItemStack; - -/** - * General recipe registry. - * - *

IMachineRecipeManager.addRecipe takes a metadata parameter, the expected contents are specified - * below as "recipe meta". The metadata NBT itself should be null for "no recipe meta" or a - * NBTTagCompound with keys matching the names and value types mentioned below. - * - *

Example: Compressor recipe, Sand -> Glass: - *

{@code
- * Recipes.compressor.addRecipe(new RecipeInputItemStack(new ItemStack(Blocks.SAND)), null, false, new ItemStack(Blocks.GLASS));
- * }
- * - *

Example: Metal former rolling recipe, Platinum ingot (oredict) -> Platinum plate: - *

{@code
- * Recipes.metalformerRolling.addRecipe(new RecipeInputOreDict("ingotPlatinum"), null, false, myPlatinumPlateStack)
- * }
- * - *

Example: Mass fabricator amplifier, nether stars amplifying 1M EU: - *

{@code
- * NBTTagCompound meta = new NBTTagCompound();
- * meta.setInteger("amplification", 1000000);
- * Recipes.matterAmplifier.addRecipe(new RecipeInputItemStack(new ItemStack(Items.NETHER_STAR)), meta, false);
- * }
- * - */ -public class Recipes { - /** - * Convenience factory for various recipe input variants. - */ - public static IRecipeInputFactory inputFactory; - - /** - * Recipe manager for furnace recipes. - * - *

Recipe meta: - *

    - *
  • float experience: experience per smelt operation - *
- */ - public static IMachineRecipeManager furnace; - - /** - * Recipe manager for macerator recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager macerator; - - /** - * Recipe manager for extractor recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager extractor; - - /** - * Recipe manager for compressor recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager compressor; - - /** - * Recipe manager for thermal centrifuge recipes. - * - *

Recipe meta: - *

    - *
  • int minHeat: minimum heat level required - *
- */ - public static IBasicMachineRecipeManager centrifuge; - - /** - * Recipe manager for blast cutter recipes. - * - *

Recipe meta: - *

    - *
  • int hardness: minimum blade hardness (3=iron, 6=steel, 9=diamond) - *
- */ - public static IBasicMachineRecipeManager blockcutter; - - /** - * Recipe manager for blast furnace recipes. - * - *

Recipe meta: - *

    - *
  • int fluid: input fluid amount per cycle (in mB) - *
  • int duration: process duration (in ticks) - *
- */ - public static IBasicMachineRecipeManager blastfurnace; - - /** - * Recipe manager for recycler recipes. - * - *

No recipe meta. - * - * @note the implementation is currently immutable, any non-blacklisted item will be accepted, - * chance checking is up to the caller. - */ - public static IBasicMachineRecipeManager recycler; - - /** - * Recipe manager for metal former extrusion mode recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager metalformerExtruding; - - /** - * Recipe manager for metal former cutting mode recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager metalformerCutting; - - /** - * Recipe manager for metal former rolling mode recipes. - * - *

No recipe meta. - */ - public static IBasicMachineRecipeManager metalformerRolling; - - /** - * Recipe manager for ore washing plant recipes. - * - *

Recipe meta: - *

    - *
  • int amount: input fluid amount per cycle (in mB) - *
- */ - public static IBasicMachineRecipeManager oreWashing; - public static ICannerBottleRecipeManager cannerBottle; - public static ICannerEnrichRecipeManager cannerEnrich; - public static IElectrolyzerRecipeManager electrolyzer; - public static IFermenterRecipeManager fermenter; - - /** - * Recipe manager for uu mass fabricator (matter gen) recipes. - * - *

No recipe meta. - * - *

Reference values: - *

    - *
  • 5000: Scrap - *
  • 45000: Scrapbox - *
- */ - public static IMachineRecipeManager matterAmplifier; - - /** - * Reference scrap box chance values: - * - * 0.1: Diamond - * 0.5: Cake, Gold Helmet, Iron Ore, Gold Ore - * 1.0: Wooden tools, Soul Sand, Sign, Leather, Feather, Bone - * 1.5: Apple, Bread - * 2.0: Netherrack, Rotten Flesh - * 3.0: Grass, Gravel - * 4.0: Stick - * 5.0: Dirt, Wooden Hoe - */ - public static IScrapboxManager scrapboxDrops; - public static IListRecipeManager recyclerBlacklist; - /** - * Do not add anything to this Whitelist. This is for Configuration only. - * You may need this if you have an own Recycler in your Mod, just to check if something can be recycled. but don't add anything to this List - */ - public static IListRecipeManager recyclerWhitelist; - public static ICraftingRecipeManager advRecipes; - - public static ISemiFluidFuelManager semiFluidGenerator; - 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; - /** - * Opposite of {@link #liquidCooldownManager}. This is for Liquids that can be heated up again. - */ - public static ILiquidHeatExchangerManager liquidHeatupManager; - - public static IEmptyFluidContainerRecipeManager emptyFluidContainer; - public static IFillFluidContainerRecipeManager fillFluidContainer; -} diff --git a/src/api/java/ic2/api/tile/ExplosionWhitelist.class b/src/api/java/ic2/api/tile/ExplosionWhitelist.class deleted file mode 100644 index a55a2c524..000000000 Binary files a/src/api/java/ic2/api/tile/ExplosionWhitelist.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/ExplosionWhitelist.java b/src/api/java/ic2/api/tile/ExplosionWhitelist.java deleted file mode 100644 index 9a4d96998..000000000 --- a/src/api/java/ic2/api/tile/ExplosionWhitelist.java +++ /dev/null @@ -1,48 +0,0 @@ -package ic2.api.tile; - -import java.util.Collections; -import java.util.IdentityHashMap; -import java.util.Set; - -import net.minecraft.block.Block; - -/** - * Blocks on this whitelist will not resist an explosion but won't be destroyed. - * - * The explosion code by default ignores blocks which absorb more than 1000 explosion power to - * prevent abusing personal safes, Trade-O-Mats and other blocks to serve as a cheap and - * invulnerable reactor chambers. Said blocks will not shield the explosion and won't get - * destroyed. - */ -public final class ExplosionWhitelist { - /** - * Add a block to the whitelist. - * - * @param block block to add - */ - 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) { - 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) { - return whitelist.contains(block); - } - - private static Set whitelist = Collections.newSetFromMap(new IdentityHashMap()); -} - diff --git a/src/api/java/ic2/api/tile/IEnergyStorage.class b/src/api/java/ic2/api/tile/IEnergyStorage.class deleted file mode 100644 index 603752384..000000000 Binary files a/src/api/java/ic2/api/tile/IEnergyStorage.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/IEnergyStorage.java b/src/api/java/ic2/api/tile/IEnergyStorage.java deleted file mode 100644 index 8fd96da2c..000000000 --- a/src/api/java/ic2/api/tile/IEnergyStorage.java +++ /dev/null @@ -1,61 +0,0 @@ -package ic2.api.tile; - -import net.minecraft.util.EnumFacing; - -/** - * Interface implemented by the tile entity of energy storage blocks. - */ -public interface IEnergyStorage { - /** - * Get the amount of energy currently stored in the block. - * - * @return Energy stored in the block - */ - public int getStored(); - - /** - * Set the amount of energy currently stored in the block. - * - * @param energy stored energy - */ - public void setStored(int energy); - - /** - * Add the specified amount of energy. - * - * Use negative values to decrease. - * - * @param amount of energy to add - * @return Energy stored in the block after adding the specified amount - */ - public int addEnergy(int amount); - - /** - * Get the maximum amount of energy the block can store. - * - * @return Maximum energy stored - */ - public int getCapacity(); - - /** - * Get the block's energy output. - * - * @return Energy output in EU/t - */ - public int getOutput(); - - /** - * Get the block's energy output. - * - * @return Energy output in EU/t - */ - public double getOutputEnergyUnitsPerTick(); - - /** - * Get whether this block can have its energy used by an adjacent teleporter. - * - * @param side side the teleporter is draining energy from - * @return Whether the block is teleporter compatible - */ - public boolean isTeleporterCompatible(EnumFacing side); -} diff --git a/src/api/java/ic2/api/tile/IRotorProvider.class b/src/api/java/ic2/api/tile/IRotorProvider.class deleted file mode 100644 index c772aea74..000000000 Binary files a/src/api/java/ic2/api/tile/IRotorProvider.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/IRotorProvider.java b/src/api/java/ic2/api/tile/IRotorProvider.java deleted file mode 100644 index 0a3597e1e..000000000 --- a/src/api/java/ic2/api/tile/IRotorProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -package ic2.api.tile; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; - -import ic2.api.item.IKineticRotor; - -/** - * Interface for {@link TileEntity}s that can have rotors, see also {@link IKineticRotor}
- * Use the {@link RotorRegistry} to use IC2's default windmill renderer - */ -public interface IRotorProvider { - /** - * @return Radius of current rotor (in blocks), or 0 for no rotor - */ - public int getRotorDiameter(); - - /** - * @return The current direction the rotor is facing - */ - public EnumFacing getFacing(); - - /** - * @return Angle (in degrees) to render the rotor at - */ - public float getAngle(); - - /** - * @return Texture of the current rotor, called every tick so remember to store in a variable - */ - public ResourceLocation getRotorRenderTexture(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/tile/IWrenchable.class b/src/api/java/ic2/api/tile/IWrenchable.class deleted file mode 100644 index c3628ae7c..000000000 Binary files a/src/api/java/ic2/api/tile/IWrenchable.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/IWrenchable.java b/src/api/java/ic2/api/tile/IWrenchable.java deleted file mode 100644 index f43067b3a..000000000 --- a/src/api/java/ic2/api/tile/IWrenchable.java +++ /dev/null @@ -1,67 +0,0 @@ -package ic2.api.tile; - -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** - * Allows a block to make use of the wrench's removal and rotation functions. - */ -public interface IWrenchable { - /** - * Get direction the block is facing. - * - * The direction typically refers to the front/main/functionally dominant side of a block. - * - * @param world World containing the block. - * @param pos The block's current position in the world. - * @return Current block facing. - */ - EnumFacing getFacing(World world, BlockPos pos); - - /** - * Set the block's facing to face towards the specified direction. - * - * Contrary to Block.rotateBlock the block should always face the requested direction after - * successfully processing this method. - * - * @param world World containing the block. - * @param pos The block's current position in the world. - * @param newDirection Requested facing, see {@link #getFacing}. - * @param player Player causing the action, may be null. - * @return true if successful, false otherwise. - */ - boolean setFacing(World world, BlockPos pos, EnumFacing newDirection, EntityPlayer player); - - /** - * Determine if the wrench can be used to remove the block. - * - * @param world World containing the block. - * @param pos The block's current position in the world. - * @param player Player causing the action, may be null. - * @return true if allowed, false otherwise. - */ - boolean wrenchCanRemove(World world, BlockPos pos, EntityPlayer player); - - /** - * Determine the items the block will drop when the wrenching is successful. - * - * The ItemStack will be copied before creating the EntityItem. - * - * @param world World containing the block. - * @param pos The block's current position in the world. - * @param state The block's block state before removal. - * @param te The block's tile entity before removal, if any, may be null. - * @param player Player removing the block, may be null. - * @param fortune Fortune level for drop calculation. - * @return ItemStacks to drop, may be empty. - */ - List getWrenchDrops(World world, BlockPos pos, IBlockState state, TileEntity te, EntityPlayer player, int fortune); -} - diff --git a/src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class b/src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class deleted file mode 100644 index 4b25b38aa..000000000 Binary files a/src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/RotorRegistry.class b/src/api/java/ic2/api/tile/RotorRegistry.class deleted file mode 100644 index 45357043a..000000000 Binary files a/src/api/java/ic2/api/tile/RotorRegistry.class and /dev/null differ diff --git a/src/api/java/ic2/api/tile/RotorRegistry.java b/src/api/java/ic2/api/tile/RotorRegistry.java deleted file mode 100644 index 132f0f9f5..000000000 --- a/src/api/java/ic2/api/tile/RotorRegistry.java +++ /dev/null @@ -1,45 +0,0 @@ -package ic2.api.tile; - -import static net.minecraftforge.fml.relauncher.Side.CLIENT; - -import net.minecraft.tileentity.TileEntity; - -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.relauncher.SideOnly; - -import ic2.api.info.Info; - -/** - * Helper class for registering {@link IRotorProvider}s to provide the default windmill renderer - */ -@SideOnly(CLIENT) -public class RotorRegistry { - /** - * Method to register a tile entity with the default IC2 windmill TESH - * @param clazz {@link TileEntity} that implements {@link IRotorProvider} - * @param Type checking to ensure only {@link IRotorProvider} implementing classes are registered - */ - public static void registerRotorProvider(Class clazz) { - if (INSTANCE != null) INSTANCE.registerRotorProvider(clazz); - } - - /** - * Sets the internal Registry instance. - * ONLY IC2 CAN DO THIS!!!!!!! - */ - public static void setInstance(IRotorRegistry i) { - ModContainer mc = Loader.instance().activeModContainer(); - if (mc == null || !Info.MOD_ID.equals(mc.getModId())) { - throw new IllegalAccessError("Only IC2 can set the instance"); - } else { - INSTANCE = i; - } - } - - private static IRotorRegistry INSTANCE; - - public static interface IRotorRegistry { - public void registerRotorProvider(Class clazz); - } -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.class b/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.class deleted file mode 100644 index 98e28e1f5..000000000 Binary files a/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.java b/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.java deleted file mode 100644 index 4a0ff0a89..000000000 --- a/src/api/java/ic2/api/upgrade/IAugmentationUpgrade.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.upgrade; - -import net.minecraft.item.ItemStack; - -/** - * An interface to mark an item as an {@link UpgradableProperty#Augmentable} type upgrade - * - * @author Player, Chocohead - */ -public interface IAugmentationUpgrade extends IUpgradeItem { - /** - * Gets the augmentation of the upgrade on the given {@link IUpgradableBlock} - * - * @param stack The upgrade stack - * @param parent The block being augmented - * - * @return The augmentation applied - */ - int getAugmentation(ItemStack stack, IUpgradableBlock parent); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.class b/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.class deleted file mode 100644 index a2a1a3099..000000000 Binary files a/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.java b/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.java deleted file mode 100644 index 9c9a9e63a..000000000 --- a/src/api/java/ic2/api/upgrade/IEnergyStorageUpgrade.java +++ /dev/null @@ -1,30 +0,0 @@ -package ic2.api.upgrade; - -import net.minecraft.item.ItemStack; - -/** - * An interface to mark an item as an {@link UpgradableProperty#EnergyStorage} type upgrade - * - * @author Player, Chocohead - */ -public interface IEnergyStorageUpgrade extends IUpgradeItem { - /** - * A raw value that is added to the {@link IUpgradableBlock}'s energy storage - * - * @param stack The upgrade stack - * @param parent The block storing energy - * - * @return The raw change in energy storage to be applied - */ - int getExtraEnergyStorage(ItemStack stack, IUpgradableBlock parent); - - /** - * A multiplier value that the {@link IUpgradableBlock}'s energy storage is affected by - * - * @param stack The upgrade stack - * @param parent The block storing energy - * - * @return The multiplier to be applied to be energy storage - */ - double getEnergyStorageMultiplier(ItemStack stack, IUpgradableBlock parent); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.class b/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.class deleted file mode 100644 index cc9dcfa8d..000000000 Binary files a/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.java b/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.java deleted file mode 100644 index f798452f4..000000000 --- a/src/api/java/ic2/api/upgrade/IFluidConsumingUpgrade.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.upgrade; - -/** - * An interface to mark an item as an {@link UpgradableProperty#FluidConsuming} type upgrade - * - * @author Player, Chocohead - */ -public interface IFluidConsumingUpgrade extends IUpgradeItem { - -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.class b/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.class deleted file mode 100644 index 2142df906..000000000 Binary files a/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.java b/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.java deleted file mode 100644 index f310a90f5..000000000 --- a/src/api/java/ic2/api/upgrade/IFluidProducingUpgrade.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.upgrade; - -/** - * An interface to mark an item as an {@link UpgradableProperty#FluidProducing} type upgrade - * - * @author Player, Chocohead - */ -public interface IFluidProducingUpgrade extends IUpgradeItem { - -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IFullUpgrade.class b/src/api/java/ic2/api/upgrade/IFullUpgrade.class deleted file mode 100644 index 2e3ed4f98..000000000 Binary files a/src/api/java/ic2/api/upgrade/IFullUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IFullUpgrade.java b/src/api/java/ic2/api/upgrade/IFullUpgrade.java deleted file mode 100644 index 207786220..000000000 --- a/src/api/java/ic2/api/upgrade/IFullUpgrade.java +++ /dev/null @@ -1,12 +0,0 @@ -package ic2.api.upgrade; - -/** - * An interface to mark an item supporting all {@link UpgradableProperty} type upgrades - * - * @author Player, Chocohead - */ -public interface IFullUpgrade extends IAugmentationUpgrade, IEnergyStorageUpgrade, IFluidConsumingUpgrade, - IFluidProducingUpgrade, IItemConsumingUpgrade, IItemProducingUpgrade, IProcessingUpgrade, - IRedstoneSensitiveUpgrade, ITransformerUpgrade { - -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.class b/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.class deleted file mode 100644 index b571d1dab..000000000 Binary files a/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.java b/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.java deleted file mode 100644 index 0a7216bc9..000000000 --- a/src/api/java/ic2/api/upgrade/IItemConsumingUpgrade.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.upgrade; - -/** - * An interface to mark an item as an {@link UpgradableProperty#ItemConsuming} type upgrade - * - * @author Player, Chocohead - */ -public interface IItemConsumingUpgrade extends IUpgradeItem { - -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.class b/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.class deleted file mode 100644 index e28bf01b6..000000000 Binary files a/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.java b/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.java deleted file mode 100644 index 85a3b9929..000000000 --- a/src/api/java/ic2/api/upgrade/IItemProducingUpgrade.java +++ /dev/null @@ -1,10 +0,0 @@ -package ic2.api.upgrade; - -/** - * An interface to mark an item as an {@link UpgradableProperty#ItemProducing} type upgrade - * - * @author Player, Chocohead - */ -public interface IItemProducingUpgrade extends IUpgradeItem { - -} diff --git a/src/api/java/ic2/api/upgrade/IProcessingUpgrade.class b/src/api/java/ic2/api/upgrade/IProcessingUpgrade.class deleted file mode 100644 index 38402e890..000000000 Binary files a/src/api/java/ic2/api/upgrade/IProcessingUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IProcessingUpgrade.java b/src/api/java/ic2/api/upgrade/IProcessingUpgrade.java deleted file mode 100644 index 694b4687e..000000000 --- a/src/api/java/ic2/api/upgrade/IProcessingUpgrade.java +++ /dev/null @@ -1,50 +0,0 @@ -package ic2.api.upgrade; - -import net.minecraft.item.ItemStack; - -/** - * An interface to mark an item as an {@link UpgradableProperty#Processing} type upgrade - * - * @author Player, Chocohead - */ -public interface IProcessingUpgrade extends IUpgradeItem { - /** - * A raw value that the process time is affected by (in ticks) - * - * @param stack The upgrade stack - * @param parent The {@link IUpgradableBlock} receiving the change - * - * @return The raw change in process to be applied - */ - int getExtraProcessTime(ItemStack stack, IUpgradableBlock parent); - - /** - * A multiplier value that the process time is affected by - * - * @param stack The upgrade stack - * @param parent The {@link IUpgradableBlock} receiving the change - * - * @return The multiplier to be applied to be progress - */ - double getProcessTimeMultiplier(ItemStack stack, IUpgradableBlock parent); - - /** - * A raw value that is added to the {@link IUpgradableBlock}'s energy demand - * - * @param stack The upgrade stack - * @param parent The block consuming energy - * - * @return The raw change in energy demand to be applied - */ - int getExtraEnergyDemand(ItemStack stack, IUpgradableBlock parent); - - /** - * A multiplier value that the {@link IUpgradableBlock}'s energy demand is affected by - * - * @param stack The upgrade stack - * @param parent The block consuming energy - * - * @return The multiplier to be applied to be energy demand - */ - double getEnergyDemandMultiplier(ItemStack stack, IUpgradableBlock parent); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.class b/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.class deleted file mode 100644 index 9a215c5d7..000000000 Binary files a/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.java b/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.java deleted file mode 100644 index 7c06a5afe..000000000 --- a/src/api/java/ic2/api/upgrade/IRedstoneSensitiveUpgrade.java +++ /dev/null @@ -1,31 +0,0 @@ -package ic2.api.upgrade; - -import net.minecraft.item.ItemStack; - -/** - * An interface to mark an item as an {@link UpgradableProperty#RedstoneSensitive} type upgrade - * - * @author Player, Chocohead - */ -public interface IRedstoneSensitiveUpgrade extends IUpgradeItem { - /** - * Whether the upgrade modifies the given {@link IUpgradableBlock}'s redstone input - * - * @param stack The upgrade stack - * @param parent The block being modified - * - * @return Whether the redstone input should be changed (and thus {@link #getRedstoneInput(ItemStack, IUpgradableBlock, int)} be called) - */ - boolean modifiesRedstoneInput(ItemStack stack, IUpgradableBlock parent); - - /** - * Change the redstone input given the {@link IUpgradableBlock}'s initial input value - * - * @param stack The upgrade stack - * @param parent The block receiving the redstone signal - * @param externalInput The initial redstone signal - * - * @return The new redstone signal - */ - int getRedstoneInput(ItemStack stack, IUpgradableBlock parent, int externalInput); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/ITransformerUpgrade.class b/src/api/java/ic2/api/upgrade/ITransformerUpgrade.class deleted file mode 100644 index 2d52de1f9..000000000 Binary files a/src/api/java/ic2/api/upgrade/ITransformerUpgrade.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/ITransformerUpgrade.java b/src/api/java/ic2/api/upgrade/ITransformerUpgrade.java deleted file mode 100644 index e6e2146cd..000000000 --- a/src/api/java/ic2/api/upgrade/ITransformerUpgrade.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.upgrade; - -import net.minecraft.item.ItemStack; - -/** - * An interface to mark an item as an {@link UpgradableProperty#Transformer} type upgrade - * - * @author Player, Chocohead - */ -public interface ITransformerUpgrade extends IUpgradeItem { - /** - * Gets the additional tier that the given {@link IUpgradableBlock} can take - * - * @param stack The upgrade stack - * @param parent The block receiving energy - * - * @return The value to tier the tier by - */ - int getExtraTier(ItemStack stack, IUpgradableBlock parent); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IUpgradableBlock.class b/src/api/java/ic2/api/upgrade/IUpgradableBlock.class deleted file mode 100644 index d533b246c..000000000 Binary files a/src/api/java/ic2/api/upgrade/IUpgradableBlock.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IUpgradableBlock.java b/src/api/java/ic2/api/upgrade/IUpgradableBlock.java deleted file mode 100644 index 766761873..000000000 --- a/src/api/java/ic2/api/upgrade/IUpgradableBlock.java +++ /dev/null @@ -1,29 +0,0 @@ -package ic2.api.upgrade; - -import java.util.Set; - -/** - * An interface to mark a block as supporting {@link IUpgradeItem}s - * - * @author Player - */ -public interface IUpgradableBlock { - /** - * @return The energy the block current has - */ - double getEnergy(); - - /** - * Attempt to use the given amount of energy - * - * @param amount The amount of energy to be used - * - * @return Whether the energy was successfully used - */ - boolean useEnergy(double amount); - - /** - * @return The set of {@link UpgradableProperty}s that the block supports - */ - Set getUpgradableProperties(); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/IUpgradeItem.class b/src/api/java/ic2/api/upgrade/IUpgradeItem.class deleted file mode 100644 index 6432181d3..000000000 Binary files a/src/api/java/ic2/api/upgrade/IUpgradeItem.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/IUpgradeItem.java b/src/api/java/ic2/api/upgrade/IUpgradeItem.java deleted file mode 100644 index 09e16a30b..000000000 --- a/src/api/java/ic2/api/upgrade/IUpgradeItem.java +++ /dev/null @@ -1,44 +0,0 @@ -package ic2.api.upgrade; - -import java.util.Collection; -import java.util.Set; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * An interface to mark an item as an upgrade for {@link IUpgradableBlock}s - * - * @author Player, Chocohead - */ -public interface IUpgradeItem { - /** - * Checks if the upgrade is valid for the given {@link UpgradableProperty} types - * - * @param stack The upgrade stack being checked - * @param types The list of types being tested - * - * @return Whether the upgrade is valid - */ - boolean isSuitableFor(ItemStack stack, Set types); - - /** - * Called every time the given {@link IUpgradableBlock} ticks - * - * @param stack The upgrade stack being ticked - * @param parent The parent block being ticked - * - * @return Whether to call {@link TileEntity#markDirty()} due to a stack changing - */ - boolean onTick(ItemStack stack, IUpgradableBlock parent); - - /** - * Called when the given {@link IUpgradableBlock} finishes processing - * - * @param stack The upgrade stack - * @param parent The parent finishing processing - * @param output The list of output products from the process, read only! - * @return final output - */ - Collection onProcessEnd(ItemStack stack, IUpgradableBlock parent, Collection output); -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/UpgradableProperty.class b/src/api/java/ic2/api/upgrade/UpgradableProperty.class deleted file mode 100644 index 7f5149878..000000000 Binary files a/src/api/java/ic2/api/upgrade/UpgradableProperty.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/UpgradableProperty.java b/src/api/java/ic2/api/upgrade/UpgradableProperty.java deleted file mode 100644 index 17c575cf6..000000000 --- a/src/api/java/ic2/api/upgrade/UpgradableProperty.java +++ /dev/null @@ -1,45 +0,0 @@ -package ic2.api.upgrade; - -/** - * The possible properties an {@link IUpgradableBlock} can support - * - * @author Player - */ -public enum UpgradableProperty { - /** - * A block that processes something, taking upgrade process time + energy demand into account - */ - Processing, - /** - * A simple count based upgrade property, e.g. extra range - */ - Augmentable, - /** - * A block that is sensitive to redstone state/changes - */ - RedstoneSensitive, - /** - * A block that can have it's tier changed - */ - Transformer, - /** - * A block that can have the amount of energy it stores changed - */ - EnergyStorage, - /** - * A block that consumes items - */ - ItemConsuming, - /** - * A block that produces items - */ - ItemProducing, - /** - * A block that consumes fluids - */ - FluidConsuming, - /** - * A block that produces fluids - */ - FluidProducing, -} \ No newline at end of file diff --git a/src/api/java/ic2/api/upgrade/UpgradeRegistry.class b/src/api/java/ic2/api/upgrade/UpgradeRegistry.class deleted file mode 100644 index 9059b9d15..000000000 Binary files a/src/api/java/ic2/api/upgrade/UpgradeRegistry.class and /dev/null differ diff --git a/src/api/java/ic2/api/upgrade/UpgradeRegistry.java b/src/api/java/ic2/api/upgrade/UpgradeRegistry.java deleted file mode 100644 index 8f6bed650..000000000 --- a/src/api/java/ic2/api/upgrade/UpgradeRegistry.java +++ /dev/null @@ -1,38 +0,0 @@ -package ic2.api.upgrade; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * The registry that contains all known {@link IUpgradeItem}s - * - * @author Player - */ -public class UpgradeRegistry { - /** - * Register an upgrade itemstack to the registry - * - * @param stack The upgrade to register - * - * @return The stack that has been registered - */ - public static ItemStack register(ItemStack stack) { - if (!(stack.getItem() instanceof IUpgradeItem)) throw new IllegalArgumentException("The stack must represent an IUpgradeItem."); - - upgrades.add(stack); - - return stack; - } - - /** - * @return An unmodifiable list of registered upgrades - */ - public static Iterable getUpgrades() { - return Collections.unmodifiableCollection(upgrades); - } - - private static final List upgrades = new ArrayList(); -} diff --git a/src/api/java/ic2/api/util/FluidContainerOutputMode.class b/src/api/java/ic2/api/util/FluidContainerOutputMode.class deleted file mode 100644 index 43c42ccb6..000000000 Binary files a/src/api/java/ic2/api/util/FluidContainerOutputMode.class and /dev/null differ diff --git a/src/api/java/ic2/api/util/FluidContainerOutputMode.java b/src/api/java/ic2/api/util/FluidContainerOutputMode.java deleted file mode 100644 index 89812956b..000000000 --- a/src/api/java/ic2/api/util/FluidContainerOutputMode.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api.util; - -public enum FluidContainerOutputMode { - EmptyFullToOutput(true), // move only completely filled/drained containers to output - AnyToOutput(true), // move any containers to output if they changed - InPlacePreferred(false), // adjust the input stack if possible (size == 1) - InPlace(false); // always adjust the input stack - - private FluidContainerOutputMode(boolean outputEmptyFull) { - this.outputEmptyFull = outputEmptyFull; - } - - public boolean isOutputEmptyFull() { - return outputEmptyFull; - } - - private final boolean outputEmptyFull; -} \ No newline at end of file diff --git a/src/api/java/ic2/api/util/IKeyboard.class b/src/api/java/ic2/api/util/IKeyboard.class deleted file mode 100644 index 1e52c66c8..000000000 Binary files a/src/api/java/ic2/api/util/IKeyboard.class and /dev/null differ diff --git a/src/api/java/ic2/api/util/IKeyboard.java b/src/api/java/ic2/api/util/IKeyboard.java deleted file mode 100644 index ff6eaea5e..000000000 --- a/src/api/java/ic2/api/util/IKeyboard.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.util; - -import net.minecraft.entity.player.EntityPlayer; - -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.class b/src/api/java/ic2/api/util/Keys.class deleted file mode 100644 index 0e5ff7fba..000000000 Binary files a/src/api/java/ic2/api/util/Keys.class and /dev/null differ diff --git a/src/api/java/ic2/api/util/Keys.java b/src/api/java/ic2/api/util/Keys.java deleted file mode 100644 index 84d175676..000000000 --- a/src/api/java/ic2/api/util/Keys.java +++ /dev/null @@ -1,6 +0,0 @@ -package ic2.api.util; - - -public class Keys { - public static IKeyboard instance; -} \ No newline at end of file diff --git a/src/main/java/mekanism/common/tile/TileEntityFormulaicAssemblicator.java b/src/main/java/mekanism/common/tile/TileEntityFormulaicAssemblicator.java index 59f40c4b5..b2535a43c 100644 --- a/src/main/java/mekanism/common/tile/TileEntityFormulaicAssemblicator.java +++ b/src/main/java/mekanism/common/tile/TileEntityFormulaicAssemblicator.java @@ -267,11 +267,11 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im { if(!inventory.get(i).isEmpty()) { - ItemStack stack = inventory.get(i); + ItemStack stack = inventory.get(i).copy(); inventory.get(i).shrink(1); - if(stack.getCount() == 0 && stack.getItem().hasContainerItem(stack)) + if(inventory.get(i).getCount() == 0 && stack.getItem().hasContainerItem(stack)) { ItemStack container = stack.getItem().getContainerItem(stack);