1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-02-14 10:00:06 +00:00

Remove dye block state property

It doesn't make sense to have it now as the coloured models do not exist
any more, and so would just produce errors should we try to load them.
This commit is contained in:
SquidDev 2017-05-06 17:41:49 +01:00
parent d652bdb0b0
commit 2f93354981
5 changed files with 14 additions and 306 deletions

View File

@ -34,7 +34,6 @@ public class BlockTurtle extends BlockComputerBase
public static class Properties public static class Properties
{ {
public static final PropertyDirection FACING = PropertyDirection.create( "facing", EnumFacing.Plane.HORIZONTAL ); public static final PropertyDirection FACING = PropertyDirection.create( "facing", EnumFacing.Plane.HORIZONTAL );
public static final PropertyEnum<BlockTurtleDyeVariant> DYE = PropertyEnum.<BlockTurtleDyeVariant>create( "dye", BlockTurtleDyeVariant.class );
} }
public static BlockTurtle createTurtleBlock() public static BlockTurtle createTurtleBlock()
@ -52,7 +51,6 @@ public class BlockTurtle extends BlockComputerBase
setCreativeTab( ComputerCraft.mainCreativeTab ); setCreativeTab( ComputerCraft.mainCreativeTab );
setDefaultState( this.blockState.getBaseState() setDefaultState( this.blockState.getBaseState()
.withProperty( Properties.FACING, EnumFacing.NORTH ) .withProperty( Properties.FACING, EnumFacing.NORTH )
.withProperty( Properties.DYE, BlockTurtleDyeVariant.None )
); );
} }
@ -77,10 +75,7 @@ public class BlockTurtle extends BlockComputerBase
@Override @Override
protected BlockStateContainer createBlockState() protected BlockStateContainer createBlockState()
{ {
return new BlockStateContainer(this, new IProperty[] { return new BlockStateContainer(this, Properties.FACING );
Properties.FACING,
Properties.DYE
});
} }
@Override @Override
@ -98,18 +93,7 @@ public class BlockTurtle extends BlockComputerBase
@Override @Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{ {
state = state.withProperty( Properties.FACING, getDirection( world, pos ) ); return state.withProperty( Properties.FACING, getDirection( world, pos ) );
TileEntity tile = world.getTileEntity( pos );
if( tile != null && tile instanceof ITurtleTile )
{
ITurtleTile turtle = (ITurtleTile)tile;
state = state.withProperty( Properties.DYE, BlockTurtleDyeVariant.fromColour( turtle.getColour() ) );
}
else
{
state = state.withProperty( Properties.DYE, BlockTurtleDyeVariant.None );
}
return state;
} }
@Override @Override

View File

