diff --git a/build.gradle b/build.gradle index 31d5d58c3..7c10f2f37 100644 --- a/build.gradle +++ b/build.gradle @@ -65,6 +65,14 @@ repositories { name 'buildcraft' url 'https://mod-buildcraft.com/maven/' } + maven { + name 'tterrag' + url 'http://maven.tterrag.com/' + } + maven { + name 'ic2' + url 'http://maven.ic2.player.to' + } } // Define properties file @@ -96,11 +104,14 @@ dependencies { deobfProvided "mezz.jei:jei_${config.minecraft_version}:${config.jei_version}:api" runtime "mezz.jei:jei_${config.minecraft_version}:${config.jei_version}" compile "net.darkhax.tesla:Tesla-${config.minecraft_version}:${config.tesla_version}" - compile "inventory-tweaks:InventoryTweaks:${config.invtweak_version}:api" // Not updated yet + compile "inventory-tweaks:InventoryTweaks:${config.invtweak_version}:api" compile "li.cil.oc:OpenComputers:MC1.11.2-${config.opencomputers_version}:api" // Not updated yet deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla_version}" deobfCompile "cofh:RedstoneFlux:${config.minecraft_version}-${config.redstoneflux_version}:universal" deobfCompile "com.mod-buildcraft:buildcraft-api:${config.buildcraft_version}" + deobfProvided "team.chisel.ctm:CTM:MC${config.minecraft_version}-${config.ctm_version}:api" + runtime "team.chisel.ctm:CTM:MC${config.minecraft_version}-${config.ctm_version}" + compile "net.industrial-craft:industrialcraft-2:${config.ic2_version}:api" } processResources @@ -113,7 +124,9 @@ processResources } task coreJar(type: Jar) { - baseName = 'Mekanism' + archiveName = "Mekanism-${project.version}.jar" + dependsOn 'reobfJar' + classifier "core" from('etc/core') { include '*.info' @@ -126,7 +139,9 @@ task coreJar(type: Jar) { } task toolsJar(type: Jar) { - baseName = 'MekanismTools' + archiveName = "MekanismTools-${project.version}.jar" + dependsOn 'reobfJar' + classifier "tools" from('etc/tools') { include '*.info' @@ -139,7 +154,9 @@ task toolsJar(type: Jar) { } task generatorsJar(type: Jar) { - baseName = 'MekanismGenerators' + archiveName = "MekanismGenerators-${project.version}.jar" + dependsOn 'reobfJar' + classifier "generators" from('etc/generators') { include '*.info' @@ -151,28 +168,64 @@ task generatorsJar(type: Jar) { } } -coreJar.dependsOn('reobfJar') -toolsJar.dependsOn('reobfJar') -generatorsJar.dependsOn('reobfJar') - -task MDKZip(type: Zip) { - baseName = 'MDK' - from sourceSets.main.java.srcDirs +task apiJar(type: Jar) { + classifier "api" + baseName "Mekanism" + dependsOn "sourceMainJava" include 'mekanism/api/**' + from sourceSets.main.java.srcDirs + from sourceSets.main.output } -task releaseJars(type: Copy) { - from coreJar - from toolsJar - from generatorsJar - from MDKZip - rename '-(.*)jar', '.jar' - rename '-(.*)zip', '.zip' - into '.' +artifacts { + archives apiJar + archives coreJar + archives toolsJar + archives generatorsJar } task fullBuild(type: Delete) { delete jar + dependsOn "build" } -fullBuild.dependsOn('releaseJars') +apply plugin: 'maven' +apply plugin: 'maven-publish' + +uploadArchives { + if(System.getenv("LOCAL_MAVEN") != null) { + repositories { + mavenDeployer { + repository(url: "file://"+System.getenv("LOCAL_MAVEN")) + pom { + groupId = project.group + version = project.version + if (System.getenv("MAVEN_ARTIFACT") != null) { + artifactId = System.getenv("MAVEN_ARTIFACT") + } else { + artifactId = "Mekanism" + } + project { + name "Mekanism" + packaging 'jar' + description 'Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.' + url 'http://aidancbrady.com/mekanism/' + scm { + url 'https://github.com/aidancbrady/Mekanism.git' + } + issueManagement { + system 'github' + url 'https://github.com/aidancbrady/Mekanism/issues' + } + licenses { + license { + name 'MIT' + distribution 'repo' + } + } + } + } + } + } + } +} diff --git a/build.properties b/build.properties index e4bb302eb..dc16a019f 100644 --- a/build.properties +++ b/build.properties @@ -3,10 +3,12 @@ mappings_version=snapshot_20170625 forge_version=14.21.1.2387 mcmp_version=2.2.1_36 jei_version=4.7.0.67 -mod_version=9.3.3 +mod_version=9.3.4 tesla_version=1.0.59 -invtweak_version=1.62+beta.89 +invtweak_version=1.63+beta.107 opencomputers_version=1.7.0.24 hwyla_version=1.8.18-B32_1.12 redstoneflux_version=2.0.0.1 buildcraft_version=7.99.6 +ctm_version=0.2.1.5 +ic2_version=2.8.9-ex112 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 624e1077f..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 || stack.isEmpty() || !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 || stack.isEmpty() || !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 32434a7ee..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 1e1614058..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSink.java +++ /dev/null @@ -1,155 +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); - - this.tier = tier; - } - - public BasicSink(ILocatable parent, double capacity, int tier) { - super(parent, capacity); - - this.tier = tier; - } - - public BasicSink(World world, BlockPos pos, double capacity, int tier) { - super(world, pos, capacity); - - this.tier = tier; - } - - /** - * Set the IC2 energy tier for this sink. - * - * @param tier IC2 Tier. - */ - public void setSinkTier(int 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 d81177d46..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 3936ca843..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSinkSource.java +++ /dev/null @@ -1,114 +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); - - 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); - - 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); - - 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) { - this.sinkTier = tier; - } - - /** - * Set the IC2 energy tier for this source. - * - * @param tier IC2 Tier. - */ - public void setSourceTier(int 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 aec40ce5d..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 9efba8de7..000000000 --- a/src/api/java/ic2/api/energy/prefab/BasicSource.java +++ /dev/null @@ -1,165 +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); - - 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); - - 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); - - 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) { - 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/client/ClientProxy.java b/src/main/java/mekanism/client/ClientProxy.java index 8d62b479d..0de36abbe 100644 --- a/src/main/java/mekanism/client/ClientProxy.java +++ b/src/main/java/mekanism/client/ClientProxy.java @@ -71,7 +71,6 @@ import mekanism.client.gui.GuiTransporterConfig; import mekanism.client.gui.GuiUpgradeManagement; import mekanism.client.render.MekanismRenderer; import mekanism.client.render.RenderTickHandler; -import mekanism.client.render.ctm.CTMRegistry; import mekanism.client.render.entity.RenderBalloon; import mekanism.client.render.entity.RenderFlame; import mekanism.client.render.entity.RenderObsidianTNTPrimed; @@ -279,7 +278,6 @@ public class ClientProxy extends CommonProxy client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean(); client.replaceSoundsWhenResuming = Mekanism.configuration.get("client", "ReplaceSoundsWhenResuming", true, "If true, will reduce lagging between player sounds. Setting to false will reduce GC load").getBoolean(); - client.renderCTM = Mekanism.configuration.get("client", "CTMRenderer", true).getBoolean(); client.enableAmbientLighting = Mekanism.configuration.get("client", "EnableAmbientLighting", true).getBoolean(); client.ambientLightingLevel = Mekanism.configuration.get("client", "AmbientLightingLevel", 15).getInt(); client.opaqueTransmitters = Mekanism.configuration.get("client", "OpaqueTransmitterRender", false).getBoolean(); @@ -1111,8 +1109,7 @@ public class ClientProxy extends CommonProxy MekanismRenderer.init(); ModelLoaderRegistry.registerLoader(MekanismOBJLoader.INSTANCE); - - MinecraftForge.EVENT_BUS.register(new CTMRegistry()); + MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(MekanismOBJLoader.INSTANCE); @@ -1152,11 +1149,6 @@ public class ClientProxy extends CommonProxy return new RenderFlame(manager); } }); - - CTMRegistry.registerCTMs("mekanism", "dynamic_tank", "structural_glass", "dynamic_valve", "teleporter", "teleporter_frame", "induction_casing", "induction_port", "induction_port_output", - "induction_cell_basic", "induction_cell_advanced", "induction_cell_elite", "induction_cell_ultimate", "induction_provider_basic", "induction_provider_advanced", "induction_provider_elite", - "induction_provider_ultimate", "thermal_evaporation_controller", "thermal_evaporation_controller_on", "thermal_evaporation_valve", "superheating_element", "superheating_element_on", - "boiler_casing", "boiler_valve", "thermal_evaporation_valve", "thermal_evaporation_block"); } @Override diff --git a/src/main/java/mekanism/client/render/RenderResizableCuboid.java b/src/main/java/mekanism/client/render/RenderResizableCuboid.java index cb29ede0e..a976661e2 100644 --- a/src/main/java/mekanism/client/render/RenderResizableCuboid.java +++ b/src/main/java/mekanism/client/render/RenderResizableCuboid.java @@ -161,7 +161,8 @@ public class RenderResizableCuboid { wr.begin(GL11.GL_QUADS, shadeTypes.vertexFormat); for (EnumFacing face : EnumFacing.values()) { - renderCuboidFace(wr, face, sprites, flips, textureStart, textureSize, size, textureOffset, shadeTypes, formula, faceFormula, world); + if(cube.shouldSideRender(face)) + renderCuboidFace(wr, face, sprites, flips, textureStart, textureSize, size, textureOffset, shadeTypes, formula, faceFormula, world); } tess.draw(); diff --git a/src/main/java/mekanism/client/render/ctm/CTM.java b/src/main/java/mekanism/client/render/ctm/CTM.java deleted file mode 100644 index 3e5197e84..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTM.java +++ /dev/null @@ -1,349 +0,0 @@ -package mekanism.client.render.ctm; - -import static mekanism.client.render.ctm.Dir.BOTTOM; -import static mekanism.client.render.ctm.Dir.BOTTOM_LEFT; -import static mekanism.client.render.ctm.Dir.BOTTOM_RIGHT; -import static mekanism.client.render.ctm.Dir.LEFT; -import static mekanism.client.render.ctm.Dir.RIGHT; -import static mekanism.client.render.ctm.Dir.TOP; -import static mekanism.client.render.ctm.Dir.TOP_LEFT; -import static mekanism.client.render.ctm.Dir.TOP_RIGHT; -import gnu.trove.map.TIntObjectMap; -import gnu.trove.map.hash.TIntObjectHashMap; - -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -import com.google.common.base.Optional; -import com.google.common.collect.Maps; - -// @formatter:off -/** - * The CTM renderer will draw the block's FACE using by assembling 4 quadrants from the 5 available block - * textures. The normal Texture.png is the blocks "unconnected" texture, and is used when CTM is disabled or the block - * has nothing to connect to. This texture has all of the outside corner quadrants The texture-ctm.png contains the - * rest of the quadrants. - *
- * ┌─────────────────┐ ┌────────────────────────────────┐ - * │ texture.png │ │ texture-ctm.png │ - * │ ╔══════╤══════╗ │ │ ──────┼────── ║ ─────┼───── ║ │ - * │ ║ │ ║ │ │ │ │ │║ │ ║ │ - * │ ║ 16 │ 17 ║ │ │ │ 0 │ 1 │║ 2 │ 3 ║ │ - * │ ╟──────┼──────╢ │ │ ┼──────┼──────┼╟──────┼──────╢ │ - * │ ║ │ ║ │ │ │ │ │║ │ ║ │ - * │ ║ 18 │ 19 ║ │ │ │ 4 │ 5 │║ 6 │ 7 ║ │ - * │ ╚══════╧══════╝ │ │ ──────┼────── ║ ─────┼───── ║ │ - * └─────────────────┘ │ ═══════╤═══════╝ ─────┼───── ╚ │ - * │ │ │ ││ │ │ │ - * │ │ 8 │ 9 ││ 10 │ 11 │ │ - * │ ┼──────┼──────┼┼──────┼──────┼ │ - * │ │ │ ││ │ │ │ - * │ │ 12 │ 13 ││ 14 │ 15 │ │ - * │ ═══════╧═══════╗ ─────┼───── ╔ │ - * └────────────────────────────────┘ - *
- * combining { 18, 13, 9, 16 }, we can generate a texture connected to the right! - *
- * ╔══════╤═══════ - * ║ │ │ - * ║ 16 │ 9 │ - * ╟──────┼──────┼ - * ║ │ │ - * ║ 18 │ 13 │ - * ╚══════╧═══════ - *
- * - * combining { 18, 13, 11, 2 }, we can generate a texture, in the shape of an L (connected to the right, and up - *
- * ║ ─────┼───── ╚ - * ║ │ │ - * ║ 2 │ 11 │ - * ╟──────┼──────┼ - * ║ │ │ - * ║ 18 │ 13 │ - * ╚══════╧═══════ - *
- * - * HAVE FUN! - * -CptRageToaster- - */ -public class CTM { - public static int REQUIRED_TEXTURES = 2; - public static int QUADS_PER_SIDE = 4; - - /** - * The Uvs for the specific "magic number" value - */ - public static final ISubmap[] uvs = new ISubmap[]{ - //Ctm texture - new Submap(4, 4, 0, 0), // 0 - new Submap(4, 4, 4, 0), // 1 - new Submap(4, 4, 8, 0), // 2 - new Submap(4, 4, 12, 0), // 3 - new Submap(4, 4, 0, 4), // 4 - new Submap(4, 4, 4, 4), // 5 - new Submap(4, 4, 8, 4), // 6 - new Submap(4, 4, 12, 4), // 7 - new Submap(4, 4, 0, 8), // 8 - new Submap(4, 4, 4, 8), // 9 - new Submap(4, 4, 8, 8), // 10 - new Submap(4, 4, 12, 8), // 11 - new Submap(4, 4, 0, 12), // 12 - new Submap(4, 4, 4, 12), // 13 - new Submap(4, 4, 8, 12), // 14 - new Submap(4, 4, 12, 12), // 15 - // Default texture - new Submap(8, 8, 0, 0), // 16 - new Submap(8, 8, 8, 0), // 17 - new Submap(8, 8, 0, 8), // 18 - new Submap(8, 8, 8, 8) // 19 - }; - - public static final ISubmap FULL_TEXTURE = new Submap(16, 16, 0, 0); - - // @formatter:on - - /** Some hardcoded offset values for the different corner indeces */ - protected static int[] submapOffsets = { 4, 5, 1, 0 }; - /** For use via the Chisel 2 config only, altering this could cause unintended behavior */ - public static boolean disableObscuredFaceCheckConfig = false; - - public Optional disableObscuredFaceCheck = Optional.absent(); - - protected TIntObjectMap submapMap = new TIntObjectHashMap(); - protected EnumMap connectionMap = Maps.newEnumMap(Dir.class); - protected int[] submapCache; - - protected CTM() - { - for (Dir dir : Dir.VALUES) - { - connectionMap.put(dir, false); - } - - // Mapping the different corner indeces to their respective dirs - submapMap.put(0, new Dir[] { BOTTOM, LEFT, BOTTOM_LEFT }); - submapMap.put(1, new Dir[] { BOTTOM, RIGHT, BOTTOM_RIGHT }); - submapMap.put(2, new Dir[] { TOP, RIGHT, TOP_RIGHT }); - submapMap.put(3, new Dir[] { TOP, LEFT, TOP_LEFT }); - } - - public static CTM getInstance() { - return new CTM(); - } - - /** - * @return The indeces of the typical 4x4 submap to use for the given face at the given location. - * - * Indeces are in counter-clockwise order starting at bottom left. - */ - public int[] createSubmapIndices(IBlockAccess world, BlockPos pos, EnumFacing side) { - submapCache = new int[] { 18, 19, 17, 16 }; - - if (world == null) { - return submapCache; - } - - buildConnectionMap(world, pos, side); - - // Map connections to submap indeces - for (int i = 0; i < 4; i++) { - fillSubmaps(i); - } - - return submapCache; - } - - public int[] createSubmapIndices(long data, EnumFacing side){ - submapCache = new int[] { 18, 19, 17, 16 }; - - buildConnectionMap(data, side); - - // Map connections to submap indeces - for (int i = 0; i < 4; i++) { - fillSubmaps(i); - } - - return submapCache; - } - - public int[] getSubmapIndices() { - return submapCache; - } - - public static boolean isDefaultTexture(int id) { - return (id == 16 || id == 17 || id == 18 || id == 19); - } - - /** - * Builds the connection map and stores it in this CTM instance. The {@link #connected(Dir)}, {@link #connectedAnd(Dir...)}, and {@link #connectedOr(Dir...)} methods can be used to access it. - */ - public void buildConnectionMap(IBlockAccess world, BlockPos pos, EnumFacing side) { - IBlockState state = world.getBlockState(pos); - for (Dir dir : Dir.VALUES) { - connectionMap.put(dir, dir.isConnected(this, world, pos, side, state)); - } - } - - public void buildConnectionMap(long data, EnumFacing side){ - for (Dir dir : Dir.VALUES){ - connectionMap.put(dir, false); - } - List connections = CTMConnections.decode(data); - for (CTMConnections loc : connections){ - if (loc.getDirForSide(side) != null){ - connectionMap.put(loc.getDirForSide(side), true); - } - } - } - - private void fillSubmaps(int idx) { - Dir[] dirs = submapMap.get(idx); - if (connectedOr(dirs[0], dirs[1])) { - if (connectedAnd(dirs)) { - // If all dirs are connected, we use the fully connected face, - // the base offset value. - submapCache[idx] = submapOffsets[idx]; - } else { - // This is a bit magic-y, but basically the array is ordered so - // the first dir requires an offset of 2, and the second dir - // requires an offset of 8, plus the initial offset for the - // corner. - submapCache[idx] = submapOffsets[idx] + (connected(dirs[0]) ? 2 : 0) + (connected(dirs[1]) ? 8 : 0); - } - } - } - - /** - * @param dir - * The direction to check connection in. - * @return True if the cached connectionMap holds a connection in this {@link Dir direction}. - */ - public boolean connected(Dir dir) { - return connectionMap.get(dir); - } - - /** - * @param dirs - * The directions to check connection in. - * @return True if the cached connectionMap holds a connection in all the given {@link Dir directions}. - */ - public boolean connectedAnd(Dir... dirs) { - for (Dir dir : dirs) { - if (!connected(dir)) { - return false; - } - } - return true; - } - - /** - * @param dirs - * The directions to check connection in. - * @return True if the cached connectionMap holds a connection in one of the given {@link Dir directions}. - */ - public boolean connectedOr(Dir... dirs) { - for (Dir dir : dirs) { - if (connected(dir)) { - return true; - } - } - return false; - } - - /** - * A simple check for if the given block can connect to the given direction on the given side. - * - * @param world - * @param current - * The position of your block. - * @param y - * The position of the block to check against. - * @param dir - * The {@link EnumFacing side} of the block to check for connection status. This is not the direction to check in. - * @return True if the given block can connect to the given location on the given side. - */ - public boolean isConnected(IBlockAccess world, BlockPos current, BlockPos connection, EnumFacing dir) { - - IBlockState state = world.getBlockState(current); - return isConnected(world, current, connection, dir, state); - } - - /** - * A simple check for if the given block can connect to the given direction on the given side. - * - * @param world - * @param current - * The position of your block. - * @param y - * The position of the block to check against. - * @param dir - * The {@link EnumFacing side} of the block to check for connection status. This is not the direction to check in. - * @param state - * The state to check against for connection. - * @return True if the given block can connect to the given location on the given side. - */ - public boolean isConnected(IBlockAccess world, BlockPos current, BlockPos connection, EnumFacing dir, IBlockState state) - { - BlockPos pos2 = connection.add(dir.getDirectionVec()); - - boolean disableObscured = disableObscuredFaceCheck.or(disableObscuredFaceCheckConfig); - - IBlockState obscuring = disableObscured ? null : getConnectedState(world, pos2, dir); - - boolean ret = canConnect(world, current, connection); - - // no block obscuring this face - if(obscuring == null) - { - return ret; - } - - // check that we aren't already connected outwards from this side - ret &= !obscuring.isFullCube() || !obscuring.equals(state); - - return ret; - } - - public static boolean canConnect(IBlockAccess world, BlockPos pos, BlockPos connection) - { - IBlockState state = world.getBlockState(pos); - IBlockState con = world.getBlockState(connection); - - if(!(state.getBlock() instanceof ICTMBlock)) - { - return false; - } - - CTMData data = ((ICTMBlock)state.getBlock()).getCTMData(state); - - // no block or a bad API user - if(con == null || data == null) - { - return false; - } - - boolean ret = false; - - if(con.getBlock() instanceof ICTMBlock && ((ICTMBlock)con.getBlock()).getCTMData(con) != null) - { - String state2 = ((IStringSerializable)con.getValue(((ICTMBlock)con.getBlock()).getTypeProperty())).getName(); - - ret = data.acceptableBlockStates.contains(state2); - } - - return ret; - } - - public static IBlockState getConnectedState(IBlockAccess world, BlockPos pos, EnumFacing side) - { - IBlockState state = world.getBlockState(pos); - return state; - } -} \ No newline at end of file diff --git a/src/main/java/mekanism/client/render/ctm/CTMBlockRenderContext.java b/src/main/java/mekanism/client/render/ctm/CTMBlockRenderContext.java deleted file mode 100644 index 26e437bee..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTMBlockRenderContext.java +++ /dev/null @@ -1,59 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.EnumMap; - -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -import org.apache.commons.lang3.ArrayUtils; - -import static mekanism.client.render.ctm.CTMConnections.*; - -public class CTMBlockRenderContext -{ - private static final CTMConnections[] CACHED_LOCATIONS = ArrayUtils.removeElements(CTMConnections.VALUES, UP_UP, DOWN_DOWN, EAST_EAST, WEST_WEST, NORTH_NORTH, SOUTH_SOUTH); - - private EnumMap ctmData = new EnumMap<>(EnumFacing.class); - - private long data; - - public CTMBlockRenderContext(IBlockAccess world, BlockPos pos) - { - for(EnumFacing face : EnumFacing.VALUES) - { - CTM ctm = createCTM(); - ctm.createSubmapIndices(world, pos, face); - ctmData.put(face, ctm); - } - - data = CTMConnections.getData(world, pos, CACHED_LOCATIONS); - } - - public CTMBlockRenderContext(long d) - { - data = d; - - for(EnumFacing face : EnumFacing.VALUES) - { - CTM ctm = createCTM(); - ctm.createSubmapIndices(data, face); - ctmData.put(face, ctm); - } - } - - protected CTM createCTM() - { - return CTM.getInstance(); - } - - public CTM getCTM(EnumFacing face) - { - return ctmData.get(face); - } - - public long serialize() - { - return data; - } -} diff --git a/src/main/java/mekanism/client/render/ctm/CTMConnections.java b/src/main/java/mekanism/client/render/ctm/CTMConnections.java deleted file mode 100644 index a2eb5b73b..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTMConnections.java +++ /dev/null @@ -1,224 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.ArrayList; -import java.util.List; - -import mekanism.api.MekanismAPI; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Represents all the different spot for connection locations for a ctm block - */ -public enum CTMConnections -{ - UP(Dir.TOP), - DOWN(Dir.BOTTOM), - NORTH(EnumFacing.EAST, Dir.RIGHT), - SOUTH(EnumFacing.EAST, Dir.LEFT), - EAST(Dir.RIGHT), - WEST(Dir.LEFT), - - NORTH_EAST(EnumFacing.UP, Dir.TOP_RIGHT), - NORTH_WEST(EnumFacing.UP, Dir.TOP_LEFT), - SOUTH_EAST(EnumFacing.UP, Dir.BOTTOM_RIGHT), - SOUTH_WEST(EnumFacing.UP, Dir.BOTTOM_LEFT), - - NORTH_UP(EnumFacing.EAST, Dir.TOP_RIGHT), - NORTH_DOWN(EnumFacing.EAST, Dir.BOTTOM_RIGHT), - SOUTH_UP(EnumFacing.EAST, Dir.TOP_LEFT), - SOUTH_DOWN(EnumFacing.EAST, Dir.BOTTOM_LEFT), - - EAST_UP(Dir.TOP_RIGHT), - EAST_DOWN(Dir.BOTTOM_RIGHT), - WEST_UP(Dir.TOP_LEFT), - WEST_DOWN(Dir.BOTTOM_LEFT), - - NORTH_EAST_UP(EnumFacing.EAST, Dir.TOP_RIGHT, true), - NORTH_EAST_DOWN(EnumFacing.EAST, Dir.BOTTOM_RIGHT, true), - - SOUTH_EAST_UP(EnumFacing.EAST, Dir.TOP_LEFT, true), - SOUTH_EAST_DOWN(EnumFacing.EAST, Dir.BOTTOM_LEFT, true), - - SOUTH_WEST_UP(EnumFacing.WEST, Dir.TOP_LEFT, true), - SOUTH_WEST_DOWN(EnumFacing.WEST, Dir.BOTTOM_LEFT, true), - - NORTH_WEST_UP(EnumFacing.WEST, Dir.TOP_RIGHT, true), - NORTH_WEST_DOWN(EnumFacing.WEST, Dir.BOTTOM_RIGHT, true), - - UP_UP(EnumFacing.UP, null, true), - DOWN_DOWN(EnumFacing.DOWN, null, true), - NORTH_NORTH(EnumFacing.NORTH, null, true), - SOUTH_SOUTH(EnumFacing.SOUTH, null, true), - EAST_EAST(EnumFacing.EAST, null, true), - WEST_WEST(EnumFacing.WEST, null, true); - - public static final CTMConnections[] VALUES = values(); - - /** - * The enum facing directions needed to get to this connection location - */ - private EnumFacing normal; - private Dir dir; - private boolean offset; - - private CTMConnections(Dir dir) - { - this(EnumFacing.SOUTH, dir); - } - - private CTMConnections(Dir dir, boolean offset) - { - this(EnumFacing.SOUTH, dir, offset); - } - - private CTMConnections(EnumFacing normal, Dir dir) - { - this(normal, dir, false); - } - - private CTMConnections(EnumFacing normal, Dir dir, boolean offset) - { - this.normal = normal; - this.dir = dir; - this.offset = offset; - } - - public Dir getDirForSide(EnumFacing facing) - { - return dir == null ? null : dir;//TODO .relativize() - } - - public EnumFacing clipOrDestroy(EnumFacing direction) - { - EnumFacing[] dirs = dir == null ? new EnumFacing[] {normal, normal} : dir.getNormalizedDirs(direction); - - if(dirs[0] == direction) - { - return dirs.length > 1 ? dirs[1] : null; - } - else if(dirs.length > 1 && dirs[1] == direction) - { - return dirs[0]; - } - else { - return null; - } - } - - public BlockPos transform(BlockPos pos) - { - if(dir != null) - { - for(EnumFacing facing : dir.getNormalizedDirs(normal)) - { - pos = pos.offset(facing); - } - } - else { - pos = pos.offset(normal); - } - - if(offset) - { - pos = pos.offset(normal); - } - - return pos; - } - - public static CTMConnections fromFacing(EnumFacing facing) - { - switch(facing) - { - case NORTH: return NORTH; - case SOUTH: return SOUTH; - case EAST: return EAST; - case WEST: return WEST; - case UP: return UP; - case DOWN: return DOWN; - default: return NORTH; - } - } - - public static EnumFacing toFacing(CTMConnections loc) - { - switch(loc) - { - case NORTH: return EnumFacing.NORTH; - case SOUTH: return EnumFacing.SOUTH; - case EAST: return EnumFacing.EAST; - case WEST: return EnumFacing.WEST; - case UP: return EnumFacing.UP; - case DOWN: return EnumFacing.DOWN; - default: return EnumFacing.NORTH; - } - } - - public static List decode(long data) - { - List list = new ArrayList<>(); - - for(CTMConnections loc : values()) - { - if((1 & (data >> loc.ordinal())) != 0) - { - list.add(loc); - } - } - - return list; - } - - public long getMask() - { - return 1 << ordinal(); - } - - public static List getConnections(IBlockAccess world, BlockPos pos, CTMConnections[] values) - { - List locs = new ArrayList<>(); - - IBlockState state = world.getBlockState(pos); - - for(CTMConnections loc : values) - { - BlockPos second = loc.transform(pos); - - if(CTM.canConnect(world, pos, second)) - { - locs.add(loc); - } - } - - return locs; - } - - public static long getData(IBlockAccess world, BlockPos pos, CTMConnections[] values) - { - List locs = getConnections(world, pos, values); - - long data = 0; - - for(CTMConnections loc : locs) - { - data = data | loc.getMask(); - } - - if(MekanismAPI.debug) - { - String s = Long.toBinaryString(data); - - while(s.length() < 32) - { - s = "0" + s; - } - - System.out.println(pos + ": " + s); - } - - return data; - } -} \ No newline at end of file diff --git a/src/main/java/mekanism/client/render/ctm/CTMData.java b/src/main/java/mekanism/client/render/ctm/CTMData.java deleted file mode 100644 index 3cb7015bc..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTMData.java +++ /dev/null @@ -1,47 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class CTMData -{ - public List acceptableBlockStates = new ArrayList(); - - public boolean renderConvexConnections = false; - - public CTMData(IStringSerializable... states) - { - for(IStringSerializable state : states) - { - acceptableBlockStates.add(state.getName()); - } - } - - public CTMData setRenderConvexConnections() - { - renderConvexConnections = true; - return this; - } - - @SideOnly(Side.CLIENT) - public boolean shouldRenderSide(IBlockAccess world, BlockPos pos, EnumFacing side) - { - IBlockState state = world.getBlockState(pos); - - if(state.getBlock() instanceof ICTMBlock) - { - IStringSerializable serializable = (IStringSerializable)state.getValue(((ICTMBlock)state.getBlock()).getTypeProperty()); - return !acceptableBlockStates.contains(serializable.getName()); - } - - return true; - } -} diff --git a/src/main/java/mekanism/client/render/ctm/CTMModelFactory.java b/src/main/java/mekanism/client/render/ctm/CTMModelFactory.java deleted file mode 100644 index 9b4594079..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTMModelFactory.java +++ /dev/null @@ -1,226 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import javax.vecmath.Vector3f; - -import mekanism.common.block.states.BlockStateBasic; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.model.TRSRTransformation; -import net.minecraftforge.common.property.IExtendedBlockState; - -import org.apache.commons.lang3.tuple.Pair; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.FluentIterable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.MultimapBuilder; -import com.google.common.collect.Table; -import com.google.common.collect.Tables; - -/** - * Model for all CTM blocks, credit to Chisel - */ -@SuppressWarnings("deprecation") -public class CTMModelFactory implements IBakedModel -{ - private ListMultimap genQuads = MultimapBuilder.enumKeys(BlockRenderLayer.class).arrayListValues().build(); - private Table> faceQuads = Tables.newCustomTable(Maps.newEnumMap(BlockRenderLayer.class), () -> Maps.newEnumMap(EnumFacing.class)); - - private ModelCTM model; - - private CTMOverride override = new CTMOverride(); - - public CTMModelFactory(ModelCTM m) - { - model = m; - } - - private static Cache ctmCache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES).maximumSize(500).build(); - - @Override - public List getQuads(IBlockState stateIn, EnumFacing side, long rand) - { - CTMModelFactory baked; - - if(stateIn != null && stateIn.getBlock() instanceof ICTMBlock && stateIn instanceof IExtendedBlockState) - { - IExtendedBlockState state = (IExtendedBlockState)stateIn; - IBlockState clean = state.getClean(); - CTMBlockRenderContext ctxList = state.getValue(BlockStateBasic.ctmProperty); - - try { - if(ctxList == null) - { - baked = ctmCache.get(Objects.hash(clean, -1), () -> createModel(state, model, null)); - } - else { - long serialized = ctxList.serialize(); - baked = ctmCache.get(Objects.hash(clean, serialized), () -> createModel(state, model, ctxList)); - } - } catch(Exception e) { - e.printStackTrace(); - return Lists.newArrayList(); - } - } - else { - baked = this; - } - - BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer(); - return side == null ? baked.genQuads.get(layer) : layer == null ? baked.faceQuads.column(side).values().stream().flatMap(List::stream).collect(Collectors.toList()) : baked.faceQuads.get(layer, side); - } - - @Override - public boolean isAmbientOcclusion() - { - return true; - } - - @Override - public boolean isGui3d() - { - return true; - } - - @Override - public boolean isBuiltInRenderer() - { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() - { - return model.getDefaultFace().getParticle(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() - { - return ItemCameraTransforms.DEFAULT; - } - - private CTMModelFactory createModel(IBlockState state, ModelCTM model, CTMBlockRenderContext ctx) - { - CTMModelFactory ret = new CTMModelFactory(model); - IBakedModel baked = model.getModel(state); - int quadGoal = ctx == null ? 1 : CTM.QUADS_PER_SIDE; - List quads = Lists.newArrayList(); - - for(BlockRenderLayer layer : BlockRenderLayer.values()) - { - for(EnumFacing facing : EnumFacing.VALUES) - { - TextureCTM face = model.getFace(facing); - - if(ctx == null || layer == state.getBlock().getBlockLayer()) - { - ICTMBlock block = (ICTMBlock)state.getBlock(); - CTMData data = block.getCTMData(state); - - if(block.getOverrideTexture(state, facing) != null) - { - face = CTMRegistry.textureCache.get(block.getOverrideTexture(state, facing)); - } - - List temp = baked.getQuads(state, facing, 0); - addAllQuads(temp, face, ctx, state, quadGoal, quads); - ret.faceQuads.put(layer, facing, ImmutableList.copyOf(quads)); - - temp = FluentIterable.from(baked.getQuads(state, null, 0)).filter(q -> q.getFace() == facing).toList(); - addAllQuads(temp, face, ctx, state, quadGoal, quads); - ret.genQuads.putAll(layer, temp); - } - else { - ret.faceQuads.put(layer, facing, Lists.newArrayList()); - } - } - } - - return ret; - } - - private void addAllQuads(List from, TextureCTM tex, @Nullable CTMBlockRenderContext ctx, IBlockState state, int quadGoal, List to) - { - to.clear(); - - for(BakedQuad q : from) - { - to.addAll(tex.transformQuad(q, ctx == null ? null : ctx, quadGoal)); - } - } - - private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) - { - return new TRSRTransformation( - new Vector3f(tx / 16, ty / 16, tz / 16), - TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), - new Vector3f(s, s, s), - null); - } - - public static Map transforms = ImmutableMap.builder() - .put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)) - .put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) - .put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) - .put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)) - .put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)) - .put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f)) - .put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1)) - .put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1)) - .put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0)) - .build(); - - @Override - public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) - { - return Pair.of(this, transforms.get(cameraTransformType).getMatrix()); - } - - @Override - public ItemOverrideList getOverrides() - { - return override; - } - - private class CTMOverride extends ItemOverrideList - { - public CTMOverride() - { - super(Lists.newArrayList()); - } - - @Override - public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) - { - Block block = ((ItemBlock)stack.getItem()).getBlock(); - return createModel(block.getDefaultState(), model, null); - } - } -} diff --git a/src/main/java/mekanism/client/render/ctm/CTMRegistry.java b/src/main/java/mekanism/client/render/ctm/CTMRegistry.java deleted file mode 100644 index a89da3afc..000000000 --- a/src/main/java/mekanism/client/render/ctm/CTMRegistry.java +++ /dev/null @@ -1,83 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.ModelBakeEvent; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.client.model.Attributes; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.model.TRSRTransformation; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import org.apache.commons.lang3.tuple.Pair; - -public class CTMRegistry -{ - private static List textures = new ArrayList(); - - private IBakedModel baseModel; - public static ResourceLocation baseResource = new ResourceLocation("mekanism:block/ctm_block"); - - public static List> ctmTypes = new ArrayList>(); - - public static Map textureCache = new HashMap(); - - @SubscribeEvent - public void onTextureStitch(TextureStitchEvent.Pre event) - { - for(TextureSpriteCallback callback : textures) - { - callback.stitch(event.getMap()); - } - } - - @SubscribeEvent - public void onModelBake(ModelBakeEvent event) throws Exception - { - IModel model = ModelLoaderRegistry.getModel(baseResource); - baseModel = model.bake(new TRSRTransformation(ModelRotation.X0_Y0), Attributes.DEFAULT_BAKED_FORMAT, r -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(r.toString())); - - for(Pair pair : ctmTypes) - { - ModelCTM chiselModel = new ModelCTM(baseModel, pair.getRight()); - chiselModel.load(); - event.getModelRegistry().putObject(new ModelResourceLocation(pair.getLeft() + ":" + pair.getRight()), new CTMModelFactory(chiselModel)); - } - } - - public static void registerCTMs(String domain, String... ctms) - { - for(String s : ctms) - { - ctmTypes.add(Pair.of(domain, s)); - textureCache.put(s, createTexture(domain, s)); - } - } - - public static void register(TextureSpriteCallback callback) - { - textures.add(callback); - } - - public static TextureCTM createTexture(String domain, String name) - { - TextureSpriteCallback[] callbacks = new TextureSpriteCallback[CTM.REQUIRED_TEXTURES]; - - callbacks[0] = new TextureSpriteCallback(new ResourceLocation(domain + ":blocks/ctm/" + name)); - callbacks[1] = new TextureSpriteCallback(new ResourceLocation(domain + ":blocks/ctm/" + name + "-ctm")); - - register(callbacks[0]); - register(callbacks[1]); - - return new TextureCTM(callbacks); - } -} diff --git a/src/main/java/mekanism/client/render/ctm/Dir.java b/src/main/java/mekanism/client/render/ctm/Dir.java deleted file mode 100644 index 111c73f64..000000000 --- a/src/main/java/mekanism/client/render/ctm/Dir.java +++ /dev/null @@ -1,185 +0,0 @@ -package mekanism.client.render.ctm; - -import static net.minecraft.util.EnumFacing.DOWN; -import static net.minecraft.util.EnumFacing.EAST; -import static net.minecraft.util.EnumFacing.NORTH; -import static net.minecraft.util.EnumFacing.SOUTH; -import static net.minecraft.util.EnumFacing.UP; -import static net.minecraft.util.EnumFacing.WEST; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumFacing.Axis; -import net.minecraft.util.EnumFacing.AxisDirection; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Think of this class as a "Two dimensional EnumFacing, with diagonals". - *

- * It represents the eight different directions a face of a block can connect with CTM, and contains the logic for determining if a block is indeed connected in that direction. - *

- * Note that, for example, {@link #TOP_RIGHT} does not mean connected to the {@link #TOP} and {@link #RIGHT}, but connected in the diagonal direction represented by {@link #TOP_RIGHT}. This is used - * for inner corner rendering. - */ -public enum Dir { - // @formatter:off - TOP(UP), - TOP_RIGHT(UP, EAST), - RIGHT(EAST), - BOTTOM_RIGHT(DOWN, EAST), - BOTTOM(DOWN), - BOTTOM_LEFT(DOWN, WEST), - LEFT(WEST), - TOP_LEFT(UP, WEST); - // @formatter:on - - /** - * All values of this enum, used to prevent unnecessary allocation via {@link #values()}. - */ - public static final Dir[] VALUES = values(); - private static final EnumFacing NORMAL = SOUTH; - - private EnumFacing[] dirs; - - private Dir(EnumFacing... dirs) { - this.dirs = dirs; - } - - /** - * Finds if this block is connected for the given side in this Dir. - * - * @param inst - * The CTM instance to use for logic. - * @param world - * The world the block is in. - * @param pos - * The position of your block. - * @param side - * The side of the current face. - * @return True if the block is connected in the given Dir, false otherwise. - */ - public boolean isConnected(CTM ctm, IBlockAccess world, BlockPos pos, EnumFacing side) { - return ctm.isConnected(world, pos, getConnection(pos, side), side); - } - - /** - * Finds if this block is connected for the given side in this Dir. - * - * @param inst - * The CTM instance to use for logic. - * @param world - * The world the block is in. - * @param pos - * The position of your block. - * @param side - * The side of the current face. - * @param side - * The state to check for connection with. - * @return True if the block is connected in the given Dir, false otherwise. - */ - public boolean isConnected(CTM ctm, IBlockAccess world, BlockPos pos, EnumFacing side, IBlockState state) { - return ctm.isConnected(world, pos, getConnection(pos, side), side, state); - } - - private BlockPos getConnection(BlockPos pos, EnumFacing side) { - EnumFacing[] dirs = getNormalizedDirs(side); - BlockPos connection = pos; - for (EnumFacing dir : dirs) { - connection = connection.offset(dir); - } - return connection; - } - - public EnumFacing[] getNormalizedDirs(EnumFacing normal) { - if (normal == NORMAL) { - return dirs; - } else if (normal == NORMAL.getOpposite()) { - // If this is the opposite direction of the default normal, we - // need to mirror the dirs - // A mirror version does not affect y+ and y- so we ignore those - EnumFacing[] ret = new EnumFacing[dirs.length]; - for (int i = 0; i < ret.length; i++) { - ret[i] = dirs[i].getFrontOffsetY() != 0 ? dirs[i] : dirs[i].getOpposite(); - } - return ret; - } else { - EnumFacing axis = null; - // Next, we need different a different rotation axis depending - // on if this is up/down or not - if (normal.getFrontOffsetY() == 0) { - // If it is not up/down, pick either the left or right-hand - // rotation - axis = normal == NORMAL.rotateY() ? UP : DOWN; - } else { - // If it is up/down, pick either the up or down rotation. - axis = normal == UP ? NORMAL.rotateYCCW() : NORMAL.rotateY(); - } - EnumFacing[] ret = new EnumFacing[dirs.length]; - // Finally apply all the rotations - for (int i = 0; i < ret.length; i++) { - ret[i] = rotate(dirs[i], axis); - } - return ret; - } - } - - // God why - - private static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; - static { - FACING_LOOKUP[NORTH.ordinal()] = 1; - FACING_LOOKUP[EAST.ordinal()] = 2; - FACING_LOOKUP[SOUTH.ordinal()] = 3; - FACING_LOOKUP[WEST.ordinal()] = 4; - FACING_LOOKUP[UP.ordinal()] = 5; - FACING_LOOKUP[DOWN.ordinal()] = 6; - } - - private EnumFacing rotate(EnumFacing facing, EnumFacing axisFacing) { - Axis axis = axisFacing.getAxis(); - AxisDirection axisDir = axisFacing.getAxisDirection(); - - if (axisDir == AxisDirection.POSITIVE) { - return facing.rotateAround(axis); - } - - if (facing.getAxis() != axis) { - switch (axis) { - case X: - // I did some manual testing and this is what worked...I don't get it either - switch (FACING_LOOKUP[facing.ordinal()]) { - case 1: - return NORTH; - case 2: - case 4: - default: - return facing; // Invalid but ignored - case 3: - return SOUTH; - case 5: - return SOUTH; - case 6: - return NORTH; - } - case Y: - return facing.rotateYCCW(); - case Z: - switch (FACING_LOOKUP[facing.ordinal()]) { - case 2: - return EAST; - case 3: - default: - return facing; // invalid but ignored - case 4: - return WEST; - case 5: - return DOWN; - case 6: - return UP; - } - } - } - - return facing; - } -} \ No newline at end of file diff --git a/src/main/java/mekanism/client/render/ctm/ICTMBlock.java b/src/main/java/mekanism/client/render/ctm/ICTMBlock.java deleted file mode 100644 index e7c9a7303..000000000 --- a/src/main/java/mekanism/client/render/ctm/ICTMBlock.java +++ /dev/null @@ -1,15 +0,0 @@ -package mekanism.client.render.ctm; - -import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; - -public interface ICTMBlock -{ - public CTMData getCTMData(IBlockState state); - - public PropertyEnum getTypeProperty(); - - public String getOverrideTexture(IBlockState state, EnumFacing side); -} diff --git a/src/main/java/mekanism/client/render/ctm/ISubmap.java b/src/main/java/mekanism/client/render/ctm/ISubmap.java deleted file mode 100644 index f0d91d8b0..000000000 --- a/src/main/java/mekanism/client/render/ctm/ISubmap.java +++ /dev/null @@ -1,24 +0,0 @@ -package mekanism.client.render.ctm; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -public interface ISubmap { - - float getYOffset(); - - float getXOffset(); - - float getWidth(); - - float getHeight(); - - float getInterpolatedU(TextureAtlasSprite sprite, float u); - - float getInterpolatedV(TextureAtlasSprite sprite, float v); - - float[] toArray(); - - ISubmap normalize(); - - ISubmap relativize(); -} diff --git a/src/main/java/mekanism/client/render/ctm/ModelCTM.java b/src/main/java/mekanism/client/render/ctm/ModelCTM.java deleted file mode 100644 index a29bb9174..000000000 --- a/src/main/java/mekanism/client/render/ctm/ModelCTM.java +++ /dev/null @@ -1,93 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -public class ModelCTM implements IModel -{ - private Map overrides = Maps.newHashMap(); - - private transient TextureCTM faceObj; - private transient Map overridesObj = new EnumMap<>(EnumFacing.class); - - private transient IBakedModel modelObj; - - private transient List textures = Lists.newArrayList(); - - public String modelName; - - public ModelCTM(IBakedModel model, String name) - { - modelObj = model; - modelName = name; - } - - @Override - public Collection getDependencies() - { - return new ArrayList(); - } - - @Override - public Collection getTextures() - { - return ImmutableList.copyOf(textures); - } - - @Override - public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) - { - return null; - } - - @Override - public IModelState getDefaultState() - { - return TRSRTransformation.identity(); - } - - void load() - { - if(faceObj != null) - { - return; - } - - faceObj = CTMRegistry.textureCache.get(modelName); - textures.addAll(faceObj.getTextures()); - overridesObj.values().forEach(t -> textures.addAll(t.getTextures())); - } - - public TextureCTM getDefaultFace() - { - return faceObj; - } - - public TextureCTM getFace(EnumFacing facing) - { - return overridesObj.getOrDefault(facing, faceObj); - } - - public IBakedModel getModel(IBlockState state) - { - return modelObj; - } -} diff --git a/src/main/java/mekanism/client/render/ctm/PropertyCTMRenderContext.java b/src/main/java/mekanism/client/render/ctm/PropertyCTMRenderContext.java deleted file mode 100644 index 452a67813..000000000 --- a/src/main/java/mekanism/client/render/ctm/PropertyCTMRenderContext.java +++ /dev/null @@ -1,33 +0,0 @@ -package mekanism.client.render.ctm; - -import net.minecraftforge.common.property.IUnlistedProperty; - -/** - * Block Property for the render context list - */ -public class PropertyCTMRenderContext implements IUnlistedProperty -{ - @Override - public String getName() - { - return "connections"; - } - - @Override - public boolean isValid(CTMBlockRenderContext value) - { - return true; - } - - @Override - public Class getType() - { - return CTMBlockRenderContext.class; - } - - @Override - public String valueToString(CTMBlockRenderContext value) - { - return value.toString(); - } -} diff --git a/src/main/java/mekanism/client/render/ctm/Quad.java b/src/main/java/mekanism/client/render/ctm/Quad.java deleted file mode 100644 index 3a2c3b404..000000000 --- a/src/main/java/mekanism/client/render/ctm/Quad.java +++ /dev/null @@ -1,548 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.List; - -import javax.annotation.Nullable; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.IVertexConsumer; -import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; - -import org.apache.commons.lang3.tuple.Pair; -import org.lwjgl.util.vector.Vector; -import org.lwjgl.util.vector.Vector2f; -import org.lwjgl.util.vector.Vector3f; - -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Lists; -import com.google.common.collect.MultimapBuilder; - -public class Quad -{ - public static final ISubmap TOP_LEFT = new Submap(8, 8, 0, 0); - public static final ISubmap TOP_RIGHT = new Submap(8, 8, 8, 0); - public static final ISubmap BOTTOM_LEFT = new Submap(8, 8, 0, 8); - public static final ISubmap BOTTOM_RIGHT = new Submap(8, 8, 8, 8); - - public static class Vertex - { - Vector3f pos; - Vector2f uvs; - } - - private static final TextureAtlasSprite BASE = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(TextureMap.LOCATION_MISSING_TEXTURE.toString()); - - public class UVs - { - private float minU, minV, maxU, maxV; - - private final TextureAtlasSprite sprite; - - private final Vector2f[] data; - - private UVs(Vector2f... data) - { - this(BASE, data); - } - - private UVs(TextureAtlasSprite sprite, Vector2f... data) - { - this.data = data; - this.sprite = sprite; - - float minU = Float.MAX_VALUE; - float minV = Float.MAX_VALUE; - float maxU = 0, maxV = 0; - - for (Vector2f v : data) - { - minU = Math.min(minU, v.x); - minV = Math.min(minV, v.y); - maxU = Math.max(maxU, v.x); - maxV = Math.max(maxV, v.y); - } - - this.minU = minU; - this.minV = minV; - this.maxU = maxU; - this.maxV = maxV; - } - - public UVs(float minU, float minV, float maxU, float maxV, TextureAtlasSprite sprite) - { - this.minU = minU; - this.minV = minV; - this.maxU = maxU; - this.maxV = maxV; - this.sprite = sprite; - this.data = vectorize(); - } - - public UVs transform(TextureAtlasSprite other, ISubmap submap) - { - UVs normal = normalize(); - submap = submap.normalize(); - - float width = normal.maxU - normal.minU; - float height = normal.maxV - normal.minV; - - float minU = submap.getXOffset(); - float minV = submap.getYOffset(); - minU += normal.minU * submap.getWidth(); - minV += normal.minV * submap.getHeight(); - - float maxU = minU + (width * submap.getWidth()); - float maxV = minV + (height * submap.getHeight()); - - // TODO this is horrid - return new UVs(other, - new Vector2f(data[0].x == this.minU ? minU : maxU, data[0].y == this.minV ? minV : maxV), - new Vector2f(data[1].x == this.minU ? minU : maxU, data[1].y == this.minV ? minV : maxV), - new Vector2f(data[2].x == this.minU ? minU : maxU, data[2].y == this.minV ? minV : maxV), - new Vector2f(data[3].x == this.minU ? minU : maxU, data[3].y == this.minV ? minV : maxV)) - .relativize(); - } - - public UVs normalizeQuadrant() - { - UVs normal = normalize(); - - int quadrant = normal.getQuadrant(); - float minUInterp = quadrant == 1 || quadrant == 2 ? 0.5f : 0; - float minVInterp = quadrant < 2 ? 0.5f : 0; - float maxUInterp = quadrant == 0 || quadrant == 3 ? 0.5f : 1; - float maxVInterp = quadrant > 1 ? 0.5f : 1; - - normal = new UVs(sprite, normalize(new Vector2f(minUInterp, minVInterp), new Vector2f(maxUInterp, maxVInterp), normal.vectorize())); - return normal.relativize(); - } - - public UVs normalize() - { - Vector2f min = new Vector2f(sprite.getMinU(), sprite.getMinV()); - Vector2f max = new Vector2f(sprite.getMaxU(), sprite.getMaxV()); - return new UVs(sprite, normalize(min, max, data)); - } - - public UVs relativize() - { - return relativize(sprite); - } - - public TextureAtlasSprite getSprite() - { - return sprite; - } - - public UVs relativize(TextureAtlasSprite sprite) - { - Vector2f min = new Vector2f(sprite.getMinU(), sprite.getMinV()); - Vector2f max = new Vector2f(sprite.getMaxU(), sprite.getMaxV()); - return new UVs(sprite, lerp(min, max, data)); - } - - public Vector2f[] vectorize() - { - return data == null ? new Vector2f[]{ new Vector2f(minU, minV), new Vector2f(minU, maxV), new Vector2f(maxU, maxV), new Vector2f(maxU, minV) } : data; - } - - private Vector2f[] normalize(Vector2f min, Vector2f max, Vector2f... vecs) - { - Vector2f[] ret = new Vector2f[vecs.length]; - - for(int i = 0; i < ret.length; i++) - { - ret[i] = normalize(min, max, vecs[i]); - } - - return ret; - } - - private Vector2f normalize(Vector2f min, Vector2f max, Vector2f vec) - { - return new Vector2f(Quad.normalize(min.x, max.x, vec.x), Quad.normalize(min.y, max.y, vec.y)); - } - - private Vector2f[] lerp(Vector2f min, Vector2f max, Vector2f... vecs) - { - Vector2f[] ret = new Vector2f[vecs.length]; - - for(int i = 0; i < ret.length; i++) - { - ret[i] = lerp(min, max, vecs[i]); - } - - return ret; - } - - private Vector2f lerp(Vector2f min, Vector2f max, Vector2f vec) - { - return new Vector2f(Quad.lerp(min.x, max.x, vec.x), Quad.lerp(min.y, max.y, vec.y)); - } - - public int getQuadrant() - { - if(maxU <= 0.5f) - { - if(maxV <= 0.5f) - { - return 3; - } - else { - return 0; - } - } - else { - if(maxV <= 0.5f) - { - return 2; - } - else { - return 1; - } - } - } - } - - private final Vector3f[] vertPos; - private final Vector2f[] vertUv; - - // Technically nonfinal, but treated as such except in constructor - private UVs uvsObj; - - private final Builder builder; - - private Quad(Vector3f[] verts, Vector2f[] uvs, Builder b) - { - vertPos = verts; - vertUv = uvs; - builder = b; - uvsObj = new UVs(uvs); - } - - private Quad(Vector3f[] verts, UVs uvs, Builder builder) - { - this(verts, uvs.vectorize(), builder); - uvsObj = new UVs(uvs.getSprite(), vertUv); - } - - public UVs getUVs() - { - return uvsObj; - } - - public Quad[] subdivide(int count) - { - List rects = Lists.newArrayList(); - - Pair firstDivide = divide(false); - Pair secondDivide = firstDivide.getLeft().divide(true); - rects.add(secondDivide.getLeft()); - - if(firstDivide.getRight() != null) - { - Pair thirdDivide = firstDivide.getRight().divide(true); - rects.add(thirdDivide.getLeft()); - rects.add(thirdDivide.getRight()); - } - else { - rects.add(null); - rects.add(null); - } - - rects.add(secondDivide.getRight()); - - return rects.toArray(new Quad[rects.size()]); - } - - @Nullable - private Pair divide(boolean vertical) - { - float min, max; - UVs uvs = uvsObj.normalize(); - - if(vertical) - { - min = uvs.minV; - max = uvs.maxV; - } - else { - min = uvs.minU; - max = uvs.maxU; - } - - if(min < 0.5 && max > 0.5) - { - UVs first = new UVs(vertical ? uvs.minU : 0.5f, vertical ? 0.5f : uvs.minV, uvs.maxU, uvs.maxV, uvs.getSprite()); - UVs second = new UVs(uvs.minU, uvs.minV, vertical ? uvs.maxU : 0.5f, vertical ? 0.5f : uvs.maxV, uvs.getSprite()); - - int firstIndex = 0; - - for(int i = 0; i < vertUv.length; i++) - { - if(vertUv[i].y == uvsObj.minV && vertUv[i].x == uvsObj.minU) - { - firstIndex = i; - break; - } - } - - float f = (0.5f - min) / (max - min); - - Vector3f[] firstQuad = new Vector3f[4]; - Vector3f[] secondQuad = new Vector3f[4]; - - for(int i = 0; i < 4; i++) - { - int idx = (firstIndex + i) % 4; - firstQuad[i] = new Vector3f(vertPos[idx]); - secondQuad[i] = new Vector3f(vertPos[idx]); - } - - int i1 = 0; - int i2 = vertical ? 1 : 3; - int j1 = vertical ? 3 : 1; - int j2 = 2; - - firstQuad[i1].x = lerp(firstQuad[i1].x, firstQuad[i2].x, f); - firstQuad[i1].y = lerp(firstQuad[i1].y, firstQuad[i2].y, f); - firstQuad[i1].z = lerp(firstQuad[i1].z, firstQuad[i2].z, f); - firstQuad[j1].x = lerp(firstQuad[j1].x, firstQuad[j2].x, f); - firstQuad[j1].y = lerp(firstQuad[j1].y, firstQuad[j2].y, f); - firstQuad[j1].z = lerp(firstQuad[j1].z, firstQuad[j2].z, f); - - secondQuad[i2].x = lerp(secondQuad[i1].x, secondQuad[i2].x, f); - secondQuad[i2].y = lerp(secondQuad[i1].y, secondQuad[i2].y, f); - secondQuad[i2].z = lerp(secondQuad[i1].z, secondQuad[i2].z, f); - secondQuad[j2].x = lerp(secondQuad[j1].x, secondQuad[j2].x, f); - secondQuad[j2].y = lerp(secondQuad[j1].y, secondQuad[j2].y, f); - secondQuad[j2].z = lerp(secondQuad[j1].z, secondQuad[j2].z, f); - - Quad q1 = new Quad(firstQuad, first.relativize(), builder); - Quad q2 = new Quad(secondQuad, second.relativize(), builder); - - return Pair.of(q1, q2); - } - else { - return Pair.of(this, null); - } - } - - static float lerp(float a, float b, float f) - { - float ret = (a * (1 - f)) + (b * f); - return ret; - } - - static float normalize(float min, float max, float x) - { - float ret = (x - min) / (max - min); - return ret; - } - - public Quad rotate(int amount) - { - Vector2f[] uvs = new Vector2f[4]; - - TextureAtlasSprite s = uvsObj.getSprite(); - - for(int i = 0; i < 4; i++) - { - Vector2f normalized = new Vector2f(normalize(s.getMinU(), s.getMaxU(), vertUv[i].x), normalize(s.getMinV(), s.getMaxV(), vertUv[i].y)); - Vector2f uv; - - switch(amount) - { - case 1: - uv = new Vector2f(normalized.y, 1 - normalized.x); - break; - case 2: - uv = new Vector2f(1 - normalized.x, 1 - normalized.y); - break; - case 3: - uv = new Vector2f(1 - normalized.y, normalized.x); - break; - default: - uv = new Vector2f(normalized.x, normalized.y); - break; - } - - uvs[i] = uv; - } - - for(int i = 0; i < uvs.length; i++) - { - uvs[i] = new Vector2f(lerp(s.getMinU(), s.getMaxU(), uvs[i].x), lerp(s.getMinV(), s.getMaxV(), uvs[i].y)); - } - - Quad ret = new Quad(vertPos, uvs, builder); - ret.uvsObj = new UVs(uvsObj.getSprite(), ret.vertUv); - - return ret; - } - - public Quad derotate() - { - int start = 0; - - for(int i = 0; i < 4; i++) - { - if(vertUv[i].x <= uvsObj.minU && vertUv[i].y <= uvsObj.minV) - { - start = i; - break; - } - } - - Vector2f[] uvs = new Vector2f[4]; - - for(int i = 0; i < 4; i++) - { - uvs[i] = vertUv[(i + start) % 4]; - } - - return new Quad(vertPos, uvs, builder); - } - - public BakedQuad rebake() - { - UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(this.builder.vertexFormat); - builder.setQuadOrientation(this.builder.quadOrientation); - builder.setQuadTint(this.builder.quadTint); - builder.setApplyDiffuseLighting(this.builder.applyDiffuseLighting); - builder.setTexture(this.uvsObj.getSprite()); - - for(int v = 0; v < 4; v++) - { - for(int i = 0; i < this.builder.vertexFormat.getElementCount(); i++) - { - VertexFormatElement ele = this.builder.vertexFormat.getElement(i); - - switch(ele.getUsage()) - { - case UV: - Vector2f uv = vertUv[v]; - builder.put(i, uv.x, uv.y, 0, 1); - - break; - case POSITION: - Vector3f p = vertPos[v]; - builder.put(i, p.x, p.y, p.z, 1); - - break; - default: - builder.put(i, this.builder.vertexData.get(ele.getUsage()).get(v)); - } - } - } - - return builder.build(); - } - - public Quad transformUVs(TextureAtlasSprite sprite) - { - return transformUVs(sprite, CTM.FULL_TEXTURE.normalize()); - } - - public Quad transformUVs(TextureAtlasSprite sprite, ISubmap submap) - { - return new Quad(vertPos, uvsObj.transform(sprite, submap), builder); - } - - public Quad grow() - { - return new Quad(vertPos, uvsObj.normalizeQuadrant(), builder); - } - - public static Quad from(BakedQuad baked, VertexFormat fmt) - { - Builder b = new Builder(fmt); - baked.pipe(b); - return b.build().derotate(); // for now we will ignore rotated UVs - } - - public static class Builder implements IVertexConsumer - { - public Builder(VertexFormat fmt) - { - vertexFormat = fmt; - } - - private final VertexFormat vertexFormat; - - private int quadTint; - - private EnumFacing quadOrientation; - - private boolean applyDiffuseLighting; - - @Override - public void setTexture(TextureAtlasSprite sprite) - { - //TODO ignore for now - } - - @Override - public void setQuadTint(int tint) - { - quadTint = tint; - } - - @Override - public void setQuadOrientation(EnumFacing orientation) - { - quadOrientation = orientation; - } - - @Override - public VertexFormat getVertexFormat() - { - return vertexFormat; - } - - @Override - public void setApplyDiffuseLighting(boolean lighting) - { - applyDiffuseLighting = lighting; - } - - private ListMultimap vertexData = MultimapBuilder.enumKeys(EnumUsage.class).arrayListValues().build(); - - @Override - public void put(int element, float... data) - { - float[] copy = new float[data.length]; - System.arraycopy(data, 0, copy, 0, data.length); - VertexFormatElement ele = vertexFormat.getElement(element); - vertexData.put(ele.getUsage(), copy); - } - - public Quad build() - { - Vector3f[] verts = fromData(vertexData.get(EnumUsage.POSITION), 3); - Vector2f[] uvs = fromData(vertexData.get(EnumUsage.UV), 2); - - return new Quad(verts, uvs, this); - } - - @SuppressWarnings("unchecked") - private T[] fromData(List data, int size) - { - Vector[] ret = size == 2 ? new Vector2f[data.size()] : new Vector3f[data.size()]; - - for(int i = 0; i < data.size(); i++) - { - ret[i] = size == 2 ? new Vector2f(data.get(i)[0], data.get(i)[1]) : new Vector3f(data.get(i)[0], data.get(i)[1], data.get(i)[2]); - } - - return (T[])ret; - } - } -} diff --git a/src/main/java/mekanism/client/render/ctm/Submap.java b/src/main/java/mekanism/client/render/ctm/Submap.java deleted file mode 100644 index 57fca7bf4..000000000 --- a/src/main/java/mekanism/client/render/ctm/Submap.java +++ /dev/null @@ -1,125 +0,0 @@ -package mekanism.client.render.ctm; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -public class Submap implements ISubmap -{ - private final float width, height; - private final float xOffset, yOffset; - - private final SubmapNormalized normalized = new SubmapNormalized(this); - - public Submap(float w, float h, float x, float y) - { - width = w; - height = h; - xOffset = x; - yOffset = y; - } - - @Override - public float getXOffset() - { - return xOffset; - } - - @Override - public float getYOffset() - { - return yOffset; - } - - @Override - public float getWidth() - { - return width; - } - - @Override - public float getHeight() - { - return height; - } - - @Override - public float getInterpolatedU(TextureAtlasSprite sprite, float u) { - return sprite.getInterpolatedU(getXOffset() + u / getWidth()); - } - - @Override - public float getInterpolatedV(TextureAtlasSprite sprite, float v) { - return sprite.getInterpolatedV(getYOffset() + v / getWidth()); - } - - @Override - public float[] toArray() { - return new float[] { getXOffset(), getYOffset(), getXOffset() + getWidth(), getYOffset() + getHeight() }; - } - - @Override - public SubmapNormalized normalize() { - return normalized; - } - - @Override - public ISubmap relativize() { - return this; - } - - private static final float FACTOR = 16f; - - private static class SubmapNormalized implements ISubmap - { - private final ISubmap parent; - - public SubmapNormalized(ISubmap submap) - { - parent = submap; - } - - @Override - public float getXOffset() { - return parent.getXOffset() / FACTOR; - } - - @Override - public float getYOffset() { - return parent.getYOffset() / FACTOR; - } - - @Override - public float getWidth() { - return parent.getWidth() / FACTOR; - } - - @Override - public float getHeight() { - return parent.getHeight() / FACTOR; - } - - @Override - public ISubmap relativize() { - return parent; - } - - @Override - public ISubmap normalize() { - return this; - } - - @Override - public float getInterpolatedU(TextureAtlasSprite sprite, float u) { - return parent.getInterpolatedU(sprite, u); - } - - @Override - public float getInterpolatedV(TextureAtlasSprite sprite, float v) { - return parent.getInterpolatedV(sprite, v); - } - - @Override - public float[] toArray() { - return parent.toArray(); - } - } -} diff --git a/src/main/java/mekanism/client/render/ctm/TextureCTM.java b/src/main/java/mekanism/client/render/ctm/TextureCTM.java deleted file mode 100644 index 3a810aca8..000000000 --- a/src/main/java/mekanism/client/render/ctm/TextureCTM.java +++ /dev/null @@ -1,61 +0,0 @@ -package mekanism.client.render.ctm; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.ResourceLocation; - -public class TextureCTM -{ - public TextureSpriteCallback[] sprites; - - public TextureCTM(TextureSpriteCallback[] sprites) - { - this.sprites = sprites; - } - - public List transformQuad(BakedQuad bq, CTMBlockRenderContext context, int quadGoal) - { - Quad quad = Quad.from(bq, DefaultVertexFormats.ITEM); - - if(context == null) - { - return Collections.singletonList(quad.transformUVs(sprites[0].getSprite()).rebake()); - } - - Quad[] quads = quad.subdivide(4); - - int[] ctm = ((CTMBlockRenderContext)context).getCTM(bq.getFace()).getSubmapIndices(); - - for(int i = 0; i < quads.length; i++) - { - Quad q = quads[i]; - - if(q != null) - { - int ctmid = q.getUVs().normalize().getQuadrant(); - quads[i] = q.grow().transformUVs(sprites[ctm[ctmid] > 15 ? 0 : 1].getSprite(), CTM.uvs[ctm[ctmid]].normalize()); - } - } - - return Arrays.stream(quads).filter(Objects::nonNull).map(q -> q.rebake()).collect(Collectors.toList()); - } - - public TextureAtlasSprite getParticle() - { - return sprites[0].getSprite(); - } - - public Collection getTextures() - { - return Arrays.stream(sprites).map(TextureSpriteCallback::getLocation).collect(Collectors.toList()); - } -} diff --git a/src/main/java/mekanism/client/render/ctm/TextureSpriteCallback.java b/src/main/java/mekanism/client/render/ctm/TextureSpriteCallback.java deleted file mode 100644 index 2aa25af05..000000000 --- a/src/main/java/mekanism/client/render/ctm/TextureSpriteCallback.java +++ /dev/null @@ -1,34 +0,0 @@ -package mekanism.client.render.ctm; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; - -/** - * Callback when textures are stitched - */ -public class TextureSpriteCallback -{ - private ResourceLocation location; - private TextureAtlasSprite sprite; - - public TextureSpriteCallback(ResourceLocation loc) - { - location = loc; - } - - public void stitch(TextureMap map) - { - sprite = map.registerSprite(location); - } - - public TextureAtlasSprite getSprite() - { - return sprite; - } - - public ResourceLocation getLocation() - { - return location; - } -} diff --git a/src/main/java/mekanism/client/render/item/BakedCustomItemModel.java b/src/main/java/mekanism/client/render/item/BakedCustomItemModel.java index d61b55266..d2b014c13 100644 --- a/src/main/java/mekanism/client/render/item/BakedCustomItemModel.java +++ b/src/main/java/mekanism/client/render/item/BakedCustomItemModel.java @@ -2,9 +2,12 @@ package mekanism.client.render.item; import java.util.LinkedList; import java.util.List; +import java.util.Map; import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; +import com.google.common.collect.ImmutableMap; import mekanism.api.energy.IEnergizedItem; import mekanism.client.model.ModelArmoredJetpack; import mekanism.client.model.ModelAtomicDisassembler; @@ -23,7 +26,6 @@ import mekanism.client.model.ModelSecurityDesk; import mekanism.client.model.ModelSeismicVibrator; import mekanism.client.model.ModelSolarNeutronActivator; import mekanism.client.render.MekanismRenderer; -import mekanism.client.render.ctm.CTMModelFactory; import mekanism.client.render.tileentity.RenderBin; import mekanism.client.render.tileentity.RenderEnergyCube; import mekanism.client.render.tileentity.RenderFluidTank; @@ -63,6 +65,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.model.TRSRTransformation; import net.minecraftforge.fluids.Fluid; import org.apache.commons.lang3.tuple.Pair; @@ -503,15 +506,37 @@ public class BakedCustomItemModel implements IBakedModel { return baseModel.getItemCameraTransforms(); } - + @Override public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { prevTransform = cameraTransformType; - - return Pair.of(this, CTMModelFactory.transforms.get(cameraTransformType).getMatrix()); + + return Pair.of(this, transforms.get(cameraTransformType).getMatrix()); } + // Copy from old CTM + public static Map transforms = ImmutableMap.builder() + .put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)) + .put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)) + .put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)) + .put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f)) + .put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0)) + .build(); + + private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) + { + return new TRSRTransformation( + new Vector3f(tx / 16, ty / 16, tz / 16), + TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), + new Vector3f(s, s, s), + null); + } + @Override public ItemOverrideList getOverrides() { diff --git a/src/main/java/mekanism/client/render/obj/GlowPanelModel.java b/src/main/java/mekanism/client/render/obj/GlowPanelModel.java index 085c02d58..517e2fe3c 100644 --- a/src/main/java/mekanism/client/render/obj/GlowPanelModel.java +++ b/src/main/java/mekanism/client/render/obj/GlowPanelModel.java @@ -5,9 +5,9 @@ import java.util.List; import java.util.Map; import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; import mekanism.api.EnumColor; -import mekanism.client.render.ctm.CTMModelFactory; import mekanism.common.block.property.PropertyColor; import mekanism.common.tile.TileEntityGlowPanel; import net.minecraft.block.state.IBlockState; @@ -29,8 +29,8 @@ import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.obj.OBJModel; import net.minecraftforge.client.model.obj.OBJModel.Face; -import net.minecraftforge.client.model.obj.OBJModel.OBJBakedModel; import net.minecraftforge.common.model.IModelState; +import net.minecraftforge.common.model.TRSRTransformation; import net.minecraftforge.common.property.IExtendedBlockState; import org.apache.commons.lang3.tuple.Pair; @@ -41,8 +41,8 @@ import com.google.common.collect.Lists; public class GlowPanelModel extends OBJBakedModelBase { - private static Map> glowPanelCache = new HashMap>(); - private static Map glowPanelItemCache = new HashMap(); + private static Map> glowPanelCache = new HashMap<>(); + private static Map glowPanelItemCache = new HashMap<>(); private IBlockState tempState; private ItemStack tempStack; @@ -163,8 +163,6 @@ public class GlowPanelModel extends OBJBakedModelBase return null; } - - private Pair thirdPersonTransform; @Override public Pair handlePerspective(ItemCameraTransforms.TransformType transformType) @@ -172,7 +170,7 @@ public class GlowPanelModel extends OBJBakedModelBase if(transformType == TransformType.GUI) { GlStateManager.rotate(180, 1, 0, 0); - ForgeHooksClient.multiplyCurrentGlMatrix(CTMModelFactory.transforms.get(transformType).getMatrix()); + ForgeHooksClient.multiplyCurrentGlMatrix(transforms.get(transformType).getMatrix()); GlStateManager.translate(0.65F, 0.45F, 0.0F); GlStateManager.rotate(90, 1, 0, 0); GlStateManager.scale(1.6F, 1.6F, 1.6F); @@ -185,12 +183,34 @@ public class GlowPanelModel extends OBJBakedModelBase } else if(transformType == TransformType.THIRD_PERSON_RIGHT_HAND || transformType == TransformType.THIRD_PERSON_LEFT_HAND) { - ForgeHooksClient.multiplyCurrentGlMatrix(CTMModelFactory.transforms.get(transformType).getMatrix()); + ForgeHooksClient.multiplyCurrentGlMatrix(transforms.get(transformType).getMatrix()); GlStateManager.translate(0.0F, 0.3F, 0.2F); return Pair.of(this, null); } - return Pair.of(this, CTMModelFactory.transforms.get(transformType).getMatrix()); + return Pair.of(this, transforms.get(transformType).getMatrix()); } + + // Copy from old CTM + public static Map transforms = ImmutableMap.builder() + .put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)) + .put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)) + .put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)) + .put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f)) + .put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0)) + .build(); + + private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) + { + return new TRSRTransformation( + new Vector3f(tx / 16, ty / 16, tz / 16), + TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), + new Vector3f(s, s, s), + null); + } } diff --git a/src/main/java/mekanism/client/render/obj/TransmitterModel.java b/src/main/java/mekanism/client/render/obj/TransmitterModel.java index 6ff522716..9e4ee3d0b 100644 --- a/src/main/java/mekanism/client/render/obj/TransmitterModel.java +++ b/src/main/java/mekanism/client/render/obj/TransmitterModel.java @@ -9,8 +9,8 @@ import java.util.Objects; import java.util.Set; import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; -import mekanism.client.render.ctm.CTMModelFactory; import mekanism.common.block.property.PropertyColor; import mekanism.common.block.property.PropertyConnection; import mekanism.common.config.MekanismConfig.client; @@ -39,6 +39,7 @@ import net.minecraftforge.client.model.obj.OBJModel.Group; import net.minecraftforge.client.model.obj.OBJModel.OBJProperty; import net.minecraftforge.client.model.obj.OBJModel.OBJState; import net.minecraftforge.common.model.IModelState; +import net.minecraftforge.common.model.TRSRTransformation; import net.minecraftforge.common.property.IExtendedBlockState; import org.apache.commons.lang3.tuple.Pair; @@ -49,9 +50,9 @@ import com.google.common.collect.Lists; public class TransmitterModel extends OBJBakedModelBase { - private static Set modelInstances = new HashSet(); + private static Set modelInstances = new HashSet<>(); - private Map> modelCache = new HashMap>(); + private Map> modelCache = new HashMap<>(); private TransmitterModel itemCache; private IBlockState tempState; @@ -83,7 +84,7 @@ public class TransmitterModel extends OBJBakedModelBase { if(itemCache == null) { - List visible = new ArrayList(); + List visible = new ArrayList<>(); for(EnumFacing side : EnumFacing.values()) { @@ -270,8 +271,30 @@ public class TransmitterModel extends OBJBakedModelBase @Override public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { - return Pair.of(this, CTMModelFactory.transforms.get(cameraTransformType).getMatrix()); + return Pair.of(this, transforms.get(cameraTransformType).getMatrix()); } + + // Copy from old CTM + public static Map transforms = ImmutableMap.builder() + .put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)) + .put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)) + .put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)) + .put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f)) + .put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0)) + .build(); + + private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) + { + return new TRSRTransformation( + new Vector3f(tx / 16, ty / 16, tz / 16), + TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), + new Vector3f(s, s, s), + null); + } public static void registerIcons(TextureMap map) { diff --git a/src/main/java/mekanism/client/render/tileentity/RenderThermalEvaporationController.java b/src/main/java/mekanism/client/render/tileentity/RenderThermalEvaporationController.java index 70e11ee6f..1b6fb9a2a 100644 --- a/src/main/java/mekanism/client/render/tileentity/RenderThermalEvaporationController.java +++ b/src/main/java/mekanism/client/render/tileentity/RenderThermalEvaporationController.java @@ -19,37 +19,67 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; +import java.util.Arrays; @SideOnly(Side.CLIENT) public class RenderThermalEvaporationController extends TileEntitySpecialRenderer { - private static Map> cachedCenterFluids = new HashMap>(); + private static HashMap cachedCenterFluids = new HashMap(); + private static final int LEVELS = 16; + private static final int ALL_LEVELS = LEVELS + 2; + private static final int RING_INDEX = ALL_LEVELS-2; + private static final int CONCAVE_INDEX = ALL_LEVELS-1; @Override public void render(TileEntityThermalEvaporationController tileEntity, double x, double y, double z, float partialTick, int destroyStage, float alpha) { if(tileEntity.structured && tileEntity.inputTank.getFluid() != null) { - SalinationRenderData data = new SalinationRenderData(); - - data.height = tileEntity.height-2; - data.side = tileEntity.facing; bindTexture(MekanismRenderer.getBlocksTexture()); - if(data.height >= 1 && tileEntity.inputTank.getCapacity() > 0) + if(tileEntity.height-2 >= 1 && tileEntity.inputTank.getCapacity() > 0) { push(); FluidRenderer.translateToOrigin(tileEntity.getRenderLocation()); - MekanismRenderer.glowOn(tileEntity.inputTank.getFluid().getFluid().getLuminosity()); + DisplayInteger[] displayList = getListAndRender(tileEntity.inputTank.getFluid().getFluid()); - DisplayInteger[] displayList = getListAndRender(data, tileEntity.inputTank.getFluid().getFluid()); + float levels = Math.min(((float)tileEntity.inputTank.getFluidAmount()/tileEntity.inputTank.getCapacity()), 1); + levels *= (tileEntity.height-2); - float tankFillPercentage = Math.min(((float)tileEntity.inputTank.getFluidAmount()/tileEntity.inputTank.getCapacity()), 1); + int partialLevels = (int)((levels-(int)levels)*16); - displayList[(int)(tankFillPercentage * ((float)getStages(data.height)-1))].render(); + switch(tileEntity.facing) + { + case SOUTH: + GlStateManager.translate(-1, 0, -1); + break; + case EAST: + GlStateManager.translate(-1, 0, 0); + break; + case WEST: + GlStateManager.translate(0, 0, -1); + break; + default: + break; + } + + GlStateManager.translate(0, 0.01, 0); + + if((int)levels>0) + { + displayList[CONCAVE_INDEX].render(); + GlStateManager.translate(0, 1, 0); + + for(int i = 1; i < (int)levels; i++) + { + displayList[RING_INDEX].render(); + GlStateManager.translate(0, 1, 0); + } + } + displayList[partialLevels].render(); MekanismRenderer.glowOff(); @@ -74,118 +104,67 @@ public class RenderThermalEvaporationController extends TileEntitySpecialRendere GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); } - @SuppressWarnings("incomplete-switch") - private DisplayInteger[] getListAndRender(SalinationRenderData data, Fluid fluid) + + private DisplayInteger[] getListAndRender(Fluid fluid) { - if(cachedCenterFluids.containsKey(data) && cachedCenterFluids.get(data).containsKey(fluid)) + if(cachedCenterFluids.containsKey(fluid)) { - return cachedCenterFluids.get(data).get(fluid); + return cachedCenterFluids.get(fluid); } - Model3D toReturn = new Model3D(); - toReturn.baseBlock = Blocks.WATER; - toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL)); + DisplayInteger[] displays = new DisplayInteger[ALL_LEVELS]; - final int stages = getStages(data.height); - DisplayInteger[] displays = new DisplayInteger[stages]; - - if(cachedCenterFluids.containsKey(data)) - { - cachedCenterFluids.get(data).put(fluid, displays); - } - else { - HashMap map = new HashMap(); - map.put(fluid, displays); - cachedCenterFluids.put(data, map); - } + Model3D model = new Model3D(); + model.baseBlock = fluid.getBlock(); + model.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL)); MekanismRenderer.colorFluid(fluid); - for(int i = 0; i < stages; i++) + if(fluid.getStill() == null) { - displays[i] = DisplayInteger.createAndStart(); - - if(fluid.getStill() != null) + DisplayInteger empty = DisplayInteger.createAndStart(); + DisplayInteger.endList(); + Arrays.fill(displays, 0, LEVELS, empty); + } + else { + model.setSideRender(EnumFacing.DOWN, false); + + for(int i = 0; i < LEVELS; i++) { - switch(data.side) - { - case NORTH: - toReturn.minX = 0 + .01; - toReturn.minY = 0 + .01; - toReturn.minZ = 0 + .01; - - toReturn.maxX = 2 - .01; - toReturn.maxY = ((float)i/(float)stages)*data.height - .01; - toReturn.maxZ = 2 - .01; - break; - case SOUTH: - toReturn.minX = -1 + .01; - toReturn.minY = 0 + .01; - toReturn.minZ = -1 + .01; - - toReturn.maxX = 1 - .01; - toReturn.maxY = ((float)i/(float)stages)*data.height - .01; - toReturn.maxZ = 1 - .01; - break; - case WEST: - toReturn.minX = 0 + .01; - toReturn.minY = 0 + .01; - toReturn.minZ = -1 + .01; - - toReturn.maxX = 2 - .01; - toReturn.maxY = ((float)i/(float)stages)*data.height - .01; - toReturn.maxZ = 1 - .01; - break; - case EAST: - toReturn.minX = -1 + .01; - toReturn.minY = 0 + .01; - toReturn.minZ = 0 + .01; - - toReturn.maxX = 1 - .01; - toReturn.maxY = ((float)i/(float)stages)*data.height - .01; - toReturn.maxZ = 2 - .01; - break; - } - - MekanismRenderer.renderObject(toReturn); + displays[i] = generateLevel(i, model); } - - displays[i].endList(); + + model.setSideRender(EnumFacing.UP, false); + displays[RING_INDEX] = generateLevel(LEVELS-1, model); + model.setSideRender(EnumFacing.DOWN, true); + displays[CONCAVE_INDEX] = generateLevel(LEVELS-1, model); } MekanismRenderer.resetColor(); - + cachedCenterFluids.put(fluid, displays); + return displays; } - private int getStages(int height) + private DisplayInteger generateLevel(int height, Model3D model) { - return height*(TankUpdateProtocol.FLUID_PER_TANK/10); - } + DisplayInteger displayInteger = DisplayInteger.createAndStart(); - public static class SalinationRenderData - { - public int height; - public EnumFacing side; + model.minX = 0 + .01; + model.minY = 0; + model.minZ = 0 + .01; + model.maxX = 2 - .01; + model.maxY = (float)height/(float)(LEVELS-1) + (height==0?.02:0); + model.maxZ = 2 - .01; - @Override - public int hashCode() - { - int code = 1; - code = 31 * code + height; - return code; - } + MekanismRenderer.renderObject(model); + DisplayInteger.endList(); - @Override - public boolean equals(Object data) - { - return data instanceof SalinationRenderData && ((SalinationRenderData)data).height == height && - ((SalinationRenderData)data).side == side; - } + return displayInteger; } public static void resetDisplayInts() { cachedCenterFluids.clear(); } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/common/Mekanism.java b/src/main/java/mekanism/common/Mekanism.java index bf5f151f4..2c58eebff 100644 --- a/src/main/java/mekanism/common/Mekanism.java +++ b/src/main/java/mekanism/common/Mekanism.java @@ -29,13 +29,11 @@ import mekanism.client.ClientTickHandler; import mekanism.common.Tier.BaseTier; import mekanism.common.base.IChunkLoadHandler; import mekanism.common.base.IModule; -import mekanism.common.block.states.BlockStateMachine.MachineType; import mekanism.common.block.states.BlockStateTransmitter.TransmitterType; import mekanism.common.capabilities.Capabilities; import mekanism.common.chunkloading.ChunkManager; import mekanism.common.config.MekanismConfig.general; import mekanism.common.config.MekanismConfig.usage; -import mekanism.common.config.TypeConfigManager; import mekanism.common.content.boiler.SynchronizedBoilerData; import mekanism.common.content.entangloporter.InventoryFrequency; import mekanism.common.content.matrix.SynchronizedMatrixData; @@ -132,7 +130,6 @@ import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInterModComms; -import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @@ -153,7 +150,7 @@ import com.mojang.authlib.GameProfile; * @author AidanBrady * */ -@Mod(modid = "mekanism", name = "Mekanism", version = "9.3.3", guiFactory = "mekanism.client.gui.ConfigGuiFactory", +@Mod(modid = "mekanism", name = "Mekanism", version = "9.3.4", guiFactory = "mekanism.client.gui.ConfigGuiFactory", dependencies = "required-after:forge@[14.21.0.2373,);" + "after:redstoneflux;" + "after:mcmultipart;" + @@ -189,7 +186,7 @@ public class Mekanism public static Configuration configuration; /** Mekanism version number */ - public static Version versionNumber = new Version(9, 3, 3); + public static Version versionNumber = new Version(9, 3, 4); /** MultiblockManagers for various structrures */ public static MultiblockManager tankManager = new MultiblockManager("dynamicTank"); diff --git a/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java b/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java index 122e1c4f4..07a5c776e 100644 --- a/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java +++ b/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java @@ -7,6 +7,7 @@ import mekanism.api.IConfigCardAccess.ISpecialConfigData; import mekanism.api.energy.IStrictEnergyAcceptor; import mekanism.api.energy.IStrictEnergyStorage; import mekanism.common.integration.computer.IComputerIntegration; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.security.ISecurityTile; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -17,9 +18,9 @@ import net.minecraftforge.fml.common.Optional.Interface; import net.minecraftforge.fml.common.Optional.InterfaceList; @InterfaceList({ - @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), @Interface(iface = "cofh.redstoneflux.api.IEnergyProvider", modid = "redstoneflux"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyReceiver", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyReceiver", modid = "redstoneflux"), + @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = IC2Integration.MODID), }) public interface IAdvancedBoundingBlock extends ICapabilityProvider, IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyReceiver, IEnergyProvider, IComputerIntegration, ISpecialConfigData, ISecurityTile { diff --git a/src/main/java/mekanism/common/base/IEnergyWrapper.java b/src/main/java/mekanism/common/base/IEnergyWrapper.java index 2b54984cc..75cba8e04 100644 --- a/src/main/java/mekanism/common/base/IEnergyWrapper.java +++ b/src/main/java/mekanism/common/base/IEnergyWrapper.java @@ -6,12 +6,10 @@ import cofh.redstoneflux.api.IEnergyReceiver; import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource; import ic2.api.tile.IEnergyStorage; - -import java.util.EnumSet; - import mekanism.api.energy.IStrictEnergyAcceptor; import mekanism.api.energy.IStrictEnergyOutputter; import mekanism.api.energy.IStrictEnergyStorage; +import mekanism.common.integration.ic2.IC2Integration; import net.minecraft.inventory.IInventory; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.common.Optional.Interface; @@ -20,10 +18,10 @@ import net.minecraftforge.fml.common.Optional.InterfaceList; @InterfaceList({ @Interface(iface = "cofh.redstoneflux.api.IEnergyProvider", modid = "redstoneflux"), @Interface(iface = "cofh.redstoneflux.api.IEnergyReceiver", modid = "redstoneflux"), - @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), - @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), - @Interface(iface = "ic2.api.energy.tile.IEnergyEmitter", modid = "IC2"), - @Interface(iface = "ic2.api.tile.IEnergyStorage", modid = "IC2") + @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = IC2Integration.MODID), + @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = IC2Integration.MODID), + @Interface(iface = "ic2.api.energy.tile.IEnergyEmitter", modid = IC2Integration.MODID), + @Interface(iface = "ic2.api.tile.IEnergyStorage", modid = IC2Integration.MODID) }) public interface IEnergyWrapper extends IStrictEnergyStorage, IEnergyReceiver, IEnergyProvider, IEnergySink, IEnergySource, IEnergyStorage, IStrictEnergyAcceptor, IStrictEnergyOutputter, IInventory { diff --git a/src/main/java/mekanism/common/block/BlockBasic.java b/src/main/java/mekanism/common/block/BlockBasic.java index df907e6cd..307e7d892 100644 --- a/src/main/java/mekanism/common/block/BlockBasic.java +++ b/src/main/java/mekanism/common/block/BlockBasic.java @@ -6,9 +6,6 @@ import java.util.UUID; import mekanism.api.Coord4D; import mekanism.api.energy.IEnergizedItem; import mekanism.api.energy.IStrictEnergyStorage; -import mekanism.client.render.ctm.CTMBlockRenderContext; -import mekanism.client.render.ctm.CTMData; -import mekanism.client.render.ctm.ICTMBlock; import mekanism.common.Mekanism; import mekanism.common.Tier.BaseTier; import mekanism.common.base.IActiveState; @@ -18,7 +15,6 @@ import mekanism.common.block.states.BlockStateBasic; import mekanism.common.block.states.BlockStateBasic.BasicBlock; import mekanism.common.block.states.BlockStateBasic.BasicBlockType; import mekanism.common.block.states.BlockStateFacing; -import mekanism.common.block.states.BlockStateMachine.MachineType; import mekanism.common.content.boiler.SynchronizedBoilerData; import mekanism.common.content.tank.TankUpdateProtocol; import mekanism.common.inventory.InventoryBin; @@ -69,7 +65,6 @@ import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.property.IExtendedBlockState; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidUtil; import net.minecraftforge.fluids.capability.IFluidHandlerItem; @@ -109,18 +104,14 @@ import buildcraft.api.tools.IToolWrench; * @author AidanBrady * */ -public abstract class BlockBasic extends Block implements ICTMBlock +public abstract class BlockBasic extends Block { - public CTMData[][] ctmData = new CTMData[16][4]; - public BlockBasic() { super(Material.IRON); setHardness(5F); setResistance(20F); setCreativeTab(Mekanism.tabMekanism); - - initCTMs(); } public static BlockBasic getBlockBasic(BasicBlock block) @@ -207,21 +198,6 @@ public abstract class BlockBasic extends Block implements ICTMBlock return state; } - - @SideOnly(Side.CLIENT) - @Override - public IBlockState getExtendedState(IBlockState stateIn, IBlockAccess w, BlockPos pos) - { - if(stateIn.getBlock() == null || stateIn.getMaterial() == Material.AIR) - { - return stateIn; - } - - IExtendedBlockState state = (IExtendedBlockState)stateIn; - CTMBlockRenderContext ctx = new CTMBlockRenderContext(w, pos); - - return state.withProperty(BlockStateBasic.ctmProperty, ctx); - } @Override public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos fromPos) @@ -261,40 +237,6 @@ public abstract class BlockBasic extends Block implements ICTMBlock return blockResistance; } - public void initCTMs() - { - switch(getBasicBlock()) - { - case BASIC_BLOCK_1: - ctmData[7][0] = new CTMData(BasicBlockType.TELEPORTER_FRAME, MachineType.TELEPORTER); - ctmData[9][0] = new CTMData(BasicBlockType.DYNAMIC_TANK, BasicBlockType.DYNAMIC_VALVE); - ctmData[10][0] = new CTMData(BasicBlockType.STRUCTURAL_GLASS); - ctmData[11][0] = new CTMData(BasicBlockType.DYNAMIC_TANK, BasicBlockType.DYNAMIC_VALVE); - - ctmData[14][0] = new CTMData(BasicBlockType.THERMAL_EVAPORATION_BLOCK, BasicBlockType.THERMAL_EVAPORATION_VALVE, BasicBlockType.THERMAL_EVAPORATION_CONTROLLER); - ctmData[15][0] = new CTMData(BasicBlockType.THERMAL_EVAPORATION_BLOCK, BasicBlockType.THERMAL_EVAPORATION_VALVE, BasicBlockType.THERMAL_EVAPORATION_CONTROLLER); - - break; - case BASIC_BLOCK_2: - ctmData[0][0] = new CTMData(BasicBlockType.THERMAL_EVAPORATION_BLOCK, BasicBlockType.THERMAL_EVAPORATION_VALVE, BasicBlockType.THERMAL_EVAPORATION_CONTROLLER); - ctmData[1][0] = new CTMData(BasicBlockType.INDUCTION_CASING, BasicBlockType.INDUCTION_PORT); - ctmData[2][0] = new CTMData(BasicBlockType.INDUCTION_CASING, BasicBlockType.INDUCTION_PORT); - ctmData[3][0] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[3][1] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[3][2] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[3][3] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[4][0] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[4][1] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[4][2] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[4][3] = new CTMData(BasicBlockType.INDUCTION_CELL, BasicBlockType.INDUCTION_PROVIDER).setRenderConvexConnections(); - ctmData[5][0] = new CTMData(BasicBlockType.SUPERHEATING_ELEMENT).setRenderConvexConnections(); - ctmData[7][0] = new CTMData(BasicBlockType.BOILER_CASING, BasicBlockType.BOILER_VALVE); - ctmData[8][0] = new CTMData(BasicBlockType.BOILER_CASING, BasicBlockType.BOILER_VALVE); - - break; - } - } - @Override public int damageDropped(IBlockState state) { @@ -962,12 +904,9 @@ public abstract class BlockBasic extends Block implements ICTMBlock @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { - if(BasicBlockType.get(state) == BasicBlockType.STRUCTURAL_GLASS) + if(BasicBlockType.get(state) == BasicBlockType.STRUCTURAL_GLASS && BasicBlockType.get(world.getBlockState(pos.offset(side))) == BasicBlockType.STRUCTURAL_GLASS) { - if(!ctmData[10][0].shouldRenderSide(world, pos.offset(side), side)) - { - return false; - } + return false; } return super.shouldSideBeRendered(state, world, pos, side); @@ -1013,43 +952,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock return false; } - - @Override - public CTMData getCTMData(IBlockState state) - { - return ctmData[state.getBlock().getMetaFromState(state)][0]; - } - - @Override - public String getOverrideTexture(IBlockState state, EnumFacing side) - { - BasicBlockType type = state.getValue(getTypeProperty()); - - if(type == BasicBlockType.INDUCTION_CELL || type == BasicBlockType.INDUCTION_PROVIDER) - { - return type.getName() + "_" + state.getValue(BlockStateBasic.tierProperty).getName(); - } - - if(type == BasicBlockType.THERMAL_EVAPORATION_CONTROLLER) - { - if(side == state.getValue(BlockStateFacing.facingProperty)) - { - return type.getName() + (state.getValue(BlockStateBasic.activeProperty) ? "_on" : ""); - } - else { - return "thermal_evaporation_block"; - } - } - - if(type == BasicBlockType.INDUCTION_PORT) - { - return type.getName() + (state.getValue(BlockStateBasic.activeProperty) ? "_output" : ""); - } - - return null; - } - - @Override + public PropertyEnum getTypeProperty() { return getBasicBlock().getProperty(); diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index ddfeb95e7..6d1b2b924 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -6,9 +6,6 @@ import java.util.UUID; import mekanism.api.Coord4D; import mekanism.api.energy.IEnergizedItem; import mekanism.api.energy.IStrictEnergyStorage; -import mekanism.client.render.ctm.CTMBlockRenderContext; -import mekanism.client.render.ctm.CTMData; -import mekanism.client.render.ctm.ICTMBlock; import mekanism.common.Mekanism; import mekanism.common.Tier.FluidTankTier; import mekanism.common.base.IActiveState; @@ -134,10 +131,8 @@ import buildcraft.api.tools.IToolWrench; * @author AidanBrady * */ -public abstract class BlockMachine extends BlockContainer implements ICTMBlock +public abstract class BlockMachine extends BlockContainer { - public CTMData[] ctmData = new CTMData[16]; - private static final AxisAlignedBB CHARGEPAD_BOUNDS = new AxisAlignedBB(0.0F, 0.0F, 0.0F, 1.0F, 0.06F, 1.0F); private static final AxisAlignedBB TANK_BOUNDS = new AxisAlignedBB(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F); private static final AxisAlignedBB LASER_BOUNDS = new AxisAlignedBB(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F); @@ -149,8 +144,6 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock setHardness(3.5F); setResistance(16F); setCreativeTab(Mekanism.tabMekanism); - - initCTMs(); } public static BlockMachine getBlockMachine(MachineBlock block) @@ -166,21 +159,6 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock } public abstract MachineBlock getMachineBlock(); - - @SideOnly(Side.CLIENT) - @Override - public IBlockState getExtendedState(IBlockState stateIn, IBlockAccess w, BlockPos pos) - { - if(stateIn.getBlock() == null || stateIn.getMaterial() == Material.AIR) - { - return stateIn; - } - - IExtendedBlockState state = (IExtendedBlockState)stateIn; - CTMBlockRenderContext ctx = new CTMBlockRenderContext(w, pos); - - return state.withProperty(BlockStateBasic.ctmProperty, ctx); - } @Override public BlockStateContainer createBlockState() @@ -230,18 +208,6 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock return state; } - - public void initCTMs() - { - switch(getMachineBlock()) - { - case MACHINE_BLOCK_1: - ctmData[11] = new CTMData(BasicBlockType.TELEPORTER_FRAME, MachineType.TELEPORTER); - - break; - default: - } - } @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) @@ -1041,20 +1007,7 @@ public abstract class BlockMachine extends BlockContainer implements ICTMBlock return true; } } - - @Override - public CTMData getCTMData(IBlockState state) - { - return ctmData[state.getBlock().getMetaFromState(state)]; - } - - @Override - public String getOverrideTexture(IBlockState state, EnumFacing side) - { - return null; - } - - @Override + public PropertyEnum getTypeProperty() { return getMachineBlock().getProperty(); diff --git a/src/main/java/mekanism/common/block/states/BlockStateBasic.java b/src/main/java/mekanism/common/block/states/BlockStateBasic.java index 8dbfacd80..adeb23f4b 100644 --- a/src/main/java/mekanism/common/block/states/BlockStateBasic.java +++ b/src/main/java/mekanism/common/block/states/BlockStateBasic.java @@ -1,6 +1,5 @@ package mekanism.common.block.states; -import mekanism.client.render.ctm.PropertyCTMRenderContext; import mekanism.common.Mekanism; import mekanism.common.MekanismBlocks; import mekanism.common.Tier.BaseTier; @@ -45,11 +44,10 @@ public class BlockStateBasic extends ExtendedBlockState { public static final PropertyBool activeProperty = PropertyBool.create("active"); public static final PropertyEnum tierProperty = PropertyEnum.create("tier", BaseTier.class); - public static final PropertyCTMRenderContext ctmProperty = new PropertyCTMRenderContext(); public BlockStateBasic(BlockBasic block, PropertyEnum typeProperty) { - super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty, tierProperty}, new IUnlistedProperty[] {BlockStateBasic.ctmProperty}); + super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty, tierProperty}, new IUnlistedProperty[] {}); } public static enum BasicBlock @@ -99,11 +97,11 @@ public class BlockStateBasic extends ExtendedBlockState DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, "DynamicValve", TileEntityDynamicValve.class, true, Predicates.alwaysFalse(), false, false, false), COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, "CopperBlock", null, false, Predicates.alwaysFalse(), false, false, true), TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, "TinBlock", null, false, Predicates.alwaysFalse(), false, false, true), - THERMAL_EVAPORATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, "ThermalEvaporationController", TileEntityThermalEvaporationController.class, true, Predicates.alwaysFalse(), false, false, false), + THERMAL_EVAPORATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, "ThermalEvaporationController", TileEntityThermalEvaporationController.class, true, Plane.HORIZONTAL, true, false, false), THERMAL_EVAPORATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, "ThermalEvaporationValve", TileEntityThermalEvaporationValve.class, true, Predicates.alwaysFalse(), false, false, false), THERMAL_EVAPORATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, "ThermalEvaporationBlock", TileEntityThermalEvaporationBlock.class, true, Predicates.alwaysFalse(), false, false, false), INDUCTION_CASING(BasicBlock.BASIC_BLOCK_2, 1, "InductionCasing", TileEntityInductionCasing.class, true, Predicates.alwaysFalse(), false, false, false), - INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, "InductionPort", TileEntityInductionPort.class, true, Predicates.alwaysFalse(), false, false, false), + INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, "InductionPort", TileEntityInductionPort.class, true, Predicates.alwaysFalse(), true, false, false), INDUCTION_CELL(BasicBlock.BASIC_BLOCK_2, 3, "InductionCell", TileEntityInductionCell.class, true, Predicates.alwaysFalse(), false, true, false), INDUCTION_PROVIDER(BasicBlock.BASIC_BLOCK_2, 4, "InductionProvider", TileEntityInductionProvider.class, true, Predicates.alwaysFalse(), false, true, false), SUPERHEATING_ELEMENT(BasicBlock.BASIC_BLOCK_2, 5, "SuperheatingElement", TileEntitySuperheatingElement.class, true, Predicates.alwaysFalse(), false, false, false), diff --git a/src/main/java/mekanism/common/block/states/BlockStateMachine.java b/src/main/java/mekanism/common/block/states/BlockStateMachine.java index a57d1b2d6..fff2fcb8d 100644 --- a/src/main/java/mekanism/common/block/states/BlockStateMachine.java +++ b/src/main/java/mekanism/common/block/states/BlockStateMachine.java @@ -81,7 +81,7 @@ public class BlockStateMachine extends ExtendedBlockState public BlockStateMachine(BlockMachine block, PropertyEnum typeProperty) { - super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty, tierProperty, recipeProperty}, new IUnlistedProperty[] {BlockStateBasic.ctmProperty}); + super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty, tierProperty, recipeProperty}, new IUnlistedProperty[] {}); } public enum MachineBlock diff --git a/src/main/java/mekanism/common/config/MekanismConfig.java b/src/main/java/mekanism/common/config/MekanismConfig.java index 2fc3088df..967e8873a 100644 --- a/src/main/java/mekanism/common/config/MekanismConfig.java +++ b/src/main/java/mekanism/common/config/MekanismConfig.java @@ -84,7 +84,6 @@ public class MekanismConfig public static boolean machineEffects = true; public static boolean oldTransmitterRender = false; public static boolean replaceSoundsWhenResuming = true; - public static boolean renderCTM = true; public static boolean enableAmbientLighting; public static int ambientLightingLevel; public static boolean opaqueTransmitters = false; diff --git a/src/main/java/mekanism/common/integration/MekanismHooks.java b/src/main/java/mekanism/common/integration/MekanismHooks.java index e33b3f8b4..5ddfd2cee 100644 --- a/src/main/java/mekanism/common/integration/MekanismHooks.java +++ b/src/main/java/mekanism/common/integration/MekanismHooks.java @@ -16,6 +16,7 @@ import mekanism.common.Resource; import mekanism.common.block.states.BlockStateTransmitter.TransmitterType; import mekanism.common.integration.computer.CCPeripheral; import mekanism.common.integration.computer.OCDriver; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.recipe.RecipeHandler; import mekanism.common.util.MekanismUtils; import net.minecraft.init.Items; @@ -48,10 +49,10 @@ public final class MekanismHooks public void hook() { - if(Loader.isModLoaded("CoFHCore")) CoFHCoreLoaded = true; - if(Loader.isModLoaded("IC2")) IC2Loaded = true; - if(Loader.isModLoaded("Railcraft")) RailcraftLoaded = true; - if(Loader.isModLoaded("ThermalExpansion")) TELoaded = true; + if(Loader.isModLoaded("cofhcore")) CoFHCoreLoaded = true; + if(Loader.isModLoaded("ic2")) IC2Loaded = true; + if(Loader.isModLoaded("railcraft")) RailcraftLoaded = true; + if(Loader.isModLoaded("thermalexpansion")) TELoaded = true; if(Loader.isModLoaded("ComputerCraft")) CCLoaded = true; if(Loader.isModLoaded("appliedenergistics2")) AE2Loaded = true; if(Loader.isModLoaded("tesla")) TeslaLoaded = true; @@ -82,7 +83,7 @@ public final class MekanismHooks } } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public void hookIC2Recipes() { for(MachineRecipe> entry : Recipes.macerator.getRecipes()) @@ -136,7 +137,7 @@ public final class MekanismHooks } catch(Exception e) {} } - @Method(modid = "OpenComputers") + @Method(modid = "opencomputers") public void loadOCDrivers() { try { diff --git a/src/main/java/mekanism/common/integration/OreDictManager.java b/src/main/java/mekanism/common/integration/OreDictManager.java index a8f61e805..3119d3562 100644 --- a/src/main/java/mekanism/common/integration/OreDictManager.java +++ b/src/main/java/mekanism/common/integration/OreDictManager.java @@ -2,7 +2,6 @@ package mekanism.common.integration; import ic2.api.recipe.Recipes; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -14,6 +13,7 @@ import mekanism.common.Mekanism; import mekanism.common.MekanismFluids; import mekanism.common.MekanismItems; import mekanism.common.Resource; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.recipe.RecipeHandler; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -25,7 +25,6 @@ import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.fml.common.Optional.Method; import net.minecraftforge.oredict.OreDictionary; @@ -288,7 +287,7 @@ public final class OreDictManager } catch(Exception e) {} } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public static void addIC2BronzeRecipe() { try { diff --git a/src/main/java/mekanism/common/integration/ic2/IC2Integration.java b/src/main/java/mekanism/common/integration/ic2/IC2Integration.java index a0146caac..f354ef1be 100644 --- a/src/main/java/mekanism/common/integration/ic2/IC2Integration.java +++ b/src/main/java/mekanism/common/integration/ic2/IC2Integration.java @@ -12,7 +12,9 @@ import net.minecraftforge.fml.common.Optional.Method; public class IC2Integration { - @Method(modid = "IC2") + public static final String MODID = "ic2"; + + @Method(modid = IC2Integration.MODID) public static boolean isOutputter(TileEntity tileEntity, EnumFacing side) { IEnergyTile tile = EnergyNet.instance.getSubTile(tileEntity.getWorld(), tileEntity.getPos()); @@ -25,7 +27,7 @@ public class IC2Integration return false; } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public static boolean isAcceptor(TileEntity orig, TileEntity tileEntity, EnumFacing side) { IEnergyTile tile = EnergyNet.instance.getSubTile(tileEntity.getWorld(), tileEntity.getPos()); @@ -41,7 +43,7 @@ public class IC2Integration return false; } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public static double emitEnergy(IEnergyWrapper from, TileEntity tileEntity, EnumFacing side, double currentSending) { IEnergyTile tile = EnergyNet.instance.getSubTile(tileEntity.getWorld(), tileEntity.getPos()); diff --git a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java index 3a48dc51d..bb7caea9f 100644 --- a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java +++ b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java @@ -25,6 +25,7 @@ import mekanism.common.base.ITierItem; import mekanism.common.capabilities.ItemCapabilityWrapper; import mekanism.common.config.MekanismConfig.general; import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.ic2.IC2ItemManager; import mekanism.common.integration.tesla.TeslaItemWrapper; import mekanism.common.network.PacketTileEntity.TileEntityMessage; @@ -58,8 +59,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @InterfaceList({ - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = IC2Integration.MODID) }) public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, ISustainedInventory, IEnergyContainerItem, ISecurityItem, ITierItem { @@ -331,7 +332,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index 2b105bd95..f652cc2da 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -37,6 +37,7 @@ import mekanism.common.block.states.BlockStateMachine.MachineType; import mekanism.common.capabilities.ItemCapabilityWrapper; import mekanism.common.config.MekanismConfig.general; import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.ic2.IC2ItemManager; import mekanism.common.integration.tesla.TeslaItemWrapper; import mekanism.common.inventory.InventoryPersonalChest; @@ -134,8 +135,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; * */ @InterfaceList({ - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = IC2Integration.MODID) }) public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, IFactory, ISustainedInventory, ISustainedTank, IEnergyContainerItem, IFluidItemWrapper, ITierItem, ISecurityItem, IItemNetwork { @@ -785,7 +786,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/item/ItemEnergized.java b/src/main/java/mekanism/common/item/ItemEnergized.java index 320b25ffe..d2079f3d9 100644 --- a/src/main/java/mekanism/common/item/ItemEnergized.java +++ b/src/main/java/mekanism/common/item/ItemEnergized.java @@ -12,6 +12,7 @@ import mekanism.common.Mekanism; import mekanism.common.capabilities.ItemCapabilityWrapper; import mekanism.common.config.MekanismConfig.general; import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.ic2.IC2ItemManager; import mekanism.common.integration.tesla.TeslaItemWrapper; import mekanism.common.util.ItemDataUtils; @@ -33,7 +34,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @InterfaceList({ @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = IC2Integration.MODID) }) public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem { @@ -177,7 +179,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/item/ItemFreeRunners.java b/src/main/java/mekanism/common/item/ItemFreeRunners.java index 4cfc5d3ae..db7f94722 100644 --- a/src/main/java/mekanism/common/item/ItemFreeRunners.java +++ b/src/main/java/mekanism/common/item/ItemFreeRunners.java @@ -14,6 +14,7 @@ import mekanism.common.Mekanism; import mekanism.common.capabilities.ItemCapabilityWrapper; import mekanism.common.config.MekanismConfig.general; import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.ic2.IC2ItemManager; import mekanism.common.integration.tesla.TeslaItemWrapper; import mekanism.common.util.ItemDataUtils; @@ -45,7 +46,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @InterfaceList({ @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = IC2Integration.MODID) }) public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem { @@ -213,7 +215,7 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/network/PacketTransmitterUpdate.java b/src/main/java/mekanism/common/network/PacketTransmitterUpdate.java index ca59d63eb..331bc0b92 100644 --- a/src/main/java/mekanism/common/network/PacketTransmitterUpdate.java +++ b/src/main/java/mekanism/common/network/PacketTransmitterUpdate.java @@ -39,6 +39,11 @@ public class PacketTransmitterUpdate implements IMessageHandler transforms = ImmutableMap.builder() + .put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)) + .put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f)) + .put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)) + .put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)) + .put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f)) + .put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1)) + .put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0)) + .build(); + private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) + { + return new TRSRTransformation( + new Vector3f(tx / 16, ty / 16, tz / 16), + TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), + new Vector3f(s, s, s), + null); + } + @Override public ItemOverrideList getOverrides() { diff --git a/src/main/java/mekanism/generators/common/MekanismGenerators.java b/src/main/java/mekanism/generators/common/MekanismGenerators.java index fec47e8e1..16a9dc853 100644 --- a/src/main/java/mekanism/generators/common/MekanismGenerators.java +++ b/src/main/java/mekanism/generators/common/MekanismGenerators.java @@ -44,7 +44,7 @@ import net.minecraftforge.oredict.OreDictionary; import buildcraft.api.fuels.BuildcraftFuelRegistry; import buildcraft.api.fuels.IFuel; -@Mod(modid = "mekanismgenerators", name = "MekanismGenerators", version = "9.3.3", dependencies = "required-after:mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory") +@Mod(modid = "mekanismgenerators", name = "MekanismGenerators", version = "9.3.4", dependencies = "required-after:mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory") @Mod.EventBusSubscriber() public class MekanismGenerators implements IModule { @@ -55,7 +55,7 @@ public class MekanismGenerators implements IModule public static MekanismGenerators instance; /** MekanismGenerators version number */ - public static Version versionNumber = new Version(9, 3, 3); + public static Version versionNumber = new Version(9, 3, 4); public static MultiblockManager turbineManager = new MultiblockManager("industrialTurbine"); diff --git a/src/main/java/mekanism/generators/common/block/BlockGenerator.java b/src/main/java/mekanism/generators/common/block/BlockGenerator.java index 7427278e8..cc6c55e54 100644 --- a/src/main/java/mekanism/generators/common/block/BlockGenerator.java +++ b/src/main/java/mekanism/generators/common/block/BlockGenerator.java @@ -3,9 +3,6 @@ package mekanism.generators.common.block; import java.util.Random; import mekanism.api.energy.IEnergizedItem; -import mekanism.client.render.ctm.CTMBlockRenderContext; -import mekanism.client.render.ctm.CTMData; -import mekanism.client.render.ctm.ICTMBlock; import mekanism.common.Mekanism; import mekanism.common.base.IActiveState; import mekanism.common.base.IBoundingBlock; @@ -82,10 +79,8 @@ import buildcraft.api.tools.IToolWrench; * @author AidanBrady * */ -public abstract class BlockGenerator extends BlockContainer implements ICTMBlock +public abstract class BlockGenerator extends BlockContainer { - public CTMData[] ctmData = new CTMData[16]; - public Random machineRand = new Random(); private static final AxisAlignedBB SOLAR_BOUNDS = new AxisAlignedBB(0.0F, 0.0F, 0.0F, 1.0F, 0.7F, 1.0F); @@ -97,8 +92,6 @@ public abstract class BlockGenerator extends BlockContainer implements ICTMBlock setHardness(3.5F); setResistance(8F); setCreativeTab(Mekanism.tabMekanism); - - initCTMs(); } public static BlockGenerator getGeneratorBlock(GeneratorBlock block) @@ -115,36 +108,6 @@ public abstract class BlockGenerator extends BlockContainer implements ICTMBlock public abstract GeneratorBlock getGeneratorBlock(); - public void initCTMs() - { - switch(getGeneratorBlock()) - { - case GENERATOR_BLOCK_1: - ctmData[9] = new CTMData(GeneratorType.ELECTROMAGNETIC_COIL); - ctmData[10] = new CTMData(GeneratorType.TURBINE_CASING, GeneratorType.TURBINE_VALVE, GeneratorType.TURBINE_VENT); - ctmData[11] = new CTMData(GeneratorType.TURBINE_VALVE, GeneratorType.TURBINE_CASING, GeneratorType.TURBINE_VENT); - ctmData[12] = new CTMData(GeneratorType.TURBINE_VENT, GeneratorType.TURBINE_CASING, GeneratorType.TURBINE_VALVE); - ctmData[13] = new CTMData(GeneratorType.SATURATING_CONDENSER); - - break; - } - } - - @SideOnly(Side.CLIENT) - @Override - public IBlockState getExtendedState(IBlockState stateIn, IBlockAccess w, BlockPos pos) - { - if(stateIn.getBlock() == null || stateIn.getMaterial() == Material.AIR) - { - return stateIn; - } - - IExtendedBlockState state = (IExtendedBlockState)stateIn; - CTMBlockRenderContext ctx = new CTMBlockRenderContext(w, pos); - - return state.withProperty(BlockStateBasic.ctmProperty, ctx); - } - @Override public BlockStateContainer createBlockState() { @@ -760,20 +723,7 @@ public abstract class BlockGenerator extends BlockContainer implements ICTMBlock return false; } - - @Override - public CTMData getCTMData(IBlockState state) - { - return ctmData[state.getBlock().getMetaFromState(state)]; - } - - @Override - public String getOverrideTexture(IBlockState state, EnumFacing side) - { - return null; - } - - @Override + public PropertyEnum getTypeProperty() { return getGeneratorBlock().getProperty(); diff --git a/src/main/java/mekanism/generators/common/block/BlockReactor.java b/src/main/java/mekanism/generators/common/block/BlockReactor.java index d290683cf..a5daaac17 100644 --- a/src/main/java/mekanism/generators/common/block/BlockReactor.java +++ b/src/main/java/mekanism/generators/common/block/BlockReactor.java @@ -1,11 +1,7 @@ package mekanism.generators.common.block; -import mekanism.client.render.ctm.CTMBlockRenderContext; -import mekanism.client.render.ctm.CTMData; -import mekanism.client.render.ctm.ICTMBlock; import mekanism.common.Mekanism; import mekanism.common.base.IActiveState; -import mekanism.common.block.states.BlockStateBasic; import mekanism.common.tile.prefab.TileEntityBasicBlock; import mekanism.common.tile.prefab.TileEntityElectricBlock; import mekanism.common.util.MekanismUtils; @@ -39,14 +35,12 @@ import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.property.IExtendedBlockState; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import buildcraft.api.tools.IToolWrench; -public abstract class BlockReactor extends Block implements ICTMBlock, ITileEntityProvider +public abstract class BlockReactor extends Block implements ITileEntityProvider { - public CTMData[] ctmData = new CTMData[16]; public BlockReactor() { @@ -54,8 +48,6 @@ public abstract class BlockReactor extends Block implements ICTMBlock, ITileEnti setHardness(3.5F); setResistance(8F); setCreativeTab(Mekanism.tabMekanism); - - initCTMs(); } public static BlockReactor getReactorBlock(ReactorBlock block) @@ -90,41 +82,6 @@ public abstract class BlockReactor extends Block implements ICTMBlock, ITileEnti return state; } - public void initCTMs() - { - switch(getReactorBlock()) - { - case REACTOR_BLOCK: - ctmData[0] = new CTMData(ReactorBlockType.REACTOR_CONTROLLER, ReactorBlockType.REACTOR_FRAME, ReactorBlockType.REACTOR_PORT, ReactorBlockType.REACTOR_LOGIC_ADAPTER); - ctmData[1] = new CTMData(ReactorBlockType.REACTOR_CONTROLLER, ReactorBlockType.REACTOR_FRAME, ReactorBlockType.REACTOR_PORT, ReactorBlockType.REACTOR_LOGIC_ADAPTER); - ctmData[2] = new CTMData(ReactorBlockType.REACTOR_CONTROLLER, ReactorBlockType.REACTOR_FRAME, ReactorBlockType.REACTOR_PORT, ReactorBlockType.REACTOR_LOGIC_ADAPTER); - ctmData[3] = new CTMData(ReactorBlockType.REACTOR_CONTROLLER, ReactorBlockType.REACTOR_FRAME, ReactorBlockType.REACTOR_PORT, ReactorBlockType.REACTOR_LOGIC_ADAPTER); - ctmData[4] = new CTMData(ReactorBlockType.REACTOR_CONTROLLER, ReactorBlockType.REACTOR_FRAME, ReactorBlockType.REACTOR_PORT, ReactorBlockType.REACTOR_LOGIC_ADAPTER); - - break; - case REACTOR_GLASS: - ctmData[0] = new CTMData(ReactorBlockType.REACTOR_GLASS, ReactorBlockType.LASER_FOCUS_MATRIX); - ctmData[1] = new CTMData(ReactorBlockType.REACTOR_GLASS, ReactorBlockType.LASER_FOCUS_MATRIX); - - break; - } - } - - @SideOnly(Side.CLIENT) - @Override - public IBlockState getExtendedState(IBlockState stateIn, IBlockAccess w, BlockPos pos) - { - if(stateIn.getBlock() == null || stateIn.getMaterial() == Material.AIR) - { - return stateIn; - } - - IExtendedBlockState state = (IExtendedBlockState)stateIn; - CTMBlockRenderContext ctx = new CTMBlockRenderContext(w, pos); - - return state.withProperty(BlockStateBasic.ctmProperty, ctx); - } - @Override public BlockStateContainer createBlockState() { @@ -280,9 +237,13 @@ public abstract class BlockReactor extends Block implements ICTMBlock, ITileEnti if(type == ReactorBlockType.REACTOR_GLASS || type == ReactorBlockType.LASER_FOCUS_MATRIX) { - if(!ctmData[meta].shouldRenderSide(world, pos.offset(side), side)) - { - return false; + IBlockState stateOffset = world.getBlockState(pos.offset(side)); + if(this == stateOffset.getBlock()) { + int metaOffset = stateOffset.getBlock().getMetaFromState(stateOffset); + ReactorBlockType typeOffset = ReactorBlockType.get(getReactorBlock(), metaOffset); + if (typeOffset == ReactorBlockType.REACTOR_GLASS || typeOffset == ReactorBlockType.LASER_FOCUS_MATRIX) { + return false; + } } } @@ -353,37 +314,7 @@ public abstract class BlockReactor extends Block implements ICTMBlock, ITileEnti return itemStack; } - - @Override - public CTMData getCTMData(IBlockState state) - { - return ctmData[state.getBlock().getMetaFromState(state)]; - } - - @Override - public String getOverrideTexture(IBlockState state, EnumFacing side) - { - ReactorBlockType type = state.getValue(getTypeProperty()); - - if(type == ReactorBlockType.REACTOR_CONTROLLER) - { - if(side == EnumFacing.UP) - { - return type.getName() + (state.getValue(BlockStateReactor.activeProperty) ? "_on" : ""); - } - else { - return "reactor_frame"; - } - } - else if(type == ReactorBlockType.REACTOR_PORT) - { - return type.getName() + (state.getValue(BlockStateReactor.activeProperty) ? "_output" : ""); - } - - return null; - } - - @Override + public PropertyEnum getTypeProperty() { return getReactorBlock().getProperty(); diff --git a/src/main/java/mekanism/generators/common/block/states/BlockStateGenerator.java b/src/main/java/mekanism/generators/common/block/states/BlockStateGenerator.java index 8ec8baf43..9b6710552 100644 --- a/src/main/java/mekanism/generators/common/block/states/BlockStateGenerator.java +++ b/src/main/java/mekanism/generators/common/block/states/BlockStateGenerator.java @@ -52,7 +52,7 @@ public class BlockStateGenerator extends ExtendedBlockState public BlockStateGenerator(BlockGenerator block, PropertyEnum typeProperty) { - super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty}, new IUnlistedProperty[] {BlockStateBasic.ctmProperty}); + super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty}, new IUnlistedProperty[] {}); } public static enum GeneratorBlock diff --git a/src/main/java/mekanism/generators/common/block/states/BlockStateReactor.java b/src/main/java/mekanism/generators/common/block/states/BlockStateReactor.java index dbe6ade6f..064a98d5d 100644 --- a/src/main/java/mekanism/generators/common/block/states/BlockStateReactor.java +++ b/src/main/java/mekanism/generators/common/block/states/BlockStateReactor.java @@ -34,7 +34,7 @@ public class BlockStateReactor extends ExtendedBlockState public BlockStateReactor(BlockReactor block, PropertyEnum typeProperty) { - super(block, new IProperty[] {typeProperty, activeProperty}, new IUnlistedProperty[] {BlockStateBasic.ctmProperty}); + super(block, new IProperty[] {typeProperty, activeProperty}, new IUnlistedProperty[] {}); } public static enum ReactorBlock @@ -86,12 +86,12 @@ public class BlockStateReactor extends ExtendedBlockState public static enum ReactorBlockType implements IStringSerializable { - REACTOR_CONTROLLER(ReactorBlock.REACTOR_BLOCK, 0, "ReactorController", 10, TileEntityReactorController.class, false), + REACTOR_CONTROLLER(ReactorBlock.REACTOR_BLOCK, 0, "ReactorController", 10, TileEntityReactorController.class, true), REACTOR_FRAME(ReactorBlock.REACTOR_BLOCK, 1, "ReactorFrame", -1, TileEntityReactorFrame.class, false), - REACTOR_PORT(ReactorBlock.REACTOR_BLOCK, 2, "ReactorPort", -1, TileEntityReactorPort.class, false), + REACTOR_PORT(ReactorBlock.REACTOR_BLOCK, 2, "ReactorPort", -1, TileEntityReactorPort.class, true), REACTOR_LOGIC_ADAPTER(ReactorBlock.REACTOR_BLOCK, 3, "ReactorLogicAdapter", 15, TileEntityReactorLogicAdapter.class, false), REACTOR_GLASS(ReactorBlock.REACTOR_GLASS, 0, "ReactorGlass", -1, TileEntityReactorGlass.class, false), - LASER_FOCUS_MATRIX(ReactorBlock.REACTOR_GLASS, 1, "ReactorLaserFocusMatrix", -1, TileEntityReactorLaserFocusMatrix.class, true); + LASER_FOCUS_MATRIX(ReactorBlock.REACTOR_GLASS, 1, "ReactorLaserFocusMatrix", -1, TileEntityReactorLaserFocusMatrix.class, false); public ReactorBlock blockType; public int meta; @@ -164,6 +164,11 @@ public class BlockStateReactor extends ExtendedBlockState { return new ItemStack(blockType.getBlock(), amount, meta); } + + public boolean hasActiveTexture() + { + return activable; + } } public static class ReactorBlockStateMapper extends StateMapperBase @@ -176,6 +181,13 @@ public class BlockStateReactor extends ExtendedBlockState StringBuilder builder = new StringBuilder(); String nameOverride = null; + if(type.hasActiveTexture()) + { + builder.append(activeProperty.getName()); + builder.append("="); + builder.append(state.getValue(activeProperty)); + } + if(builder.length() == 0) { builder.append("normal"); diff --git a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java index f5fd437e5..2fa8f143b 100644 --- a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java +++ b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java @@ -18,6 +18,7 @@ import mekanism.common.base.ISustainedTank; import mekanism.common.capabilities.ItemCapabilityWrapper; import mekanism.common.config.MekanismConfig.general; import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.ic2.IC2ItemManager; import mekanism.common.integration.tesla.TeslaItemWrapper; import mekanism.common.security.ISecurityItem; @@ -72,8 +73,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; */ @InterfaceList({ - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2"), - @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux") + @Interface(iface = "cofh.redstoneflux.api.IEnergyContainerItem", modid = "redstoneflux"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = IC2Integration.MODID) }) public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, ISustainedInventory, ISustainedTank, IEnergyContainerItem, ISecurityItem { @@ -418,7 +419,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java index cc4315865..1aa094892 100644 --- a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java +++ b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java @@ -7,9 +7,6 @@ import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.IEnergyConductor; import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergyTile; - -import java.util.EnumSet; - import mekanism.api.Coord4D; import mekanism.common.base.FluidHandlerWrapper; import mekanism.common.base.IEnergyWrapper; @@ -20,6 +17,7 @@ import mekanism.common.config.MekanismConfig.general; import mekanism.common.config.MekanismConfig.generators; import mekanism.common.integration.computer.IComputerIntegration; import mekanism.common.integration.forgeenergy.ForgeEnergyIntegration; +import mekanism.common.integration.ic2.IC2Integration; import mekanism.common.integration.tesla.TeslaIntegration; import mekanism.common.tile.TileEntityGasTank.GasMode; import mekanism.common.util.CableUtils; @@ -89,7 +87,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I return false; } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public void register() { if(!world.isRemote) @@ -111,7 +109,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I } } - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public void deregister() { if(!world.isRemote) @@ -212,35 +210,35 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int getSinkTier() { return 4; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int getSourceTier() { return 4; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public void setStored(int energy) { setEnergy(energy*general.FROM_IC2); } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int addEnergy(int amount) { return 0; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public boolean isTeleporterCompatible(EnumFacing side) { return canOutputEnergy(side); @@ -253,49 +251,49 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { return false; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { return sideIsOutput(direction) && receiver instanceof IEnergyConductor; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int getStored() { return (int)Math.round(Math.min(Integer.MAX_VALUE, getEnergy()*general.TO_IC2)); } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int getCapacity() { return (int)Math.round(Math.min(Integer.MAX_VALUE, getMaxEnergy()*general.TO_IC2)); } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public int getOutput() { return (int)Math.round(Math.min(Integer.MAX_VALUE, getMaxOutput()*general.TO_IC2)); } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public double getDemandedEnergy() { return 0; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public double getOfferedEnergy() { return Math.min(getEnergy(), getMaxOutput())*general.TO_IC2; @@ -308,21 +306,21 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public double getOutputEnergyUnitsPerTick() { return getMaxOutput()*general.TO_IC2; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public double injectEnergy(EnumFacing direction, double amount, double voltage) { return amount; } @Override - @Method(modid = "IC2") + @Method(modid = IC2Integration.MODID) public void drawEnergy(double amount) { if(structure != null) diff --git a/src/main/java/mekanism/tools/common/MekanismTools.java b/src/main/java/mekanism/tools/common/MekanismTools.java index 8d9669559..36806c682 100644 --- a/src/main/java/mekanism/tools/common/MekanismTools.java +++ b/src/main/java/mekanism/tools/common/MekanismTools.java @@ -32,7 +32,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -@Mod(modid = "mekanismtools", name = "MekanismTools", version = "9.3.3", dependencies = "required-after:mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory") +@Mod(modid = "mekanismtools", name = "MekanismTools", version = "9.3.4", dependencies = "required-after:mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory") @Mod.EventBusSubscriber() public class MekanismTools implements IModule { @@ -43,7 +43,7 @@ public class MekanismTools implements IModule public static MekanismTools instance; /** MekanismTools version number */ - public static Version versionNumber = new Version(9, 3, 3); + public static Version versionNumber = new Version(9, 3, 4); //Enums: Tools public static ToolMaterial toolOBSIDIAN; diff --git a/src/main/resources/assets/mekanism/blockstates/boiler_casing.json b/src/main/resources/assets/mekanism/blockstates/boiler_casing.json index e2cbe4ccd..0f28918b5 100644 --- a/src/main/resources/assets/mekanism/blockstates/boiler_casing.json +++ b/src/main/resources/assets/mekanism/blockstates/boiler_casing.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/boiler_casing" + "all": "mekanism:blocks/boiler_casing" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/boiler_valve.json b/src/main/resources/assets/mekanism/blockstates/boiler_valve.json index ef299bcc0..184ec8961 100644 --- a/src/main/resources/assets/mekanism/blockstates/boiler_valve.json +++ b/src/main/resources/assets/mekanism/blockstates/boiler_valve.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/boiler_valve" + "all": "mekanism:blocks/boiler_valve" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/dynamic_tank.json b/src/main/resources/assets/mekanism/blockstates/dynamic_tank.json index 0c41fc493..a07cdc517 100644 --- a/src/main/resources/assets/mekanism/blockstates/dynamic_tank.json +++ b/src/main/resources/assets/mekanism/blockstates/dynamic_tank.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/dynamic_tank" + "all": "mekanism:blocks/dynamic_tank" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/dynamic_valve.json b/src/main/resources/assets/mekanism/blockstates/dynamic_valve.json index 667a65d9d..4f6eec8df 100644 --- a/src/main/resources/assets/mekanism/blockstates/dynamic_valve.json +++ b/src/main/resources/assets/mekanism/blockstates/dynamic_valve.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/dynamic_valve" + "all": "mekanism:blocks/dynamic_valve" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/electromagnetic_coil.json b/src/main/resources/assets/mekanism/blockstates/electromagnetic_coil.json index 1b14552ad..3252f8a82 100644 --- a/src/main/resources/assets/mekanism/blockstates/electromagnetic_coil.json +++ b/src/main/resources/assets/mekanism/blockstates/electromagnetic_coil.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/electromagnetic_coil" + "all": "mekanism:blocks/electromagnetic_coil" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_casing.json b/src/main/resources/assets/mekanism/blockstates/induction_casing.json index 3f0e2a490..2cba17d60 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_casing.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_casing.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_casing" + "all": "mekanism:blocks/induction_casing" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_cell_advanced.json b/src/main/resources/assets/mekanism/blockstates/induction_cell_advanced.json index eafa1f124..8ece7b1d6 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_cell_advanced.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_cell_advanced.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_cell_advanced" + "all": "mekanism:blocks/induction_cell_advanced" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_cell_basic.json b/src/main/resources/assets/mekanism/blockstates/induction_cell_basic.json index 119c43d8d..1a7241cb1 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_cell_basic.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_cell_basic.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_cell_basic" + "all": "mekanism:blocks/induction_cell_basic" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_cell_elite.json b/src/main/resources/assets/mekanism/blockstates/induction_cell_elite.json index cbb647a84..63f7bbaea 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_cell_elite.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_cell_elite.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_cell_elite" + "all": "mekanism:blocks/induction_cell_elite" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_cell_ultimate.json b/src/main/resources/assets/mekanism/blockstates/induction_cell_ultimate.json index ab064eb36..987515f9e 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_cell_ultimate.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_cell_ultimate.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_cell_ultimate" + "all": "mekanism:blocks/induction_cell_ultimate" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_port.json b/src/main/resources/assets/mekanism/blockstates/induction_port.json index 1206a30dd..4fdb1e33a 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_port.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_port.json @@ -3,12 +3,20 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_port" + "all": "mekanism:blocks/induction_port" } }, "variants": { "normal": [{}], - "inventory": [{}] + "inventory": [{}], + "active": { + "false": {}, + "true": { + "textures": { + "all": "mekanism:blocks/induction_port_output" + } + } + } } } diff --git a/src/main/resources/assets/mekanism/blockstates/induction_provider_advanced.json b/src/main/resources/assets/mekanism/blockstates/induction_provider_advanced.json index 639865b48..0b7eb7a30 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_provider_advanced.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_provider_advanced.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_provider_advanced" + "all": "mekanism:blocks/induction_provider_advanced" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_provider_basic.json b/src/main/resources/assets/mekanism/blockstates/induction_provider_basic.json index 1da31590e..1c4321aaf 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_provider_basic.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_provider_basic.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_provider_basic" + "all": "mekanism:blocks/induction_provider_basic" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_provider_elite.json b/src/main/resources/assets/mekanism/blockstates/induction_provider_elite.json index ed9789302..9d8aef33e 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_provider_elite.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_provider_elite.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_provider_elite" + "all": "mekanism:blocks/induction_provider_elite" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/induction_provider_ultimate.json b/src/main/resources/assets/mekanism/blockstates/induction_provider_ultimate.json index 8b426c869..955cd4e05 100644 --- a/src/main/resources/assets/mekanism/blockstates/induction_provider_ultimate.json +++ b/src/main/resources/assets/mekanism/blockstates/induction_provider_ultimate.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/induction_provider_ultimate" + "all": "mekanism:blocks/induction_provider_ultimate" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/structural_glass.json b/src/main/resources/assets/mekanism/blockstates/structural_glass.json index 00bae141e..e06060a91 100644 --- a/src/main/resources/assets/mekanism/blockstates/structural_glass.json +++ b/src/main/resources/assets/mekanism/blockstates/structural_glass.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/structural_glass" + "all": "mekanism:blocks/structural_glass" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/superheating_element.json b/src/main/resources/assets/mekanism/blockstates/superheating_element.json index 6943c41a7..fb83c472f 100644 --- a/src/main/resources/assets/mekanism/blockstates/superheating_element.json +++ b/src/main/resources/assets/mekanism/blockstates/superheating_element.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/superheating_element" + "all": "mekanism:blocks/superheating_element" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/teleporter.json b/src/main/resources/assets/mekanism/blockstates/teleporter.json index 6f2dd8a61..f973e45b9 100644 --- a/src/main/resources/assets/mekanism/blockstates/teleporter.json +++ b/src/main/resources/assets/mekanism/blockstates/teleporter.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/teleporter" + "all": "mekanism:blocks/teleporter" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/teleporter_frame.json b/src/main/resources/assets/mekanism/blockstates/teleporter_frame.json index b09eeb541..b440f7dda 100644 --- a/src/main/resources/assets/mekanism/blockstates/teleporter_frame.json +++ b/src/main/resources/assets/mekanism/blockstates/teleporter_frame.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/teleporter_frame" + "all": "mekanism:blocks/teleporter_frame" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_block.json b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_block.json index 1c74369d2..5e0699a97 100644 --- a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_block.json +++ b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_block.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/thermal_evaporation_block" + "all": "mekanism:blocks/thermal_evaporation_block" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_controller.json b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_controller.json index 61ab2f43f..e0cdf4916 100644 --- a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_controller.json +++ b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_controller.json @@ -3,8 +3,8 @@ "defaults": { "model": "mekanism:machine", "textures": { - "sides": "mekanism:blocks/ctm/thermal_evaporation_block", - "front": "mekanism:blocks/ctm/thermal_evaporation_controller" + "sides": "mekanism:blocks/thermal_evaporation_block", + "front": "mekanism:blocks/thermal_evaporation_controller" } }, "variants": { @@ -15,7 +15,16 @@ "east": {"y": 90}, "west": {"y": -90} }, - "inventory": [{}] + "inventory": [{}], + "active": { + "false": {}, + "true": { + "textures": { + "sides": "mekanism:blocks/thermal_evaporation_block", + "front": "mekanism:blocks/thermal_evaporation_controller_on" + } + } + } } } diff --git a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_valve.json b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_valve.json index 2b1da32df..43b41657c 100644 --- a/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_valve.json +++ b/src/main/resources/assets/mekanism/blockstates/thermal_evaporation_valve.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanism:blocks/ctm/thermal_evaporation_valve" + "all": "mekanism:blocks/thermal_evaporation_valve" } }, "variants": { diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_casing-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/boiler_casing-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_casing-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/boiler_casing-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_casing.png b/src/main/resources/assets/mekanism/textures/blocks/boiler_casing.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_casing.png rename to src/main/resources/assets/mekanism/textures/blocks/boiler_casing.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/boiler_casing.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/boiler_casing.png.mcmeta new file mode 100644 index 000000000..a6608aefe --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/boiler_casing.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/boiler_casing-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "boiler_casing" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "boiler_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_valve-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/boiler_valve-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_valve-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/boiler_valve-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_valve.png b/src/main/resources/assets/mekanism/textures/blocks/boiler_valve.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/boiler_valve.png rename to src/main/resources/assets/mekanism/textures/blocks/boiler_valve.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/boiler_valve.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/boiler_valve.png.mcmeta new file mode 100644 index 000000000..5d537af66 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/boiler_valve.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/boiler_valve-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "boiler_casing" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "boiler_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on-ctm.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on-ctm.png.mcmeta deleted file mode 100644 index efc331201..000000000 --- a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on-ctm.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "animation": { - "frametime": 10 - } -} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on.png.mcmeta deleted file mode 100644 index efc331201..000000000 --- a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "animation": { - "frametime": 10 - } -} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_tank-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/dynamic_tank-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_tank-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/dynamic_tank-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_tank.png b/src/main/resources/assets/mekanism/textures/blocks/dynamic_tank.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_tank.png rename to src/main/resources/assets/mekanism/textures/blocks/dynamic_tank.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/dynamic_tank.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/dynamic_tank.png.mcmeta new file mode 100644 index 000000000..38ab01749 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/dynamic_tank.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/dynamic_tank-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "dynamic_tank" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "dynamic_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_valve-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/dynamic_valve-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_valve-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/dynamic_valve-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_valve.png b/src/main/resources/assets/mekanism/textures/blocks/dynamic_valve.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/dynamic_valve.png rename to src/main/resources/assets/mekanism/textures/blocks/dynamic_valve.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/dynamic_valve.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/dynamic_valve.png.mcmeta new file mode 100644 index 000000000..a5d5cdb40 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/dynamic_valve.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/dynamic_valve-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "dynamic_tank" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "dynamic_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_casing-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_casing-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_casing-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_casing-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_casing.png b/src/main/resources/assets/mekanism/textures/blocks/induction_casing.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_casing.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_casing.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_casing.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_casing.png.mcmeta new file mode 100644 index 000000000..676c3c7f6 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_casing.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_casing-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_casing" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_advanced-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_advanced-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_advanced.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_advanced.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced.png.mcmeta new file mode 100644 index 000000000..27305eee5 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_advanced.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_cell_advanced-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_basic-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_basic-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_basic.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_basic.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic.png.mcmeta new file mode 100644 index 000000000..50bff00ac --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_basic.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_cell_basic-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_elite-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_elite-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_elite.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_elite.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite.png.mcmeta new file mode 100644 index 000000000..d91b9490c --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_elite.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_cell_elite-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_ultimate-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_ultimate-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_ultimate.png b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_cell_ultimate.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate.png.mcmeta new file mode 100644 index 000000000..03c9a6398 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_cell_ultimate.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_cell_ultimate-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_port-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_port-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port.png b/src/main/resources/assets/mekanism/textures/blocks/induction_port.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_port.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_port.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_port.png.mcmeta new file mode 100644 index 000000000..8e67deed2 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_port.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_port-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_casing" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port_output-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_port_output-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port_output-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_port_output-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port_output.png b/src/main/resources/assets/mekanism/textures/blocks/induction_port_output.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_port_output.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_port_output.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_port_output.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_port_output.png.mcmeta new file mode 100644 index 000000000..a2275b128 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_port_output.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_port_output-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_casing" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_advanced-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_advanced-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_advanced.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_advanced.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced.png.mcmeta new file mode 100644 index 000000000..4cf8bf026 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_advanced.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_provider_advanced-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_basic-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_basic-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_basic.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_basic.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic.png.mcmeta new file mode 100644 index 000000000..b1123a05e --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_basic.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_provider_basic-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_elite-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_elite-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_elite.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_elite.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite.png.mcmeta new file mode 100644 index 000000000..c8ed21f54 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_elite.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_provider_elite-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_ultimate-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_ultimate-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_ultimate.png b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/induction_provider_ultimate.png rename to src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate.png.mcmeta new file mode 100644 index 000000000..52de5b581 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/induction_provider_ultimate.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/induction_provider_ultimate-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_cell" + } + }, + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "induction_provider" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/structural_glass-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/structural_glass-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/structural_glass-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/structural_glass-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/structural_glass.png b/src/main/resources/assets/mekanism/textures/blocks/structural_glass.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/structural_glass.png rename to src/main/resources/assets/mekanism/textures/blocks/structural_glass.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/structural_glass.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/structural_glass.png.mcmeta new file mode 100644 index 000000000..196780b25 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/structural_glass.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"CUTOUT", + "textures":[ + "mekanism:blocks/structural_glass-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/superheating_element-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/superheating_element-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element.png b/src/main/resources/assets/mekanism/textures/blocks/superheating_element.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element.png rename to src/main/resources/assets/mekanism/textures/blocks/superheating_element.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/superheating_element.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/superheating_element.png.mcmeta new file mode 100644 index 000000000..ec7da3e74 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/superheating_element.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/superheating_element-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element_on-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/superheating_element_on-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element_on-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/superheating_element_on-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element_on.png b/src/main/resources/assets/mekanism/textures/blocks/superheating_element_on.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/superheating_element_on.png rename to src/main/resources/assets/mekanism/textures/blocks/superheating_element_on.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/superheating_element_on.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/superheating_element_on.png.mcmeta new file mode 100644 index 000000000..c7f2897e6 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/superheating_element_on.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/superheating_element_on-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/teleporter-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/teleporter-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter.png b/src/main/resources/assets/mekanism/textures/blocks/teleporter.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter.png rename to src/main/resources/assets/mekanism/textures/blocks/teleporter.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/teleporter.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/teleporter.png.mcmeta new file mode 100644 index 000000000..15144b177 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/teleporter.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/teleporter-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "teleporter_frame" + } + }, + { + "block": "mekanism:machineblock", + "predicate": + { + "type": "teleporter" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter_frame-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/teleporter_frame-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter_frame-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/teleporter_frame-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter_frame.png b/src/main/resources/assets/mekanism/textures/blocks/teleporter_frame.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/teleporter_frame.png rename to src/main/resources/assets/mekanism/textures/blocks/teleporter_frame.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/teleporter_frame.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/teleporter_frame.png.mcmeta new file mode 100644 index 000000000..dad88f3ad --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/teleporter_frame.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/teleporter_frame-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "teleporter_frame" + } + }, + { + "block": "mekanism:machineblock", + "predicate": + { + "type": "teleporter" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_block-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_block-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_block.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_block.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block.png.mcmeta new file mode 100644 index 000000000..836e5bb0d --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_block.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/thermal_evaporation_block-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "thermal_evaporation_block" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_controller" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller.png.mcmeta new file mode 100644 index 000000000..79641f2a7 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/thermal_evaporation_controller-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "thermal_evaporation_block" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_controller" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on-ctm.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on-ctm.png.mcmeta new file mode 100644 index 000000000..a949f0dba --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on-ctm.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 10 + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_controller_on.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on.png.mcmeta new file mode 100644 index 000000000..a6e3540b3 --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_controller_on.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frametime": 10 + }, + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/thermal_evaporation_controller_on-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "thermal_evaporation_block" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_controller" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_valve-ctm.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve-ctm.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_valve-ctm.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve-ctm.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_valve.png b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/blocks/ctm/thermal_evaporation_valve.png rename to src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve.png diff --git a/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve.png.mcmeta b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve.png.mcmeta new file mode 100644 index 000000000..190a014ff --- /dev/null +++ b/src/main/resources/assets/mekanism/textures/blocks/thermal_evaporation_valve.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanism:blocks/thermal_evaporation_valve-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanism:basicblock2", + "predicate": + { + "type": "thermal_evaporation_block" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_controller" + } + }, + { + "block": "mekanism:basicblock", + "predicate": + { + "type": "thermal_evaporation_valve" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/electromagnetic_coil.json b/src/main/resources/assets/mekanismgenerators/blockstates/electromagnetic_coil.json index cb9368072..8d57ca8d7 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/electromagnetic_coil.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/electromagnetic_coil.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/electromagnetic_coil" + "all": "mekanismgenerators:blocks/electromagnetic_coil" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/laser_focus_matrix.json b/src/main/resources/assets/mekanismgenerators/blockstates/laser_focus_matrix.json index cb1c6899e..6ce375e73 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/laser_focus_matrix.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/laser_focus_matrix.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/laser_focus_matrix" + "all": "mekanismgenerators:blocks/laser_focus_matrix" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_controller.json b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_controller.json index d23429914..192e12856 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_controller.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_controller.json @@ -3,20 +3,24 @@ "defaults": { "model": "mekanism:machine", "textures": { - "sides": "mekanismgenerators:blocks/ctm/reactor_frame", - "front": "mekanismgenerators:blocks/ctm/reactor_frame", - "top": "mekanismgenerators:blocks/ctm/reactor_controller" + "sides": "mekanismgenerators:blocks/reactor_frame", + "front": "mekanismgenerators:blocks/reactor_frame", + "up": "mekanismgenerators:blocks/reactor_controller" } }, "variants": { "normal": [{}], - "facing": { - "north": {}, - "south": {"y": 180}, - "east": {"y": 90}, - "west": {"y": -90} - }, - "inventory": [{}] + "inventory": [{}], + "active": { + "false": {}, + "true": { + "textures": { + "sides": "mekanismgenerators:blocks/reactor_frame", + "front": "mekanismgenerators:blocks/reactor_frame", + "up": "mekanismgenerators:blocks/reactor_controller_on" + } + } + } } } diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_frame.json b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_frame.json index 4301c212c..86c07c498 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_frame.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_frame.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/reactor_frame" + "all": "mekanismgenerators:blocks/reactor_frame" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_glass.json b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_glass.json index ee9fbcb58..57f20e994 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_glass.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_glass.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/reactor_glass" + "all": "mekanismgenerators:blocks/reactor_glass" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_logic_adapter.json b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_logic_adapter.json index 76ac4001d..7268044a6 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_logic_adapter.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_logic_adapter.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/reactor_logic_adapter" + "all": "mekanismgenerators:blocks/reactor_logic_adapter" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_port.json b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_port.json index 7c206e9c1..8f4e114ba 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/reactor_port.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/reactor_port.json @@ -3,12 +3,20 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/reactor_port" + "all": "mekanismgenerators:blocks/reactor_port" } }, "variants": { "normal": [{}], - "inventory": [{}] + "inventory": [{}], + "active": { + "false": {}, + "true": { + "textures": { + "all": "mekanismgenerators:blocks/reactor_port_output" + } + } + } } } diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/saturating_condenser.json b/src/main/resources/assets/mekanismgenerators/blockstates/saturating_condenser.json index cdc754f69..0129b1a66 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/saturating_condenser.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/saturating_condenser.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/saturating_condenser" + "all": "mekanismgenerators:blocks/saturating_condenser" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_casing.json b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_casing.json index 5ab17c563..387913bff 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_casing.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_casing.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/turbine_casing" + "all": "mekanismgenerators:blocks/turbine_casing" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_valve.json b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_valve.json index efbffc748..a2f29142d 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_valve.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_valve.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/turbine_valve" + "all": "mekanismgenerators:blocks/turbine_valve" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_vent.json b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_vent.json index 104893fa1..fac3e290b 100644 --- a/src/main/resources/assets/mekanismgenerators/blockstates/turbine_vent.json +++ b/src/main/resources/assets/mekanismgenerators/blockstates/turbine_vent.json @@ -3,7 +3,7 @@ "defaults": { "model": "mekanism:basic_cube", "textures": { - "all": "mekanismgenerators:blocks/ctm/turbine_vent" + "all": "mekanismgenerators:blocks/turbine_vent" } }, "variants": { diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/electromagnetic_coil-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/electromagnetic_coil-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/electromagnetic_coil.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/electromagnetic_coil.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil.png.mcmeta new file mode 100644 index 000000000..20f32df80 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/electromagnetic_coil.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/electromagnetic_coil-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/laser_focus_matrix-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/laser_focus_matrix-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/laser_focus_matrix.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/laser_focus_matrix.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix.png.mcmeta new file mode 100644 index 000000000..985103ab8 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/laser_focus_matrix.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"TRANSLUCENT", + "textures":[ + "mekanismgenerators:blocks/laser_focus_matrix-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactorglass", + "predicate": + { + "type": "reactor_glass" + } + }, + { + "block": "mekanismgenerators:reactorglass", + "predicate": + { + "type": "laser_focus_matrix" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller.png.mcmeta new file mode 100644 index 000000000..41c2d44b4 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_controller-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller_on-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller_on-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller_on.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_controller_on.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on.png.mcmeta new file mode 100644 index 000000000..2a1a78418 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_controller_on.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_controller_on-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_frame-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_frame-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_frame.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_frame.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame.png.mcmeta new file mode 100644 index 000000000..9e4b6a9aa --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_frame.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_frame-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_glass-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_glass-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_glass.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_glass.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass.png.mcmeta new file mode 100644 index 000000000..7121dad34 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_glass.png.mcmeta @@ -0,0 +1,28 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"TRANSLUCENT", + "textures":[ + "mekanismgenerators:blocks/reactor_glass-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactorglass", + "predicate": + { + "type": "reactor_glass" + } + }, + { + "block": "mekanismgenerators:reactorglass", + "predicate": + { + "type": "laser_focus_matrix" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_logic_adapter-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_logic_adapter-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_logic_adapter.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_logic_adapter.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter.png.mcmeta new file mode 100644 index 000000000..cc258e2e8 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_logic_adapter.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_logic_adapter-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_neutron_capture-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_neutron_capture-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_neutron_capture.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_neutron_capture.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture.png.mcmeta new file mode 100644 index 000000000..4631ac6e3 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_neutron_capture.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"TRANSLUCENT", + "textures":[ + "mekanismgenerators:blocks/reactor_neutron_capture-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port.png.mcmeta new file mode 100644 index 000000000..8885f43ea --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_port-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port_output-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port_output-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port_output.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/reactor_port_output.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output.png.mcmeta new file mode 100644 index 000000000..4fe849667 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/reactor_port_output.png.mcmeta @@ -0,0 +1,42 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/reactor_port_output-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_frame" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_controller" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_logic_adapter" + } + }, + { + "block": "mekanismgenerators:reactor", + "predicate": + { + "type": "reactor_port" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/saturating_condenser-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/saturating_condenser-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/saturating_condenser.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/saturating_condenser.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser.png.mcmeta new file mode 100644 index 000000000..c7b687cf4 --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/saturating_condenser.png.mcmeta @@ -0,0 +1,10 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/saturating_condenser-ctm" + ] + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_casing-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_casing-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_casing.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_casing.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing.png.mcmeta new file mode 100644 index 000000000..373d77fff --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_casing.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/turbine_casing-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_casing" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_valve" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_vent" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_valve-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_valve-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_valve.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_valve.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve.png.mcmeta new file mode 100644 index 000000000..d9077479b --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_valve.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/turbine_valve-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_casing" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_valve" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_vent" + } + } + ] + } + } +} diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_vent-ctm.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent-ctm.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_vent-ctm.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent-ctm.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_vent.png b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent.png similarity index 100% rename from src/main/resources/assets/mekanismgenerators/textures/blocks/ctm/turbine_vent.png rename to src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent.png diff --git a/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent.png.mcmeta b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent.png.mcmeta new file mode 100644 index 000000000..be7c9f9fa --- /dev/null +++ b/src/main/resources/assets/mekanismgenerators/textures/blocks/turbine_vent.png.mcmeta @@ -0,0 +1,35 @@ +{ + "ctm":{ + "ctm_version": 1, + "type":"CTM", + "layer":"SOLID", + "textures":[ + "mekanismgenerators:blocks/turbine_vent-ctm" + ], + "extra": { + "connect_to": [ + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_casing" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_valve" + } + }, + { + "block": "mekanismgenerators:generator", + "predicate": + { + "type": "turbine_vent" + } + } + ] + } + } +}