Bamboo and hevea stairs and slabs

This commit is contained in:
Emmanuel BENOîT 2016-07-11 01:04:05 +02:00
parent 07fc30e06f
commit b6c259e4ac
28 changed files with 293 additions and 16 deletions

View file

@ -9,7 +9,7 @@ deco No Stone - Smooth + stairs + slabs
Limestone
Slate
Basalt
deco No Wood - Stairs + slabs + doors + fences + chairs + tables + thrones
deco No Wood - Doors + fences + chairs + tables + thrones
Hevea
Bamboo
-------------------------------------------------------------------------------------------------------

View file

@ -1,6 +1,7 @@
package mmm.deco;
import mmm.materials.MTree;
import mmm.utils.I_URecipeRegistrar;
import mmm.utils.URegistry;
import net.minecraft.block.Block;
@ -16,33 +17,47 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
public class DSlab
implements I_URecipeRegistrar
{
public static DSlab fromStone( final BlockStone.EnumType type )
public static DSlab fromVanillaSmoothStone( final BlockStone.EnumType type )
{
final IBlockState bs = Blocks.STONE.getDefaultState( ).withProperty( BlockStone.VARIANT , type );
final String name = type.getName( ).replace( "smooth_" , "" );
return new DSlab( bs , name );
}
public static DSlab fromWood( final MTree materials )
{
final DSlab slab = new DSlab( materials.PLANKS.getDefaultState( ) , materials.NAME );
if ( materials.getBaseFlammability( ) != 0 ) {
Blocks.FIRE.setFireInfo( slab.HALF , materials.getBaseFireEncouragement( ) ,
materials.getBaseFlammability( ) * 4 );
Blocks.FIRE.setFireInfo( slab.DOUBLE , materials.getBaseFireEncouragement( ) ,
materials.getBaseFlammability( ) * 4 );
}
return slab;
}
public final DSlabHalf HALF;
public final DSlabDouble DOUBLE;
public final ItemSlab ITEM;
public DSlab( final Block modelBlock , final String name )
{
this( modelBlock.getDefaultState( ) , name );
}
public DSlab( final IBlockState modelState , final String name )
{
this.HALF = new DSlabHalf( modelState , name );
this.DOUBLE = new DSlabDouble( this.HALF , name );
this.ITEM = new ItemSlab( this.HALF , this.HALF , this.DOUBLE );
URegistry.setIdentifiers( this.ITEM , "deco" , "slabs" , name );
}
public DSlab register( )
{
URegistry.addBlock( this.HALF , this.ITEM );
URegistry.addBlock( this.DOUBLE , null );
URegistry.addRecipeRegistrar( this );
return this;
}

View file

@ -1,6 +1,7 @@
package mmm.deco;
import mmm.materials.MTree;
import mmm.utils.I_URecipeRegistrar;
import mmm.utils.URegistry;
import net.minecraft.block.Block;
@ -17,16 +18,36 @@ public class DStairs
extends BlockStairs
implements I_URecipeRegistrar
{
public static DStairs fromStone( final BlockStone.EnumType type )
public static DStairs fromVanillaSmoothStone( final BlockStone.EnumType type )
{
final IBlockState bs = Blocks.STONE.getDefaultState( ).withProperty( BlockStone.VARIANT , type );
return new DStairs( bs , type.getName( ).replace( "smooth_" , "" ) );
final DStairs stairs = new DStairs( bs , type.getName( ).replace( "smooth_" , "" ) );
URegistry.addBlock( stairs );
return stairs;
}
public static DStairs fromWood( final MTree materials )
{
final DStairs stairs = new DStairs( materials.PLANKS.getDefaultState( ) , materials.NAME );
URegistry.addBlock( stairs );
if ( materials.getBaseFlammability( ) != 0 ) {
Blocks.FIRE.setFireInfo( stairs , materials.getBaseFireEncouragement( ) ,
materials.getBaseFlammability( ) * 4 );
}
return stairs;
}
public final IBlockState modelState;
public final Block modelBlock;
public DStairs( final Block modelBlock , final String name )
{
this( modelBlock.getDefaultState( ) , name );
}
public DStairs( final IBlockState modelState , final String name )
{
super( modelState );

View file

@ -1,6 +1,7 @@
package mmm.deco;
import mmm.materials.Materials;
import mmm.utils.URegistry;
import net.minecraft.block.BlockStone;
@ -11,10 +12,14 @@ public class DecorativeBlocks
public static final DStairs STAIRS_GRANITE;
public static final DStairs STAIRS_DIORITE;
public static final DStairs STAIRS_ANDESITE;
public static final DStairs STAIRS_HEVEA;
public static final DStairs STAIRS_BAMBOO;
public static final DSlab SLAB_GRANITE;
public static final DSlab SLAB_DIORITE;
public static final DSlab SLAB_ANDESITE;
public static final DSlab SLAB_HEVEA;
public static final DSlab SLAB_BAMBOO;
public static final DTable TABLE_OAK;
public static final DTable TABLE_BIRCH;
@ -43,14 +48,18 @@ public class DecorativeBlocks
final BlockStone.EnumType andesite = BlockStone.EnumType.ANDESITE_SMOOTH;
// Stairs
URegistry.addBlock( STAIRS_GRANITE = DStairs.fromStone( granite ) );
URegistry.addBlock( STAIRS_DIORITE = DStairs.fromStone( diorite ) );
URegistry.addBlock( STAIRS_ANDESITE = DStairs.fromStone( andesite ) );
STAIRS_GRANITE = DStairs.fromVanillaSmoothStone( granite );
STAIRS_DIORITE = DStairs.fromVanillaSmoothStone( diorite );
STAIRS_ANDESITE = DStairs.fromVanillaSmoothStone( andesite );
STAIRS_HEVEA = DStairs.fromWood( Materials.TREE.HEVEA );
STAIRS_BAMBOO = DStairs.fromWood( Materials.TREE.BAMBOO );
// Slabs
SLAB_GRANITE = DSlab.fromStone( granite ).register( );
SLAB_DIORITE = DSlab.fromStone( diorite ).register( );
SLAB_ANDESITE = DSlab.fromStone( andesite ).register( );
SLAB_GRANITE = DSlab.fromVanillaSmoothStone( granite );
SLAB_DIORITE = DSlab.fromVanillaSmoothStone( diorite );
SLAB_ANDESITE = DSlab.fromVanillaSmoothStone( andesite );
SLAB_HEVEA = DSlab.fromWood( Materials.TREE.HEVEA );
SLAB_BAMBOO = DSlab.fromWood( Materials.TREE.BAMBOO );
// Tables
URegistry.addBlock( TABLE_OAK = new DTable( E_DWoodType.OAK ) );

View file

@ -249,12 +249,25 @@ public class MTree
}
}
public boolean hasLogBoundingBox( )
{
return this.logBoundingBoxX != null;
}
public int getBaseFireEncouragement( )
{
return baseFireEncouragement;
}
public int getBaseFlammability( )
{
return baseFlammability;
}
public int getSaplingDropChance( )
{
return this.saplingDropChance;
@ -507,5 +520,4 @@ public class MTree
'I' , new ItemStack( Items.IRON_INGOT ) );
}
}

