Throne - Textures and models for oak variant

This commit is contained in:
Emmanuel BENOîT 2016-07-05 11:07:04 +02:00
parent cab22724ea
commit 805f041a4a
9 changed files with 331 additions and 0 deletions

BIN
graphics/throne.xcf Normal file

Binary file not shown.

View file

@ -7,6 +7,7 @@ import mmm.utils.I_UBlockSeat;
import mmm.utils.I_UColoredBlock;
import mmm.utils.I_URecipeRegistrar;
import mmm.utils.I_USupportBlock;
import mmm.utils.UMaths;
import mmm.utils.URegistry;
import mmm.utils.USeat;
import net.minecraft.block.Block;
@ -29,8 +30,10 @@ import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
@ -49,6 +52,11 @@ public class DThroneBlock
public static final PropertyDirection FACING;
public static final PropertyBool IS_TOP;
public static final PropertyEnum< EnumDyeColor > COLOR;
private static final AxisAlignedBB COLLISION_TOP_NORTH = UMaths.makeBlockAABB( 0 , 0 , 0 , 16 , 13 , 3 );
private static final AxisAlignedBB COLLISION_TOP_EAST = UMaths.makeBlockAABB( 13 , 0 , 0 , 16 , 13 , 16 );
private static final AxisAlignedBB COLLISION_TOP_SOUTH = UMaths.makeBlockAABB( 0 , 0 , 13 , 16 , 13 , 16 );
private static final AxisAlignedBB COLLISION_TOP_WEST = UMaths.makeBlockAABB( 0 , 0 , 0 , 3 , 13 , 16 );
private static boolean dropping = false;
@ -85,6 +93,54 @@ public class DThroneBlock
this.setHarvestLevel( "axe" , 0 );
}
// *************************************************************************************************
// RENDERING AND SHAPE
// *************************************************************************************************
@Override
@SideOnly( Side.CLIENT )
public BlockRenderLayer getBlockLayer( )
{
return BlockRenderLayer.CUTOUT_MIPPED;
}
@Override
public boolean isOpaqueCube( final IBlockState state )
{
return false;
}
@Override
public boolean isFullCube( final IBlockState state )
{
return false;
}
@Override
public AxisAlignedBB getBoundingBox( final IBlockState state , final IBlockAccess source , final BlockPos pos )
{
if ( state.getValue( IS_TOP )) {
switch ( state.getValue( DChair.FACING ) ) {
case EAST:
return COLLISION_TOP_EAST;
case NORTH:
return COLLISION_TOP_NORTH;
case SOUTH:
return COLLISION_TOP_SOUTH;
case WEST:
return COLLISION_TOP_WEST;
default:
// TODO log problem
return FULL_BLOCK_AABB;
}
}
return FULL_BLOCK_AABB;
}
// *************************************************************************************************
// BLOCK STATE

View file

@ -0,0 +1,53 @@
{
"forge_marker": 1 ,
"defaults" : {
"textures": {
"wood": "mmm:blocks/deco/throne/oak/wood"
}
} ,
"variants" : {
"is_top" : {
"true" : {
"model": "mmm:deco/throne/top" ,
"textures" : {
"front" : "mmm:blocks/deco/throne/oak/front-top"
}
} ,
"false" : {
"model": "mmm:deco/throne/bottom" ,
"textures" : {
"front" : "mmm:blocks/deco/throne/oak/front-bottom" ,
"top" : "mmm:blocks/deco/throne/oak/bottom"
}
}
} ,
"facing" : {
"north" : { "y": 0 } ,
"east" : { "y": 90 } ,
"south" : { "y": 180 } ,
"west" : { "y": 270 }
} ,
"color" : {
"black" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_black" } } ,
"blue" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_blue" } } ,
"brown" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_brown" } } ,
"cyan" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_cyan" } } ,
"gray" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_gray" } } ,
"green" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_green" } } ,
"light_blue" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_light_blue" } } ,
"lime" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_lime" } } ,
"magenta" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_magenta" } } ,
"orange" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_orange" } } ,
"pink" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_pink" } } ,
"purple" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_purple" } } ,
"red" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_red" } } ,
"silver" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_silver" } } ,
"white" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_white" } } ,
"yellow" : { "textures" : { "wool" : "minecraft:blocks/wool_colored_yellow" } }
}
}
}

