Add origin grass
This commit is contained in:
parent
b26378ca17
commit
2706bd521d
|
@ -134,6 +134,10 @@ public class BlockBOPGrass extends BOPBlock implements IGrowable
|
|||
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());
|
||||
}
|
||||
}
|
||||
|
@ -513,6 +517,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:
|
||||
return null;
|
||||
|
|
|
@ -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,6 +73,7 @@ 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");
|
||||
|
@ -84,7 +84,7 @@ public class ModBlocks
|
|||
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) {
|
||||
|
|
|
@ -31,6 +31,7 @@ public class ModItems
|
|||
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)
|
||||
|
|
|
@ -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" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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