mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
779cc7604c | ||
|
|
ad8cf9de8a | ||
|
|
78308cdb01 | ||
|
|
d203cf3fe4 | ||
|
|
9c58319e68 | ||
|
|
a7080b2439 | ||
|
|
becc642b85 | ||
|
|
a94a86b9ce | ||
|
|
4926137ff0 | ||
|
|
67605075d8 | ||
|
|
89e00c7ae8 | ||
|
|
7601eecba3 | ||
|
|
0887f76575 | ||
|
|
79210e484c | ||
|
|
fddf546474 | ||
|
|
eb7a6aee50 | ||
|
|
5104ff52d6 | ||
|
|
aee5b8c0c2 | ||
|
|
08fa70e25c | ||
|
|
ac72a5a660 | ||
|
|
400bf95a44 | ||
|
|
ba3d9ff9f8 |
No files matched your search
Binary file not shown.
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* 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<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
|
||||
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
|
||||
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> 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<? extends SubTileEntity> 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<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
|
||||
}
|
||||
// Convenience overloads for the above two calls
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(subtileBlockModels);
|
||||
}
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> 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<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(subtileItemModels);
|
||||
}
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> 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<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(subtileItemModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered island type model map
|
||||
*/
|
||||
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> 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<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
|
||||
return Collections.unmodifiableMap(islandTypeModels);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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<String> SUBTILE_ID = new PropertyObject<>("subtile_id", String.class);
|
||||
// The property for specialFlower subtile id
|
||||
public static final PropertyObject<String> SUBTILE_ID = new PropertyObject<>("subtile_id", String.class);
|
||||
|
||||
// The property for floating flower island type
|
||||
public static final PropertyObject<IFloatingFlower.IslandType> ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class);
|
||||
// The property for floating flower island type
|
||||
public static final PropertyObject<IFloatingFlower.IslandType> ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class);
|
||||
|
||||
// The property for platform held blockstate id
|
||||
public static final PropertyObject<IBlockState> HELD_STATE = new PropertyObject<>("held_state", IBlockState.class);
|
||||
// The property for platform held blockstate id
|
||||
public static final PropertyObject<IBlockState> 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<EnumDyeColor> COLOR = PropertyEnum.create("color", EnumDyeColor.class);
|
||||
// The 16 Minecraft colors
|
||||
public static final PropertyEnum<EnumDyeColor> COLOR = PropertyEnum.create("color", EnumDyeColor.class);
|
||||
|
||||
// The four cardinal directions
|
||||
public static final PropertyEnum<EnumFacing> CARDINALS = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL);
|
||||
// The four cardinal directions
|
||||
public static final PropertyEnum<EnumFacing> CARDINALS = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL);
|
||||
|
||||
// All 6 directions
|
||||
public static final PropertyEnum<EnumFacing> FACING = PropertyEnum.create("facing", EnumFacing.class);
|
||||
// All 6 directions
|
||||
public static final PropertyEnum<EnumFacing> 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<EnumFacing.Axis> AXIS_FACING = BlockRotatedPillar.AXIS;
|
||||
|
||||
// The axis directions (think quartz pillars and wood logs)
|
||||
public static final PropertyEnum<EnumFacing.Axis> AXIS_FACING = BlockRotatedPillar.AXIS;
|
||||
// Extra Quartz Blocks
|
||||
public static final PropertyEnum<QuartzVariant> QUARTZ_VARIANT = PropertyEnum.create("variant", QuartzVariant.class);
|
||||
|
||||
// Extra Quartz Blocks
|
||||
public static final PropertyEnum<QuartzVariant> QUARTZ_VARIANT = PropertyEnum.create("variant", QuartzVariant.class);
|
||||
/** Properties for individual blocks **/
|
||||
|
||||
/** Properties for individual blocks **/
|
||||
// Block18Stone
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
|
||||
|
||||
// Block18Stone
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
|
||||
// Block18StoneWall
|
||||
public static final PropertyEnum<FutureStoneVariant> 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<FutureStoneVariant> 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<AlfPortalState> ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class);
|
||||
|
||||
// BlockAlfPortal
|
||||
public static final PropertyEnum<AlfPortalState> ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class);
|
||||
// BlockAltar
|
||||
public static final PropertyEnum<AltarVariant> ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class);
|
||||
|
||||
// BlockAltar
|
||||
public static final PropertyEnum<AltarVariant> ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class);
|
||||
// BlockAltGrass
|
||||
public static final PropertyEnum<AltGrassVariant> ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class);
|
||||
|
||||
// BlockAltGrass
|
||||
public static final PropertyEnum<AltGrassVariant> ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class);
|
||||
// BlockBiomeStoneA
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONE_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class);
|
||||
|
||||
// BlockBiomeStoneA
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONE_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class);
|
||||
// BlockBiomeStoneB
|
||||
public static final PropertyEnum<BiomeBrickVariant> BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class);
|
||||
|
||||
// BlockBiomeStoneB
|
||||
public static final PropertyEnum<BiomeBrickVariant> BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class);
|
||||
// BlockBiomeStoneWall
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble"));
|
||||
|
||||
// BlockBiomeStoneWall
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble"));
|
||||
// BlockCustomBrick
|
||||
public static final PropertyEnum<CustomBrickVariant> CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class);
|
||||
|
||||
// BlockCustomBrick
|
||||
public static final PropertyEnum<CustomBrickVariant> CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class);
|
||||
// BlockDreamWood, BlockLivingWood
|
||||
public static final PropertyEnum<LivingWoodVariant> LIVINGWOOD_VARIANT = PropertyEnum.create("variant", LivingWoodVariant.class);
|
||||
|
||||
// BlockDreamWood, BlockLivingWood
|
||||
public static final PropertyEnum<LivingWoodVariant> LIVINGWOOD_VARIANT = PropertyEnum.create("variant", LivingWoodVariant.class);
|
||||
// BlockEnchanter
|
||||
public static final PropertyEnum<EnumFacing.Axis> ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y)));
|
||||
|
||||
// BlockEnchanter
|
||||
public static final PropertyEnum<EnumFacing.Axis> ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y)));
|
||||
// BlockEndStoneBrick
|
||||
public static final PropertyEnum<EndBrickVariant> ENDBRICK_VARIANT = PropertyEnum.create("variant", EndBrickVariant.class);
|
||||
|
||||
// BlockEndStoneBrick
|
||||
public static final PropertyEnum<EndBrickVariant> ENDBRICK_VARIANT = PropertyEnum.create("variant", EndBrickVariant.class);
|
||||
// BlockForestDrum
|
||||
public static final PropertyEnum<DrumVariant> DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class);
|
||||
|
||||
// BlockForestDrum
|
||||
public static final PropertyEnum<DrumVariant> DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class);
|
||||
// BlockGhostRail
|
||||
public static final PropertyEnum<BlockRailBase.EnumRailDirection> RAIL_DIRECTION = BlockRailPowered.SHAPE;
|
||||
|
||||
// BlockGhostRail
|
||||
public static final PropertyEnum<BlockRailBase.EnumRailDirection> RAIL_DIRECTION = BlockRailPowered.SHAPE;
|
||||
// BlockLightRelay
|
||||
public static final PropertyEnum<LuminizerVariant> LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class);
|
||||
|
||||
// BlockLightRelay
|
||||
public static final PropertyEnum<LuminizerVariant> LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class);
|
||||
// BlockLivingRock
|
||||
public static final PropertyEnum<LivingRockVariant> LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
|
||||
|
||||
// BlockLivingRock
|
||||
public static final PropertyEnum<LivingRockVariant> LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
|
||||
// BlockModDoubleFlower (white to gray)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7);
|
||||
|
||||
// BlockModDoubleFlower (white to gray)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7);
|
||||
// (silver to black)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15);
|
||||
|
||||
// (silver to black)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15);
|
||||
// BlockOpenCrate
|
||||
public static final PropertyEnum<CrateVariant> CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class);
|
||||
public static final PropertyEnum<CratePattern> CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class);
|
||||
|
||||
// BlockOpenCrate
|
||||
public static final PropertyEnum<CrateVariant> CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class);
|
||||
public static final PropertyEnum<CratePattern> CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class);
|
||||
// BlockPavement
|
||||
public static final PropertyEnum<EnumDyeColor> 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<EnumDyeColor> 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<PlatformVariant> PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class);
|
||||
|
||||
// BlockPlatform
|
||||
public static final PropertyEnum<PlatformVariant> PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class);
|
||||
// BlockPool
|
||||
public static final PropertyEnum<PoolVariant> POOL_VARIANT = PropertyEnum.create("variant", PoolVariant.class);
|
||||
|
||||
// BlockPool
|
||||
public static final PropertyEnum<PoolVariant> 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<PrismarineVariant> PRISMARINE_VARIANT = PropertyEnum.create("variant", PrismarineVariant.class);
|
||||
|
||||
// BlockPrismarine
|
||||
public static final PropertyEnum<PrismarineVariant> PRISMARINE_VARIANT = PropertyEnum.create("variant", PrismarineVariant.class);
|
||||
// BlockPylon
|
||||
public static final PropertyEnum<PylonVariant> PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class);
|
||||
|
||||
// BlockPylon
|
||||
public static final PropertyEnum<PylonVariant> PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class);
|
||||
// BlockSpreader
|
||||
public static final PropertyEnum<SpreaderVariant> SPREADER_VARIANT = PropertyEnum.create("variant", SpreaderVariant.class);
|
||||
|
||||
// BlockSpreader
|
||||
public static final PropertyEnum<SpreaderVariant> SPREADER_VARIANT = PropertyEnum.create("variant", SpreaderVariant.class);
|
||||
// BlockStorage
|
||||
public static final PropertyEnum<StorageVariant> STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class);
|
||||
|
||||
// BlockStorage
|
||||
public static final PropertyEnum<StorageVariant> STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class);
|
||||
|
||||
private BotaniaStateProps() {}
|
||||
private BotaniaStateProps() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* 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<T> implements IUnlistedProperty<T> {
|
||||
|
||||
private final String name;
|
||||
private final Class<T> clazz;
|
||||
private final Predicate<T> validator;
|
||||
private final Function<T, String> stringFunction;
|
||||
private final String name;
|
||||
private final Class<T> clazz;
|
||||
private final Predicate<T> validator;
|
||||
private final Function<T, String> stringFunction;
|
||||
|
||||
public PropertyObject(String name, Class<T> clazz, Predicate<T> validator, Function<T, String> stringFunction) {
|
||||
this.name = name;
|
||||
this.clazz = clazz;
|
||||
this.validator = validator;
|
||||
this.stringFunction = stringFunction;
|
||||
}
|
||||
public PropertyObject(String name, Class<T> clazz, Predicate<T> validator, Function<T, String> stringFunction) {
|
||||
this.name = name;
|
||||
this.clazz = clazz;
|
||||
this.validator = validator;
|
||||
this.stringFunction = stringFunction;
|
||||
}
|
||||
|
||||
public PropertyObject(String name, Class<T> clazz) {
|
||||
this(name, clazz, Predicates.alwaysTrue(), Object::toString);
|
||||
}
|
||||
public PropertyObject(String name, Class<T> 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<T> getType() {
|
||||
return clazz;
|
||||
}
|
||||
@Override
|
||||
public Class<T> getType() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String valueToString(T value) {
|
||||
return stringFunction.apply(value);
|
||||
}
|
||||
@Override
|
||||
public String valueToString(T value) {
|
||||
return stringFunction.apply(value);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
}
|
||||
|
||||
public boolean isValidBinding() {
|
||||
return supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && linkedPool != null && !linkedPool.isInvalid() && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
|
||||
return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -630,7 +630,7 @@ public final class ModelHandler {
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.hourglass), 0, TileHourglass.class);
|
||||
|
||||
registerItemModel(ModBlocks.pump); // todo await animation api
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.pump), 0, TilePump.class);
|
||||
//ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.pump), 0, TilePump.class);
|
||||
|
||||
registerItemModel(ModBlocks.teruTeruBozu);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.teruTeruBozu), 0, TileTeruTeruBozu.class);
|
||||
@@ -806,7 +806,6 @@ public final class ModelHandler {
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.brewery, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.gaiaHead, new StateMap.Builder().ignore(BlockSkull.FACING, BlockSkull.NODROP).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.hourglass, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.pump, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
|
||||
}
|
||||
|
||||
private static void registerMushrooms() {
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.client.model.animation.AnimationTESR;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.item.IExtendedPlayerController;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -236,14 +237,13 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingFlower.class, renderTileFloatingFlower);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingSpecialFlower.class, renderTileFloatingFlower);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato());
|
||||
// ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileStarfield.class, new RenderTileStarfield());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBrewery.class, new RenderTileBrewery());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTerraPlate.class, new RenderTileTerraPlate());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileRedString.class, new RenderTileRedString());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePrism.class, new RenderTilePrism());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaIndex.class, new RenderTileCorporeaIndex());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new RenderTilePump());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new AnimationTESR<>());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaCrystalCube.class, new RenderTileCorporeaCrystalCube());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileIncensePlate.class, new RenderTileIncensePlate());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileHourglass.class, new RenderTileHourglass());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+56
-55
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) 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());
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipeBrew> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeBrew> getRecipeClass() {
|
||||
return RecipeBrew.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeBrew> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+39
-33
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack> output;
|
||||
private final List input;
|
||||
private final List<ItemStack> 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<ItemStack> getOutputs() {
|
||||
return output;
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() { return ImmutableList.of(); }
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() { return ImmutableList.of(); }
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+68
-68
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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));
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipeElvenTrade> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeElvenTrade> getRecipeClass() {
|
||||
return RecipeElvenTrade.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeElvenTrade> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+38
-36
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+65
-64
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) wrapper.getOutputs().get(0)));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipeManaInfusion> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeManaInfusion> getRecipeClass() {
|
||||
return RecipeManaInfusion.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeManaInfusion> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+45
-44
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+66
-65
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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));
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipePetals> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipePetals> getRecipeClass() {
|
||||
return RecipePetals.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipePetals> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+38
-36
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+68
-67
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) 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<ItemStack>) wrapper.getOutputs().get(0)));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(2, ((ItemStack) wrapper.getOutputs().get(0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipePureDaisy> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipePureDaisy> getRecipeClass() {
|
||||
return RecipePureDaisy.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipePureDaisy> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+45
-43
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<FluidStack> fluidInputs = ImmutableList.of();
|
||||
private List<FluidStack> fluidOutputs = ImmutableList.of();
|
||||
private List inputs = ImmutableList.of();
|
||||
private List outputs = ImmutableList.of();
|
||||
private List<FluidStack> fluidInputs = ImmutableList.of();
|
||||
private List<FluidStack> 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<FluidStack> getFluidInputs() {
|
||||
return fluidInputs;
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return fluidInputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return fluidOutputs;
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+66
-65
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack>) 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<ItemStack>) 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));
|
||||
}
|
||||
|
||||
}
|
||||
+20
-20
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<RecipeRuneAltar> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeRuneAltar> getRecipeClass() {
|
||||
return RecipeRuneAltar.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeRuneAltar> 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;
|
||||
}
|
||||
|
||||
}
|
||||
+43
-42
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public List<FluidStack> 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) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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 21, 2014, 8:03:06 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.lib;
|
||||
|
||||
public final class LibRenderIDs {
|
||||
|
||||
public static int idAltar = -1;
|
||||
public static int idSpecialFlower = -1;
|
||||
public static int idSpreader = -1;
|
||||
public static int idPool = -1;
|
||||
public static int idPylon = -1;
|
||||
public static int idMiniIsland = -1;
|
||||
public static int idTinyPotato = -1;
|
||||
public static int idSpawnerClaw = -1;
|
||||
public static int idBrewery = -1;
|
||||
public static int idCorporeaIndex = -1;
|
||||
public static int idPump = -1;
|
||||
public static int idDoubleFlower = -1;
|
||||
public static int idCorporeaCrystalCybe = -1;
|
||||
public static int idIncensePlate = -1;
|
||||
public static int idHourglass = -1;
|
||||
public static int idCocoon = -1;
|
||||
public static int idLightRelay = -1;
|
||||
public static int idBellows = -1;
|
||||
public static int idTeruTeruBozu = -1;
|
||||
public static int idAvatar = -1;
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p/>
|
||||
* 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<IFloatingFlower.IslandType, String, CompositeBakedModel> CACHE = HashBasedTable.create();
|
||||
|
||||
private static Table<IFloatingFlower.IslandType, String, CompositeBakedModel> 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<BakedQuad> 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<BakedQuad> getGeneralQuads() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
private static class CompositeBakedModel implements IBakedModel {
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private final IBakedModel base;
|
||||
private final List<BakedQuad> genQuads;
|
||||
@Override
|
||||
public boolean isGui3d() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public CompositeBakedModel(IBakedModel flower, IBakedModel island) {
|
||||
this.base = flower;
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
ImmutableList.Builder<BakedQuad> 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<BakedQuad> genQuads;
|
||||
|
||||
public CompositeBakedModel(IBakedModel flower, IBakedModel island) {
|
||||
this.base = flower;
|
||||
|
||||
ImmutableList.Builder<BakedQuad> 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<BakedQuad> getGeneralQuads() {
|
||||
return genQuads;
|
||||
}
|
||||
@Override public List<BakedQuad> 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<BakedQuad> getGeneralQuads() {
|
||||
return genQuads;
|
||||
}
|
||||
|
||||
// Dummy results
|
||||
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public List<BakedQuad> 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<BakedQuad> 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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* <p>
|
||||
* 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<ResourceLocation, TextureAtlasSprite> 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<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
|
||||
private static final Set<String> 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<BakedQuad> quads, int color)
|
||||
{
|
||||
for (BakedQuad bakedquad : quads)
|
||||
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color) {
|
||||
for(BakedQuad bakedquad : quads)
|
||||
LightUtil.renderQuadColor(renderer, bakedquad, color);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public List<BakedQuad> 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<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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<ResourceLocation, TextureAtlasSprite> textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
final Function<ResourceLocation, TextureAtlasSprite> textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
|
||||
ImmutableList<String> standardGroups = ImmutableList.of("Crystal", "Crystal_Ring",
|
||||
"Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04",
|
||||
"Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
|
||||
ImmutableList<String> 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<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public List<BakedQuad> 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<BakedQuad> 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<BakedQuad> 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<? extends IFlexibleBakedModel, Matrix4f> 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<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return parent.getFaceQuads(p_177551_1_); }
|
||||
@Override public List<BakedQuad> 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<? extends IFlexibleBakedModel, Matrix4f> 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<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) {
|
||||
return parent.getFaceQuads(p_177551_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* <p>
|
||||
* 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.<Optional<String>, ModelResourceLocation>of(), ImmutableMap.<Optional<String>, ModelResourceLocation>of());
|
||||
// SpecialFlowerModel for when there are no blockModels registered for a subtile
|
||||
public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.<Optional<String>, ModelResourceLocation>of(), ImmutableMap.<Optional<String>, ModelResourceLocation>of());
|
||||
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
|
||||
|
||||
public SpecialFlowerModel(ImmutableMap<Optional<String>, ModelResourceLocation> blockModels,
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> itemModels) {
|
||||
this.blockModels = blockModels;
|
||||
this.itemModels = itemModels;
|
||||
}
|
||||
public SpecialFlowerModel(ImmutableMap<Optional<String>, ModelResourceLocation> blockModels,
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> itemModels) {
|
||||
this.blockModels = blockModels;
|
||||
this.itemModels = itemModels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies() {
|
||||
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
|
||||
builder.addAll(blockModels.values());
|
||||
builder.addAll(itemModels.values());
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies() {
|
||||
ImmutableSet.Builder<ResourceLocation> 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<ResourceLocation> getTextures() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
@Override
|
||||
public Collection<ResourceLocation> getTextures() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> 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<ResourceLocation, TextureAtlasSprite> 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<String, String> customData) {
|
||||
// Load the base variant from blockstate json, and also add all the model paths we received from external API
|
||||
ImmutableMap.Builder<Optional<String>, ModelResourceLocation> blockBuilder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<Optional<String>, ModelResourceLocation> itemBuilder = ImmutableMap.builder();
|
||||
@Override
|
||||
public IModel process(ImmutableMap<String, String> customData) {
|
||||
// Load the base variant from blockstate json, and also add all the model paths we received from external API
|
||||
ImmutableMap.Builder<Optional<String>, ModelResourceLocation> blockBuilder = ImmutableMap.builder();
|
||||
ImmutableMap.Builder<Optional<String>, ModelResourceLocation> itemBuilder = ImmutableMap.builder();
|
||||
|
||||
for (String key : customData.keySet()) {
|
||||
if ("base".equals(key)) {
|
||||
blockBuilder.put(Optional.<String>absent(), getLocation(customData.get(key)));
|
||||
}
|
||||
}
|
||||
for(String key : customData.keySet()) {
|
||||
if("base".equals(key)) {
|
||||
blockBuilder.put(Optional.<String>absent(), getLocation(customData.get(key)));
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) {
|
||||
blockBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) {
|
||||
itemBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
for(Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) {
|
||||
blockBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
for(Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) {
|
||||
itemBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> blockModels = blockBuilder.build();
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> itemModels = itemBuilder.build();
|
||||
if (blockModels.isEmpty() && itemModels.isEmpty()) return INSTANCE;
|
||||
return new SpecialFlowerModel(blockModels, itemModels);
|
||||
}
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> blockModels = blockBuilder.build();
|
||||
ImmutableMap<Optional<String>, 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<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
|
||||
private final VertexFormat vertexFormat;
|
||||
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> blockModels;
|
||||
private final ImmutableMap<Optional<String>, ModelResourceLocation> itemModels;
|
||||
private final VertexFormat vertexFormat;
|
||||
|
||||
private IBakedModel baseModel;
|
||||
private ImmutableMap<String, IBakedModel> bakedBlockModels;
|
||||
private ImmutableMap<String, IBakedModel> bakedItemModels;
|
||||
private ImmutableMap<Optional<EnumFacing>, ImmutableList<BakedQuad>> quads;
|
||||
private IBakedModel baseModel;
|
||||
private ImmutableMap<String, IBakedModel> bakedBlockModels;
|
||||
private ImmutableMap<String, IBakedModel> bakedItemModels;
|
||||
private ImmutableMap<Optional<EnumFacing>, ImmutableList<BakedQuad>> quads;
|
||||
|
||||
public SpecialFlowerBakedModel(ImmutableMap<Optional<String>, ModelResourceLocation> blockModels,
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> itemModels,
|
||||
VertexFormat format, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> cameraTransforms) {
|
||||
this.blockModels = blockModels;
|
||||
this.itemModels = itemModels;
|
||||
this.vertexFormat = format;
|
||||
this.transforms = cameraTransforms;
|
||||
}
|
||||
public SpecialFlowerBakedModel(ImmutableMap<Optional<String>, ModelResourceLocation> blockModels,
|
||||
ImmutableMap<Optional<String>, ModelResourceLocation> itemModels,
|
||||
VertexFormat format, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> 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.<String>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.<String>absent());
|
||||
|
||||
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
|
||||
for (Map.Entry<Optional<String>, ModelResourceLocation> e : blockModels.entrySet()) {
|
||||
if (e.getKey().isPresent()) {
|
||||
builder.put(e.getKey().get(), getBlockModel(manager, e.getKey()));
|
||||
}
|
||||
}
|
||||
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
|
||||
for(Map.Entry<Optional<String>, 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<String, IBakedModel> builder2 = ImmutableMap.builder();
|
||||
for (Map.Entry<Optional<String>, ModelResourceLocation> e : itemModels.entrySet()) {
|
||||
if (e.getKey().isPresent()) {
|
||||
builder2.put(e.getKey().get(), getItemModel(manager, e.getKey()));
|
||||
}
|
||||
}
|
||||
ImmutableMap.Builder<String, IBakedModel> builder2 = ImmutableMap.builder();
|
||||
for(Map.Entry<Optional<String>, 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<Optional<EnumFacing>, ImmutableList<BakedQuad>> quadBuilder = ImmutableMap.builder();
|
||||
quadBuilder.put(Optional.<EnumFacing>absent(), buildQuads(Optional.<EnumFacing>absent()));
|
||||
for (EnumFacing side : EnumFacing.values()) {
|
||||
quadBuilder.put(Optional.of(side), buildQuads(Optional.of(side)));
|
||||
}
|
||||
quads = quadBuilder.build();
|
||||
}
|
||||
}
|
||||
ImmutableMap.Builder<Optional<EnumFacing>, ImmutableList<BakedQuad>> quadBuilder = ImmutableMap.builder();
|
||||
quadBuilder.put(Optional.<EnumFacing>absent(), buildQuads(Optional.<EnumFacing>absent()));
|
||||
for(EnumFacing side : EnumFacing.values()) {
|
||||
quadBuilder.put(Optional.of(side), buildQuads(Optional.of(side)));
|
||||
}
|
||||
quads = quadBuilder.build();
|
||||
}
|
||||
}
|
||||
|
||||
private IBakedModel getBlockModel(ModelManager manager, Optional<String> 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<String> 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<String> 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<String> opt) {
|
||||
ModelResourceLocation loc = itemModels.get(opt);
|
||||
if(loc == null) {
|
||||
loc = new ModelResourceLocation("builtin/missing", "missing");
|
||||
}
|
||||
return manager.getModel(loc);
|
||||
}
|
||||
|
||||
private ImmutableList<BakedQuad> buildQuads(Optional<EnumFacing> side) {
|
||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||
for (IBakedModel model : bakedBlockModels.values()) {
|
||||
if (side.isPresent()) {
|
||||
builder.addAll(model.getFaceQuads(side.get()));
|
||||
} else {
|
||||
builder.addAll(model.getGeneralQuads());
|
||||
}
|
||||
}
|
||||
private ImmutableList<BakedQuad> buildQuads(Optional<EnumFacing> side) {
|
||||
ImmutableList.Builder<BakedQuad> 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<BakedQuad> getFaceQuads(EnumFacing side) {
|
||||
refreshBakedModels();
|
||||
return quads.get(Optional.of(side));
|
||||
}
|
||||
@Override
|
||||
public List<BakedQuad> getFaceQuads(EnumFacing side) {
|
||||
refreshBakedModels();
|
||||
return quads.get(Optional.of(side));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
refreshBakedModels();
|
||||
return quads.get(Optional.<EnumFacing>absent());
|
||||
}
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
refreshBakedModels();
|
||||
return quads.get(Optional.<EnumFacing>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<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType);
|
||||
}
|
||||
@Override
|
||||
public Pair<? extends IFlexibleBakedModel, Matrix4f> 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,138 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,51 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,96 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -1,124 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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();
|
||||
}
|
||||
|
||||
}*/
|
||||
@@ -1,81 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
@@ -26,14 +27,11 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelIncensePlate;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncensePlate> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
};
|
||||
|
||||
ResourceLocation texture = new ResourceLocation(LibResources.MODEL_INCENSE_PLATE);
|
||||
ModelIncensePlate model = new ModelIncensePlate();
|
||||
private static final Map<EnumFacing, Integer> ROTATIONS = ImmutableMap.of(EnumFacing.NORTH, 180, EnumFacing.SOUTH, 0, EnumFacing.WEST, 270, EnumFacing.EAST, 90);
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
@@ -45,27 +43,17 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
// Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
// model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS.get(facing), 0F, 1F, 0F);
|
||||
|
||||
ItemStack stack = plate.getStackInSlot(0);
|
||||
if(stack != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
float s = 0.4F;
|
||||
GlStateManager.translate(-0.075F, -1.25F, 0F);
|
||||
GlStateManager.scale(s, s, s);
|
||||
//GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -10,15 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraftforge.client.model.animation.FastTESR;
|
||||
import vazkii.botania.client.core.handler.RedStringRenderer;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
|
||||
public class RenderTileRedString extends TileEntitySpecialRenderer<TileRedString> {
|
||||
public class RenderTileRedString extends FastTESR<TileRedString> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileRedString trs, double x, double y, double z, float partticks, int digProgress) {
|
||||
public void renderTileEntityFast(TileRedString trs, double x, double y, double z, float partialTicks, int destroyStage, WorldRenderer worldRenderer) {
|
||||
RedStringRenderer.redStringTiles.add(trs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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, 5:46:10 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpawnerClaw;
|
||||
|
||||
public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPAWNER_CLAW);
|
||||
private static final ModelSpawnerClaw model = new ModelSpawnerClaw();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
model.render();
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
GlStateManager.disableFog();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks);
|
||||
float f7;
|
||||
@@ -137,7 +137,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
float lowA = Math.max(0F, effCelAng - 0.3F) * f6;
|
||||
float a = Math.max(0.1F, lowA);
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.color(1F, 1F, 1F, (a * 4) * (1F - insideVoid));
|
||||
GlStateManager.rotate(90F, 0.5F, 0.5F, 0.0F);
|
||||
@@ -176,7 +176,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
f10 = 20F;
|
||||
a = lowA;
|
||||
GlStateManager.pushMatrix();
|
||||
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
|
||||
GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0);
|
||||
GlStateManager.translate(0F, -1F, 0F);
|
||||
GlStateManager.rotate(220F, 1F, 0F, 0F);
|
||||
GlStateManager.color(1F, 1F, 1F, a);
|
||||
@@ -237,7 +237,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
|
||||
// === Rainbow
|
||||
GlStateManager.pushMatrix();
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
mc.renderEngine.bindTexture(textureRainbow);
|
||||
f10 = 10F;
|
||||
float effCelAng1 = celAng;
|
||||
@@ -280,7 +280,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
|
||||
GlStateManager.color(1F, 1F, 1F, 1F - insideVoid);
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
|
||||
GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0);
|
||||
|
||||
// === Sun
|
||||
GlStateManager.rotate(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
@@ -29,7 +29,6 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileAvatar;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -160,7 +159,7 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idAvatar;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileCocoon;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -55,7 +54,7 @@ public class BlockCocoon extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idCocoon;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,6 @@ import vazkii.botania.api.mana.IManaTrigger;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileHourglass;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -124,7 +123,8 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2);
|
||||
if(state.getValue(BotaniaStateProps.POWERED))
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,7 +177,7 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idHourglass;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
@@ -233,4 +234,12 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(field_181084_N, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
|
||||
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,6 +27,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -77,7 +79,12 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
if (meta >= EnumDyeColor.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)).withProperty(type, EnumFlowerType.POPPY);
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.withProperty(type, EnumFlowerType.POPPY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -109,7 +108,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idTeruTeruBozu;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.tile.mana.TileBellows;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
@@ -85,7 +84,7 @@ public class BlockBellows extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idBellows;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,6 @@ import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.tile.TileBrewery;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
@@ -144,7 +143,7 @@ public class BlockBrewery extends BlockModContainer implements ILexiconable, IWa
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idBrewery;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -21,9 +22,12 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
@@ -39,12 +43,12 @@ public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
setStepSound(soundTypeStone);
|
||||
setUnlocalizedName(LibBlockNames.PUMP);
|
||||
setBlockBounds(EnumFacing.Axis.X);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
setDefaultState(blockState.getBaseState().withProperty(Properties.StaticProperty, true).withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.CARDINALS);
|
||||
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.CARDINALS, Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,6 +56,11 @@ public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
return state.getValue(BotaniaStateProps.CARDINALS).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.withProperty(Properties.StaticProperty, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta < 2 || meta > 5) {
|
||||
@@ -79,11 +88,6 @@ public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idPump;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
public class TileMod extends TileEntity implements ITickable {
|
||||
|
||||
@@ -65,7 +66,21 @@ public class TileMod extends TileEntity implements ITickable {
|
||||
@Override
|
||||
public final void update() {
|
||||
if (!isInvalid() && worldObj.isBlockLoaded(getPos(), false)) {
|
||||
updateEntity();
|
||||
if (!worldObj.isRemote)
|
||||
updateEntity();
|
||||
else {
|
||||
try {
|
||||
updateEntity();
|
||||
} catch (Exception e) { // todo 1.8 remove this abhorration after I figure out what's going on.
|
||||
e.printStackTrace();
|
||||
FMLLog.severe("[Botania]: CLIENT TICK FAILED");
|
||||
FMLLog.severe("[Botania]: World: %s, Pos: %s, TE: %s", worldObj, pos, this);
|
||||
if (this instanceof TileSpecialFlower) {
|
||||
TileSpecialFlower spec = ((TileSpecialFlower) this);
|
||||
FMLLog.severe("[Botania]: SUBTILE: %s", spec.getSubTile().getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TilePylon extends TileEntity implements ITickable {
|
||||
public void update() {
|
||||
++ticks;
|
||||
|
||||
if (worldObj.getBlockState(getPos()) != ModBlocks.pylon)
|
||||
if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.pylon)
|
||||
return;
|
||||
|
||||
PylonVariant variant = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT);
|
||||
|
||||
@@ -42,13 +42,10 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
|
||||
}
|
||||
|
||||
public List<ItemStack> getFilter() {
|
||||
List<ItemStack> filter = new ArrayList();
|
||||
List<ItemStack> filter = new ArrayList<>();
|
||||
|
||||
final int[] orientationToDir = new int[] {
|
||||
3, 4, 2, 5
|
||||
};
|
||||
final int[] rotationToStackSize = new int[] {
|
||||
1, 16, 32, 64
|
||||
1, 16, 24, 32, 40, 48, 56, 64
|
||||
};
|
||||
|
||||
for(EnumFacing dir : LibMisc.CARDINAL_DIRECTIONS) {
|
||||
@@ -95,15 +92,14 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
|
||||
|
||||
List<ItemStack> stacks = CorporeaHelper.requestItem(request, count, spark, true, true);
|
||||
spark.onItemsRequested(stacks);
|
||||
for(ItemStack reqStack : stacks)
|
||||
if(request != null) {
|
||||
if(inv != null && !(inv instanceof TileCorporeaFunnel) && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, EnumFacing.UP))
|
||||
InventoryHelper.insertItemIntoInventory(inv, reqStack);
|
||||
else {
|
||||
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
for(ItemStack reqStack : stacks) {
|
||||
if(inv != null && !(inv instanceof TileCorporeaFunnel) && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, EnumFacing.UP))
|
||||
InventoryHelper.insertItemIntoInventory(inv, reqStack);
|
||||
else {
|
||||
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,14 +10,23 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile.mana;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.client.model.animation.IAnimationProvider;
|
||||
import net.minecraftforge.client.model.animation.ITimeValue;
|
||||
import net.minecraftforge.client.model.animation.TimeValues;
|
||||
import net.minecraftforge.common.model.animation.IAnimationStateMachine;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TilePump extends TileMod {
|
||||
public class TilePump extends TileMod implements IAnimationProvider {
|
||||
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
|
||||
@@ -31,6 +40,19 @@ public class TilePump extends TileMod {
|
||||
public boolean hasRedstone = false;
|
||||
int lastComparator = 0;
|
||||
|
||||
private final TimeValues.VariableValue move;
|
||||
private final IAnimationStateMachine asm;
|
||||
|
||||
public TilePump() {
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
move = new TimeValues.VariableValue(0);
|
||||
asm = Animation.INSTANCE.load(new ResourceLocation("botania", "asms/block/pump.json"), ImmutableMap.of("move", move));
|
||||
} else {
|
||||
move = null;
|
||||
asm = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
hasRedstone = false;
|
||||
@@ -64,6 +86,8 @@ public class TilePump extends TileMod {
|
||||
moving = 0F;
|
||||
}
|
||||
}
|
||||
move.setValue(innerRingPos / 8 * 0.5F); // rescale to 0 - 0.5 for json animation
|
||||
|
||||
|
||||
if(!hasCartOnTop)
|
||||
comparator = 0;
|
||||
@@ -87,7 +111,11 @@ public class TilePump extends TileMod {
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
boolean prevActive = active;
|
||||
active = cmp.getBoolean(TAG_ACTIVE);
|
||||
if(worldObj != null && worldObj.isRemote)
|
||||
if(prevActive != active)
|
||||
asm.transition(active ? "moving" : "default");
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
@@ -99,4 +127,8 @@ public class TilePump extends TileMod {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnimationStateMachine asm() {
|
||||
return asm;
|
||||
}
|
||||
}
|
||||
@@ -90,4 +90,9 @@ public abstract class TileRedString extends TileMod implements ITileBound {
|
||||
return binding == null ? Blocks.air : worldObj.getBlockState(binding).getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFastRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
@@ -26,13 +32,22 @@ public class ItemWaterRod extends ItemMod implements IManaUsingItem {
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.doesWaterVaporize()) {
|
||||
|
||||
ItemStack stackToPlace = new ItemStack(Blocks.flowing_water);
|
||||
stackToPlace.onItemUse(par2EntityPlayer, par3World, pos, side, par8, par9, par10);
|
||||
// Adapted from bucket code
|
||||
MovingObjectPosition mop = getMovingObjectPositionFromPlayer(par3World, par2EntityPlayer, false);
|
||||
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
BlockPos hitPos = mop.getBlockPos();
|
||||
if(!par3World.isBlockModifiable(par2EntityPlayer, hitPos))
|
||||
return false;
|
||||
BlockPos placePos = hitPos.offset(mop.sideHit);
|
||||
if(par2EntityPlayer.canPlayerEdit(placePos, mop.sideHit, par1ItemStack)) {
|
||||
if (ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, true)
|
||||
&& ((ItemBucket) Items.water_bucket).tryPlaceContainedLiquid(par3World, placePos)) {
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
}
|
||||
}
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(par3World, pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -81,10 +81,9 @@ public final class SkyblockWorldEvents {
|
||||
}
|
||||
} else if(equipped != null && equipped.getItem() == Items.bowl && event.action == Action.RIGHT_CLICK_BLOCK && !event.world.isRemote) {
|
||||
MovingObjectPosition movingobjectposition = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, true, 4.5F);
|
||||
|
||||
if(movingobjectposition != null) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !event.world.isRemote) {
|
||||
if(event.world.getBlockState(event.pos).getBlock().getMaterial() == Material.water) {
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
if(event.world.getBlockState(movingobjectposition.getBlockPos()).getBlock().getMaterial() == Material.water) {
|
||||
--equipped.stackSize;
|
||||
|
||||
if(equipped.stackSize <= 0)
|
||||
|
||||
@@ -37,7 +37,7 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
|
||||
@Override
|
||||
public int getSpawnFuzz() {
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +47,7 @@ public class WorldTypeSkyblock extends WorldType {
|
||||
|
||||
@Override
|
||||
public IChunkProvider getChunkGenerator(World world, String generatorOptions) {
|
||||
return new ChunkProviderFlat(world, world.getSeed(), false, "2;1x0;");
|
||||
return new ChunkProviderFlat(world, world.getSeed(), false, "3;minecraft:air;");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"joints": {
|
||||
"head": { "0": [ 1.0 ], "1": [ 1.0 ], "2": [ 1.0 ], "3": [ 1.0 ] }
|
||||
},
|
||||
"clips": {
|
||||
"default": {
|
||||
"loop": false,
|
||||
"joint_clips": {},
|
||||
"events": {}
|
||||
},
|
||||
"moving": {
|
||||
"loop": false,
|
||||
"joint_clips": {
|
||||
"head": [{
|
||||
"variable": "offset_z",
|
||||
"type": "uniform",
|
||||
"interpolation": "linear",
|
||||
"samples": [ 0, 0.5, 0 ]
|
||||
}]
|
||||
},
|
||||
"events": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"parameters": {},
|
||||
"clips": {
|
||||
"default": "botania:block/pump_head@default",
|
||||
"moving": [ "apply", "botania:block/pump_head@moving", "#move" ]
|
||||
},
|
||||
"states": [ "default", "moving" ],
|
||||
"transitions": {
|
||||
"default": "moving",
|
||||
"moving": "default"
|
||||
},
|
||||
"start_state": "default"
|
||||
}
|
||||
@@ -1,12 +1,33 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "botania:dummy",
|
||||
"textures": {
|
||||
"particle": "botania:blocks/livingrock0"
|
||||
}
|
||||
},
|
||||
"transform": "forge:default-block"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}]
|
||||
"facing": {
|
||||
"north": {},
|
||||
"south": { "y": 180 },
|
||||
"west": { "y": 270 },
|
||||
"east": { "y": 90 }
|
||||
},
|
||||
"static": {
|
||||
"true": {
|
||||
"model": "botania:pump"
|
||||
},
|
||||
"false": {
|
||||
"model": "botania:pump_head"
|
||||
}
|
||||
},
|
||||
"inventory": [{
|
||||
"model": "botania:pump",
|
||||
"submodel": {
|
||||
"head": {
|
||||
"model": "botania:pump_head"
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -3300,7 +3300,7 @@ botania.page.corporeaIndex7=A certain magical one at that
|
||||
botania.entry.corporeaFunnel=Corporea Funnel
|
||||
botania.tagline.corporeaFunnel=Request items from a Corporea network via redstone
|
||||
botania.page.corporeaFunnel0=A simpler block that utilizes the prospects of the &4Corporea Network&0 is the &1Corporea Funnel&0, when given access to a network through a &1Corporea Spark&0 on top, it'll pull a single item from the network when given a redstone signal.<br>This item is put into an inventory 1 or 2 blocks below it, or case one doesn't exist or is full, tossed into the world right above the funnel.
|
||||
botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.<br>Rotating the item changes how many will be requested at once, starting at 1, rotating once, twice and three times will pull 16, 32 and 64, respectively.
|
||||
botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.<br>Rotating the item changes how many will be requested at once, starting at 1, rotating once will pull 16, and each rotation thereafter increases the count by 8, up to a maximum of 64.
|
||||
botania.page.corporeaFunnel2=Energistically applied
|
||||
|
||||
# -- CORPOREA INTERCEPTOR
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"name": "EndNorth",
|
||||
"from": [ 4.0, 0.0, 0.0 ],
|
||||
"to": [ 12.0, 8.0, 1.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "EndSouth",
|
||||
"from": [ 4.0, 0.0, 15.0 ],
|
||||
"to": [ 12.0, 8.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Axle",
|
||||
"from": [ 6.0, 2.0, 1.0 ],
|
||||
"to": [ 10.0, 6.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 4.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 14.0, 4.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 4.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 14.0, 4.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 14.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "PinkTop",
|
||||
"from": [ 4.0, 7.0, 11.0 ],
|
||||
"to": [ 12.0, 8.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "PinkBottom",
|
||||
"from": [ 4.0, 0.0, 11.0 ],
|
||||
"to": [ 12.0, 1.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 1.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "PinkWest",
|
||||
"from": [ 4.0, 1.0, 11.0 ],
|
||||
"to": [ 5.0, 7.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 6.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 6.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "PinkEast",
|
||||
"from": [ 11.0, 1.0, 11.0 ],
|
||||
"to": [ 12.0, 7.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 6.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 4.0, 6.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"name": "BlueTop",
|
||||
"from": [ 5.0, 6.0, 1.0 ],
|
||||
"to": [ 11.0, 7.0, 7.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 6.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BlueBottom",
|
||||
"from": [ 5.0, 1.0, 1.0 ],
|
||||
"to": [ 11.0, 2.0, 7.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 1.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 6.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BlueWest",
|
||||
"from": [ 5.0, 2.0, 1.0 ],
|
||||
"to": [ 6.0, 6.0, 7.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 4.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 4.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BlueEast",
|
||||
"from": [ 10.0, 2.0, 1.0 ],
|
||||
"to": [ 11.0, 6.0, 7.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"east": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 4.0 ] },
|
||||
"south": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 4.0 ] },
|
||||
"west": { "texture": "#-1", "uv": [ 0.0, 0.0, 6.0, 4.0 ] },
|
||||
"up": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] },
|
||||
"down": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 6.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"parent": "builtin/entity"
|
||||
}
|
||||
Reference in new issue
Block a user