Add origin grass

This commit is contained in:
Cheeserolls 2015-03-27 22:47:36 +00:00
parent b26378ca17
commit 2706bd521d
12 changed files with 67 additions and 20 deletions

View File

@ -133,6 +133,10 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
// smoldering grass supports no plants
case SMOLDERING:
return false;
// origin grass supports all plants (including crop type - no need for hoe)
case ORIGIN:
return true;
default:
switch (plantType)
@ -422,7 +426,7 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
// enum representing the variants of grass
public static enum BOPGrassType implements IStringSerializable
{
SPECTRALMOSS, SMOLDERING, LOAMY, SANDY, SILTY;
SPECTRALMOSS, SMOLDERING, LOAMY, SANDY, SILTY, ORIGIN;
@Override
public String getName()
@ -456,7 +460,7 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT_PROP, BlockBOPDirt.BOPDirtType.SANDY);
case SILTY:
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT_PROP, BlockBOPDirt.BOPDirtType.SILTY);
case SMOLDERING: default:
case SMOLDERING: case ORIGIN: default:
return Blocks.dirt.getStateFromMeta(BlockDirt.DirtType.DIRT.getMetadata());
}
}
@ -512,6 +516,17 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
{
return null;
}
// origin grass spreads to any kind of dirt
case ORIGIN:
if ((target.getBlock() == Blocks.dirt && target.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT) || (target.getBlock() == BOPBlocks.dirt && Boolean.FALSE.equals(target.getValue(BlockBOPDirt.COARSE))))
{
return BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT_PROP, BlockBOPGrass.BOPGrassType.ORIGIN);
}
else
{
return null;
}
// smoldering grass doesn't spread at all
case SMOLDERING: default:

View File

@ -10,10 +10,8 @@ package biomesoplenty.common.init;
import static biomesoplenty.api.block.BOPBlocks.*;
import net.minecraft.block.Block;
import net.minecraft.block.Block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import biomesoplenty.api.block.BOPBlock;
@ -34,6 +32,7 @@ import biomesoplenty.common.block.BlockBOPStone;
import biomesoplenty.common.block.BlockBamboo;
import biomesoplenty.common.block.BlockBones;
import biomesoplenty.common.block.BlockCoral;
import biomesoplenty.common.block.BlockCrystal;
import biomesoplenty.common.block.BlockFruit;
import biomesoplenty.common.block.BlockGem;
import biomesoplenty.common.block.BlockGemOre;
@ -74,17 +73,18 @@ public class ModBlocks
dirt = registerBlock(new BlockBOPDirt(), "dirt");
stone_formations = registerBlock(new BlockStoneFormations(),"stone_formations");
fruit_block = registerBlock(new BlockFruit(), "fruit_block");
crystal = registerBlock(new BlockCrystal(), "crystal");
// generics
ash_stone = registerBlock(new BlockBOPGeneric(),"ash_stone");
crag_rock = registerBlock((new BlockBOPGeneric()).setStepSound(Block.soundTypeStone),"crag_rock");
dried_dirt = registerBlock(new BlockBOPGeneric(),"dried_dirt"); dried_dirt.setHarvestLevel("pickaxe",0);
hard_dirt = registerBlock((new BlockBOPGeneric()).setHardness(0.7F),"hard_dirt");
hard_ice = registerBlock((new BlockBOPGeneric()).setHardness(0.75F),"hard_ice");
hard_sand = registerBlock((new BlockBOPGeneric(Material.sand)).setHardness(0.9F).setStepSound(Block.soundTypeSand),"hard_sand");
mud_brick = registerBlock((new BlockBOPGeneric()).setResistance(2.0F),"mud_brick");
ash_stone = registerBlock(new BlockBOPGeneric(), "ash_stone");
crag_rock = registerBlock((new BlockBOPGeneric()).setStepSound(Block.soundTypeStone), "crag_rock");
dried_dirt = registerBlock(new BlockBOPGeneric(), "dried_dirt"); dried_dirt.setHarvestLevel("pickaxe",0);
hard_dirt = registerBlock((new BlockBOPGeneric()).setHardness(0.7F), "hard_dirt");
hard_ice = registerBlock((new BlockBOPGeneric()).setHardness(0.75F), "hard_ice");
hard_sand = registerBlock((new BlockBOPGeneric(Material.sand)).setHardness(0.9F).setStepSound(Block.soundTypeSand), "hard_sand");
mud_brick = registerBlock((new BlockBOPGeneric()).setResistance(2.0F), "mud_brick");
//TODO biome_block & crystal are in 1.7 BlockBOPGeneric but actually have some special powers
}
private static Block registerBlock(Block block, String name) {

View File

@ -24,13 +24,14 @@ public class ModItems
{
public static void init()
{
fleshchunk = registerItem(new Item(),"fleshchunk");
mudball = registerItem(new ItemMudball(),"mudball");
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland),"turnip_seeds");
turnip = registerItem(new ItemFood(3, 0.4F, false),"turnip");
persimmon = registerItem(new ItemFood(5, 0.2F, false),"persimmon");
peach = registerItem(new ItemFood(5, 0.5F, false),"peach");
pear = registerItem(new ItemFood(5, 0.3F, false),"pear");
fleshchunk = registerItem(new Item(), "fleshchunk");
mudball = registerItem(new ItemMudball(), "mudball");
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland), "turnip_seeds");
turnip = registerItem(new ItemFood(3, 0.4F, false), "turnip");
persimmon = registerItem(new ItemFood(5, 0.2F, false), "persimmon");
peach = registerItem(new ItemFood(5, 0.5F, false), "peach");
pear = registerItem(new ItemFood(5, 0.3F, false), "pear");
crystal_shard = registerItem(new Item(), "crystal_shard");
}
private static Item registerItem(Item item, String name)

View File

@ -9,6 +9,8 @@
"snowy=false,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block" },
"snowy=true,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block_snowed" },
"snowy=false,variant=silty_grass_block": { "model": "biomesoplenty:silty_grass_block" },
"snowy=true,variant=silty_grass_block": { "model": "biomesoplenty:silty_grass_block_snowed" }
"snowy=true,variant=silty_grass_block": { "model": "biomesoplenty:silty_grass_block_snowed" },
"snowy=false,variant=origin_grass_block": { "model": "biomesoplenty:origin_grass_block" },
"snowy=true,variant=origin_grass_block": { "model": "biomesoplenty:origin_grass_block_snowed" }
}
}

View File

@ -16,6 +16,7 @@ tile.grass.smoldering_grass_block.name=Smoldering Grass Block
tile.grass.loamy_grass_block.name=Loamy Grass Block
tile.grass.sandy_grass_block.name=Sandy Grass Block
tile.grass.silty_grass_block.name=Silty Grass Block
tile.grass.origin_grass_block.name=Origin Grass Block
tile.coral.pink.name=Pink Coral
tile.coral.orange.name=Orange Coral

View File

@ -0,0 +1,9 @@
{
"parent": "block/cube_bottom_top",
"textures": {
"particle": "biomesoplenty:blocks/dirt_origin",
"bottom": "biomesoplenty:blocks/dirt_origin",
"top": "biomesoplenty:blocks/grass_origin_top",
"side": "biomesoplenty:blocks/grass_origin_side"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "block/cube_bottom_top",
"textures": {
"particle": "biomesoplenty:blocks/dirt_origin",
"bottom": "biomesoplenty:blocks/dirt_origin",
"top": "biomesoplenty:blocks/grass_origin_top",
"side": "biomesoplenty:blocks/grass_origin_side_snowed"
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/origin_grass_block",
"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: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B