Add overgrown netherrack

This commit is contained in:
Cheeserolls 2015-04-01 02:39:49 +01:00
parent 4211c31181
commit 5f107dc8b8
7 changed files with 59 additions and 22 deletions

View file

@ -44,7 +44,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
{ {
// add properties (note we also inherit the SNOWY property from BlockGrass) // add properties (note we also inherit the SNOWY property from BlockGrass)
public static enum BOPGrassType implements IStringSerializable {SPECTRAL_MOSS, SMOLDERING, LOAMY, SANDY, SILTY, ORIGIN; public String getName() {return this.name().toLowerCase();}}; public static enum BOPGrassType implements IStringSerializable {SPECTRAL_MOSS, SMOLDERING, LOAMY, SANDY, SILTY, ORIGIN, OVERGROWN_NETHERRACK; public String getName() {return this.name().toLowerCase();}};
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGrassType.class); public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGrassType.class);
@Override @Override
protected BlockState createBlockState() {return new BlockState(this, new IProperty[] { VARIANT, SNOWY });} protected BlockState createBlockState() {return new BlockState(this, new IProperty[] { VARIANT, SNOWY });}
@ -72,6 +72,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
this.namedStates.put("sandy_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.SANDY) ); this.namedStates.put("sandy_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.SANDY) );
this.namedStates.put("silty_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.SILTY) ); this.namedStates.put("silty_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.SILTY) );
this.namedStates.put("origin_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.ORIGIN) ); this.namedStates.put("origin_grass_block", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.ORIGIN) );
this.namedStates.put("overgrown_netherrack", this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)).withProperty(VARIANT, BOPGrassType.OVERGROWN_NETHERRACK) );
this.setDefaultState(this.namedStates.get("loamy_grass_block")); this.setDefaultState(this.namedStates.get("loamy_grass_block"));
@ -108,7 +109,14 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
case ORIGIN: case ORIGIN:
return true; return true;
default: // overgrown_netherrack supports Nether plants in addition to the defaults
case OVERGROWN_NETHERRACK:
if (plantType == net.minecraftforge.common.EnumPlantType.Nether) {return true;}
break;
default: break;
}
switch (plantType) switch (plantType)
{ {
// support desert and plains plants // support desert and plains plants
@ -128,7 +136,6 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
return false; return false;
} }
} }
}
@Override @Override
@ -274,7 +281,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) { public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) {
switch ((BOPGrassType) state.getValue(VARIANT)) switch ((BOPGrassType) state.getValue(VARIANT))
{ {
case SPECTRAL_MOSS: case SMOLDERING: case SPECTRAL_MOSS: case SMOLDERING: case OVERGROWN_NETHERRACK:
return false; return false;
default: default:
return true; return true;
@ -285,7 +292,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) { public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) {
switch ((BOPGrassType) state.getValue(VARIANT)) switch ((BOPGrassType) state.getValue(VARIANT))
{ {
case SPECTRAL_MOSS: case SMOLDERING: case SPECTRAL_MOSS: case SMOLDERING: case OVERGROWN_NETHERRACK:
return false; return false;
default: default:
return true; return true;
@ -403,6 +410,8 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SANDY); return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SANDY);
case SILTY: case SILTY:
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY); return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
case OVERGROWN_NETHERRACK:
return Blocks.netherrack.getDefaultState();
case SMOLDERING: case ORIGIN: default: case SMOLDERING: case ORIGIN: default:
return Blocks.dirt.getStateFromMeta(BlockDirt.DirtType.DIRT.getMetadata()); return Blocks.dirt.getStateFromMeta(BlockDirt.DirtType.DIRT.getMetadata());
} }
@ -434,6 +443,13 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock
} }
break; break;
case OVERGROWN_NETHERRACK:
if (target.getBlock()==Blocks.netherrack)
{
return BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_NETHERRACK);
}
break;
// loamy/sandy/silty grasses spread to any kind of dirt // loamy/sandy/silty grasses spread to any kind of dirt
case LOAMY: case SANDY: case SILTY: case LOAMY: case SANDY: case SILTY:
// vanilla dirt gets vanilla grass spread to it // vanilla dirt gets vanilla grass spread to it

View file

@ -11,6 +11,8 @@
"snowy=false,variant=silty": { "model": "biomesoplenty:silty_grass_block" }, "snowy=false,variant=silty": { "model": "biomesoplenty:silty_grass_block" },
"snowy=true,variant=silty": { "model": "biomesoplenty:silty_grass_block_snowed" }, "snowy=true,variant=silty": { "model": "biomesoplenty:silty_grass_block_snowed" },
"snowy=false,variant=origin": { "model": "biomesoplenty:origin_grass_block" }, "snowy=false,variant=origin": { "model": "biomesoplenty:origin_grass_block" },
"snowy=true,variant=origin": { "model": "biomesoplenty:origin_grass_block_snowed" } "snowy=true,variant=origin": { "model": "biomesoplenty:origin_grass_block_snowed" },
"snowy=false,variant=overgrown_netherrack": { "model": "biomesoplenty:overgrown_netherrack" },
"snowy=true,variant=overgrown_netherrack": { "model": "biomesoplenty:overgrown_netherrack" }
} }
} }

View file

@ -0,0 +1,9 @@
{
"parent": "block/cube_bottom_top",
"textures": {
"particle": "biomesoplenty:blocks/overgrown_netherrack_bottom",
"bottom": "biomesoplenty:blocks/overgrown_netherrack_bottom",
"top": "biomesoplenty:blocks/overgrown_netherrack_top",
"side": "biomesoplenty:blocks/overgrown_netherrack_side"
}
}

View file

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/overgrown_netherrack",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B