@ -1,84 +0,0 @@
/**
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.shared.turtle.blocks;
import dan200.computercraft.shared.util.Colour;
import net.minecraft.util.IStringSerializable;
public enum BlockTurtleDyeVariant implements IStringSerializable
{
None( "none", null ),
Black( "black", Colour.Black ),
Red( "red", Colour.Red ),
Green( "green", Colour.Green ),
Brown( "brown", Colour.Brown ),
Blue( "blue", Colour.Blue ),
Purple( "purple", Colour.Purple ),
Cyan( "cyan", Colour.Cyan ),
LightGrey( "light_grey", Colour.LightGrey ),
Grey( "grey", Colour.Grey ),
Pink( "pink", Colour.Pink ),
Lime( "lime", Colour.Lime ),
Yellow( "yellow", Colour.Yellow ),
LightBlue( "light_blue", Colour.LightBlue ),
Magenta( "magenta", Colour.Magenta ),
Orange( "orange", Colour.Orange ),
White( "white", Colour.Orange );
public static BlockTurtleDyeVariant fromColour( Colour colour )
{
if( colour != null )
{
switch( colour )
{
case Black: return Black;
case Red: return Red;
case Green: return Green;
case Brown: return Brown;
case Blue: return Blue;
case Purple: return Purple;
case Cyan: return Cyan;
case LightGrey: return LightGrey;
case Grey: return Grey;
case Pink: return Pink;
case Lime: return Lime;
case Yellow: return Yellow;
case LightBlue: return LightBlue;
case Magenta: return Magenta;
case Orange: return Orange;
case White: return White;
}
}
return None;
}
private String m_name;
private Colour m_colour;
private BlockTurtleDyeVariant( String name, Colour colour )
{
m_name = name;
m_colour = colour;
}
@Override
public String getName()
{
return m_name;
}
public Colour getColour()
{
return m_colour;
}
@Override
public String toString()
{
return getName();
}
}

View File

@ -1,72 +1,8 @@
{ {
"variants": { "variants": {
"dye=none,facing=north": { "model": "computercraft:turtle" }, "facing=north": { "model": "computercraft:turtle" },
"dye=none,facing=south": { "model": "computercraft:turtle", "y": 180 }, "facing=south": { "model": "computercraft:turtle", "y": 180 },
"dye=none,facing=west": { "model": "computercraft:turtle", "y": 270 }, "facing=west": { "model": "computercraft:turtle", "y": 270 },
"dye=none,facing=east": { "model": "computercraft:turtle", "y": 90 }, "facing=east": { "model": "computercraft:turtle", "y": 90 }
"dye=black,facing=north": { "model": "computercraft:turtle_black" },
"dye=black,facing=south": { "model": "computercraft:turtle_black", "y": 180 },
"dye=black,facing=west": { "model": "computercraft:turtle_black", "y": 270 },
"dye=black,facing=east": { "model": "computercraft:turtle_black", "y": 90 },
"dye=blue,facing=north": { "model": "computercraft:turtle_blue" },
"dye=blue,facing=south": { "model": "computercraft:turtle_blue", "y": 180 },
"dye=blue,facing=west": { "model": "computercraft:turtle_blue", "y": 270 },
"dye=blue,facing=east": { "model": "computercraft:turtle_blue", "y": 90 },
"dye=brown,facing=north": { "model": "computercraft:turtle_brown" },
"dye=brown,facing=south": { "model": "computercraft:turtle_brown", "y": 180 },
"dye=brown,facing=west": { "model": "computercraft:turtle_brown", "y": 270 },
"dye=brown,facing=east": { "model": "computercraft:turtle_brown", "y": 90 },
"dye=cyan,facing=north": { "model": "computercraft:turtle_cyan" },
"dye=cyan,facing=south": { "model": "computercraft:turtle_cyan", "y": 180 },
"dye=cyan,facing=west": { "model": "computercraft:turtle_cyan", "y": 270 },
"dye=cyan,facing=east": { "model": "computercraft:turtle_cyan", "y": 90 },
"dye=green,facing=north": { "model": "computercraft:turtle_green" },
"dye=green,facing=south": { "model": "computercraft:turtle_green", "y": 180 },
"dye=green,facing=west": { "model": "computercraft:turtle_green", "y": 270 },
"dye=green,facing=east": { "model": "computercraft:turtle_green", "y": 90 },
"dye=grey,facing=north": { "model": "computercraft:turtle_grey" },
"dye=grey,facing=south": { "model": "computercraft:turtle_grey", "y": 180 },
"dye=grey,facing=west": { "model": "computercraft:turtle_grey", "y": 270 },
"dye=grey,facing=east": { "model": "computercraft:turtle_grey", "y": 90 },
"dye=light_blue,facing=north": { "model": "computercraft:turtle_lightBlue" },
"dye=light_blue,facing=south": { "model": "computercraft:turtle_lightBlue", "y": 180 },
"dye=light_blue,facing=west": { "model": "computercraft:turtle_lightBlue", "y": 270 },
"dye=light_blue,facing=east": { "model": "computercraft:turtle_lightBlue", "y": 90 },
"dye=light_grey,facing=north": { "model": "computercraft:turtle_lightGrey" },
"dye=light_grey,facing=south": { "model": "computercraft:turtle_lightGrey", "y": 180 },
"dye=light_grey,facing=west": { "model": "computercraft:turtle_lightGrey", "y": 270 },
"dye=light_grey,facing=east": { "model": "computercraft:turtle_lightGrey", "y": 90 },
"dye=lime,facing=north": { "model": "computercraft:turtle_lime" },
"dye=lime,facing=south": { "model": "computercraft:turtle_lime", "y": 180 },
"dye=lime,facing=west": { "model": "computercraft:turtle_lime", "y": 270 },
"dye=lime,facing=east": { "model": "computercraft:turtle_lime", "y": 90 },
"dye=magenta,facing=north": { "model": "computercraft:turtle_magenta" },
"dye=magenta,facing=south": { "model": "computercraft:turtle_magenta", "y": 180 },
"dye=magenta,facing=west": { "model": "computercraft:turtle_magenta", "y": 270 },
"dye=magenta,facing=east": { "model": "computercraft:turtle_magenta", "y": 90 },
"dye=orange,facing=north": { "model": "computercraft:turtle_orange" },
"dye=orange,facing=south": { "model": "computercraft:turtle_orange", "y": 180 },
"dye=orange,facing=west": { "model": "computercraft:turtle_orange", "y": 270 },
"dye=orange,facing=east": { "model": "computercraft:turtle_orange", "y": 90 },
"dye=pink,facing=north": { "model": "computercraft:turtle_pink" },
"dye=pink,facing=south": { "model": "computercraft:turtle_pink", "y": 180 },
"dye=pink,facing=west": { "model": "computercraft:turtle_pink", "y": 270 },
"dye=pink,facing=east": { "model": "computercraft:turtle_pink", "y": 90 },
"dye=purple,facing=north": { "model": "computercraft:turtle_purple" },
"dye=purple,facing=south": { "model": "computercraft:turtle_purple", "y": 180 },
"dye=purple,facing=west": { "model": "computercraft:turtle_purple", "y": 270 },
"dye=purple,facing=east": { "model": "computercraft:turtle_purple", "y": 90 },
"dye=red,facing=north": { "model": "computercraft:turtle_red" },
"dye=red,facing=south": { "model": "computercraft:turtle_red", "y": 180 },
"dye=red,facing=west": { "model": "computercraft:turtle_red", "y": 270 },
"dye=red,facing=east": { "model": "computercraft:turtle_red", "y": 90 },
"dye=white,facing=north": { "model": "computercraft:turtle_white" },
"dye=white,facing=south": { "model": "computercraft:turtle_white", "y": 180 },
"dye=white,facing=west": { "model": "computercraft:turtle_white", "y": 270 },
"dye=white,facing=east": { "model": "computercraft:turtle_white", "y": 90 },
"dye=yellow,facing=north": { "model": "computercraft:turtle_yellow" },
"dye=yellow,facing=south": { "model": "computercraft:turtle_yellow", "y": 180 },
"dye=yellow,facing=west": { "model": "computercraft:turtle_yellow", "y": 270 },
"dye=yellow,facing=east": { "model": "computercraft:turtle_yellow", "y": 90 }
} }
} }

View File

@ -1,72 +1,8 @@
{ {
"variants": { "variants": {
"dye=none,facing=north": { "model": "computercraft:advanced_turtle" }, "facing=north": { "model": "computercraft:advanced_turtle" },
"dye=none,facing=south": { "model": "computercraft:advanced_turtle", "y": 180 }, "facing=south": { "model": "computercraft:advanced_turtle", "y": 180 },
"dye=none,facing=west": { "model": "computercraft:advanced_turtle", "y": 270 }, "facing=west": { "model": "computercraft:advanced_turtle", "y": 270 },
"dye=none,facing=east": { "model": "computercraft:advanced_turtle", "y": 90 }, "facing=east": { "model": "computercraft:advanced_turtle", "y": 90 }
"dye=black,facing=north": { "model": "computercraft:turtle_black" },
"dye=black,facing=south": { "model": "computercraft:turtle_black", "y": 180 },
"dye=black,facing=west": { "model": "computercraft:turtle_black", "y": 270 },
"dye=black,facing=east": { "model": "computercraft:turtle_black", "y": 90 },
"dye=blue,facing=north": { "model": "computercraft:turtle_blue" },
"dye=blue,facing=south": { "model": "computercraft:turtle_blue", "y": 180 },
"dye=blue,facing=west": { "model": "computercraft:turtle_blue", "y": 270 },
"dye=blue,facing=east": { "model": "computercraft:turtle_blue", "y": 90 },
"dye=brown,facing=north": { "model": "computercraft:turtle_brown" },
"dye=brown,facing=south": { "model": "computercraft:turtle_brown", "y": 180 },
"dye=brown,facing=west": { "model": "computercraft:turtle_brown", "y": 270 },
"dye=brown,facing=east": { "model": "computercraft:turtle_brown", "y": 90 },
"dye=cyan,facing=north": { "model": "computercraft:turtle_cyan" },
"dye=cyan,facing=south": { "model": "computercraft:turtle_cyan", "y": 180 },
"dye=cyan,facing=west": { "model": "computercraft:turtle_cyan", "y": 270 },
"dye=cyan,facing=east": { "model": "computercraft:turtle_cyan", "y": 90 },
"dye=green,facing=north": { "model": "computercraft:turtle_green" },
"dye=green,facing=south": { "model": "computercraft:turtle_green", "y": 180 },
"dye=green,facing=west": { "model": "computercraft:turtle_green", "y": 270 },
"dye=green,facing=east": { "model": "computercraft:turtle_green", "y": 90 },
"dye=grey,facing=north": { "model": "computercraft:turtle_grey" },
"dye=grey,facing=south": { "model": "computercraft:turtle_grey", "y": 180 },
"dye=grey,facing=west": { "model": "computercraft:turtle_grey", "y": 270 },
"dye=grey,facing=east": { "model": "computercraft:turtle_grey", "y": 90 },
"dye=light_blue,facing=north": { "model": "computercraft:turtle_lightBlue" },
"dye=light_blue,facing=south": { "model": "computercraft:turtle_lightBlue", "y": 180 },
"dye=light_blue,facing=west": { "model": "computercraft:turtle_lightBlue", "y": 270 },
"dye=light_blue,facing=east": { "model": "computercraft:turtle_lightBlue", "y": 90 },
"dye=light_grey,facing=north": { "model": "computercraft:turtle_lightGrey" },
"dye=light_grey,facing=south": { "model": "computercraft:turtle_lightGrey", "y": 180 },
"dye=light_grey,facing=west": { "model": "computercraft:turtle_lightGrey", "y": 270 },
"dye=light_grey,facing=east": { "model": "computercraft:turtle_lightGrey", "y": 90 },
"dye=lime,facing=north": { "model": "computercraft:turtle_lime" },
"dye=lime,facing=south": { "model": "computercraft:turtle_lime", "y": 180 },
"dye=lime,facing=west": { "model": "computercraft:turtle_lime", "y": 270 },
"dye=lime,facing=east": { "model": "computercraft:turtle_lime", "y": 90 },
"dye=magenta,facing=north": { "model": "computercraft:turtle_magenta" },
"dye=magenta,facing=south": { "model": "computercraft:turtle_magenta", "y": 180 },
"dye=magenta,facing=west": { "model": "computercraft:turtle_magenta", "y": 270 },
"dye=magenta,facing=east": { "model": "computercraft:turtle_magenta", "y": 90 },
"dye=orange,facing=north": { "model": "computercraft:turtle_orange" },
"dye=orange,facing=south": { "model": "computercraft:turtle_orange", "y": 180 },
"dye=orange,facing=west": { "model": "computercraft:turtle_orange", "y": 270 },
"dye=orange,facing=east": { "model": "computercraft:turtle_orange", "y": 90 },
"dye=pink,facing=north": { "model": "computercraft:turtle_pink" },
"dye=pink,facing=south": { "model": "computercraft:turtle_pink", "y": 180 },
"dye=pink,facing=west": { "model": "computercraft:turtle_pink", "y": 270 },
"dye=pink,facing=east": { "model": "computercraft:turtle_pink", "y": 90 },
"dye=purple,facing=north": { "model": "computercraft:turtle_purple" },
"dye=purple,facing=south": { "model": "computercraft:turtle_purple", "y": 180 },
"dye=purple,facing=west": { "model": "computercraft:turtle_purple", "y": 270 },
"dye=purple,facing=east": { "model": "computercraft:turtle_purple", "y": 90 },
"dye=red,facing=north": { "model": "computercraft:turtle_red" },
"dye=red,facing=south": { "model": "computercraft:turtle_red", "y": 180 },
"dye=red,facing=west": { "model": "computercraft:turtle_red", "y": 270 },
"dye=red,facing=east": { "model": "computercraft:turtle_red", "y": 90 },
"dye=white,facing=north": { "model": "computercraft:turtle_white" },
"dye=white,facing=south": { "model": "computercraft:turtle_white", "y": 180 },
"dye=white,facing=west": { "model": "computercraft:turtle_white", "y": 270 },
"dye=white,facing=east": { "model": "computercraft:turtle_white", "y": 90 },
"dye=yellow,facing=north": { "model": "computercraft:turtle_yellow" },
"dye=yellow,facing=south": { "model": "computercraft:turtle_yellow", "y": 180 },
"dye=yellow,facing=west": { "model": "computercraft:turtle_yellow", "y": 270 },
"dye=yellow,facing=east": { "model": "computercraft:turtle_yellow", "y": 90 }
} }
} }

View File

@ -1,72 +1,8 @@
{ {
"variants": { "variants": {
"dye=none,facing=north": { "model": "computercraft:turtle" }, "facing=north": { "model": "computercraft:turtle" },
"dye=none,facing=south": { "model": "computercraft:turtle", "y": 180 }, "facing=south": { "model": "computercraft:turtle", "y": 180 },
"dye=none,facing=west": { "model": "computercraft:turtle", "y": 270 }, "facing=west": { "model": "computercraft:turtle", "y": 270 },
"dye=none,facing=east": { "model": "computercraft:turtle", "y": 90 }, "facing=east": { "model": "computercraft:turtle", "y": 90 }
"dye=black,facing=north": { "model": "computercraft:turtle_black" },
"dye=black,facing=south": { "model": "computercraft:turtle_black", "y": 180 },
"dye=black,facing=west": { "model": "computercraft:turtle_black", "y": 270 },
"dye=black,facing=east": { "model": "computercraft:turtle_black", "y": 90 },
"dye=blue,facing=north": { "model": "computercraft:turtle_blue" },
"dye=blue,facing=south": { "model": "computercraft:turtle_blue", "y": 180 },
"dye=blue,facing=west": { "model": "computercraft:turtle_blue", "y": 270 },
"dye=blue,facing=east": { "model": "computercraft:turtle_blue", "y": 90 },
"dye=brown,facing=north": { "model": "computercraft:turtle_brown" },
"dye=brown,facing=south": { "model": "computercraft:turtle_brown", "y": 180 },
"dye=brown,facing=west": { "model": "computercraft:turtle_brown", "y": 270 },
"dye=brown,facing=east": { "model": "computercraft:turtle_brown", "y": 90 },
"dye=cyan,facing=north": { "model": "computercraft:turtle_cyan" },
"dye=cyan,facing=south": { "model": "computercraft:turtle_cyan", "y": 180 },
"dye=cyan,facing=west": { "model": "computercraft:turtle_cyan", "y": 270 },
"dye=cyan,facing=east": { "model": "computercraft:turtle_cyan", "y": 90 },
"dye=green,facing=north": { "model": "computercraft:turtle_green" },
"dye=green,facing=south": { "model": "computercraft:turtle_green", "y": 180 },
"dye=green,facing=west": { "model": "computercraft:turtle_green", "y": 270 },
"dye=green,facing=east": { "model": "computercraft:turtle_green", "y": 90 },
"dye=grey,facing=north": { "model": "computercraft:turtle_grey" },
"dye=grey,facing=south": { "model": "computercraft:turtle_grey", "y": 180 },
"dye=grey,facing=west": { "model": "computercraft:turtle_grey", "y": 270 },
"dye=grey,facing=east": { "model": "computercraft:turtle_grey", "y": 90 },
"dye=light_blue,facing=north": { "model": "computercraft:turtle_lightBlue" },
"dye=light_blue,facing=south": { "model": "computercraft:turtle_lightBlue", "y": 180 },
"dye=light_blue,facing=west": { "model": "computercraft:turtle_lightBlue", "y": 270 },
"dye=light_blue,facing=east": { "model": "computercraft:turtle_lightBlue", "y": 90 },
"dye=light_grey,facing=north": { "model": "computercraft:turtle_lightGrey" },
"dye=light_grey,facing=south": { "model": "computercraft:turtle_lightGrey", "y": 180 },
"dye=light_grey,facing=west": { "model": "computercraft:turtle_lightGrey", "y": 270 },
"dye=light_grey,facing=east": { "model": "computercraft:turtle_lightGrey", "y": 90 },
"dye=lime,facing=north": { "model": "computercraft:turtle_lime" },
"dye=lime,facing=south": { "model": "computercraft:turtle_lime", "y": 180 },
"dye=lime,facing=west": { "model": "computercraft:turtle_lime", "y": 270 },
"dye=lime,facing=east": { "model": "computercraft:turtle_lime", "y": 90 },
"dye=magenta,facing=north": { "model": "computercraft:turtle_magenta" },
"dye=magenta,facing=south": { "model": "computercraft:turtle_magenta", "y": 180 },
"dye=magenta,facing=west": { "model": "computercraft:turtle_magenta", "y": 270 },
"dye=magenta,facing=east": { "model": "computercraft:turtle_magenta", "y": 90 },
"dye=orange,facing=north": { "model": "computercraft:turtle_orange" },
"dye=orange,facing=south": { "model": "computercraft:turtle_orange", "y": 180 },
"dye=orange,facing=west": { "model": "computercraft:turtle_orange", "y": 270 },
"dye=orange,facing=east": { "model": "computercraft:turtle_orange", "y": 90 },
"dye=pink,facing=north": { "model": "computercraft:turtle_pink" },
"dye=pink,facing=south": { "model": "computercraft:turtle_pink", "y": 180 },
"dye=pink,facing=west": { "model": "computercraft:turtle_pink", "y": 270 },
"dye=pink,facing=east": { "model": "computercraft:turtle_pink", "y": 90 },
"dye=purple,facing=north": { "model": "computercraft:turtle_purple" },
"dye=purple,facing=south": { "model": "computercraft:turtle_purple", "y": 180 },
"dye=purple,facing=west": { "model": "computercraft:turtle_purple", "y": 270 },
"dye=purple,facing=east": { "model": "computercraft:turtle_purple", "y": 90 },
"dye=red,facing=north": { "model": "computercraft:turtle_red" },
"dye=red,facing=south": { "model": "computercraft:turtle_red", "y": 180 },
"dye=red,facing=west": { "model": "computercraft:turtle_red", "y": 270 },
"dye=red,facing=east": { "model": "computercraft:turtle_red", "y": 90 },
"dye=white,facing=north": { "model": "computercraft:turtle_white" },
"dye=white,facing=south": { "model": "computercraft:turtle_white", "y": 180 },
"dye=white,facing=west": { "model": "computercraft:turtle_white", "y": 270 },
"dye=white,facing=east": { "model": "computercraft:turtle_white", "y": 90 },
"dye=yellow,facing=north": { "model": "computercraft:turtle_yellow" },
"dye=yellow,facing=south": { "model": "computercraft:turtle_yellow", "y": 180 },
"dye=yellow,facing=west": { "model": "computercraft:turtle_yellow", "y": 270 },
"dye=yellow,facing=east": { "model": "computercraft:turtle_yellow", "y": 90 }
} }
} }