From c1635ea94331b9e996f3dbafc288db785fd7fbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 11 Jul 2016 10:28:49 +0200 Subject: [PATCH] Bamboo / hevea fences --- src/java/mmm/deco/DFence.java | 19 ++++++++ src/java/mmm/deco/DFenceBlock.java | 45 +++++++++++++++++++ src/java/mmm/deco/DFences.java | 16 +++++++ src/java/mmm/deco/DecorativeBlocks.java | 4 ++ .../mmm/blockstates/deco/fence/bamboo.json | 17 +++++++ .../mmm/blockstates/deco/fence/hevea.json | 17 +++++++ src/resources/assets/mmm/lang/en_US.lang | 2 + .../models/block/deco/fence/bamboo/post.json | 6 +++ .../models/block/deco/fence/bamboo/side.json | 6 +++ .../models/block/deco/fence/hevea/post.json | 6 +++ .../models/block/deco/fence/hevea/side.json | 6 +++ .../mmm/models/item/deco/fence/bamboo.json | 6 +++ .../mmm/models/item/deco/fence/hevea.json | 6 +++ 13 files changed, 156 insertions(+) create mode 100644 src/java/mmm/deco/DFence.java create mode 100644 src/java/mmm/deco/DFenceBlock.java create mode 100644 src/java/mmm/deco/DFences.java create mode 100644 src/resources/assets/mmm/blockstates/deco/fence/bamboo.json create mode 100644 src/resources/assets/mmm/blockstates/deco/fence/hevea.json create mode 100644 src/resources/assets/mmm/models/block/deco/fence/bamboo/post.json create mode 100644 src/resources/assets/mmm/models/block/deco/fence/bamboo/side.json create mode 100644 src/resources/assets/mmm/models/block/deco/fence/hevea/post.json create mode 100644 src/resources/assets/mmm/models/block/deco/fence/hevea/side.json create mode 100644 src/resources/assets/mmm/models/item/deco/fence/bamboo.json create mode 100644 src/resources/assets/mmm/models/item/deco/fence/hevea.json diff --git a/src/java/mmm/deco/DFence.java b/src/java/mmm/deco/DFence.java new file mode 100644 index 0000000..90ec1a4 --- /dev/null +++ b/src/java/mmm/deco/DFence.java @@ -0,0 +1,19 @@ +package mmm.deco; + + +import mmm.utils.URegistry; + + + +public class DFence +{ + public final DFenceBlock BLOCK; + + + public DFence( DWoodType woodType ) + { + this.BLOCK = new DFenceBlock( woodType ); + URegistry.addBlock( this.BLOCK ); + } + +} diff --git a/src/java/mmm/deco/DFenceBlock.java b/src/java/mmm/deco/DFenceBlock.java new file mode 100644 index 0000000..3a49df4 --- /dev/null +++ b/src/java/mmm/deco/DFenceBlock.java @@ -0,0 +1,45 @@ +package mmm.deco; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.block.BlockFence; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class DFenceBlock + extends BlockFence + implements I_URecipeRegistrar +{ + + private DWoodType woodType; + + + public DFenceBlock( DWoodType woodType ) + { + super( Material.WOOD , woodType.getMapColor( ) ); + this.woodType = woodType; + this.setHardness( 2.f ); + this.setResistance( 5.f ); + this.setSoundType( SoundType.WOOD ); + this.setHarvestLevel( "axe" , 0 ); + URegistry.setIdentifiers( this , "deco" , "fence" , woodType.getSuffix( ) ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapedRecipe( new ItemStack( this ) , // + "PSP" , // + "PSP" , // + 'P' , this.woodType.getPlanksBlock( ) , // + 'S' , Items.STICK ); + } + +} diff --git a/src/java/mmm/deco/DFences.java b/src/java/mmm/deco/DFences.java new file mode 100644 index 0000000..dc81871 --- /dev/null +++ b/src/java/mmm/deco/DFences.java @@ -0,0 +1,16 @@ +package mmm.deco; + + +public class DFences +{ + public final DFence BAMBOO; + public final DFence HEVEA; + + + DFences( ) + { + this.BAMBOO = new DFence( DWoodType.BAMBOO ); + this.HEVEA = new DFence( DWoodType.HEVEA ); + } + +} diff --git a/src/java/mmm/deco/DecorativeBlocks.java b/src/java/mmm/deco/DecorativeBlocks.java index a83579a..2206685 100644 --- a/src/java/mmm/deco/DecorativeBlocks.java +++ b/src/java/mmm/deco/DecorativeBlocks.java @@ -48,6 +48,8 @@ public class DecorativeBlocks public static final DThrone THRONE_HEVEA; public static final DThrone THRONE_BAMBOO; + public static final DFences FENCE; + static { final BlockStone.EnumType granite = BlockStone.EnumType.GRANITE_SMOOTH; final BlockStone.EnumType diorite = BlockStone.EnumType.DIORITE_SMOOTH; @@ -96,6 +98,8 @@ public class DecorativeBlocks THRONE_ACACIA = new DThrone( DWoodType.ACACIA ); THRONE_HEVEA = new DThrone( DWoodType.HEVEA); THRONE_BAMBOO = new DThrone( DWoodType.BAMBOO ); + + FENCE = new DFences( ); } diff --git a/src/resources/assets/mmm/blockstates/deco/fence/bamboo.json b/src/resources/assets/mmm/blockstates/deco/fence/bamboo.json new file mode 100644 index 0000000..be0022c --- /dev/null +++ b/src/resources/assets/mmm/blockstates/deco/fence/bamboo.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "mmm:deco/fence/bamboo/post" }}, + { "when": { "north": "true" }, + "apply": { "model": "mmm:deco/fence/bamboo/side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "mmm:deco/fence/bamboo/side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "mmm:deco/fence/bamboo/side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "mmm:deco/fence/bamboo/side", "y": 270, "uvlock": true } + } + ] +} \ No newline at end of file diff --git a/src/resources/assets/mmm/blockstates/deco/fence/hevea.json b/src/resources/assets/mmm/blockstates/deco/fence/hevea.json new file mode 100644 index 0000000..d3b38f7 --- /dev/null +++ b/src/resources/assets/mmm/blockstates/deco/fence/hevea.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "mmm:deco/fence/hevea/post" }}, + { "when": { "north": "true" }, + "apply": { "model": "mmm:deco/fence/hevea/side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "mmm:deco/fence/hevea/side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "mmm:deco/fence/hevea/side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "mmm:deco/fence/hevea/side", "y": 270, "uvlock": true } + } + ] +} \ No newline at end of file diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index c85d7ca..649515a 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -292,3 +292,5 @@ tile.mmm.deco.throne.hevea.silver.name=Hevea Throne (Silver) tile.mmm.deco.throne.hevea.white.name=Hevea Throne (White) tile.mmm.deco.throne.hevea.yellow.name=Hevea Throne (Yellow) +tile.mmm.deco.fence.hevea.name=Hevea Fence +tile.mmm.deco.fence.bamboo.name=Bamboo Fence diff --git a/src/resources/assets/mmm/models/block/deco/fence/bamboo/post.json b/src/resources/assets/mmm/models/block/deco/fence/bamboo/post.json new file mode 100644 index 0000000..4035040 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/fence/bamboo/post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_post", + "textures": { + "texture": "mmm:blocks/materials/planks/bamboo" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/fence/bamboo/side.json b/src/resources/assets/mmm/models/block/deco/fence/bamboo/side.json new file mode 100644 index 0000000..e8712fa --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/fence/bamboo/side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "mmm:blocks/materials/planks/bamboo" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/fence/hevea/post.json b/src/resources/assets/mmm/models/block/deco/fence/hevea/post.json new file mode 100644 index 0000000..262d988 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/fence/hevea/post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_post", + "textures": { + "texture": "mmm:blocks/materials/planks/hevea" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/fence/hevea/side.json b/src/resources/assets/mmm/models/block/deco/fence/hevea/side.json new file mode 100644 index 0000000..a3b34c9 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/fence/hevea/side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "mmm:blocks/materials/planks/hevea" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/deco/fence/bamboo.json b/src/resources/assets/mmm/models/item/deco/fence/bamboo.json new file mode 100644 index 0000000..7b92455 --- /dev/null +++ b/src/resources/assets/mmm/models/item/deco/fence/bamboo.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "mmm:blocks/materials/planks/bamboo" + } +} diff --git a/src/resources/assets/mmm/models/item/deco/fence/hevea.json b/src/resources/assets/mmm/models/item/deco/fence/hevea.json new file mode 100644 index 0000000..595e057 --- /dev/null +++ b/src/resources/assets/mmm/models/item/deco/fence/hevea.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "mmm:blocks/materials/planks/hevea" + } +}