Add origin grass
This commit is contained in:
parent
b26378ca17
commit
2706bd521d
|
@ -133,6 +133,10 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
|
||||||
// smoldering grass supports no plants
|
// smoldering grass supports no plants
|
||||||
case SMOLDERING:
|
case SMOLDERING:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// origin grass supports all plants (including crop type - no need for hoe)
|
||||||
|
case ORIGIN:
|
||||||
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
switch (plantType)
|
switch (plantType)
|
||||||
|
@ -422,7 +426,7 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
|
||||||
// enum representing the variants of grass
|
// enum representing the variants of grass
|
||||||
public static enum BOPGrassType implements IStringSerializable
|
public static enum BOPGrassType implements IStringSerializable
|
||||||
{
|
{
|
||||||
SPECTRALMOSS, SMOLDERING, LOAMY, SANDY, SILTY;
|
SPECTRALMOSS, SMOLDERING, LOAMY, SANDY, SILTY, ORIGIN;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName()
|
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);
|
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT_PROP, BlockBOPDirt.BOPDirtType.SANDY);
|
||||||
case SILTY:
|
case SILTY:
|
||||||
return BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT_PROP, BlockBOPDirt.BOPDirtType.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());
|
return Blocks.dirt.getStateFromMeta(BlockDirt.DirtType.DIRT.getMetadata());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -512,6 +516,17 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
|
||||||
{
|
{
|
||||||
return null;
|
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
|
// smoldering grass doesn't spread at all
|
||||||
case SMOLDERING: default:
|
case SMOLDERING: default:
|
||||||
|
|
|
@ -10,10 +10,8 @@ package biomesoplenty.common.init;
|
||||||
|
|
||||||
import static biomesoplenty.api.block.BOPBlocks.*;
|
import static biomesoplenty.api.block.BOPBlocks.*;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Block.SoundType;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import biomesoplenty.api.block.BOPBlock;
|
import biomesoplenty.api.block.BOPBlock;
|
||||||
|
@ -34,6 +32,7 @@ import biomesoplenty.common.block.BlockBOPStone;
|
||||||
import biomesoplenty.common.block.BlockBamboo;
|
import biomesoplenty.common.block.BlockBamboo;
|
||||||
import biomesoplenty.common.block.BlockBones;
|
import biomesoplenty.common.block.BlockBones;
|
||||||
import biomesoplenty.common.block.BlockCoral;
|
import biomesoplenty.common.block.BlockCoral;
|
||||||
|
import biomesoplenty.common.block.BlockCrystal;
|
||||||
import biomesoplenty.common.block.BlockFruit;
|
import biomesoplenty.common.block.BlockFruit;
|
||||||
import biomesoplenty.common.block.BlockGem;
|
import biomesoplenty.common.block.BlockGem;
|
||||||
import biomesoplenty.common.block.BlockGemOre;
|
import biomesoplenty.common.block.BlockGemOre;
|
||||||
|
@ -74,17 +73,18 @@ public class ModBlocks
|
||||||
dirt = registerBlock(new BlockBOPDirt(), "dirt");
|
dirt = registerBlock(new BlockBOPDirt(), "dirt");
|
||||||
stone_formations = registerBlock(new BlockStoneFormations(),"stone_formations");
|
stone_formations = registerBlock(new BlockStoneFormations(),"stone_formations");
|
||||||
fruit_block = registerBlock(new BlockFruit(), "fruit_block");
|
fruit_block = registerBlock(new BlockFruit(), "fruit_block");
|
||||||
|
crystal = registerBlock(new BlockCrystal(), "crystal");
|
||||||
|
|
||||||
// generics
|
// generics
|
||||||
ash_stone = registerBlock(new BlockBOPGeneric(),"ash_stone");
|
ash_stone = registerBlock(new BlockBOPGeneric(), "ash_stone");
|
||||||
crag_rock = registerBlock((new BlockBOPGeneric()).setStepSound(Block.soundTypeStone),"crag_rock");
|
crag_rock = registerBlock((new BlockBOPGeneric()).setStepSound(Block.soundTypeStone), "crag_rock");
|
||||||
dried_dirt = registerBlock(new BlockBOPGeneric(),"dried_dirt"); dried_dirt.setHarvestLevel("pickaxe",0);
|
dried_dirt = registerBlock(new BlockBOPGeneric(), "dried_dirt"); dried_dirt.setHarvestLevel("pickaxe",0);
|
||||||
hard_dirt = registerBlock((new BlockBOPGeneric()).setHardness(0.7F),"hard_dirt");
|
hard_dirt = registerBlock((new BlockBOPGeneric()).setHardness(0.7F), "hard_dirt");
|
||||||
hard_ice = registerBlock((new BlockBOPGeneric()).setHardness(0.75F),"hard_ice");
|
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");
|
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");
|
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) {
|
private static Block registerBlock(Block block, String name) {
|
||||||
|
|
|
@ -24,13 +24,14 @@ public class ModItems
|
||||||
{
|
{
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
fleshchunk = registerItem(new Item(),"fleshchunk");
|
fleshchunk = registerItem(new Item(), "fleshchunk");
|
||||||
mudball = registerItem(new ItemMudball(),"mudball");
|
mudball = registerItem(new ItemMudball(), "mudball");
|
||||||
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland),"turnip_seeds");
|
turnip_seeds = registerItem(new ItemSeeds(BOPBlocks.turnip_block, Blocks.farmland), "turnip_seeds");
|
||||||
turnip = registerItem(new ItemFood(3, 0.4F, false),"turnip");
|
turnip = registerItem(new ItemFood(3, 0.4F, false), "turnip");
|
||||||
persimmon = registerItem(new ItemFood(5, 0.2F, false),"persimmon");
|
persimmon = registerItem(new ItemFood(5, 0.2F, false), "persimmon");
|
||||||
peach = registerItem(new ItemFood(5, 0.5F, false),"peach");
|
peach = registerItem(new ItemFood(5, 0.5F, false), "peach");
|
||||||
pear = registerItem(new ItemFood(5, 0.3F, false),"pear");
|
pear = registerItem(new ItemFood(5, 0.3F, false), "pear");
|
||||||
|
crystal_shard = registerItem(new Item(), "crystal_shard");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item registerItem(Item item, String name)
|
private static Item registerItem(Item item, String name)
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
"snowy=false,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block" },
|
"snowy=false,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block" },
|
||||||
"snowy=true,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block_snowed" },
|
"snowy=true,variant=sandy_grass_block": { "model": "biomesoplenty:sandy_grass_block_snowed" },
|
||||||
"snowy=false,variant=silty_grass_block": { "model": "biomesoplenty:silty_grass_block" },
|
"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" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ tile.grass.smoldering_grass_block.name=Smoldering Grass Block
|
||||||
tile.grass.loamy_grass_block.name=Loamy Grass Block
|
tile.grass.loamy_grass_block.name=Loamy Grass Block
|
||||||
tile.grass.sandy_grass_block.name=Sandy Grass Block
|
tile.grass.sandy_grass_block.name=Sandy Grass Block
|
||||||
tile.grass.silty_grass_block.name=Silty 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.pink.name=Pink Coral
|
||||||
tile.coral.orange.name=Orange Coral
|
tile.coral.orange.name=Orange Coral
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 |
Loading…
Reference in New Issue