diff --git a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java index 331984185..3a599dff9 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -47,6 +47,7 @@ import vazkii.botania.api.state.enums.FutureStoneVariant; import vazkii.botania.api.state.enums.LivingRockVariant; import vazkii.botania.api.state.enums.LivingWoodVariant; import vazkii.botania.api.state.enums.LuminizerVariant; +import vazkii.botania.api.state.enums.PoolVariant; import vazkii.botania.api.state.enums.PrismarineVariant; import vazkii.botania.api.state.enums.PylonVariant; import vazkii.botania.api.state.enums.StorageVariant; @@ -430,6 +431,7 @@ public final class ModelHandler { registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "variant"); registerVariantsDefaulted(ModBlocks.customBrick, CustomBrickVariant.class, "variant"); registerVariantsDefaulted(ModBlocks.prismarine, PrismarineVariant.class, "variant"); + registerVariantsDefaulted(ModBlocks.pool, PoolVariant.class, "variant"); } private static void registerStandardItems() { diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java index 7c399f962..b4951a548 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java @@ -10,15 +10,23 @@ */ package vazkii.botania.common.item.block; +import java.awt.*; import java.util.List; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.client.core.handler.ClientTickHandler; public class ItemBlockPool extends ItemBlockWithMetadataAndName { + private final Random rand = new Random(); + public ItemBlockPool(Block par2Block) { super(par2Block); } @@ -30,4 +38,16 @@ public class ItemBlockPool extends ItemBlockWithMetadataAndName { par3List.add(StatCollector.translateToLocal("botaniamisc.creativePool" + i)); } + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int renderPass) { + if (stack.getItemDamage() == PoolVariant.FABULOUS.ordinal() && renderPass == 0) { + float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks; + time += rand.nextInt(100000); + return Color.getHSBColor(time * 0.005F, 0.6F, 1F).hashCode(); + } else { + return 16777215; + } + } + } diff --git a/src/main/resources/assets/botania/blockstates/pool.json b/src/main/resources/assets/botania/blockstates/pool.json new file mode 100644 index 000000000..e515b21c9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pool.json @@ -0,0 +1,21 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:pool", + "transform": "forge:default-block" + }, + "variants": { + "variant": { + "default": { "textures": { "all": "botania:model/poolCopy" } }, + "diluted": { "textures": { "all": "botania:model/poolCopy" } }, + "creative": { + "model": "botania:pool_filled", + "textures": { "all": "botania:model/poolCopy", "liquid": "botania:blocks/manaWater" } + }, + "fabulous": { + "model": "botania:pool_tinted", + "textures": { "all": "botania:model/poolCopy" } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pool.json b/src/main/resources/assets/botania/models/block/pool.json new file mode 100644 index 000000000..65ae0a289 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pool.json @@ -0,0 +1,69 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + "particle": "botania:blocks/livingrock0" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 1.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 4.25 ] }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 4.25 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 4.25 ] }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 4.25 ] }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "cullface": "down" } + } + }, + { + "name": "SideSouth", + "from": [ 0.0, 1.0, 15.0 ], + "to": [ 16.0, 8.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ] }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "cullface": "south" }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ] }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ] } + } + }, + { + "name": "SideNorth", + "from": [ 0.0, 1.0, 0.0 ], + "to": [ 16.0, 8.0, 1.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "cullface": "north" }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ] }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ] }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ] } + } + }, + { + "name": "SideWest", + "from": [ 0.0, 1.0, 1.0 ], + "to": [ 1.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "cullface": "west" }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ] }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ] }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ] } + } + }, + { + "name": "SideEast", + "from": [ 15.0, 1.0, 1.0 ], + "to": [ 16.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ] }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "cullface": "east" }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ] }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pool_filled.json b/src/main/resources/assets/botania/models/block/pool_filled.json new file mode 100644 index 000000000..0ea2aafc8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pool_filled.json @@ -0,0 +1,78 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + "particle": "botania:blocks/livingrock0" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 1.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 4.25 ] }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 4.25 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 4.25 ] }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 4.25 ] }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "cullface": "down" } + } + }, + { + "name": "SideSouth", + "from": [ 0.0, 1.0, 15.0 ], + "to": [ 16.0, 8.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ] }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "cullface": "south" }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ] }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ] } + } + }, + { + "name": "SideNorth", + "from": [ 0.0, 1.0, 0.0 ], + "to": [ 16.0, 8.0, 1.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "cullface": "north" }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ] }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ] }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ] } + } + }, + { + "name": "SideWest", + "from": [ 0.0, 1.0, 1.0 ], + "to": [ 1.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "cullface": "west" }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ] }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ] }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ] } + } + }, + { + "name": "SideEast", + "from": [ 15.0, 1.0, 1.0 ], + "to": [ 16.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ] }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "cullface": "east" }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ] }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ] } + } + }, + { + "name": "Liquid", + "from": [ 1.0, 7.0, 1.0 ], + "to": [ 15.0, 7.0, 15.0 ], + "faces": { + "up": { "texture": "#liquid", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }, + "down": { "texture": "#liquid", "uv": [ 1.0, 1.0, 15.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pool_tinted.json b/src/main/resources/assets/botania/models/block/pool_tinted.json new file mode 100644 index 000000000..d08ac9201 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pool_tinted.json @@ -0,0 +1,69 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + "particle": "botania:blocks/livingrock0" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 1.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 4.25 ], "tintindex": 0 }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 4.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 4.25 ], "tintindex": 0 }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 4.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "tintindex": 0, "cullface": "down" } + } + }, + { + "name": "SideSouth", + "from": [ 0.0, 1.0, 15.0 ], + "to": [ 16.0, 8.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0, "cullface": "south" }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideNorth", + "from": [ 0.0, 1.0, 0.0 ], + "to": [ 16.0, 8.0, 1.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0, "cullface": "north" }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideWest", + "from": [ 0.0, 1.0, 1.0 ], + "to": [ 1.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0, "cullface": "west" }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + }, + { + "name": "SideEast", + "from": [ 15.0, 1.0, 1.0 ], + "to": [ 16.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0, "cullface": "east" }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/textures/model/poolCopy.png b/src/main/resources/assets/botania/textures/model/poolCopy.png new file mode 100644 index 000000000..9db5bf16b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/poolCopy.png differ