View file

@ -0,0 +1,145 @@
{
"textures" : {
"particle" : "#wood" ,
"front" : "#front" ,
"wool" : "#wool"
},
"elements":
[
{
"from": [ 0, 5, 0 ] ,
"to": [ 16 , 16, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 0, 9, 2 ] ,
"to": [ 3 , 11, 16 ] ,
"faces": {
"south": { "texture": "#front" , "cullface": "south" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#top" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 13, 9, 2 ] ,
"to": [ 16 , 11, 16 ] ,
"faces": {
"south": { "texture": "#front" , "cullface": "south" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#top" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 3, 3, 2 ] ,
"to": [ 13 , 5, 15 ] ,
"faces": {
"south": { "texture": "#wood" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#top" }
}
} ,
{
"from": [ 0, 3, 2 ] ,
"to": [ 3 , 5, 16 ] ,
"faces": {
"south": { "texture": "#wood" , "cullface": "south" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 13, 3, 2 ] ,
"to": [ 16 , 5, 16 ] ,
"faces": {
"south": { "texture": "#wood" , "cullface": "south" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 3, 3 , 15 ] ,
"to": [ 13 , 4 , 16 ] ,
"faces": {
"south": { "texture": "#wood" , "cullface": "south" } ,
"down": { "texture": "#wood" } ,
"up": { "texture": "#wood" }
}
} ,
{
"from": [ 0, 0 , 0 ] ,
"to": [ 16 , 5 , 3 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#wood" } ,
"down": { "texture": "#wood" , "cullface": "down" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 0, 0 , 13 ] ,
"to": [ 2 , 9 , 15 ] ,
"faces": {
"north": { "texture": "#wood" } ,
"south": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 14, 0 , 13 ] ,
"to": [ 16 , 9 , 15 ] ,
"faces": {
"north": { "texture": "#wood" } ,
"south": { "texture": "#wood" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 5, 5, 2 ] ,
"to": [ 11 , 16 , 3 ] ,
"faces" : {
"south": { "texture": "#wool" } ,
"east": { "texture": "#wool" } ,
"west": { "texture": "#wool" }
}
} ,
{
"from": [ 5, 5, 3 ] ,
"to": [ 11 , 6 , 11 ] ,
"faces" : {
"up": { "texture": "#wool" } ,
"south": { "texture": "#wool" } ,
"east": { "texture": "#wool" } ,
"west": { "texture": "#wool" }
}
} ,
{
"from": [ 6, 5, 11 ] ,
"to": [ 10 , 6 , 12 ] ,
"faces" : {
"up": { "texture": "#wool" } ,
"south": { "texture": "#wool" } ,
"east": { "texture": "#wool" } ,
"west": { "texture": "#wool" }
}
}
]
}

View file

@ -0,0 +1,77 @@
{
"textures" : {
"particle" : "#wood" ,
"front" : "#front" ,
"wool" : "#wool"
},
"elements":
[
{
"from": [ 0, 0, 0 ] ,
"to": [ 16 , 8, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" , "cullface": "east" } ,
"west": { "texture": "#wood" , "cullface": "west" }
}
} ,
{
"from": [ 1, 8, 0 ] ,
"to": [ 15 , 10, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 2, 10, 0 ] ,
"to": [ 14 , 11, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 3, 11, 0 ] ,
"to": [ 13 , 12, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 5, 12, 0 ] ,
"to": [ 11 , 13, 2 ] ,
"faces": {
"north": { "texture": "#wood" , "cullface": "north" } ,
"south": { "texture": "#front" } ,
"up": { "texture": "#wood" } ,
"east": { "texture": "#wood" } ,
"west": { "texture": "#wood" }
}
} ,
{
"from": [ 5, 0, 2 ] ,
"to": [ 11 , 6 , 3 ] ,
"faces" : {
"south": { "texture": "#wool" } ,
"up": { "texture": "#wool" } ,
"east": { "texture": "#wool" } ,
"west": { "texture": "#wool" }
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B