Readded bamboo
This commit is contained in:
parent
9d341a9921
commit
30251db8ec
11 changed files with 114 additions and 2 deletions
|
@ -13,6 +13,7 @@ import net.minecraft.block.Block;
|
|||
public class BOPBlocks
|
||||
{
|
||||
public static Block ash_block;
|
||||
public static Block bamboo;
|
||||
public static Block flower;
|
||||
public static Block flower2;
|
||||
public static Block log;
|
||||
|
|
|
@ -72,7 +72,7 @@ public class BOPPlant extends BOPBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
|
||||
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
54
src/main/java/biomesoplenty/common/block/BlockBamboo.java
Normal file
54
src/main/java/biomesoplenty/common/block/BlockBamboo.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 2014, the Biomes O' Plenty Team
|
||||
*
|
||||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||
*
|
||||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||
******************************************************************************/
|
||||
|
||||
package biomesoplenty.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import biomesoplenty.api.block.BOPPlant;
|
||||
|
||||
//TODO: Reimplement IPlantable interface (Requires Forge)
|
||||
public class BlockBamboo extends BOPPlant
|
||||
{
|
||||
public BlockBamboo()
|
||||
{
|
||||
super(null);
|
||||
|
||||
this.setHardness(0.2F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
|
||||
this.setBlockBounds(0.3125F, 0.0F, 0.3125F, 0.6875F, 1.0F, 0.6875F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
Block ground = world.getBlockState(pos.offsetDown()).getBlock();
|
||||
|
||||
return ground == Blocks.grass || ground == Blocks.dirt || ground == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Block.EnumOffsetType getOffsetType()
|
||||
{
|
||||
return Block.EnumOffsetType.NONE;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@ import net.minecraft.item.Item;
|
|||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import biomesoplenty.api.block.BOPBlock;
|
||||
import biomesoplenty.api.block.IBOPVariant;
|
||||
import biomesoplenty.client.util.ModelHelper;
|
||||
import biomesoplenty.common.block.BOPBlockPlanks;
|
||||
import biomesoplenty.common.block.BlockAsh;
|
||||
import biomesoplenty.common.block.BlockBOPFlower;
|
||||
|
@ -25,6 +24,7 @@ import biomesoplenty.common.block.BlockBOPLog2;
|
|||
import biomesoplenty.common.block.BlockBOPLog3;
|
||||
import biomesoplenty.common.block.BlockBOPLog4;
|
||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
||||
import biomesoplenty.common.block.BlockBamboo;
|
||||
import biomesoplenty.common.item.ItemBlockWithVariants;
|
||||
import biomesoplenty.core.BiomesOPlenty;
|
||||
|
||||
|
@ -33,6 +33,7 @@ public class ModBlocks
|
|||
public static void init()
|
||||
{
|
||||
ash_block = registerBlock(new BlockAsh(), "ash_block");
|
||||
bamboo = registerBlock(new BlockBamboo(), "bamboo");
|
||||
flower = registerBlock(new BlockBOPFlower(), "flower");
|
||||
flower2 = registerBlock(new BlockBOPFlower2(), "flower2");
|
||||
log = registerBlock(new BlockBOPLog(), "log");
|
||||
|
|
5
src/main/resources/assets/biomesoplenty/blockstates/bamboo.json
Executable file
5
src/main/resources/assets/biomesoplenty/blockstates/bamboo.json
Executable file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"normal": { "model": "biomesoplenty:bamboo" }
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
tile.ash_block.name=Ash Block
|
||||
|
||||
tile.bamboo.name=Bamboo
|
||||
|
||||
tile.flower.clover.name=Clover
|
||||
tile.flower.swampflower.name=Swampflower
|
||||
tile.flower.deathbloom.name=Deathbloom
|
||||
|
|
31
src/main/resources/assets/biomesoplenty/models/block/bamboo.json
Executable file
31
src/main/resources/assets/biomesoplenty/models/block/bamboo.json
Executable file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"particle": "biomesoplenty:blocks/bamboo",
|
||||
"top": "biomesoplenty:blocks/bamboo_top",
|
||||
"side": "biomesoplenty:blocks/bamboo"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up" }
|
||||
}
|
||||
},
|
||||
{ "from": [ 0, 0, 5 ],
|
||||
"to": [ 16, 16, 11 ],
|
||||
"faces": {
|
||||
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" },
|
||||
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }
|
||||
}
|
||||
},
|
||||
{ "from": [ 5, 0, 0 ],
|
||||
"to": [ 11, 16, 16 ],
|
||||
"faces": {
|
||||
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" },
|
||||
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
18
src/main/resources/assets/biomesoplenty/models/item/bamboo.json
Executable file
18
src/main/resources/assets/biomesoplenty/models/item/bamboo.json
Executable file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"parent": "builtin/generated",
|
||||
"textures": {
|
||||
"layer0": "biomesoplenty:items/bamboo"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ -90, 0, 0 ],
|
||||
"translation": [ 0, 1, -3 ],
|
||||
"scale": [ 0.55, 0.55, 0.55 ]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [ 0, -135, 25 ],
|
||||
"translation": [ 0, 4, 2 ],
|
||||
"scale": [ 1.7, 1.7, 1.7 ]
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 695 B |
Binary file not shown.
After Width: | Height: | Size: 282 B |
Binary file not shown.
After Width: | Height: | Size: 402 B |
Loading…
Reference in a new issue