From 0b27d9d0b5586fa78939ab5be7c151e69b6f48b1 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 3 Jan 2016 19:29:09 -0600 Subject: [PATCH] Attempt at json pool model --- .../client/core/handler/ModelHandler.java | 2 + .../common/item/block/ItemBlockPool.java | 20 +++++ .../assets/botania/blockstates/pool.json | 21 +++++ .../assets/botania/models/block/pool.json | 69 ++++++++++++++++ .../botania/models/block/pool_filled.json | 78 ++++++++++++++++++ .../botania/models/block/pool_tinted.json | 69 ++++++++++++++++ .../botania/textures/model/poolCopy.png | Bin 0 -> 2392 bytes 7 files changed, 259 insertions(+) create mode 100644 src/main/resources/assets/botania/blockstates/pool.json create mode 100644 src/main/resources/assets/botania/models/block/pool.json create mode 100644 src/main/resources/assets/botania/models/block/pool_filled.json create mode 100644 src/main/resources/assets/botania/models/block/pool_tinted.json create mode 100644 src/main/resources/assets/botania/textures/model/poolCopy.png 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 0000000000000000000000000000000000000000..9db5bf16bfde617bd14ac3a1a10ee974666b64fd GIT binary patch literal 2392 zcmV-e38(gnP)#g{uw;*d%ZR)DRQ4!idMfA+;NU|<~<@`~bc zNDe1-Pj|mquYwN(_UMDgfG+QIFQ9(kO9cV&{?l!0rUv9)Rpd73)SpPfleDBy67rHvTa=U(!^jjB$tb37B=nw`1y-wu!ZsNFz)U1Y z#W*C=W9o08BaRH;~9R&+yT>>@t1SQ|(o zr;yW2X8$!n430DpSPYfTD6M6Z5>3Yb`HsAh7+ax*U^pG9HW&C1@K%w#9v3}%zQJZ5 zAtcTDHE9|MZN_?2p~Q(eb%;EIQaBI0{RdK1tTp&l(z=0*I%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