View file

@ -0,0 +1,6 @@
{
"variants": {
"half=bottom,variant=default": { "model": "mmm:deco/slabs/bamboo/bottom" },
"half=top,variant=default": { "model": "mmm:deco/slabs/bamboo/top" }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"variant=default": { "model": "mmm:deco/slabs/bamboo/double" }
}
}

View file

@ -0,0 +1,6 @@
{
"variants": {
"half=bottom,variant=default": { "model": "mmm:deco/slabs/hevea/bottom" },
"half=top,variant=default": { "model": "mmm:deco/slabs/hevea/top" }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"variant=default": { "model": "mmm:deco/slabs/hevea/double" }
}
}

View file

@ -0,0 +1,44 @@
{
"variants": {
"facing=east,half=bottom,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight" },
"facing=west,half=bottom,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "y": 180, "uvlock": true },
"facing=east,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "y": 180, "uvlock": true },
"facing=east,half=top,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "x": 180, "uvlock": true },
"facing=west,half=top,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=straight": { "model": "mmm:deco/stairs/bamboo/straight", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=outer_right": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "uvlock": true },
"facing=east,half=top,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "uvlock": true },
"facing=west,half=top,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=outer_left": { "model": "mmm:deco/stairs/bamboo/outer", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=inner_right": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "uvlock": true },
"facing=east,half=top,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "uvlock": true },
"facing=west,half=top,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=inner_left": { "model": "mmm:deco/stairs/bamboo/inner", "x": 180, "y": 270, "uvlock": true }
}
}

View file

@ -0,0 +1,44 @@
{
"variants": {
"facing=east,half=bottom,shape=straight": { "model": "mmm:deco/stairs/hevea/straight" },
"facing=west,half=bottom,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "y": 180, "uvlock": true },
"facing=east,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "y": 180, "uvlock": true },
"facing=east,half=top,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "x": 180, "uvlock": true },
"facing=west,half=top,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=straight": { "model": "mmm:deco/stairs/hevea/straight", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=outer_right": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "uvlock": true },
"facing=east,half=top,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "uvlock": true },
"facing=west,half=top,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=outer_left": { "model": "mmm:deco/stairs/hevea/outer", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=inner_right": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "uvlock": true },
"facing=east,half=top,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "uvlock": true },
"facing=west,half=top,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=inner_left": { "model": "mmm:deco/stairs/hevea/inner", "x": 180, "y": 270, "uvlock": true }
}
}

View file

@ -136,10 +136,14 @@ item.mmm.food.milk.donkey.name=Donkey milk
tile.mmm.deco.stairs.granite.name=Granite Stairs
tile.mmm.deco.stairs.diorite.name=Diorite Stairs
tile.mmm.deco.stairs.andesite.name=Andesite Stairs
tile.mmm.deco.stairs.hevea.name=Hevea Wood Stairs
tile.mmm.deco.stairs.bamboo.name=Bamboo Wood Stairs
tile.mmm.deco.slabs.granite.name=Granite Slab
tile.mmm.deco.slabs.diorite.name=Diorite Slab
tile.mmm.deco.slabs.andesite.name=Andesite Slab
tile.mmm.deco.slabs.hevea.name=Hevea Wood Slab
tile.mmm.deco.slabs.bamboo.name=Bamboo Wood Slab
tile.mmm.deco.table.oak.name=Oak Table
tile.mmm.deco.table.birch.name=Birch Table

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/half_slab",
"textures": {
"bottom": "mmm:blocks/materials/planks/bamboo",
"top": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/upper_slab",
"textures": {
"bottom": "mmm:blocks/materials/planks/bamboo",
"top": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/half_slab",
"textures": {
"bottom": "mmm:blocks/materials/planks/hevea",
"top": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/upper_slab",
"textures": {
"bottom": "mmm:blocks/materials/planks/hevea",
"top": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/inner_stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/bamboo",
"top": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/outer_stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/bamboo",
"top": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/bamboo",
"top": "mmm:blocks/materials/planks/bamboo",
"side": "mmm:blocks/materials/planks/bamboo"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/inner_stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/hevea",
"top": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/outer_stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/hevea",
"top": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/stairs",
"textures": {
"bottom": "mmm:blocks/materials/planks/hevea",
"top": "mmm:blocks/materials/planks/hevea",
"side": "mmm:blocks/materials/planks/hevea"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "mmm:block/deco/slabs/bamboo/bottom"
}

View file

@ -0,0 +1,3 @@
{
"parent": "mmm:block/deco/slabs/hevea/bottom"
}

View file

@ -0,0 +1,3 @@
{
"parent": "mmm:block/deco/stairs/bamboo/straight"
}

View file

@ -0,0 +1,3 @@
{
"parent": "mmm:block/deco/stairs/hevea/straight"
}