From fddf546474a481fac81b891e1fef3bd133b3a60a Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 24 Jan 2016 14:15:41 -0600 Subject: [PATCH] Cleanup and reformat: Delete all ISBRH's and IItemRenderers besides book, reformat to tabs in my new classes, add missing copylefts --- .../vazkii/botania/api/BotaniaAPIClient.java | 144 +++--- .../botania/api/state/BotaniaStateProps.java | 176 ++++--- .../botania/api/state/PropertyObject.java | 66 +-- .../api/state/enums/AlfPortalState.java | 16 +- .../api/state/enums/AltGrassVariant.java | 22 +- .../botania/api/state/enums/AltarVariant.java | 30 +- .../api/state/enums/BiomeBrickVariant.java | 42 +- .../api/state/enums/BiomeStoneVariant.java | 42 +- .../botania/api/state/enums/CratePattern.java | 30 +- .../botania/api/state/enums/CrateVariant.java | 14 +- .../api/state/enums/CustomBrickVariant.java | 42 +- .../botania/api/state/enums/DrumVariant.java | 16 +- .../api/state/enums/EndBrickVariant.java | 18 +- .../api/state/enums/FutureStoneVariant.java | 42 +- .../api/state/enums/LivingRockVariant.java | 20 +- .../api/state/enums/LivingWoodVariant.java | 22 +- .../api/state/enums/LuminizerVariant.java | 14 +- .../api/state/enums/PlatformVariant.java | 16 +- .../botania/api/state/enums/PoolVariant.java | 18 +- .../api/state/enums/PrismarineVariant.java | 16 +- .../botania/api/state/enums/PylonVariant.java | 16 +- .../api/state/enums/QuartzVariant.java | 20 +- .../api/state/enums/SpreaderVariant.java | 18 +- .../api/state/enums/StorageVariant.java | 20 +- .../integration/jei/JEIBotaniaPlugin.java | 80 ++-- .../jei/brewery/BreweryRecipeCategory.java | 111 ++--- .../jei/brewery/BreweryRecipeHandler.java | 40 +- .../jei/brewery/BreweryRecipeWrapper.java | 72 +-- .../elventrade/ElvenTradeRecipeCategory.java | 136 +++--- .../elventrade/ElvenTradeRecipeHandler.java | 40 +- .../elventrade/ElvenTradeRecipeWrapper.java | 74 +-- .../jei/manapool/ManaPoolRecipeCategory.java | 129 +++--- .../jei/manapool/ManaPoolRecipeHandler.java | 40 +- .../jei/manapool/ManaPoolRecipeWrapper.java | 89 ++-- .../PetalApothecaryRecipeCategory.java | 131 +++--- .../PetalApothecaryRecipeHandler.java | 40 +- .../PetalApothecaryRecipeWrapper.java | 74 +-- .../puredaisy/PureDaisyRecipeCategory.java | 135 +++--- .../jei/puredaisy/PureDaisyRecipeHandler.java | 40 +- .../jei/puredaisy/PureDaisyRecipeWrapper.java | 88 ++-- .../runicaltar/RunicAltarRecipeCategory.java | 131 +++--- .../runicaltar/RunicAltarRecipeHandler.java | 40 +- .../runicaltar/RunicAltarRecipeWrapper.java | 85 ++-- .../client/model/FloatingFlowerModel.java | 312 +++++++------ .../botania/client/model/ModelPylon.java | 67 +-- .../botania/client/model/PlatformModel.java | 89 ++-- .../botania/client/model/PylonItemModel.java | 221 +++++---- .../client/model/SpecialFlowerModel.java | 436 +++++++++--------- .../client/render/block/RenderAvatar.java | 51 -- .../client/render/block/RenderBellows.java | 52 --- .../client/render/block/RenderBrewery.java | 55 --- .../client/render/block/RenderCocoon.java | 51 -- .../block/RenderCorporeaCrystalCube.java | 53 --- .../render/block/RenderCorporeaIndex.java | 55 --- .../client/render/block/RenderHourglass.java | 53 --- .../render/block/RenderIncensePlate.java | 52 --- .../client/render/block/RenderPool.java | 54 --- .../client/render/block/RenderPump.java | 51 -- .../render/block/RenderSpawnerClaw.java | 51 -- .../render/block/RenderSpecialFlower.java | 138 ------ .../client/render/block/RenderSpreader.java | 57 --- .../render/block/RenderTeruTeruBozu.java | 51 -- .../client/render/block/RenderTinyPotato.java | 51 -- .../botania/client/render/item/RenderBow.java | 96 ---- .../client/render/item/RenderLens.java | 124 ----- .../render/item/RenderTransparentItem.java | 81 ---- 66 files changed, 1877 insertions(+), 2879 deletions(-) delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderAvatar.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderBellows.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderBrewery.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderCocoon.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderHourglass.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderPool.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderPump.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderSpreader.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java delete mode 100644 src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java delete mode 100644 src/main/java/vazkii/botania/client/render/item/RenderBow.java delete mode 100644 src/main/java/vazkii/botania/client/render/item/RenderLens.java delete mode 100644 src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java diff --git a/src/main/java/vazkii/botania/api/BotaniaAPIClient.java b/src/main/java/vazkii/botania/api/BotaniaAPIClient.java index 68e31ce4a..3db57c7ff 100644 --- a/src/main/java/vazkii/botania/api/BotaniaAPIClient.java +++ b/src/main/java/vazkii/botania/api/BotaniaAPIClient.java @@ -1,3 +1,11 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

+ * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ package vazkii.botania.api; import com.google.common.base.Preconditions; @@ -7,8 +15,8 @@ import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.LoaderState; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.subtile.SubTileEntity; import java.util.Collections; import java.util.Map; @@ -19,80 +27,82 @@ import java.util.Map; @SideOnly(Side.CLIENT) public final class BotaniaAPIClient { - private static final Map subtileBlockModels = Maps.newHashMap(); - private static final Map subtileItemModels = Maps.newHashMap(); - private static final Map islandTypeModels = Maps.newHashMap(); + private static final Map subtileBlockModels = Maps.newHashMap(); + private static final Map subtileItemModels = Maps.newHashMap(); + private static final Map islandTypeModels = Maps.newHashMap(); - /** - * Register your model for the given subtile class here. - * Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work. - * Your model json must specify key "tintindex" in all the faces it wants tint applied. - * Tint is applied whenever a player recolors the flower using floral dye - * - * @param subTileName The String ID of the subtile - * @param model A path to a blockstate json and variant to be used for this subtile - * @param itemModel A path to a blockstate json and variant to be used for this subtile's item form - */ - public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) { - Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); - subtileBlockModels.put(subTileName, model); - subtileItemModels.put(subTileName, itemModel); - } + private BotaniaAPIClient() { + } - /** - * Register your model for the given subtile class here. - * Call this DURING PREINIT. - * Your model json must specify key "tintindex" in all the faces it wants tint applied. - * Tint is applied whenever a player recolors the flower using floral dye - * - * @param subTileName The String ID of the subtile - * @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory" - */ - public static void registerSubtileModel(String subTileName, ModelResourceLocation model) { - registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory")); - } + /** + * Register your model for the given subtile class here. + * Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work. + * Your model json must specify key "tintindex" in all the faces it wants tint applied. + * Tint is applied whenever a player recolors the flower using floral dye + * + * @param subTileName The String ID of the subtile + * @param model A path to a blockstate json and variant to be used for this subtile + * @param itemModel A path to a blockstate json and variant to be used for this subtile's item form + */ + public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) { + Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); + subtileBlockModels.put(subTileName, model); + subtileItemModels.put(subTileName, itemModel); + } - // Convenience overloads for the above two calls - public static void registerSubtileModel(Class clazz, ModelResourceLocation model) { - registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model); - } + /** + * Register your model for the given subtile class here. + * Call this DURING PREINIT. + * Your model json must specify key "tintindex" in all the faces it wants tint applied. + * Tint is applied whenever a player recolors the flower using floral dye + * + * @param subTileName The String ID of the subtile + * @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory" + */ + public static void registerSubtileModel(String subTileName, ModelResourceLocation model) { + registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory")); + } - public static void registerSubtileModel(Class clazz, ModelResourceLocation model, ModelResourceLocation itemModel) { - registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel); - } + // Convenience overloads for the above two calls + public static void registerSubtileModel(Class clazz, ModelResourceLocation model) { + registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model); + } - /** - * @return An immutable and live view of the registered subtile block model map - */ - public static Map getRegisteredSubtileBlockModels() { - return Collections.unmodifiableMap(subtileBlockModels); - } + public static void registerSubtileModel(Class clazz, ModelResourceLocation model, ModelResourceLocation itemModel) { + registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel); + } - /** - * @return An immutable and live view of the registered subtile item model map - */ - public static Map getRegisteredSubtileItemModels() { - return Collections.unmodifiableMap(subtileItemModels); - } + /** + * @return An immutable and live view of the registered subtile block model map + */ + public static Map getRegisteredSubtileBlockModels() { + return Collections.unmodifiableMap(subtileBlockModels); + } - /** - * Registers your model for island type islandType here. - * Call this DURING PREINIT. - * @param islandType The islandtype to register - * @param model The variant within a blockstate json to use as the islandtype's model - */ - public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) { - Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); - islandTypeModels.put(islandType, model); - } + /** + * @return An immutable and live view of the registered subtile item model map + */ + public static Map getRegisteredSubtileItemModels() { + return Collections.unmodifiableMap(subtileItemModels); + } - /** - * @return An immutable and live view of the registered island type model map - */ - public static Map getRegisteredIslandTypeModels() { - return Collections.unmodifiableMap(islandTypeModels); - } + /** + * Registers your model for island type islandType here. + * Call this DURING PREINIT. + * + * @param islandType The islandtype to register + * @param model The variant within a blockstate json to use as the islandtype's model + */ + public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) { + Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); + islandTypeModels.put(islandType, model); + } - private BotaniaAPIClient() {} + /** + * @return An immutable and live view of the registered island type model map + */ + public static Map getRegisteredIslandTypeModels() { + return Collections.unmodifiableMap(islandTypeModels); + } } diff --git a/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java b/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java index a2b9d00bc..92f49feb0 100644 --- a/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java +++ b/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -26,133 +26,131 @@ import vazkii.botania.api.state.enums.*; */ public class BotaniaStateProps { - /** Unlisted properties **/ + /** Unlisted properties **/ - // The property for specialFlower subtile id - public static final PropertyObject SUBTILE_ID = new PropertyObject<>("subtile_id", String.class); + // The property for specialFlower subtile id + public static final PropertyObject SUBTILE_ID = new PropertyObject<>("subtile_id", String.class); - // The property for floating flower island type - public static final PropertyObject ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class); + // The property for floating flower island type + public static final PropertyObject ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class); - // The property for platform held blockstate id - public static final PropertyObject HELD_STATE = new PropertyObject<>("held_state", IBlockState.class); + // The property for platform held blockstate id + public static final PropertyObject HELD_STATE = new PropertyObject<>("held_state", IBlockState.class); - /** Common properties to all blocks to use **/ + /** Common properties to all blocks to use **/ - // The 16 Minecraft colors - public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + // The 16 Minecraft colors + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); - // The four cardinal directions - public static final PropertyEnum CARDINALS = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL); + // The four cardinal directions + public static final PropertyEnum CARDINALS = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL); - // All 6 directions - public static final PropertyEnum FACING = PropertyEnum.create("facing", EnumFacing.class); + // All 6 directions + public static final PropertyEnum FACING = PropertyEnum.create("facing", EnumFacing.class); - // Redstone power - boolean - // Also for any other simple boolean "on/off" state - public static final PropertyBool POWERED = PropertyBool.create("powered"); + // Redstone power - boolean + // Also for any other simple boolean "on/off" state + public static final PropertyBool POWERED = PropertyBool.create("powered"); - // Redstone power - int - public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + /** Properties for certain kinds of blocks **/ - /** Properties for certain kinds of blocks **/ + // The axis directions (think quartz pillars and wood logs) + public static final PropertyEnum AXIS_FACING = BlockRotatedPillar.AXIS; - // The axis directions (think quartz pillars and wood logs) - public static final PropertyEnum AXIS_FACING = BlockRotatedPillar.AXIS; + // Extra Quartz Blocks + public static final PropertyEnum QUARTZ_VARIANT = PropertyEnum.create("variant", QuartzVariant.class); - // Extra Quartz Blocks - public static final PropertyEnum QUARTZ_VARIANT = PropertyEnum.create("variant", QuartzVariant.class); + /** Properties for individual blocks **/ - /** Properties for individual blocks **/ + // Block18Stone + public static final PropertyEnum FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class); - // Block18Stone - public static final PropertyEnum FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class); + // Block18StoneWall + public static final PropertyEnum FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, variant -> { + // Just the four kinds (no polished, chiseled, etc.) + return variant.ordinal() >= 0 && variant.ordinal() <= 3; + }); - // Block18StoneWall - public static final PropertyEnum FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, variant -> { - // Just the four kinds (no polished, chiseled, etc.) - return variant.ordinal() >= 0 && variant.ordinal() <= 3; - }); + // BlockAlfPortal + public static final PropertyEnum ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class); - // BlockAlfPortal - public static final PropertyEnum ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class); + // BlockAltar + public static final PropertyEnum ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class); - // BlockAltar - public static final PropertyEnum ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class); + // BlockAltGrass + public static final PropertyEnum ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class); - // BlockAltGrass - public static final PropertyEnum ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class); + // BlockBiomeStoneA + public static final PropertyEnum BIOMESTONE_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class); - // BlockBiomeStoneA - public static final PropertyEnum BIOMESTONE_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class); + // BlockBiomeStoneB + public static final PropertyEnum BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class); - // BlockBiomeStoneB - public static final PropertyEnum BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class); + // BlockBiomeStoneWall + public static final PropertyEnum BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble")); - // BlockBiomeStoneWall - public static final PropertyEnum BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble")); + // BlockCustomBrick + public static final PropertyEnum CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class); - // BlockCustomBrick - public static final PropertyEnum CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class); + // BlockDreamWood, BlockLivingWood + public static final PropertyEnum LIVINGWOOD_VARIANT = PropertyEnum.create("variant", LivingWoodVariant.class); - // BlockDreamWood, BlockLivingWood - public static final PropertyEnum LIVINGWOOD_VARIANT = PropertyEnum.create("variant", LivingWoodVariant.class); + // BlockEnchanter + public static final PropertyEnum ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y))); - // BlockEnchanter - public static final PropertyEnum ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y))); + // BlockEndStoneBrick + public static final PropertyEnum ENDBRICK_VARIANT = PropertyEnum.create("variant", EndBrickVariant.class); - // BlockEndStoneBrick - public static final PropertyEnum ENDBRICK_VARIANT = PropertyEnum.create("variant", EndBrickVariant.class); + // BlockForestDrum + public static final PropertyEnum DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class); - // BlockForestDrum - public static final PropertyEnum DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class); + // BlockGhostRail + public static final PropertyEnum RAIL_DIRECTION = BlockRailPowered.SHAPE; - // BlockGhostRail - public static final PropertyEnum RAIL_DIRECTION = BlockRailPowered.SHAPE; + // BlockLightRelay + public static final PropertyEnum LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class); - // BlockLightRelay - public static final PropertyEnum LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class); + // BlockLivingRock + public static final PropertyEnum LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class); - // BlockLivingRock - public static final PropertyEnum LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class); + // BlockModDoubleFlower (white to gray) + public static final PropertyEnum DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7); - // BlockModDoubleFlower (white to gray) - public static final PropertyEnum DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7); + // (silver to black) + public static final PropertyEnum DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15); - // (silver to black) - public static final PropertyEnum DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15); + // BlockOpenCrate + public static final PropertyEnum CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class); + public static final PropertyEnum CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class); - // BlockOpenCrate - public static final PropertyEnum CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class); - public static final PropertyEnum CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class); + // BlockPavement + public static final PropertyEnum PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, color -> + color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK + || color == EnumDyeColor.BLUE || color == EnumDyeColor.RED + || color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN); - // BlockPavement - public static final PropertyEnum PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, color -> - color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK - || color == EnumDyeColor.BLUE || color == EnumDyeColor.RED - || color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN); + // BlockPlatform + public static final PropertyEnum PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class); - // BlockPlatform - public static final PropertyEnum PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class); + // BlockPool + public static final PropertyEnum POOL_VARIANT = PropertyEnum.create("variant", PoolVariant.class); - // BlockPool - public static final PropertyEnum POOL_VARIANT = PropertyEnum.create("variant", PoolVariant.class); + // BlockPrism + public static final PropertyBool HAS_LENS = PropertyBool.create("has_lens"); - // BlockPrism - public static final PropertyBool HAS_LENS = PropertyBool.create("has_lens"); + // BlockPrismarine + public static final PropertyEnum PRISMARINE_VARIANT = PropertyEnum.create("variant", PrismarineVariant.class); - // BlockPrismarine - public static final PropertyEnum PRISMARINE_VARIANT = PropertyEnum.create("variant", PrismarineVariant.class); + // BlockPylon + public static final PropertyEnum PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class); - // BlockPylon - public static final PropertyEnum PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class); + // BlockSpreader + public static final PropertyEnum SPREADER_VARIANT = PropertyEnum.create("variant", SpreaderVariant.class); - // BlockSpreader - public static final PropertyEnum SPREADER_VARIANT = PropertyEnum.create("variant", SpreaderVariant.class); + // BlockStorage + public static final PropertyEnum STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class); - // BlockStorage - public static final PropertyEnum STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class); - - private BotaniaStateProps() {} + private BotaniaStateProps() { + } } diff --git a/src/main/java/vazkii/botania/api/state/PropertyObject.java b/src/main/java/vazkii/botania/api/state/PropertyObject.java index fc09cf7fd..78ce6dd9b 100644 --- a/src/main/java/vazkii/botania/api/state/PropertyObject.java +++ b/src/main/java/vazkii/botania/api/state/PropertyObject.java @@ -1,3 +1,11 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

+ * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ package vazkii.botania.api.state; import com.google.common.base.Function; @@ -8,39 +16,39 @@ import net.minecraftforge.common.property.IUnlistedProperty; // Generic base class for unlisted properties public class PropertyObject implements IUnlistedProperty { - private final String name; - private final Class clazz; - private final Predicate validator; - private final Function stringFunction; + private final String name; + private final Class clazz; + private final Predicate validator; + private final Function stringFunction; - public PropertyObject(String name, Class clazz, Predicate validator, Function stringFunction) { - this.name = name; - this.clazz = clazz; - this.validator = validator; - this.stringFunction = stringFunction; - } + public PropertyObject(String name, Class clazz, Predicate validator, Function stringFunction) { + this.name = name; + this.clazz = clazz; + this.validator = validator; + this.stringFunction = stringFunction; + } - public PropertyObject(String name, Class clazz) { - this(name, clazz, Predicates.alwaysTrue(), Object::toString); - } + public PropertyObject(String name, Class clazz) { + this(name, clazz, Predicates.alwaysTrue(), Object::toString); + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - @Override - public boolean isValid(T value) { - return validator.apply(value); - } + @Override + public boolean isValid(T value) { + return validator.apply(value); + } - @Override - public Class getType() { - return clazz; - } + @Override + public Class getType() { + return clazz; + } - @Override - public String valueToString(T value) { - return stringFunction.apply(value); - } + @Override + public String valueToString(T value) { + return stringFunction.apply(value); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java b/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java index 8fefab1b8..91d52e25d 100644 --- a/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java +++ b/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,13 +13,13 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum AlfPortalState implements IStringSerializable { - OFF, - ON_Z, - ON_X; + OFF, + ON_Z, + ON_X; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java b/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java index 5c39e7641..612742b73 100644 --- a/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,16 +13,16 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum AltGrassVariant implements IStringSerializable { - DRY, - GOLDEN, - VIVID, - SCORCHED, - INFUSED, - MUTATED; + DRY, + GOLDEN, + VIVID, + SCORCHED, + INFUSED, + MUTATED; - @Override - public String getName() { - return this.name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return this.name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java b/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java index 4a537727d..056b2b428 100644 --- a/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,20 +13,20 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum AltarVariant implements IStringSerializable { - DEFAULT, - FOREST, - PLAINS, - MOUNTAIN, - FUNGAL, - SWAMP, - DESERT, - TAIGA, - MESA, - MOSSY; + DEFAULT, + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + MOSSY; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java b/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java index 26fd82de6..4808a5893 100644 --- a/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,26 +13,26 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum BiomeBrickVariant implements IStringSerializable { - FOREST, - PLAINS, - MOUNTAIN, - FUNGAL, - SWAMP, - DESERT, - TAIGA, - MESA, - CHISELED_FOREST, - CHISELED_PLAINS, - CHISELED_MOUNTAIN, - CHISELED_FUNGAL, - CHISELED_SWAMP, - CHISELED_DESERT, - CHISELED_TAIGA, - CHISELED_MESA; + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + CHISELED_FOREST, + CHISELED_PLAINS, + CHISELED_MOUNTAIN, + CHISELED_FUNGAL, + CHISELED_SWAMP, + CHISELED_DESERT, + CHISELED_TAIGA, + CHISELED_MESA; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java b/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java index 64d535329..946e8fee0 100644 --- a/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,26 +13,26 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum BiomeStoneVariant implements IStringSerializable { - FOREST, - PLAINS, - MOUNTAIN, - FUNGAL, - SWAMP, - DESERT, - TAIGA, - MESA, - FOREST_COBBLE, - PLAINS_COBBLE, - MOUNTAIN_COBBLE, - FUNGAL_COBBLE, - SWAMP_COBBLE, - DESERT_COBBLE, - TAIGA_COBBLE, - MESA_COBBLE; + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + FOREST_COBBLE, + PLAINS_COBBLE, + MOUNTAIN_COBBLE, + FUNGAL_COBBLE, + SWAMP_COBBLE, + DESERT_COBBLE, + TAIGA_COBBLE, + MESA_COBBLE; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/CratePattern.java b/src/main/java/vazkii/botania/api/state/enums/CratePattern.java index 2cbf2a8f8..653a29776 100644 --- a/src/main/java/vazkii/botania/api/state/enums/CratePattern.java +++ b/src/main/java/vazkii/botania/api/state/enums/CratePattern.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,19 +13,19 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum CratePattern implements IStringSerializable { - NONE, - CRAFTY_1_1, - CRAFTY_2_2, - CRAFTY_1_2, - CRAFTY_2_1, - CRAFTY_1_3, - CRAFTY_3_1, - CRAFTY_2_3, - CRAFTY_3_2, - CRAFTY_DONUT; + NONE, + CRAFTY_1_1, + CRAFTY_2_2, + CRAFTY_1_2, + CRAFTY_2_1, + CRAFTY_1_3, + CRAFTY_3_1, + CRAFTY_2_3, + CRAFTY_3_2, + CRAFTY_DONUT; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java b/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java index 1cf832200..ba2fa8784 100644 --- a/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,12 +13,12 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum CrateVariant implements IStringSerializable { - OPEN, - CRAFTY; + OPEN, + CRAFTY; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java b/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java index 1576e4c73..182a4c019 100644 --- a/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,26 +13,26 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum CustomBrickVariant implements IStringSerializable { - HELLISH_BRICK, - SOUL_BRICK, - FROSTY_BRICK, - ROOF_TILE, - AZULEJO_1, - AZULEJO_2, - AZULEJO_3, - AZULEJO_4, - AZULEJO_5, - AZULEJO_6, - AZULEJO_7, - AZULEJO_8, - AZULEJO_9, - AZULEJO_10, - AZULEJO_11, - AZULEJO_12; + HELLISH_BRICK, + SOUL_BRICK, + FROSTY_BRICK, + ROOF_TILE, + AZULEJO_1, + AZULEJO_2, + AZULEJO_3, + AZULEJO_4, + AZULEJO_5, + AZULEJO_6, + AZULEJO_7, + AZULEJO_8, + AZULEJO_9, + AZULEJO_10, + AZULEJO_11, + AZULEJO_12; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java b/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java index 56ea59434..50d954002 100644 --- a/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,13 +13,13 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum DrumVariant implements IStringSerializable { - WILD, - GATHERING, - CANOPY; + WILD, + GATHERING, + CANOPY; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/EndBrickVariant.java b/src/main/java/vazkii/botania/api/state/enums/EndBrickVariant.java index d11fe84be..bbec78401 100644 --- a/src/main/java/vazkii/botania/api/state/enums/EndBrickVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/EndBrickVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,14 +13,14 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum EndBrickVariant implements IStringSerializable { - END_STONE_BRICKS, - CHISELED_END_STONE_BRICKS, - ENDER_BRICKS, - PILLAR_ENDER_BRICKS; + END_STONE_BRICKS, + CHISELED_END_STONE_BRICKS, + ENDER_BRICKS, + PILLAR_ENDER_BRICKS; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/FutureStoneVariant.java b/src/main/java/vazkii/botania/api/state/enums/FutureStoneVariant.java index 6856734a9..079c7aeef 100644 --- a/src/main/java/vazkii/botania/api/state/enums/FutureStoneVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/FutureStoneVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,26 +13,26 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum FutureStoneVariant implements IStringSerializable { - ANDESITE, - BASALT, - DIORITE, - GRANITE, - POLISHED_ANDESITE, - POLISHED_BASALT, - POLISHED_DIORITE, - POLISHED_GRANITE, - ANDESITE_BRICK, - BASALT_BRICK, - DIORITE_BRICK, - GRANITE_BRICK, - CHISELED_ANDESITE, - CHISELED_BASALT, - CHISELED_DIORITE, - CHISELED_GRANITE; + ANDESITE, + BASALT, + DIORITE, + GRANITE, + POLISHED_ANDESITE, + POLISHED_BASALT, + POLISHED_DIORITE, + POLISHED_GRANITE, + ANDESITE_BRICK, + BASALT_BRICK, + DIORITE_BRICK, + GRANITE_BRICK, + CHISELED_ANDESITE, + CHISELED_BASALT, + CHISELED_DIORITE, + CHISELED_GRANITE; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java b/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java index 51030e40a..bd28a9730 100644 --- a/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,15 +13,15 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum LivingRockVariant implements IStringSerializable { - DEFAULT, - BRICK, - MOSSY_BRICK, - CRACKED_BRICK, - CHISELED_BRICK; + DEFAULT, + BRICK, + MOSSY_BRICK, + CRACKED_BRICK, + CHISELED_BRICK; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java b/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java index 0c84b36e5..e9d27c2f1 100644 --- a/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,16 +13,16 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum LivingWoodVariant implements IStringSerializable { - DEFAULT, - PLANKS, - MOSSY_PLANKS, - FRAMED, - PATTERN_FRAMED, - GLIMMERING; + DEFAULT, + PLANKS, + MOSSY_PLANKS, + FRAMED, + PATTERN_FRAMED, + GLIMMERING; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java b/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java index 08b89d741..26b74ee8f 100644 --- a/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,12 +13,12 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum LuminizerVariant implements IStringSerializable { - DEFAULT, - DETECTOR; + DEFAULT, + DETECTOR; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java b/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java index 572b22e49..37c2e64db 100644 --- a/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,13 +13,13 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum PlatformVariant implements IStringSerializable { - ABSTRUSE, - SPECTRAL, - INFRANGIBLE; + ABSTRUSE, + SPECTRAL, + INFRANGIBLE; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java b/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java index e57d8b373..fe2a2e702 100644 --- a/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,14 +13,14 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum PoolVariant implements IStringSerializable { - DEFAULT, - CREATIVE, - DILUTED, - FABULOUS; + DEFAULT, + CREATIVE, + DILUTED, + FABULOUS; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/PrismarineVariant.java b/src/main/java/vazkii/botania/api/state/enums/PrismarineVariant.java index 6e37065d7..15eb2e77a 100644 --- a/src/main/java/vazkii/botania/api/state/enums/PrismarineVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/PrismarineVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,13 +13,13 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum PrismarineVariant implements IStringSerializable { - PRISMARINE, - PRISMARINE_BRICKS, - DARK_PRISMARINE; + PRISMARINE, + PRISMARINE_BRICKS, + DARK_PRISMARINE; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java b/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java index ed431c756..3a4ed9f09 100644 --- a/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,13 +13,13 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum PylonVariant implements IStringSerializable { - MANA, - NATURA, - GAIA; + MANA, + NATURA, + GAIA; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java b/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java index 6d3767ec3..3bb9a1ea2 100644 --- a/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,15 +13,15 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum QuartzVariant implements IStringSerializable { - NORMAL, - CHISELED, - PILLAR_Y, - PILLAR_X, - PILLAR_Z; + NORMAL, + CHISELED, + PILLAR_Y, + PILLAR_X, + PILLAR_Z; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java b/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java index fbae11307..3794b113f 100644 --- a/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,14 +13,14 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum SpreaderVariant implements IStringSerializable { - MANA, - REDSTONE, - ELVEN, - GAIA; + MANA, + REDSTONE, + ELVEN, + GAIA; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java b/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java index 23f5efb7c..6626730d4 100644 --- a/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java +++ b/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -13,15 +13,15 @@ import net.minecraft.util.IStringSerializable; import java.util.Locale; public enum StorageVariant implements IStringSerializable { - MANASTEEL, - TERRASTEEL, - ELEMENTIUM, - MANA_DIAMOND, - DRAGONSTONE; + MANASTEEL, + TERRASTEEL, + ELEMENTIUM, + MANA_DIAMOND, + DRAGONSTONE; - @Override - public String getName() { - return name().toLowerCase(Locale.ROOT); - } + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java b/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java index c9036d989..4d999a48f 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java +++ b/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -31,50 +31,52 @@ import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeHandler; @JEIPlugin public class JEIBotaniaPlugin implements IModPlugin { - private IJeiHelpers jeiHelpers; + private IJeiHelpers jeiHelpers; - @Override - public boolean isModLoaded() { - return true; - } + @Override + public boolean isModLoaded() { + return true; + } - @Override - public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) { - this.jeiHelpers = jeiHelpers; - } + @Override + public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) { + this.jeiHelpers = jeiHelpers; + } - @Override - public void onItemRegistryAvailable(IItemRegistry itemRegistry) {} + @Override + public void onItemRegistryAvailable(IItemRegistry itemRegistry) { + } - @Override - public void register(IModRegistry registry) { - registry.addRecipeCategories( - new BreweryRecipeCategory(jeiHelpers.getGuiHelper()), - new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()), - new PetalApothecaryRecipeCategory(jeiHelpers.getGuiHelper()), - new ElvenTradeRecipeCategory(jeiHelpers.getGuiHelper()), - new RunicAltarRecipeCategory(jeiHelpers.getGuiHelper()), - new ManaPoolRecipeCategory(jeiHelpers.getGuiHelper()) - ); + @Override + public void register(IModRegistry registry) { + registry.addRecipeCategories( + new BreweryRecipeCategory(jeiHelpers.getGuiHelper()), + new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()), + new PetalApothecaryRecipeCategory(jeiHelpers.getGuiHelper()), + new ElvenTradeRecipeCategory(jeiHelpers.getGuiHelper()), + new RunicAltarRecipeCategory(jeiHelpers.getGuiHelper()), + new ManaPoolRecipeCategory(jeiHelpers.getGuiHelper()) + ); - registry.addRecipeHandlers( - new BreweryRecipeHandler(), - new PureDaisyRecipeHandler(), - new PetalApothecaryRecipeHandler(), - new ElvenTradeRecipeHandler(), - new RunicAltarRecipeHandler(), - new ManaPoolRecipeHandler() - ); + registry.addRecipeHandlers( + new BreweryRecipeHandler(), + new PureDaisyRecipeHandler(), + new PetalApothecaryRecipeHandler(), + new ElvenTradeRecipeHandler(), + new RunicAltarRecipeHandler(), + new ManaPoolRecipeHandler() + ); - registry.addRecipes(BotaniaAPI.brewRecipes); - registry.addRecipes(BotaniaAPI.pureDaisyRecipes); - registry.addRecipes(BotaniaAPI.petalRecipes); - registry.addRecipes(BotaniaAPI.elvenTradeRecipes); - registry.addRecipes(BotaniaAPI.runeAltarRecipes); - registry.addRecipes(BotaniaAPI.manaInfusionRecipes); - } + registry.addRecipes(BotaniaAPI.brewRecipes); + registry.addRecipes(BotaniaAPI.pureDaisyRecipes); + registry.addRecipes(BotaniaAPI.petalRecipes); + registry.addRecipes(BotaniaAPI.elvenTradeRecipes); + registry.addRecipes(BotaniaAPI.runeAltarRecipes); + registry.addRecipes(BotaniaAPI.manaInfusionRecipes); + } - @Override - public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {} + @Override + public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java index ab8edf75e..4a39cead6 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import vazkii.botania.common.item.ModItems; import javax.annotation.Nonnull; import java.util.Collection; @@ -26,69 +25,71 @@ import java.util.List; public class BreweryRecipeCategory implements IRecipeCategory { - private final IDrawableStatic background; - private final String localizedName; + private final IDrawableStatic background; + private final String localizedName; - public BreweryRecipeCategory(IGuiHelper guiHelper) { - ResourceLocation location = new ResourceLocation("botania", "textures/gui/neiBrewery.png"); - background = guiHelper.createDrawable(location, 0, 0, 166, 65, 0, 0, 0, 0); - localizedName = StatCollector.translateToLocal("botania.nei.brewery"); - } + public BreweryRecipeCategory(IGuiHelper guiHelper) { + ResourceLocation location = new ResourceLocation("botania", "textures/gui/neiBrewery.png"); + background = guiHelper.createDrawable(location, 0, 0, 166, 65, 0, 0, 0, 0); + localizedName = StatCollector.translateToLocal("botania.nei.brewery"); + } - @Nonnull - @Override - public String getUid() { - return "botania.brewery"; - } + @Nonnull + @Override + public String getUid() { + return "botania.brewery"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) {} + @Override + public void drawExtras(Minecraft minecraft) { + } - @Override - public void drawAnimations(Minecraft minecraft) {} + @Override + public void drawAnimations(Minecraft minecraft) { + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof BreweryRecipeWrapper)) - return; - BreweryRecipeWrapper wrapper = ((BreweryRecipeWrapper) recipeWrapper); + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof BreweryRecipeWrapper)) + return; + BreweryRecipeWrapper wrapper = ((BreweryRecipeWrapper) recipeWrapper); - List inputs = wrapper.getInputs(); + List inputs = wrapper.getInputs(); - recipeLayout.getItemStacks().init(0, true, 39, 41); - if (inputs.get(0) instanceof ItemStack) { - recipeLayout.getItemStacks().set(0, ((ItemStack) inputs.get(0))); - } else { - recipeLayout.getItemStacks().set(0, ((Collection) inputs.get(0))); - } + recipeLayout.getItemStacks().init(0, true, 39, 41); + if(inputs.get(0) instanceof ItemStack) { + recipeLayout.getItemStacks().set(0, ((ItemStack) inputs.get(0))); + } else { + recipeLayout.getItemStacks().set(0, ((Collection) inputs.get(0))); + } - int index = 1, posX = 60; - for (int i = 1; i < wrapper.getInputs().size(); i++) { - Object o = wrapper.getInputs().get(i); - recipeLayout.getItemStacks().init(index, true, posX, 6); - if (o instanceof ItemStack) { - recipeLayout.getItemStacks().set(index, ((ItemStack) o)); - } else if (o instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) o)); - } - index++; - posX += 18; - } + int index = 1, posX = 60; + for(int i = 1; i < wrapper.getInputs().size(); i++) { + Object o = wrapper.getInputs().get(i); + recipeLayout.getItemStacks().init(index, true, posX, 6); + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } else if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + index++; + posX += 18; + } - recipeLayout.getItemStacks().init(7, false, 87, 41); - recipeLayout.getItemStacks().set(7, wrapper.getOutputs()); - } + recipeLayout.getItemStacks().init(7, false, 87, 41); + recipeLayout.getItemStacks().set(7, wrapper.getOutputs()); + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java index 275cdbccd..fdd5a08f6 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class BreweryRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipeBrew.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeBrew.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.brewery"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.brewery"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeBrew recipe) { - return new BreweryRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeBrew recipe) { + return new BreweryRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipeBrew recipe) { - return recipe.getInputs().size() <= 6; - } + @Override + public boolean isRecipeValid(@Nonnull RecipeBrew recipe) { + return recipe.getInputs().size() <= 6; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java index 305784d57..66aea0384 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -22,45 +22,51 @@ import java.util.List; public class BreweryRecipeWrapper implements IRecipeWrapper { - private final List input; - private final List output; + private final List input; + private final List output; - public BreweryRecipeWrapper(RecipeBrew recipeBrew) { - ImmutableList.Builder builder = ImmutableList.builder(); - builder.add(ImmutableList.of(new ItemStack(ModItems.vial, 1, 0), new ItemStack(ModItems.vial, 1, 1))); - for (Object o : recipeBrew.getInputs()) { - if (o instanceof ItemStack) { - builder.add(o); - } - if (o instanceof String) { - builder.add(OreDictionary.getOres(((String) o))); - } - } + public BreweryRecipeWrapper(RecipeBrew recipeBrew) { + ImmutableList.Builder builder = ImmutableList.builder(); + builder.add(ImmutableList.of(new ItemStack(ModItems.vial, 1, 0), new ItemStack(ModItems.vial, 1, 1))); + for(Object o : recipeBrew.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } - input = builder.build(); - output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.vial, 1, 1)).copy()); - } + input = builder.build(); + output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.vial, 1, 1)).copy()); + } - @Override - public List getInputs() { - return input; - } + @Override + public List getInputs() { + return input; + } - @Override - public List getOutputs() { - return output; - } + @Override + public List getOutputs() { + return output; + } - @Override - public List getFluidInputs() { return ImmutableList.of(); } + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } - @Override - public List getFluidOutputs() { return ImmutableList.of(); } + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java index 121b6bc3a..d9c6b92c6 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -31,81 +31,81 @@ import java.util.Collection; public class ElvenTradeRecipeCategory implements IRecipeCategory { - private final String localizedName; - private final IDrawable background; - private final IDrawable overlay; + private final String localizedName; + private final IDrawable background; + private final IDrawable overlay; - public ElvenTradeRecipeCategory(IGuiHelper guiHelper) { - localizedName = StatCollector.translateToLocal("botania.nei.elvenTrade"); - background = guiHelper.createBlankDrawable(145, 95); - overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/elvenTradeOverlay.png"), 0, 15, 140, 90); - } + public ElvenTradeRecipeCategory(IGuiHelper guiHelper) { + localizedName = StatCollector.translateToLocal("botania.nei.elvenTrade"); + background = guiHelper.createBlankDrawable(145, 95); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/elvenTradeOverlay.png"), 0, 15, 140, 90); + } - @Nonnull - @Override - public String getUid() { - return "botania.elvenTrade"; - } + @Nonnull + @Override + public String getUid() { + return "botania.elvenTrade"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) { - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - overlay.draw(minecraft, 0, 4); - GlStateManager.disableBlend(); - GlStateManager.disableAlpha(); - } + @Override + public void drawExtras(Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 0, 4); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(Minecraft minecraft) { - minecraft.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex; - Tessellator tess = Tessellator.getInstance(); - WorldRenderer wr = tess.getWorldRenderer(); - wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); - int startX = 22; - int startY = 25; - int stopX = 70; - int stopY = 73; - wr.pos(startX, startY, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex(); - wr.pos(startX, stopY, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex(); - wr.pos(stopX, stopY, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex(); - wr.pos(stopX, startY, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex(); - tess.draw(); - } + @Override + public void drawAnimations(Minecraft minecraft) { + minecraft.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex; + Tessellator tess = Tessellator.getInstance(); + WorldRenderer wr = tess.getWorldRenderer(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + int startX = 22; + int startY = 25; + int stopX = 70; + int stopY = 73; + wr.pos(startX, startY, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex(); + wr.pos(startX, stopY, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex(); + wr.pos(stopX, stopY, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex(); + wr.pos(stopX, startY, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex(); + tess.draw(); + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof ElvenTradeRecipeWrapper)) - return; - ElvenTradeRecipeWrapper wrapper = ((ElvenTradeRecipeWrapper) recipeWrapper); + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof ElvenTradeRecipeWrapper)) + return; + ElvenTradeRecipeWrapper wrapper = ((ElvenTradeRecipeWrapper) recipeWrapper); - int index = 0, posX = 42; - for (Object o : wrapper.getInputs()) { - recipeLayout.getItemStacks().init(index, true, posX, 0); - if (o instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) o)); - } else { - recipeLayout.getItemStacks().set(index, ((ItemStack) o)); - } - index++; - posX += 18; - } + int index = 0, posX = 42; + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, posX, 0); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index++; + posX += 18; + } - recipeLayout.getItemStacks().init(index, false, 93, 41); - recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); - } + recipeLayout.getItemStacks().init(index, false, 93, 41); + recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java index fdf313f76..e80a550af 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class ElvenTradeRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipeElvenTrade.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeElvenTrade.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.elvenTrade"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.elvenTrade"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeElvenTrade recipe) { - return new ElvenTradeRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeElvenTrade recipe) { + return new ElvenTradeRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipeElvenTrade recipe) { - return true; - } + @Override + public boolean isRecipeValid(@Nonnull RecipeElvenTrade recipe) { + return true; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java index 7e0e42572..5c6a99ce3 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -21,47 +21,49 @@ import java.util.List; public class ElvenTradeRecipeWrapper implements IRecipeWrapper { - private final List input; - private final ItemStack output; + private final List input; + private final ItemStack output; - public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) { - ImmutableList.Builder builder = ImmutableList.builder(); - for (Object o : recipe.getInputs()) { - if (o instanceof ItemStack) { - builder.add(o); - } - if (o instanceof String) { - builder.add(OreDictionary.getOres(((String) o))); - } - } - input = builder.build(); - output = recipe.getOutput(); - } + public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + output = recipe.getOutput(); + } - @Override - public List getInputs() { - return input; - } + @Override + public List getInputs() { + return input; + } - @Override - public List getOutputs() { - return ImmutableList.of(output); - } + @Override + public List getOutputs() { + return ImmutableList.of(output); + } - @Override - public List getFluidInputs() { - return ImmutableList.of(); - } + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } - @Override - public List getFluidOutputs() { - return ImmutableList.of(); - } + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java index 510ad9691..17eaaa989 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -25,81 +25,82 @@ import java.util.Collection; public class ManaPoolRecipeCategory implements IRecipeCategory { - private final IDrawable background; - private final String localizedName; - private final IDrawable overlay; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; - public ManaPoolRecipeCategory(IGuiHelper guiHelper) { - background = guiHelper.createBlankDrawable(168, 64); - localizedName = StatCollector.translateToLocal("botania.nei.manaPool"); - overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), - 0, 0, 64, 46); - } + public ManaPoolRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(168, 64); + localizedName = StatCollector.translateToLocal("botania.nei.manaPool"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), + 0, 0, 64, 46); + } - @Nonnull - @Override - public String getUid() { - return "botania.manaPool"; - } + @Nonnull + @Override + public String getUid() { + return "botania.manaPool"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) { - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - overlay.draw(minecraft, 48, 0); - GlStateManager.disableBlend(); - GlStateManager.disableAlpha(); - } + @Override + public void drawExtras(Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 48, 0); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(Minecraft minecraft) {} + @Override + public void drawAnimations(Minecraft minecraft) { + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof ManaPoolRecipeWrapper)) - return; + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof ManaPoolRecipeWrapper)) + return; - ManaPoolRecipeWrapper wrapper = ((ManaPoolRecipeWrapper) recipeWrapper); - int index = 0; + ManaPoolRecipeWrapper wrapper = ((ManaPoolRecipeWrapper) recipeWrapper); + int index = 0; - recipeLayout.getItemStacks().init(index, true, 40, 12); - if (wrapper.getInputs().get(0) instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getInputs().get(0))); - } else { - recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(0))); - } + recipeLayout.getItemStacks().init(index, true, 40, 12); + if(wrapper.getInputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getInputs().get(0))); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(0))); + } - index++; + index++; - if (wrapper.getInputs().size() > 1) { - // Has catalyst - recipeLayout.getItemStacks().init(index, true, 20, 12); - recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(1))); - index++; - } + if(wrapper.getInputs().size() > 1) { + // Has catalyst + recipeLayout.getItemStacks().init(index, true, 20, 12); + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(1))); + index++; + } - recipeLayout.getItemStacks().init(index, true, 70, 12); - recipeLayout.getItemStacks().set(index, new ItemStack(ModBlocks.pool, 1, 0)); - index++; + recipeLayout.getItemStacks().init(index, true, 70, 12); + recipeLayout.getItemStacks().set(index, new ItemStack(ModBlocks.pool, 1, 0)); + index++; - recipeLayout.getItemStacks().init(index, false, 99, 12); - if (wrapper.getOutputs().get(0) instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getOutputs().get(0))); - } else { - recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0))); - } - } + recipeLayout.getItemStacks().init(index, false, 99, 12); + if(wrapper.getOutputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getOutputs().get(0))); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0))); + } + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java index c20595b00..8dc1eed45 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class ManaPoolRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipeManaInfusion.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeManaInfusion.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.manaPool"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.manaPool"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeManaInfusion recipe) { - return new ManaPoolRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeManaInfusion recipe) { + return new ManaPoolRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipeManaInfusion recipe) { - return recipe.getManaToConsume() <= 100000; - } + @Override + public boolean isRecipeValid(@Nonnull RecipeManaInfusion recipe) { + return recipe.getManaToConsume() <= 100000; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java index ad6bc4d92..b36f4929b 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -25,58 +25,59 @@ import java.util.List; public class ManaPoolRecipeWrapper implements IRecipeWrapper { - private final List input; - private final ItemStack output; - private final int mana; + private final List input; + private final ItemStack output; + private final int mana; - public ManaPoolRecipeWrapper(RecipeManaInfusion recipe) { - ImmutableList.Builder builder = ImmutableList.builder(); + public ManaPoolRecipeWrapper(RecipeManaInfusion recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); - if (recipe.getInput() instanceof ItemStack) { - builder.add(recipe.getInput()); - } else if (recipe.getInput() instanceof String) { - builder.add(OreDictionary.getOres(((String) recipe.getInput()))); - } + if(recipe.getInput() instanceof ItemStack) { + builder.add(recipe.getInput()); + } else if(recipe.getInput() instanceof String) { + builder.add(OreDictionary.getOres(((String) recipe.getInput()))); + } - if (recipe.isAlchemy()) { - builder.add(new ItemStack(ModBlocks.alchemyCatalyst)); - } else if (recipe.isConjuration()) { - builder.add(new ItemStack(ModBlocks.conjurationCatalyst)); - } + if(recipe.isAlchemy()) { + builder.add(new ItemStack(ModBlocks.alchemyCatalyst)); + } else if(recipe.isConjuration()) { + builder.add(new ItemStack(ModBlocks.conjurationCatalyst)); + } - input = builder.build(); - output = recipe.getOutput(); - mana = recipe.getManaToConsume(); - } + input = builder.build(); + output = recipe.getOutput(); + mana = recipe.getManaToConsume(); + } - @Override - public List getInputs() { - return input; - } + @Override + public List getInputs() { + return input; + } - @Override - public List getOutputs() { - return ImmutableList.of(output); - } + @Override + public List getOutputs() { + return ImmutableList.of(output); + } - @Override - public List getFluidInputs() { - return ImmutableList.of(); - } + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } - @Override - public List getFluidOutputs() { - return ImmutableList.of(); - } + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { - GlStateManager.enableAlpha(); - HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, mana, TilePool.MAX_MANA / 10); - GlStateManager.disableAlpha(); - } + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + GlStateManager.enableAlpha(); + HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, mana, TilePool.MAX_MANA / 10); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java index 61e54d303..ebd012818 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -27,81 +27,82 @@ import java.util.Collection; public class PetalApothecaryRecipeCategory implements IRecipeCategory { - private final IDrawableStatic background; - private final String localizedName; - private final IDrawableStatic overlay; + private final IDrawableStatic background; + private final String localizedName; + private final IDrawableStatic overlay; - public PetalApothecaryRecipeCategory(IGuiHelper guiHelper) { - background = guiHelper.createBlankDrawable(150, 110); - localizedName = StatCollector.translateToLocal("botania.nei.petalApothecary"); - overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), - 0, 0, 150, 110); - } + public PetalApothecaryRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(150, 110); + localizedName = StatCollector.translateToLocal("botania.nei.petalApothecary"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), + 0, 0, 150, 110); + } - @Nonnull - @Override - public String getUid() { - return "botania.petals"; - } + @Nonnull + @Override + public String getUid() { + return "botania.petals"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) { - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - overlay.draw(minecraft); - GlStateManager.disableBlend(); - GlStateManager.disableAlpha(); - } + @Override + public void drawExtras(Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(Minecraft minecraft) {} + @Override + public void drawAnimations(Minecraft minecraft) { + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof PetalApothecaryRecipeWrapper)) - return; - PetalApothecaryRecipeWrapper wrapper = ((PetalApothecaryRecipeWrapper) recipeWrapper); + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof PetalApothecaryRecipeWrapper)) + return; + PetalApothecaryRecipeWrapper wrapper = ((PetalApothecaryRecipeWrapper) recipeWrapper); - recipeLayout.getItemStacks().init(0, true, 64, 52); - recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.altar)); + recipeLayout.getItemStacks().init(0, true, 64, 52); + recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.altar)); - int index = 1; - double angleBetweenEach = 360.0 / wrapper.getInputs().size(); - Point point = new Point(64, 20), center = new Point(64, 52); + int index = 1; + double angleBetweenEach = 360.0 / wrapper.getInputs().size(); + Point point = new Point(64, 20), center = new Point(64, 52); - for (Object o : wrapper.getInputs()) { - recipeLayout.getItemStacks().init(index, true, point.x, point.y); - if (o instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) o)); - } - if (o instanceof ItemStack) { - recipeLayout.getItemStacks().set(index, ((ItemStack) o)); - } - index += 1; - point = rotatePointAbout(point, center, angleBetweenEach); - } + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, point.x, point.y); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index += 1; + point = rotatePointAbout(point, center, angleBetweenEach); + } - recipeLayout.getItemStacks().init(index, false, 103, 17); - recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); - } + recipeLayout.getItemStacks().init(index, false, 103, 17); + recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); + } - private Point rotatePointAbout(Point in, Point about, double degrees) { - double rad = degrees * Math.PI / 180.0; - double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; - double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; - return new Point(((int) newX), ((int) newY)); - } + private Point rotatePointAbout(Point in, Point about, double degrees) { + double rad = degrees * Math.PI / 180.0; + double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; + double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; + return new Point(((int) newX), ((int) newY)); + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java index 365e81ff2..9c462db79 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class PetalApothecaryRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipePetals.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipePetals.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.petals"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.petals"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePetals recipe) { - return new PetalApothecaryRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePetals recipe) { + return new PetalApothecaryRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipePetals recipe) { - return recipe.getInputs().size() <= 16; - } + @Override + public boolean isRecipeValid(@Nonnull RecipePetals recipe) { + return recipe.getInputs().size() <= 16; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java index 2db1ab24c..9104b69ec 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -21,47 +21,49 @@ import java.util.List; public class PetalApothecaryRecipeWrapper implements IRecipeWrapper { - private final List input; - private final ItemStack output; + private final List input; + private final ItemStack output; - public PetalApothecaryRecipeWrapper(RecipePetals recipe) { - ImmutableList.Builder builder = ImmutableList.builder(); - for (Object o : recipe.getInputs()) { - if (o instanceof ItemStack) { - builder.add(o); - } - if (o instanceof String) { - builder.add(OreDictionary.getOres(((String) o))); - } - } - input = builder.build(); - output = recipe.getOutput(); - } + public PetalApothecaryRecipeWrapper(RecipePetals recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + output = recipe.getOutput(); + } - @Override - public List getInputs() { - return input; - } + @Override + public List getInputs() { + return input; + } - @Override - public List getOutputs() { - return ImmutableList.of(output); - } + @Override + public List getOutputs() { + return ImmutableList.of(output); + } - @Override - public List getFluidInputs() { - return ImmutableList.of(); - } + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } - @Override - public List getFluidOutputs() { - return ImmutableList.of(); - } + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java index e38084158..84140ac3b 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -26,83 +26,84 @@ import java.util.Collection; public class PureDaisyRecipeCategory implements IRecipeCategory { - private final IDrawable background; - private final String localizedName; - private final IDrawable overlay; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; - public PureDaisyRecipeCategory(IGuiHelper guiHelper) { - background = guiHelper.createBlankDrawable(168, 64); - localizedName = StatCollector.translateToLocal("botania.nei.pureDaisy"); - overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), - 0, 0, 64, 46); - } + public PureDaisyRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(168, 64); + localizedName = StatCollector.translateToLocal("botania.nei.pureDaisy"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), + 0, 0, 64, 46); + } - @Nonnull - @Override - public String getUid() { - return "botania.pureDaisy"; - } + @Nonnull + @Override + public String getUid() { + return "botania.pureDaisy"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) { - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - overlay.draw(minecraft, 48, 0); - GlStateManager.disableBlend(); - GlStateManager.disableAlpha(); - } + @Override + public void drawExtras(Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 48, 0); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(Minecraft minecraft) {} + @Override + public void drawAnimations(Minecraft minecraft) { + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof PureDaisyRecipeWrapper)) - return; + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof PureDaisyRecipeWrapper)) + return; - PureDaisyRecipeWrapper wrapper = ((PureDaisyRecipeWrapper) recipeWrapper); - boolean inputFluid = wrapper.getInputs().isEmpty(); - boolean outputFluid = wrapper.getOutputs().isEmpty(); + PureDaisyRecipeWrapper wrapper = ((PureDaisyRecipeWrapper) recipeWrapper); + boolean inputFluid = wrapper.getInputs().isEmpty(); + boolean outputFluid = wrapper.getOutputs().isEmpty(); - if (inputFluid) { - recipeLayout.getFluidStacks().init(0, true, 40, 12, 16, 16, 1000, false, null); - recipeLayout.getFluidStacks().set(0, wrapper.getFluidInputs().get(0)); - } else { - recipeLayout.getItemStacks().init(0, true, 40, 12); - if (wrapper.getInputs().get(0) instanceof Collection) { - recipeLayout.getItemStacks().set(0, ((Collection) wrapper.getInputs().get(0))); - } else { - recipeLayout.getItemStacks().set(0, ((ItemStack) wrapper.getInputs().get(0))); - } - } + if(inputFluid) { + recipeLayout.getFluidStacks().init(0, true, 40, 12, 16, 16, 1000, false, null); + recipeLayout.getFluidStacks().set(0, wrapper.getFluidInputs().get(0)); + } else { + recipeLayout.getItemStacks().init(0, true, 40, 12); + if(wrapper.getInputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(0, ((Collection) wrapper.getInputs().get(0))); + } else { + recipeLayout.getItemStacks().set(0, ((ItemStack) wrapper.getInputs().get(0))); + } + } - recipeLayout.getItemStacks().init(1, true, 70, 12); - recipeLayout.getItemStacks().set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY)); + recipeLayout.getItemStacks().init(1, true, 70, 12); + recipeLayout.getItemStacks().set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY)); - if (outputFluid) { - recipeLayout.getFluidStacks().init(2, false, 99, 12, 16, 16, 1000, false, null); - recipeLayout.getFluidStacks().set(2, wrapper.getFluidOutputs().get(0)); - } else { - recipeLayout.getItemStacks().init(2, false, 99, 12); - if (wrapper.getOutputs().get(0) instanceof Collection) { - recipeLayout.getItemStacks().set(2, ((Collection) wrapper.getOutputs().get(0))); - } else { - recipeLayout.getItemStacks().set(2, ((ItemStack) wrapper.getOutputs().get(0))); - } - } - } + if(outputFluid) { + recipeLayout.getFluidStacks().init(2, false, 99, 12, 16, 16, 1000, false, null); + recipeLayout.getFluidStacks().set(2, wrapper.getFluidOutputs().get(0)); + } else { + recipeLayout.getItemStacks().init(2, false, 99, 12); + if(wrapper.getOutputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(2, ((Collection) wrapper.getOutputs().get(0))); + } else { + recipeLayout.getItemStacks().set(2, ((ItemStack) wrapper.getOutputs().get(0))); + } + } + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java index 5d5ada961..200912976 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class PureDaisyRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipePureDaisy.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipePureDaisy.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.pureDaisy"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.pureDaisy"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePureDaisy recipe) { - return new PureDaisyRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePureDaisy recipe) { + return new PureDaisyRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipePureDaisy recipe) { - return true; - } + @Override + public boolean isRecipeValid(@Nonnull RecipePureDaisy recipe) { + return true; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java index 311722c28..1666d0cde 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -23,55 +23,57 @@ import java.util.List; public class PureDaisyRecipeWrapper implements IRecipeWrapper { - private List inputs = ImmutableList.of(); - private List outputs = ImmutableList.of(); - private List fluidInputs = ImmutableList.of(); - private List fluidOutputs = ImmutableList.of(); + private List inputs = ImmutableList.of(); + private List outputs = ImmutableList.of(); + private List fluidInputs = ImmutableList.of(); + private List fluidOutputs = ImmutableList.of(); - public PureDaisyRecipeWrapper(RecipePureDaisy recipe) { - if (recipe.getInput() instanceof String) { - inputs = ImmutableList.of(OreDictionary.getOres(((String) recipe.getInput()))); - } else if (recipe.getInput() instanceof Block) { - Block b = ((Block) recipe.getInput()); - if (FluidRegistry.lookupFluidForBlock(b) != null) { - fluidInputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(b), 1000)); - } else { - inputs = ImmutableList.of(new ItemStack(b, 1, b.getMetaFromState(b.getDefaultState()))); - } - } + public PureDaisyRecipeWrapper(RecipePureDaisy recipe) { + if(recipe.getInput() instanceof String) { + inputs = ImmutableList.of(OreDictionary.getOres(((String) recipe.getInput()))); + } else if(recipe.getInput() instanceof Block) { + Block b = ((Block) recipe.getInput()); + if(FluidRegistry.lookupFluidForBlock(b) != null) { + fluidInputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(b), 1000)); + } else { + inputs = ImmutableList.of(new ItemStack(b, 1, b.getMetaFromState(b.getDefaultState()))); + } + } - Block outBlock = recipe.getOutputState().getBlock(); - if (FluidRegistry.lookupFluidForBlock(outBlock) != null) { - fluidOutputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(outBlock), 1000)); - } else { - outputs = ImmutableList.of(new ItemStack(outBlock, 1, outBlock.getMetaFromState(recipe.getOutputState()))); - } - } + Block outBlock = recipe.getOutputState().getBlock(); + if(FluidRegistry.lookupFluidForBlock(outBlock) != null) { + fluidOutputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(outBlock), 1000)); + } else { + outputs = ImmutableList.of(new ItemStack(outBlock, 1, outBlock.getMetaFromState(recipe.getOutputState()))); + } + } - @Override - public List getInputs() { - return inputs; - } + @Override + public List getInputs() { + return inputs; + } - @Override - public List getOutputs() { - return outputs; - } + @Override + public List getOutputs() { + return outputs; + } - @Override - public List getFluidInputs() { - return fluidInputs; - } + @Override + public List getFluidInputs() { + return fluidInputs; + } - @Override - public List getFluidOutputs() { - return fluidOutputs; - } + @Override + public List getFluidOutputs() { + return fluidOutputs; + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java index 3a4a3937f..f65f9f03f 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -26,81 +26,82 @@ import java.util.Collection; public class RunicAltarRecipeCategory implements IRecipeCategory { - private final IDrawable background; - private final String localizedName; - private final IDrawable overlay; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; - public RunicAltarRecipeCategory(IGuiHelper guiHelper) { - background = guiHelper.createBlankDrawable(150, 110); - localizedName = StatCollector.translateToLocal("botania.nei.runicAltar"); - overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), - 0, 0, 150, 110); - } + public RunicAltarRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(150, 110); + localizedName = StatCollector.translateToLocal("botania.nei.runicAltar"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), + 0, 0, 150, 110); + } - @Nonnull - @Override - public String getUid() { - return "botania.runicAltar"; - } + @Nonnull + @Override + public String getUid() { + return "botania.runicAltar"; + } - @Nonnull - @Override - public String getTitle() { - return localizedName; - } + @Nonnull + @Override + public String getTitle() { + return localizedName; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } - @Override - public void drawExtras(Minecraft minecraft) { - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - overlay.draw(minecraft); - GlStateManager.disableBlend(); - GlStateManager.disableAlpha(); - } + @Override + public void drawExtras(Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(Minecraft minecraft) {} + @Override + public void drawAnimations(Minecraft minecraft) { + } - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - if (!(recipeWrapper instanceof RunicAltarRecipeWrapper)) - return; - RunicAltarRecipeWrapper wrapper = ((RunicAltarRecipeWrapper) recipeWrapper); + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof RunicAltarRecipeWrapper)) + return; + RunicAltarRecipeWrapper wrapper = ((RunicAltarRecipeWrapper) recipeWrapper); - recipeLayout.getItemStacks().init(0, true, 64, 52); - recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.runeAltar)); + recipeLayout.getItemStacks().init(0, true, 64, 52); + recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.runeAltar)); - int index = 1; - double angleBetweenEach = 360.0 / wrapper.getInputs().size(); - Point point = new Point(64, 20), center = new Point(64, 52); + int index = 1; + double angleBetweenEach = 360.0 / wrapper.getInputs().size(); + Point point = new Point(64, 20), center = new Point(64, 52); - for (Object o : wrapper.getInputs()) { - recipeLayout.getItemStacks().init(index, true, point.x, point.y); - if (o instanceof Collection) { - recipeLayout.getItemStacks().set(index, ((Collection) o)); - } - if (o instanceof ItemStack) { - recipeLayout.getItemStacks().set(index, ((ItemStack) o)); - } - index += 1; - point = rotatePointAbout(point, center, angleBetweenEach); - } + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, point.x, point.y); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index += 1; + point = rotatePointAbout(point, center, angleBetweenEach); + } - recipeLayout.getItemStacks().init(index, false, 103, 17); - recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); - } + recipeLayout.getItemStacks().init(index, false, 103, 17); + recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); + } - private Point rotatePointAbout(Point in, Point about, double degrees) { - double rad = degrees * Math.PI / 180.0; - double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; - double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; - return new Point(((int) newX), ((int) newY)); - } + private Point rotatePointAbout(Point in, Point about, double degrees) { + double rad = degrees * Math.PI / 180.0; + double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; + double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; + return new Point(((int) newX), ((int) newY)); + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java index 7dbd831b9..83156eb25 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -16,27 +16,27 @@ import javax.annotation.Nonnull; public class RunicAltarRecipeHandler implements IRecipeHandler { - @Nonnull - @Override - public Class getRecipeClass() { - return RecipeRuneAltar.class; - } + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeRuneAltar.class; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return "botania.runicAltar"; - } + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.runicAltar"; + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeRuneAltar recipe) { - return new RunicAltarRecipeWrapper(recipe); - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeRuneAltar recipe) { + return new RunicAltarRecipeWrapper(recipe); + } - @Override - public boolean isRecipeValid(@Nonnull RecipeRuneAltar recipe) { - return recipe.getInputs().size() <= 16; - } + @Override + public boolean isRecipeValid(@Nonnull RecipeRuneAltar recipe) { + return recipe.getInputs().size() <= 16; + } } diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java index c30dce006..051b87cc7 100644 --- a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -24,53 +24,54 @@ import java.util.List; public class RunicAltarRecipeWrapper implements IRecipeWrapper { - private final List input; - private final ItemStack output; - private final int manaUsage; + private final List input; + private final ItemStack output; + private final int manaUsage; - public RunicAltarRecipeWrapper(RecipeRuneAltar recipe) { - ImmutableList.Builder builder = ImmutableList.builder(); - for (Object o : recipe.getInputs()) { - if (o instanceof ItemStack) { - builder.add(o); - } - if (o instanceof String) { - builder.add(OreDictionary.getOres(((String) o))); - } - } - input = builder.build(); - output = recipe.getOutput(); - manaUsage = recipe.getManaUsage(); - } + public RunicAltarRecipeWrapper(RecipeRuneAltar recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + output = recipe.getOutput(); + manaUsage = recipe.getManaUsage(); + } - @Override - public List getInputs() { - return input; - } + @Override + public List getInputs() { + return input; + } - @Override - public List getOutputs() { - return ImmutableList.of(output); - } + @Override + public List getOutputs() { + return ImmutableList.of(output); + } - @Override - public List getFluidInputs() { - return ImmutableList.of(); - } + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } - @Override - public List getFluidOutputs() { - return ImmutableList.of(); - } + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { - GlStateManager.enableAlpha(); - HUDHandler.renderManaBar(28, 113, 0x0000FF, 0.75F, manaUsage, TilePool.MAX_MANA / 10); - GlStateManager.disableAlpha(); - } + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + GlStateManager.enableAlpha(); + HUDHandler.renderManaBar(28, 113, 0x0000FF, 0.75F, manaUsage, TilePool.MAX_MANA / 10); + GlStateManager.disableAlpha(); + } - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {} + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } } diff --git a/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java index 5d37fb211..b81582816 100644 --- a/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java +++ b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -23,7 +23,6 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; import net.minecraft.client.resources.model.IBakedModel; import net.minecraft.client.resources.model.ModelManager; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraftforge.client.model.ISmartBlockModel; @@ -35,10 +34,9 @@ import net.minecraftforge.client.model.pipeline.VertexTransformer; import net.minecraftforge.common.property.IExtendedBlockState; import net.minecraftforge.fml.common.FMLLog; import vazkii.botania.api.BotaniaAPIClient; +import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.decor.BlockFloatingFlower; -import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; @@ -49,163 +47,203 @@ import java.util.stream.Collectors; public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, IResourceManagerReloadListener { - public static final FloatingFlowerModel INSTANCE = new FloatingFlowerModel(); + public static final FloatingFlowerModel INSTANCE = new FloatingFlowerModel(); + private static final String MUNDANE_PREFIX = "botania:shimmeringFlower_"; + private static Table CACHE = HashBasedTable.create(); - private static Table CACHE = HashBasedTable.create(); + protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) { + UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM); + final IVertexConsumer consumer = new VertexTransformer(builder) { + @Override + public void put(int element, float... data) { + VertexFormatElement formatElement = DefaultVertexFormats.ITEM.getElement(element); + switch(formatElement.getUsage()) { + case POSITION: { + float[] newData = new float[4]; + Vector4f vec = new Vector4f(data); + transform.getMatrix().transform(vec); + vec.get(newData); + parent.put(element, newData); + break; + } + default: { + parent.put(element, data); + break; + } + } + } + }; + quad.pipe(consumer); + return builder.build(); + } - private static final String MUNDANE_PREFIX = "botania:shimmeringFlower_"; + @Override + public void onResourceManagerReload(IResourceManager resourceManager) { + CACHE.clear(); + } - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - CACHE.clear(); - } + @Override + public IBakedModel handleItemState(ItemStack stack) { + // Items always have GRASS island + IFloatingFlower.IslandType islandType = IFloatingFlower.IslandType.GRASS; + String identifier; - @Override - public IBakedModel handleItemState(ItemStack stack) { - // Items always have GRASS island - IFloatingFlower.IslandType islandType = IFloatingFlower.IslandType.GRASS; - String identifier; + if(Block.getBlockFromItem(stack.getItem()) == ModBlocks.floatingSpecialFlower) { + // Magic flower + identifier = ItemBlockFloatingSpecialFlower.getType(stack); + } else { + // Mundane flower + identifier = MUNDANE_PREFIX + stack.getItemDamage(); + } - if (Block.getBlockFromItem(stack.getItem()) == ModBlocks.floatingSpecialFlower) { - // Magic flower - identifier = ItemBlockFloatingSpecialFlower.getType(stack); - } else { - // Mundane flower - identifier = MUNDANE_PREFIX + stack.getItemDamage(); - } + return getModel(islandType, identifier); + } - return getModel(islandType, identifier); - } + @Override + public IBakedModel handleBlockState(IBlockState state) { + if(state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower) + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + IExtendedBlockState realState = ((IExtendedBlockState) state); + IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE); + String identifier; - @Override - public IBakedModel handleBlockState(IBlockState state) { - if (state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower) - return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - IExtendedBlockState realState = ((IExtendedBlockState) state); - IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE); - String identifier; + if(state.getBlock() == ModBlocks.floatingSpecialFlower) { + // Magic flower + identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID); + } else { + // Mundane flower + identifier = MUNDANE_PREFIX + state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } - if (state.getBlock() == ModBlocks.floatingSpecialFlower) { - // Magic flower - identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID); - } else { - // Mundane flower - identifier = MUNDANE_PREFIX + state.getValue(BotaniaStateProps.COLOR).getMetadata(); - } + return getModel(islandType, identifier); + } - return getModel(islandType, identifier); - } + // Get the model for this islandtype + flower type combination. If it's not cached already, generate it. + private CompositeBakedModel getModel(IFloatingFlower.IslandType islandType, String identifier) { + ModelManager modelManager = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager(); - // Get the model for this islandtype + flower type combination. If it's not cached already, generate it. - private CompositeBakedModel getModel(IFloatingFlower.IslandType islandType, String identifier) { - ModelManager modelManager = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager(); + if(CACHE.contains(islandType, identifier)) { + return CACHE.get(islandType, identifier); + } else { + IBakedModel islandModel = modelManager.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType)); + IBakedModel flowerModel; - if (CACHE.contains(islandType, identifier)) { - return CACHE.get(islandType, identifier); - } else { - IBakedModel islandModel = modelManager.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType)); - IBakedModel flowerModel; + if(identifier.startsWith(MUNDANE_PREFIX)) { + int meta = Integer.parseInt(identifier.substring(identifier.indexOf(MUNDANE_PREFIX) + MUNDANE_PREFIX.length())); + flowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(ModBlocks.shinyFlower, 1, meta)); + } else { + flowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(ItemBlockSpecialFlower.ofType(identifier)); + } - if (identifier.startsWith(MUNDANE_PREFIX)) { - int meta = Integer.parseInt(identifier.substring(identifier.indexOf(MUNDANE_PREFIX) + MUNDANE_PREFIX.length())); - flowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(ModBlocks.shinyFlower, 1, meta)); - } else { - flowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(ItemBlockSpecialFlower.ofType(identifier)); - } + // Enhance! + CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel); + FMLLog.info("[Botania]: Cached floating flower model for islandtpye %s and flowertype %s", islandType, identifier); + CACHE.put(islandType, identifier, model); + return model; + } + } - // Enhance! - CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel); - FMLLog.info("[Botania]: Cached floating flower model for islandtpye %s and flowertype %s", islandType, identifier); - CACHE.put(islandType, identifier, model); - return model; - } - } + // Dummy results + @Override + public List getFaceQuads(EnumFacing p_177551_1_) { + return ImmutableList.of(); + } - protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) { - UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM); - final IVertexConsumer consumer = new VertexTransformer(builder) { - @Override - public void put(int element, float... data) { - VertexFormatElement formatElement = DefaultVertexFormats.ITEM.getElement(element); - switch (formatElement.getUsage()) { - case POSITION: { - float[] newData = new float[4]; - Vector4f vec = new Vector4f(data); - transform.getMatrix().transform(vec); - vec.get(newData); - parent.put(element, newData); - break; - } - default: { - parent.put(element, data); - break; - } - } - } - }; - quad.pipe(consumer); - return builder.build(); - } + @Override + public List getGeneralQuads() { + return ImmutableList.of(); + } - private static class CompositeBakedModel implements IBakedModel { + @Override + public boolean isAmbientOcclusion() { + return false; + } - private final IBakedModel base; - private final List genQuads; + @Override + public boolean isGui3d() { + return true; + } - public CompositeBakedModel(IBakedModel flower, IBakedModel island) { - this.base = flower; + @Override + public boolean isBuiltInRenderer() { + return false; + } - ImmutableList.Builder genBuilder = ImmutableList.builder(); - final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0F, 0.2F, 0F), null, new Vector3f(0.5F, 0.5F, 0.5F), null)); + @Override + public TextureAtlasSprite getParticleTexture() { + return null; + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } + + private static class CompositeBakedModel implements IBakedModel { + + private final IBakedModel base; + private final List genQuads; + + public CompositeBakedModel(IBakedModel flower, IBakedModel island) { + this.base = flower; + + ImmutableList.Builder genBuilder = ImmutableList.builder(); + final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0F, 0.2F, 0F), null, new Vector3f(0.5F, 0.5F, 0.5F), null)); - // Add flower quads, scaled and translated - for (BakedQuad quad : flower.getGeneralQuads()) { - genBuilder.add(transform(quad, transform)); - } + // Add flower quads, scaled and translated + for(BakedQuad quad : flower.getGeneralQuads()) { + genBuilder.add(transform(quad, transform)); + } - for (EnumFacing e : EnumFacing.VALUES) { - genBuilder.addAll(flower.getFaceQuads(e).stream().map(input -> transform(input, transform)).collect(Collectors.toList())); - } + for(EnumFacing e : EnumFacing.VALUES) { + genBuilder.addAll(flower.getFaceQuads(e).stream().map(input -> transform(input, transform)).collect(Collectors.toList())); + } - // Add island quads - genBuilder.addAll(island.getGeneralQuads()); - for (EnumFacing e: EnumFacing.VALUES) { - genBuilder.addAll(island.getFaceQuads(e)); - } + // Add island quads + genBuilder.addAll(island.getGeneralQuads()); + for(EnumFacing e : EnumFacing.VALUES) { + genBuilder.addAll(island.getFaceQuads(e)); + } - genQuads = genBuilder.build(); - } + genQuads = genBuilder.build(); + } - // Forward all to flower model - @Override public List getGeneralQuads() { - return genQuads; - } - @Override public List getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); } - @Override public boolean isAmbientOcclusion() { - return base.isAmbientOcclusion(); - } - @Override public boolean isGui3d() { - return true; - } - @Override public boolean isBuiltInRenderer() { - return base.isBuiltInRenderer(); - } - @Override public TextureAtlasSprite getParticleTexture() { - return base.getParticleTexture(); - } - @Override public ItemCameraTransforms getItemCameraTransforms() { - return base.getItemCameraTransforms(); - } - } + // Forward all to flower model + @Override + public List getGeneralQuads() { + return genQuads; + } - // Dummy results - @Override public List getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); } - @Override public List getGeneralQuads() { return ImmutableList.of(); } - @Override public boolean isAmbientOcclusion() { return false; } - @Override public boolean isGui3d() { return true; } - @Override public boolean isBuiltInRenderer() { return false; } - @Override public TextureAtlasSprite getParticleTexture() { return null; } - @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + @Override + public List getFaceQuads(EnumFacing p_177551_1_) { + return ImmutableList.of(); + } + + @Override + public boolean isAmbientOcclusion() { + return base.isAmbientOcclusion(); + } + + @Override + public boolean isGui3d() { + return true; + } + + @Override + public boolean isBuiltInRenderer() { + return base.isBuiltInRenderer(); + } + + @Override + public TextureAtlasSprite getParticleTexture() { + return base.getParticleTexture(); + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return base.getItemCameraTransforms(); + } + } } diff --git a/src/main/java/vazkii/botania/client/model/ModelPylon.java b/src/main/java/vazkii/botania/client/model/ModelPylon.java index f90fcb282..786074769 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylon.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylon.java @@ -2,10 +2,10 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + *

