From 929860f8fa0d143e11a59c9bc84d29cb6cf2c725 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 6 Jan 2016 20:56:25 -0600 Subject: [PATCH] Partial claw model. Fix cell block being a debug floating island. Fix a pure daisy oredict bug by checking for drops instead of state --- .../botania/api/recipe/RecipePureDaisy.java | 2 +- .../botania/api/wiki/SimpleWikiProvider.java | 2 +- .../client/core/handler/ModelHandler.java | 5 +- .../client/core/proxy/ClientProxy.java | 2 +- .../common/block/mana/BlockSpawnerClaw.java | 5 - .../assets/botania/blockstates/cellBlock.json | 4 +- .../botania/blockstates/spawnerClaw.json | 23 ++++ .../assets/botania/models/block/claw.json | 125 ++++++++++++++++++ 8 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/assets/botania/blockstates/spawnerClaw.json create mode 100644 src/main/resources/assets/botania/models/block/claw.json diff --git a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java index 568296e76..c9b5e05ba 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java @@ -44,7 +44,7 @@ public class RecipePureDaisy { if(input instanceof Block) return state.getBlock() == input; - ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)); + ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state)); String oredict = (String) input; return isOreDict(stack, oredict); } diff --git a/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java index 0e166b067..590d3ddc5 100644 --- a/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java +++ b/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java @@ -56,7 +56,7 @@ public class SimpleWikiProvider implements IWikiProvider { ItemStack stack = block.getPickBlock(pos, world, bPos, null); if(stack == null || stack.getItem() == null) - stack = new ItemStack(block, 1, block.getMetaFromState(world.getBlockState(bPos))); + stack = new ItemStack(block, 1, block.getDamageValue(world, bPos)); if(stack.getItem() == null) return null; 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 a1eb126aa..9eadc8878 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -179,9 +179,9 @@ public final class ModelHandler { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { if (ItemSpawnerMover.hasData(stack)) { - return new ModelResourceLocation("botania:spawnerMover", "inventory"); - } else { return new ModelResourceLocation("botania:spawnerMoverFull", "inventory"); + } else { + return new ModelResourceLocation("botania:spawnerMover", "inventory"); } } }); @@ -405,6 +405,7 @@ public final class ModelHandler { registerItemModel(ModBlocks.root); registerItemModel(ModBlocks.cacophonium); registerItemModel(ModBlocks.tinyPotato); + registerItemModel(ModBlocks.spawnerClaw); registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.floatingFlower), EnumDyeColor.values().length); diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index adab4f63a..43691fafb 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -294,7 +294,7 @@ 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(TileSpawnerClaw.class, new RenderTileSpawnerClaw()); ClientRegistry.bindTileEntitySpecialRenderer(TileStarfield.class, new RenderTileStarfield()); ClientRegistry.bindTileEntitySpecialRenderer(TileBrewery.class, new RenderTileBrewery()); ClientRegistry.bindTileEntitySpecialRenderer(TileTerraPlate.class, new RenderTileTerraPlate()); diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java index b1b7d8c3c..1e77e0a0b 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java @@ -57,11 +57,6 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable return false; } - @Override - public int getRenderType() { - return 2; - } - @Override public TileEntity createNewTileEntity(World world, int meta) { return new TileSpawnerClaw(); diff --git a/src/main/resources/assets/botania/blockstates/cellBlock.json b/src/main/resources/assets/botania/blockstates/cellBlock.json index 7fcc159e0..b14eadd13 100644 --- a/src/main/resources/assets/botania/blockstates/cellBlock.json +++ b/src/main/resources/assets/botania/blockstates/cellBlock.json @@ -1,9 +1,9 @@ { "forge_marker": 1, "defaults": { - "model": "botania:miniIsland", + "model": "minecraft:cube_all", "textures": { - "all": "botania:model/miniIslandCopy" + "all": "botania:blocks/cellBlock" }, "transform": "forge:default-block" }, diff --git a/src/main/resources/assets/botania/blockstates/spawnerClaw.json b/src/main/resources/assets/botania/blockstates/spawnerClaw.json new file mode 100644 index 000000000..1d3a49dc9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/spawnerClaw.json @@ -0,0 +1,23 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:claw", + "textures": { + "all": "botania:model/spawnerClaw" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{ + "transform": { + "firstperson": { + "translation": [ 0, 0.25, 0 ] + }, + "gui": { + "translation": [ 0, 0.25, 0 ] + } + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/claw.json b/src/main/resources/assets/botania/models/block/claw.json new file mode 100644 index 000000000..03214d192 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/claw.json @@ -0,0 +1,125 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Plate", + "from": [ 2.0, 0.0, 2.0 ], + "to": [ 14.0, 1.0, 14.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 1.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 1.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 1.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 1.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 12.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 12.0, 12.0 ] } + } + }, + { + "name": "Limb_West", + "from": [ -1.0, 0.0, 7.0 ], + "to": [ 2.0, 1.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 2.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 2.0 ] } + } + }, + { + "name": "Limb_East", + "from": [ 14.0, 0.0, 7.0 ], + "to": [ 17.0, 1.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 2.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 2.0 ] } + } + }, + { + "name": "Limb_North", + "from": [ 7.0, 0.0, -1.0 ], + "to": [ 9.0, 1.0, 2.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 3.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 3.0 ] } + } + }, + { + "name": "Limb_South", + "from": [ 7.0, 0.0, 14.0 ], + "to": [ 9.0, 1.0, 17.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 3.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 3.0 ] } + } + }, + { + "name": "Claw_West", + "from": [ -1.0, -5.0, 7.0 ], + "to": [ 0.0, 0.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 2.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 2.0 ] } + } + }, + { + "name": "Claw_East", + "from": [ 16.0, -5.0, 7.0 ], + "to": [ 17.0, 0.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 2.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 2.0 ] } + } + }, + { + "name": "Claw_North", + "from": [ 7.0, -5.0, -1.0 ], + "to": [ 9.0, 0.0, 0.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] } + } + }, + { + "name": "Claw_South", + "from": [ 7.0, -5.0, 16.0 ], + "to": [ 9.0, 0.0, 17.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "east": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 5.0 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, + "down": { "texture": "#all", "uv": [ 0.0, 0.0, 2.0, 1.0 ] } + } + } + ] +} \ No newline at end of file