* File Created @ [Apr 1, 2014, 6:21:48 PM (GMT)] */ package vazkii.botania.client.model; @@ -38,23 +38,17 @@ import java.util.Set; public class ModelPylon implements IPylonModel { + private static final Function TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString()); private IFlexibleBakedModel manaCrystal; private IFlexibleBakedModel manaRingsAndPanes; private IFlexibleBakedModel manaGems; - private IFlexibleBakedModel naturaCrystal; private IFlexibleBakedModel naturaRingsAndPanes; private IFlexibleBakedModel naturaGems; - private IFlexibleBakedModel gaiaCrystal; private IFlexibleBakedModel gaiaRingsAndPanes; private IFlexibleBakedModel gaiaGems; - private static final Function TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString()); - - private static final Set GROUP_NAMES = ImmutableSet.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02", - "Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"); - public ModelPylon() { try { // Load the OBJ @@ -82,27 +76,39 @@ public class ModelPylon implements IPylonModel { manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER); naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER); gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER); - } catch (IOException e) { + } catch(IOException e) { throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e)); } } @Override public void renderCrystal(PylonVariant variant) { - switch (variant) { - case MANA: renderModel(manaCrystal); break; - case NATURA: renderModel(naturaCrystal); break; - case GAIA: renderModel(gaiaCrystal); break; + switch(variant) { + case MANA: + renderModel(manaCrystal); + break; + case NATURA: + renderModel(naturaCrystal); + break; + case GAIA: + renderModel(gaiaCrystal); + break; } } @Override public void renderRing(PylonVariant variant) { GlStateManager.disableLighting(); - switch (variant) { - case MANA: renderModel(manaRingsAndPanes); break; - case NATURA: renderModel(naturaRingsAndPanes); break; - case GAIA: renderModel(gaiaRingsAndPanes); break; + switch(variant) { + case MANA: + renderModel(manaRingsAndPanes); + break; + case NATURA: + renderModel(naturaRingsAndPanes); + break; + case GAIA: + renderModel(gaiaRingsAndPanes); + break; } GlStateManager.enableLighting(); } @@ -110,21 +116,25 @@ public class ModelPylon implements IPylonModel { @Override public void renderGems(PylonVariant variant) { GlStateManager.disableLighting(); - switch (variant) { - case MANA: renderModel(manaGems); break; - case NATURA: renderModel(naturaGems); break; - case GAIA: renderModel(gaiaGems); break; + switch(variant) { + case MANA: + renderModel(manaGems); + break; + case NATURA: + renderModel(naturaGems); + break; + case GAIA: + renderModel(gaiaGems); + break; } GlStateManager.enableLighting(); } - private void renderModel(IFlexibleBakedModel model) - { + private void renderModel(IFlexibleBakedModel model) { renderModel(model, -1); } - private void renderModel(IFlexibleBakedModel model, int color) - { + private void renderModel(IFlexibleBakedModel model, int color) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.begin(GL11.GL_QUADS, model.getFormat()); @@ -133,9 +143,8 @@ public class ModelPylon implements IPylonModel { tessellator.draw(); } - private void renderQuads(WorldRenderer renderer, List quads, int color) - { - for (BakedQuad bakedquad : quads) + private void renderQuads(WorldRenderer renderer, List quads, int color) { + for(BakedQuad bakedquad : quads) LightUtil.renderQuadColor(renderer, bakedquad, color); } diff --git a/src/main/java/vazkii/botania/client/model/PlatformModel.java b/src/main/java/vazkii/botania/client/model/PlatformModel.java index 516bdd1e3..b21744feb 100644 --- a/src/main/java/vazkii/botania/client/model/PlatformModel.java +++ b/src/main/java/vazkii/botania/client/model/PlatformModel.java @@ -2,11 +2,11 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ - package vazkii.botania.client.model; +package vazkii.botania.client.model; import com.google.common.collect.ImmutableList; import net.minecraft.block.state.IBlockState; @@ -27,39 +27,66 @@ import java.util.List; public class PlatformModel implements ISmartBlockModel { - @Override - public IBakedModel handleBlockState(IBlockState state) { - EnumWorldBlockLayer layer = MinecraftForgeClient.getRenderLayer(); - IBlockState heldState = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_STATE); + @Override + public IBakedModel handleBlockState(IBlockState state) { + EnumWorldBlockLayer layer = MinecraftForgeClient.getRenderLayer(); + IBlockState heldState = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_STATE); - Minecraft mc = Minecraft.getMinecraft(); - if (heldState == null && layer == EnumWorldBlockLayer.SOLID) { - // No camo - ModelResourceLocation path = new ModelResourceLocation("botania:platform", "variant=" + state.getValue(BotaniaStateProps.PLATFORM_VARIANT).getName()); - return mc.getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path); - } else if (heldState != null){ - if (heldState.getBlock().canRenderInLayer(layer)) { - // Steal camo's model - IBakedModel model = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(heldState); + Minecraft mc = Minecraft.getMinecraft(); + if(heldState == null && layer == EnumWorldBlockLayer.SOLID) { + // No camo + ModelResourceLocation path = new ModelResourceLocation("botania:platform", "variant=" + state.getValue(BotaniaStateProps.PLATFORM_VARIANT).getName()); + return mc.getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path); + } else if(heldState != null) { + if(heldState.getBlock().canRenderInLayer(layer)) { + // Steal camo's model + IBakedModel model = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(heldState); - if (model instanceof ISmartBlockModel) { - // Their model can be smart too - model = ((ISmartBlockModel) model).handleBlockState(heldState); - } + if(model instanceof ISmartBlockModel) { + // Their model can be smart too + model = ((ISmartBlockModel) model).handleBlockState(heldState); + } - return model; - } - } + return model; + } + } - return this; // This smart model has no quads as seen below, so nothing actually renders - } + return this; // This smart model has no quads as seen below, so nothing actually renders + } - @Override public List getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); } - @Override public List getGeneralQuads() { return ImmutableList.of(); } - @Override public boolean isAmbientOcclusion() { return true; } - @Override public boolean isGui3d() { return true;} - @Override public boolean isBuiltInRenderer() { return false; } - @Override public TextureAtlasSprite getParticleTexture() { return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:blocks/livingwood0"); } - @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + @Override + public List getFaceQuads(EnumFacing p_177551_1_) { + return ImmutableList.of(); + } + + @Override + public List getGeneralQuads() { + return ImmutableList.of(); + } + + @Override + public boolean isAmbientOcclusion() { + return true; + } + + @Override + public boolean isGui3d() { + return true; + } + + @Override + public boolean isBuiltInRenderer() { + return false; + } + + @Override + public TextureAtlasSprite getParticleTexture() { + return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:blocks/livingwood0"); + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } } diff --git a/src/main/java/vazkii/botania/client/model/PylonItemModel.java b/src/main/java/vazkii/botania/client/model/PylonItemModel.java index bb9f45634..32dcd2311 100644 --- a/src/main/java/vazkii/botania/client/model/PylonItemModel.java +++ b/src/main/java/vazkii/botania/client/model/PylonItemModel.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -40,95 +40,160 @@ import java.util.List; public class PylonItemModel implements ISmartItemModel { - private IBakedModel mana; - private IBakedModel natura; - private IBakedModel gaia; - private boolean cached = false; + private IBakedModel mana; + private IBakedModel natura; + private IBakedModel gaia; + private boolean cached = false; - @Override - public IBakedModel handleItemState(ItemStack stack) { - if (!cached) { - cacheModels(); - } + @Override + public IBakedModel handleItemState(ItemStack stack) { + if(!cached) { + cacheModels(); + } - switch (stack.getItemDamage()) { - case 2: return gaia; - case 1: return natura; - case 0: return mana; - default: - return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - } - } + switch(stack.getItemDamage()) { + case 2: + return gaia; + case 1: + return natura; + case 0: + return mana; + default: + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + } + } - private void cacheModels() { - // Load the OBJ - OBJModel model = null; - try { - model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj"))); - } catch (IOException e) { - FMLLog.log(Level.ERROR, "[Botania]: Error loading pylon item model, substituting missing model"); - mana = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - natura = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - gaia = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - cached = true; - return; - } + private void cacheModels() { + // Load the OBJ + OBJModel model = null; + try { + model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj"))); + } catch(IOException e) { + FMLLog.log(Level.ERROR, "[Botania]: Error loading pylon item model, substituting missing model"); + mana = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + natura = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + gaia = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + cached = true; + return; + } - // Apply the texture and flip the v's of the model - IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true")); - IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true")); - IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true")); + // Apply the texture and flip the v's of the model + IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true")); + IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true")); + IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true")); - // All groups are off by default - // OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group + // All groups are off by default + // OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group - final Function textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString()); + final Function textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString()); - ImmutableList standardGroups = ImmutableList.of("Crystal", "Crystal_Ring", - "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04", - "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"); + ImmutableList standardGroups = ImmutableList.of("Crystal", "Crystal_Ring", + "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04", + "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"); - mana = new PerspectiveWrapper(manaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); - // Natura model is just the crystal - natura = new PerspectiveWrapper(naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); - gaia = new PerspectiveWrapper(gaiaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); - cached = true; - } + mana = new PerspectiveWrapper(manaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); + // Natura model is just the crystal + natura = new PerspectiveWrapper(naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); + gaia = new PerspectiveWrapper(gaiaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter)); + cached = true; + } - @Override public List getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); } - @Override public List getGeneralQuads() { return ImmutableList.of(); } - @Override public boolean isAmbientOcclusion() { return false; } - @Override public boolean isGui3d() { return true; } - @Override public boolean isBuiltInRenderer() { return false; } - @Override public TextureAtlasSprite getParticleTexture() { return null; } - @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + @Override + public List getFaceQuads(EnumFacing p_177551_1_) { + return ImmutableList.of(); + } - // Wrapper to transform the model before rendering it, so it looks right in the inventory - private class PerspectiveWrapper implements IPerspectiveAwareModel { + @Override + public List getGeneralQuads() { + return ImmutableList.of(); + } - private final IFlexibleBakedModel parent; + @Override + public boolean isAmbientOcclusion() { + return false; + } - public PerspectiveWrapper(IBakedModel pylonModel) { - this.parent = new IFlexibleBakedModel.Wrapper(pylonModel, Attributes.DEFAULT_BAKED_FORMAT); - } + @Override + public boolean isGui3d() { + return true; + } - @Override - public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { - switch(cameraTransformType) { - case FIRST_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, 0, 0.4F), null, new Vector3f(0.75F, 0.75F, 0.75F), null).getMatrix()); - case GUI: return ImmutablePair.of(parent, TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0.5F, 0.1F, 0), null, null, null)).getMatrix()); - case THIRD_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, -0.2F, 0.5F), null, null, null).getMatrix()); - default: return ImmutablePair.of(parent, TRSRTransformation.identity().getMatrix()); - } - } + @Override + public boolean isBuiltInRenderer() { + return false; + } - @Override public VertexFormat getFormat() { return Attributes.DEFAULT_BAKED_FORMAT; } - @Override public List getFaceQuads(EnumFacing p_177551_1_) { return parent.getFaceQuads(p_177551_1_); } - @Override public List getGeneralQuads() { return parent.getGeneralQuads(); } - @Override public boolean isAmbientOcclusion() { return parent.isAmbientOcclusion(); } - @Override public boolean isGui3d() { return parent.isGui3d(); } - @Override public boolean isBuiltInRenderer() { return parent.isBuiltInRenderer(); } - @Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); } - @Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); } - } + @Override + public TextureAtlasSprite getParticleTexture() { + return null; + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } + + // Wrapper to transform the model before rendering it, so it looks right in the inventory + private class PerspectiveWrapper implements IPerspectiveAwareModel { + + private final IFlexibleBakedModel parent; + + public PerspectiveWrapper(IBakedModel pylonModel) { + this.parent = new IFlexibleBakedModel.Wrapper(pylonModel, Attributes.DEFAULT_BAKED_FORMAT); + } + + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + switch(cameraTransformType) { + case FIRST_PERSON: + return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, 0, 0.4F), null, new Vector3f(0.75F, 0.75F, 0.75F), null).getMatrix()); + case GUI: + return ImmutablePair.of(parent, TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0.5F, 0.1F, 0), null, null, null)).getMatrix()); + case THIRD_PERSON: + return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, -0.2F, 0.5F), null, null, null).getMatrix()); + default: + return ImmutablePair.of(parent, TRSRTransformation.identity().getMatrix()); + } + } + + @Override + public VertexFormat getFormat() { + return Attributes.DEFAULT_BAKED_FORMAT; + } + + @Override + public List getFaceQuads(EnumFacing p_177551_1_) { + return parent.getFaceQuads(p_177551_1_); + } + + @Override + public List getGeneralQuads() { + return parent.getGeneralQuads(); + } + + @Override + public boolean isAmbientOcclusion() { + return parent.isAmbientOcclusion(); + } + + @Override + public boolean isGui3d() { + return parent.isGui3d(); + } + + @Override + public boolean isBuiltInRenderer() { + return parent.isBuiltInRenderer(); + } + + @Override + public TextureAtlasSprite getParticleTexture() { + return parent.getParticleTexture(); + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return parent.getItemCameraTransforms(); + } + } } diff --git a/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java index 5d99a76e8..ef5c77b55 100644 --- a/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java +++ b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java @@ -2,7 +2,7 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

* Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ @@ -42,7 +42,6 @@ import net.minecraftforge.fml.common.FMLLog; import org.apache.commons.lang3.tuple.Pair; import vazkii.botania.api.BotaniaAPIClient; import vazkii.botania.api.state.BotaniaStateProps; -import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; @@ -50,269 +49,268 @@ import javax.vecmath.Matrix4f; import java.io.IOException; import java.util.Collection; import java.util.List; -import java.util.Locale; import java.util.Map; public class SpecialFlowerModel implements IModelCustomData { - // SpecialFlowerModel for when there are no blockModels registered for a subtile - public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap., ModelResourceLocation>of(), ImmutableMap., ModelResourceLocation>of()); + // SpecialFlowerModel for when there are no blockModels registered for a subtile + public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap., ModelResourceLocation>of(), ImmutableMap., ModelResourceLocation>of()); - private final ImmutableMap, ModelResourceLocation> blockModels; - private final ImmutableMap, ModelResourceLocation> itemModels; + private final ImmutableMap, ModelResourceLocation> blockModels; + private final ImmutableMap, ModelResourceLocation> itemModels; - public SpecialFlowerModel(ImmutableMap, ModelResourceLocation> blockModels, - ImmutableMap, ModelResourceLocation> itemModels) { - this.blockModels = blockModels; - this.itemModels = itemModels; - } + public SpecialFlowerModel(ImmutableMap, ModelResourceLocation> blockModels, + ImmutableMap, ModelResourceLocation> itemModels) { + this.blockModels = blockModels; + this.itemModels = itemModels; + } - @Override - public Collection getDependencies() { - ImmutableSet.Builder builder = ImmutableSet.builder(); - builder.addAll(blockModels.values()); - builder.addAll(itemModels.values()); + @Override + public Collection getDependencies() { + ImmutableSet.Builder builder = ImmutableSet.builder(); + builder.addAll(blockModels.values()); + builder.addAll(itemModels.values()); - // Force island models to be loaded and baked. See FloatingFlowerModel. - builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values()); + // Force island models to be loaded and baked. See FloatingFlowerModel. + builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values()); - return builder.build(); - } + return builder.build(); + } - @Override - public Collection getTextures() { - return ImmutableList.of(); - } + @Override + public Collection getTextures() { + return ImmutableList.of(); + } - @Override - public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - // "Bake" the SpecialFlowerModel (in reality, just create another wrapper for all the delegate blockModels) - return new SpecialFlowerBakedModel(blockModels, itemModels, format, IPerspectiveAwareModel.MapWrapper.getTransforms(state)); - } + @Override + public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { + // "Bake" the SpecialFlowerModel (in reality, just create another wrapper for all the delegate blockModels) + return new SpecialFlowerBakedModel(blockModels, itemModels, format, IPerspectiveAwareModel.MapWrapper.getTransforms(state)); + } - @Override - public IModelState getDefaultState() { - return TRSRTransformation.identity(); - } + @Override + public IModelState getDefaultState() { + return TRSRTransformation.identity(); + } - @Override - public IModel process(ImmutableMap customData) { - // Load the base variant from blockstate json, and also add all the model paths we received from external API - ImmutableMap.Builder, ModelResourceLocation> blockBuilder = ImmutableMap.builder(); - ImmutableMap.Builder, ModelResourceLocation> itemBuilder = ImmutableMap.builder(); + @Override + public IModel process(ImmutableMap customData) { + // Load the base variant from blockstate json, and also add all the model paths we received from external API + ImmutableMap.Builder, ModelResourceLocation> blockBuilder = ImmutableMap.builder(); + ImmutableMap.Builder, ModelResourceLocation> itemBuilder = ImmutableMap.builder(); - for (String key : customData.keySet()) { - if ("base".equals(key)) { - blockBuilder.put(Optional.absent(), getLocation(customData.get(key))); - } - } + for(String key : customData.keySet()) { + if("base".equals(key)) { + blockBuilder.put(Optional.absent(), getLocation(customData.get(key))); + } + } - for (Map.Entry e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) { - blockBuilder.put(Optional.of(e.getKey()), e.getValue()); - } - for (Map.Entry e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) { - itemBuilder.put(Optional.of(e.getKey()), e.getValue()); - } + for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) { + blockBuilder.put(Optional.of(e.getKey()), e.getValue()); + } + for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) { + itemBuilder.put(Optional.of(e.getKey()), e.getValue()); + } - ImmutableMap, ModelResourceLocation> blockModels = blockBuilder.build(); - ImmutableMap, ModelResourceLocation> itemModels = itemBuilder.build(); - if (blockModels.isEmpty() && itemModels.isEmpty()) return INSTANCE; - return new SpecialFlowerModel(blockModels, itemModels); - } + ImmutableMap, ModelResourceLocation> blockModels = blockBuilder.build(); + ImmutableMap, ModelResourceLocation> itemModels = itemBuilder.build(); + if(blockModels.isEmpty() && itemModels.isEmpty()) return INSTANCE; + return new SpecialFlowerModel(blockModels, itemModels); + } - private ModelResourceLocation getLocation(String json) { - JsonElement e = new JsonParser().parse(json); - if (e.isJsonPrimitive() && e.getAsJsonPrimitive().isString()) { - return new ModelResourceLocation(e.getAsString()); - } - FMLLog.severe("Expect ModelResourceLocation, got: ", json); - return new ModelResourceLocation("builtin/missing", "missing"); - } + private ModelResourceLocation getLocation(String json) { + JsonElement e = new JsonParser().parse(json); + if(e.isJsonPrimitive() && e.getAsJsonPrimitive().isString()) { + return new ModelResourceLocation(e.getAsString()); + } + FMLLog.severe("Expect ModelResourceLocation, got: ", json); + return new ModelResourceLocation("builtin/missing", "missing"); + } - public enum Loader implements ICustomModelLoader { - INSTANCE { - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - } + public enum Loader implements ICustomModelLoader { + INSTANCE { + @Override + public void onResourceManagerReload(IResourceManager resourceManager) { + } - @Override - public boolean accepts(ResourceLocation modelLocation) { - return modelLocation.getResourceDomain().equals("botania_special") && ( - modelLocation.getResourcePath().equals("specialFlower") || - modelLocation.getResourcePath().equals("models/block/specialFlower") || - modelLocation.getResourcePath().equals("models/item/specialFlower")); - } + @Override + public boolean accepts(ResourceLocation modelLocation) { + return modelLocation.getResourceDomain().equals("botania_special") && ( + modelLocation.getResourcePath().equals("specialFlower") || + modelLocation.getResourcePath().equals("models/block/specialFlower") || + modelLocation.getResourcePath().equals("models/item/specialFlower")); + } - @Override - public IModel loadModel(ResourceLocation modelLocation) throws IOException { - // Load a dummy model for now, all actual blockModels added in process(). - return SpecialFlowerModel.INSTANCE; - } - } - } + @Override + public IModel loadModel(ResourceLocation modelLocation) throws IOException { + // Load a dummy model for now, all actual blockModels added in process(). + return SpecialFlowerModel.INSTANCE; + } + } + } - public static class SpecialFlowerBakedModel implements IPerspectiveAwareModel, ISmartBlockModel, ISmartItemModel { + public static class SpecialFlowerBakedModel implements IPerspectiveAwareModel, ISmartBlockModel, ISmartItemModel { - private final ImmutableMap transforms; - private final ImmutableMap, ModelResourceLocation> blockModels; - private final ImmutableMap, ModelResourceLocation> itemModels; - private final VertexFormat vertexFormat; + private final ImmutableMap transforms; + private final ImmutableMap, ModelResourceLocation> blockModels; + private final ImmutableMap, ModelResourceLocation> itemModels; + private final VertexFormat vertexFormat; - private IBakedModel baseModel; - private ImmutableMap bakedBlockModels; - private ImmutableMap bakedItemModels; - private ImmutableMap, ImmutableList> quads; + private IBakedModel baseModel; + private ImmutableMap bakedBlockModels; + private ImmutableMap bakedItemModels; + private ImmutableMap, ImmutableList> quads; - public SpecialFlowerBakedModel(ImmutableMap, ModelResourceLocation> blockModels, - ImmutableMap, ModelResourceLocation> itemModels, - VertexFormat format, ImmutableMap cameraTransforms) { - this.blockModels = blockModels; - this.itemModels = itemModels; - this.vertexFormat = format; - this.transforms = cameraTransforms; - } + public SpecialFlowerBakedModel(ImmutableMap, ModelResourceLocation> blockModels, + ImmutableMap, ModelResourceLocation> itemModels, + VertexFormat format, ImmutableMap cameraTransforms) { + this.blockModels = blockModels; + this.itemModels = itemModels; + this.vertexFormat = format; + this.transforms = cameraTransforms; + } - private void refreshBakedModels() { - if (baseModel == null) { - // If not done already, steal all the real baked models and cache them - ModelManager manager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); - baseModel = getBlockModel(manager, Optional.absent()); + private void refreshBakedModels() { + if(baseModel == null) { + // If not done already, steal all the real baked models and cache them + ModelManager manager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); + baseModel = getBlockModel(manager, Optional.absent()); - ImmutableMap.Builder builder = ImmutableMap.builder(); - for (Map.Entry, ModelResourceLocation> e : blockModels.entrySet()) { - if (e.getKey().isPresent()) { - builder.put(e.getKey().get(), getBlockModel(manager, e.getKey())); - } - } + ImmutableMap.Builder builder = ImmutableMap.builder(); + for(Map.Entry, ModelResourceLocation> e : blockModels.entrySet()) { + if(e.getKey().isPresent()) { + builder.put(e.getKey().get(), getBlockModel(manager, e.getKey())); + } + } - bakedBlockModels = builder.build(); + bakedBlockModels = builder.build(); - ImmutableMap.Builder builder2 = ImmutableMap.builder(); - for (Map.Entry, ModelResourceLocation> e : itemModels.entrySet()) { - if (e.getKey().isPresent()) { - builder2.put(e.getKey().get(), getItemModel(manager, e.getKey())); - } - } + ImmutableMap.Builder builder2 = ImmutableMap.builder(); + for(Map.Entry, ModelResourceLocation> e : itemModels.entrySet()) { + if(e.getKey().isPresent()) { + builder2.put(e.getKey().get(), getItemModel(manager, e.getKey())); + } + } - bakedItemModels = builder2.build(); + bakedItemModels = builder2.build(); - ImmutableMap.Builder, ImmutableList> quadBuilder = ImmutableMap.builder(); - quadBuilder.put(Optional.absent(), buildQuads(Optional.absent())); - for (EnumFacing side : EnumFacing.values()) { - quadBuilder.put(Optional.of(side), buildQuads(Optional.of(side))); - } - quads = quadBuilder.build(); - } - } + ImmutableMap.Builder, ImmutableList> quadBuilder = ImmutableMap.builder(); + quadBuilder.put(Optional.absent(), buildQuads(Optional.absent())); + for(EnumFacing side : EnumFacing.values()) { + quadBuilder.put(Optional.of(side), buildQuads(Optional.of(side))); + } + quads = quadBuilder.build(); + } + } - private IBakedModel getBlockModel(ModelManager manager, Optional opt) { - ModelResourceLocation loc = blockModels.get(opt); - if (loc == null) { - loc = new ModelResourceLocation("builtin/missing", "missing"); - } - return manager.getModel(loc); - } + private IBakedModel getBlockModel(ModelManager manager, Optional opt) { + ModelResourceLocation loc = blockModels.get(opt); + if(loc == null) { + loc = new ModelResourceLocation("builtin/missing", "missing"); + } + return manager.getModel(loc); + } - private IBakedModel getItemModel(ModelManager manager, Optional opt) { - ModelResourceLocation loc = itemModels.get(opt); - if (loc == null) { - loc = new ModelResourceLocation("builtin/missing", "missing"); - } - return manager.getModel(loc); - } + private IBakedModel getItemModel(ModelManager manager, Optional opt) { + ModelResourceLocation loc = itemModels.get(opt); + if(loc == null) { + loc = new ModelResourceLocation("builtin/missing", "missing"); + } + return manager.getModel(loc); + } - private ImmutableList buildQuads(Optional side) { - ImmutableList.Builder builder = ImmutableList.builder(); - for (IBakedModel model : bakedBlockModels.values()) { - if (side.isPresent()) { - builder.addAll(model.getFaceQuads(side.get())); - } else { - builder.addAll(model.getGeneralQuads()); - } - } + private ImmutableList buildQuads(Optional side) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(IBakedModel model : bakedBlockModels.values()) { + if(side.isPresent()) { + builder.addAll(model.getFaceQuads(side.get())); + } else { + builder.addAll(model.getGeneralQuads()); + } + } - for (IBakedModel model : bakedItemModels.values()) { - if (side.isPresent()) { - builder.addAll(model.getFaceQuads(side.get())); - } else { - builder.addAll(model.getGeneralQuads()); - } - } + for(IBakedModel model : bakedItemModels.values()) { + if(side.isPresent()) { + builder.addAll(model.getFaceQuads(side.get())); + } else { + builder.addAll(model.getGeneralQuads()); + } + } - return builder.build(); - } + return builder.build(); + } - @Override - public List getFaceQuads(EnumFacing side) { - refreshBakedModels(); - return quads.get(Optional.of(side)); - } + @Override + public List getFaceQuads(EnumFacing side) { + refreshBakedModels(); + return quads.get(Optional.of(side)); + } - @Override - public List getGeneralQuads() { - refreshBakedModels(); - return quads.get(Optional.absent()); - } + @Override + public List getGeneralQuads() { + refreshBakedModels(); + return quads.get(Optional.absent()); + } - @Override - public boolean isAmbientOcclusion() { - refreshBakedModels(); - return baseModel.isAmbientOcclusion(); - } + @Override + public boolean isAmbientOcclusion() { + refreshBakedModels(); + return baseModel.isAmbientOcclusion(); + } - @Override - public boolean isGui3d() { - refreshBakedModels(); - return baseModel.isGui3d(); - } + @Override + public boolean isGui3d() { + refreshBakedModels(); + return baseModel.isGui3d(); + } - @Override - public boolean isBuiltInRenderer() { - refreshBakedModels(); - return baseModel.isBuiltInRenderer(); - } + @Override + public boolean isBuiltInRenderer() { + refreshBakedModels(); + return baseModel.isBuiltInRenderer(); + } - @Override - public TextureAtlasSprite getParticleTexture() { - refreshBakedModels(); - return baseModel.getParticleTexture(); - } + @Override + public TextureAtlasSprite getParticleTexture() { + refreshBakedModels(); + return baseModel.getParticleTexture(); + } - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } - @Override - public IBakedModel handleBlockState(IBlockState state) { - if (state.getBlock() != ModBlocks.specialFlower) - return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - refreshBakedModels(); - IExtendedBlockState extendedState = ((IExtendedBlockState) state); - IBakedModel ret = bakedBlockModels.get(extendedState.getValue(BotaniaStateProps.SUBTILE_ID)); - return ret == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : ret; - } + @Override + public IBakedModel handleBlockState(IBlockState state) { + if(state.getBlock() != ModBlocks.specialFlower) + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + refreshBakedModels(); + IExtendedBlockState extendedState = ((IExtendedBlockState) state); + IBakedModel ret = bakedBlockModels.get(extendedState.getValue(BotaniaStateProps.SUBTILE_ID)); + return ret == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : ret; + } - @Override - public VertexFormat getFormat() { - return vertexFormat; - } + @Override + public VertexFormat getFormat() { + return vertexFormat; + } - @Override - public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { - return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType); - } + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType); + } - @Override - public IBakedModel handleItemState(ItemStack stack) { - refreshBakedModels(); - IBakedModel item = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack)); - if (item == null) { - item = bakedBlockModels.get(ItemBlockSpecialFlower.getType(stack)); - } + @Override + public IBakedModel handleItemState(ItemStack stack) { + refreshBakedModels(); + IBakedModel item = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack)); + if(item == null) { + item = bakedBlockModels.get(ItemBlockSpecialFlower.getType(stack)); + } - return item == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : item; - } - } + return item == null ? Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel() : item; + } + } } diff --git a/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java b/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java deleted file mode 100644 index 4013b2ed0..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 24, 2015, 11:06:11 PM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileAvatar; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderAvatar implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.6F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileAvatar(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idAvatar; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderBellows.java b/src/main/java/vazkii/botania/client/render/block/RenderBellows.java deleted file mode 100644 index 3d5032914..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderBellows.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 28, 2015, 7:13:45 PM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TileBellows; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBellows implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.3F, -0.5F); - GlStateManager.scale(1.2F, 1.2F, 1.2F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileBellows(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idBellows; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java b/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java deleted file mode 100644 index 88ef1482b..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 31, 2014, 5:00:12 PM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTileBrewery; -import vazkii.botania.common.block.tile.TileBrewery; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewery implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - GlStateManager.scale(1.2F, 1.2F, 1.2F); - RenderTileBrewery.rotate = false; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileBrewery(), 0.0D, 0.0D, 0.0D, 0.0F); - RenderTileBrewery.rotate = true; - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idBrewery; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java b/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java deleted file mode 100644 index 6337d430f..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 8, 2015, 5:57:29 PM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileCocoon; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCocoon implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCocoon(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCocoon; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java b/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java deleted file mode 100644 index 5c692bb96..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 6:22:32 PM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCorporeaCrystalCube implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - GlStateManager.disableAlpha(); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCorporeaCrystalCube(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.enableAlpha(); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCorporeaCrystalCybe; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java b/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java deleted file mode 100644 index 95537392c..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 15, 2015, 1:57:50 AM (GMT)] - */ -/* -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTileCorporeaIndex; -import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCorporeaIndex implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.3F, -0.5F); - GlStateManager.scale(1.4F, 1.4F, 1.4F); - RenderTileCorporeaIndex.move = false; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCorporeaIndex(), 0.0D, 0.0D, 0.0D, 0.0F); - RenderTileCorporeaIndex.move = true; - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCorporeaIndex; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java b/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java deleted file mode 100644 index 06df3b26b..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 30, 2015, 3:17:41 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileHourglass; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderHourglass implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - GlStateManager.disableAlpha(); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileHourglass(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.enableAlpha(); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idHourglass; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java b/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java deleted file mode 100644 index 7b8aa222c..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 15, 2015, 5:59:56 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileIncensePlate; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderIncensePlate implements ISimpleBlockRenderingHandler{ - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.1F, -0.5F); - GlStateManager.scale(1.4F, 1.4F, 1.4F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileIncensePlate(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idIncensePlate; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderPool.java b/src/main/java/vazkii/botania/client/render/block/RenderPool.java deleted file mode 100644 index f261acfa2..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderPool.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 26, 2014, 12:25:06 AM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTilePool; -import vazkii.botania.common.block.tile.mana.TilePool; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderPool implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - RenderTilePool.forceMeta = metadata; - RenderTilePool.forceMana = RenderTilePool.forceMana | metadata == 1; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePool(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idPool; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderPump.java b/src/main/java/vazkii/botania/client/render/block/RenderPump.java deleted file mode 100644 index 8af901f00..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderPump.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 18, 2015, 4:42:08 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TilePump; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderPump implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.25F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePump(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idPump; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java b/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java deleted file mode 100644 index c8915e02c..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 23, 2014, 6:23:54 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileSpawnerClaw; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpawnerClaw implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, 0F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileSpawnerClaw(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idSpawnerClaw; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java b/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java deleted file mode 100644 index 112378b89..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 4:15:46 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook; -import vazkii.botania.api.lexicon.multiblock.Multiblock; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMultiblockRenderHook { - - int id; - - public RenderSpecialFlower(int id) { - this.id = id; - } - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - // NO-OP - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return renderCrossedSquares(blockAccess, block, x, y, z, renderer); - } - - // Copied from RenderBlocks - public static boolean renderCrossedSquares(IBlockAccess blockAccess, Block par1Block, int par2, int par3, int par4, RenderBlocks render) { - Tessellator tessellator = Tessellator.getInstance(); - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float f = 1.0F; - int l = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float f1 = (l >> 16 & 255) / 255.0F; - float f2 = (l >> 8 & 255) / 255.0F; - float f3 = (l & 255) / 255.0F; - - if(EntityRenderer.anaglyphEnable) { - float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; - float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; - float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; - f1 = f4; - f2 = f5; - f3 = f6; - } - - tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); - double d1 = par2; - double d2 = par3; - double d0 = par4; - long sh; - - sh = par2 * 3129871 ^ par4 * 116129781L ^ par3; - sh = sh * sh * 42317861L + sh * 11L; - d1 += ((sh >> 16 & 15L) / 15.0F - 0.5D) * 0.3D; - d2 += (sh >> 32 & 15L) / 15.0F * -0.15D; - d0 += ((sh >> 24 & 15L) / 15.0F - 0.5D) * 0.3D; - - - // Only change here, to use xyz rather than side/meta - IIcon icon = render.getBlockIcon(par1Block, blockAccess, par2, par3, par4, 0); - drawCrossedSquares(blockAccess, par1Block, icon, par2, par3, par4, d1, d2, d0, 1.0F, render); - - return true; - } - - // Copied from RenderBlocks - public static void drawCrossedSquares(IBlockAccess blockAccess, Block par1Block, IIcon icon, int x, int y, int z, double par3, double par5, double par7, float par9, RenderBlocks render) { - Tessellator tessellator = Tessellator.getInstance(); - - double d3 = icon.getMinU(); - double d4 = icon.getMinV(); - double d5 = icon.getMaxU(); - double d6 = icon.getMaxV(); - double d7 = 0.45D * par9; - double d8 = par3 + 0.5D - d7; - double d9 = par3 + 0.5D + d7; - double d10 = par7 + 0.5D - d7; - double d11 = par7 + 0.5D + d7; - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + par9, d10, d3, d4); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + 0.0D, d10, d3, d6); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + 0.0D, d11, d5, d6); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + par9, d11, d5, d4); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + par9, d11, d3, d4); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + 0.0D, d11, d3, d6); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + 0.0D, d10, d5, d6); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + par9, d10, d5, d4); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + par9, d11, d3, d4); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + 0.0D, d11, d3, d6); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + 0.0D, d10, d5, d6); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + par9, d10, d5, d4); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + par9, d10, d3, d4); - tessellator.getWorldRenderer().addVertexWithUV(d9, par5 + 0.0D, d10, d3, d6); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + 0.0D, d11, d5, d6); - tessellator.getWorldRenderer().addVertexWithUV(d8, par5 + par9, d11, d5, d4); - } - - @Override - public int getRenderId() { - return id; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha) { - Tessellator tess = Tessellator.getInstance(); - tess.startDrawingQuads(); - drawCrossedSquares(world, block, block.getIcon(0, meta), 0, 0, 0, -0.5, -0.5, -0.5, 1F, renderBlocks); - tess.draw(); - } - - @Override - public boolean needsTranslate(IBlockState state) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java b/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java deleted file mode 100644 index 6400353d8..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 9:45:58 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TileSpreader; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpreader implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - TileSpreader.staticRedstone = metadata == 1; - TileSpreader.staticDreamwood = metadata == 2 || metadata == 3; - TileSpreader.staticUltra = metadata == 3; - - TileSpreader spreader = new TileSpreader(); - spreader.rotationX = -180F; - TileEntityRendererDispatcher.instance.renderTileEntityAt(spreader, 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idSpreader; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java b/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java deleted file mode 100644 index ae77b4978..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 1, 2015, 9:40:27 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileTeruTeruBozu; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderTeruTeruBozu implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.3F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileTeruTeruBozu(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idTeruTeruBozu; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java b/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java deleted file mode 100644 index 85cbb724a..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2014, 11:43:37 PM (GMT)] - *//* - -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileTinyPotato; -import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderTinyPotato implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, 0F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileTinyPotato(), 0.0D, 0.0D, 0.0D, 0.0F); - GlStateManager.popMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idTinyPotato; - } - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/item/RenderBow.java b/src/main/java/vazkii/botania/client/render/item/RenderBow.java deleted file mode 100644 index 805fab163..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderBow.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 28, 2015, 3:43:09 PM (GMT)] - *//* - -package vazkii.botania.client.render.item; - -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.common.lib.LibObfuscation; -import net.minecraftforge.fml.relauncher.ReflectionHelper; - -public class RenderBow implements IItemRenderer { - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GlStateManager.translate(0F, -0.3F, 0.01F); - render(item, null, false); - GlStateManager.popMatrix(); - break; - } - case EQUIPPED : { - render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, true); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, false); - break; - } - default : break; - } - } - - public void render(ItemStack item, EntityPlayer player, boolean transform) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0); - if(player != null) { - ItemStack using = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, LibObfuscation.ITEM_IN_USE); - int time = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, LibObfuscation.ITEM_IN_USE_COUNT); - icon = item.getItem().getIcon(item, 0, player, using, time); - if(transform) { - GlStateManager.translate(0.2F, -0.3F, 0.1F); - //GlStateManager.rotate(20.0F, 0.0F, 1.0F, 0.0F); - //GlStateManager.rotate(-100.0F, 1.0F, 0.0F, 0.0F); - } - } - - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GlStateManager.pushMatrix(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GlStateManager.disableBlend(); - GlStateManager.popMatrix(); - - GlStateManager.color(1F, 1F, 1F, 1F); - } - - -} -*/ diff --git a/src/main/java/vazkii/botania/client/render/item/RenderLens.java b/src/main/java/vazkii/botania/client/render/item/RenderLens.java deleted file mode 100644 index fad1267bc..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderLens.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 31, 2014, 3:08:00 PM (GMT)] - *//* - -package vazkii.botania.client.render.item; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.mana.ILens; -import vazkii.botania.common.item.lens.ItemLens; - -public class RenderLens implements IItemRenderer { - - static RenderItem render = new RenderItem(); - ItemRenderer renderer = new ItemRenderer(Minecraft.getMinecraft()); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GlStateManager.translate(0F, -0.3F, 0.01F); - render(item); - GlStateManager.popMatrix(); - break; - } - case EQUIPPED : { - render(item); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item); - break; - } - default : break; - } - } - - public static void render(ItemStack item) { - Color color = new Color(((ILens) item.getItem()).getLensColor(item)); - render(item, color.getRGB()); - } - - public static void render(ItemStack item, int color_) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 1); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GlStateManager.color(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GlStateManager.pushMatrix(); - GlStateManager.enableBlend(); - GlStateManager.enableCull(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Color color = new Color(color_); - GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255); - - boolean shiny = ItemLens.getStoredColor(item) != -1; - icon = ItemLens.iconGlass; - GlStateManager.scale(scale, scale, scale); - GlStateManager.translate(0F, 0F, -0.5F); - renderShinyLensIcon(icon, shiny); - GlStateManager.rotate(180F, 0F, 1F, 0F); - GlStateManager.translate(-16F, 0F, 0F); - renderShinyLensIcon(icon, shiny); - GlStateManager.disableCull(); - GlStateManager.disableBlend(); - GlStateManager.popMatrix(); - - GlStateManager.color(1F, 1F, 1F, 1F); - } - - public static void renderShinyLensIcon(IIcon icon, boolean shiny) { - float par1 = 0; - float par2 = 0; - float par4 = 16; - float par5 = 16; - float zLevel = 0F; - Tessellator tessellator = Tessellator.getInstance(); - tessellator.getWorldRenderer().startDrawingQuads(); - if(shiny) - tessellator.setBrightness(240); - tessellator.getWorldRenderer().addVertexWithUV(par1 + 0, par2 + par5, zLevel, icon.getMinU(), icon.getMaxV()); - tessellator.getWorldRenderer().addVertexWithUV(par1 + par4, par2 + par5, zLevel, icon.getMaxU(), icon.getMaxV()); - tessellator.getWorldRenderer().addVertexWithUV(par1 + par4, par2 + 0, zLevel, icon.getMaxU(), icon.getMinV()); - tessellator.getWorldRenderer().addVertexWithUV(par1 + 0, par2 + 0, zLevel, icon.getMinU(), icon.getMinV()); - tessellator.draw(); - } - -}*/ diff --git a/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java b/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java deleted file mode 100644 index 62f2a4e8c..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 6, 2014, 10:04:57 PM (GMT)] - *//* - -package vazkii.botania.client.render.item; - -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -public class RenderTransparentItem implements IItemRenderer { - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GlStateManager.translate(0F, -0.3F, 0.01F); - render(item); - GlStateManager.popMatrix(); - break; - } - case EQUIPPED : { - render(item); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item); - break; - } - default : break; - } - } - - public void render(ItemStack item) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GlStateManager.pushMatrix(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GlStateManager.disableBlend(); - GlStateManager.popMatrix(); - - GlStateManager.color(1F, 1F, 1F, 1F); - } - - -} -*/