diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index 794c57f29..bfc400517 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -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; diff --git a/src/main/java/biomesoplenty/api/block/BOPPlant.java b/src/main/java/biomesoplenty/api/block/BOPPlant.java index 77be70daa..dc8df5700 100644 --- a/src/main/java/biomesoplenty/api/block/BOPPlant.java +++ b/src/main/java/biomesoplenty/api/block/BOPPlant.java @@ -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; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBamboo.java b/src/main/java/biomesoplenty/common/block/BlockBamboo.java new file mode 100644 index 000000000..3bb14f561 --- /dev/null +++ b/src/main/java/biomesoplenty/common/block/BlockBamboo.java @@ -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; + } +} diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index 0506125d8..1d89409a9 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -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"); diff --git a/src/main/resources/assets/biomesoplenty/blockstates/bamboo.json b/src/main/resources/assets/biomesoplenty/blockstates/bamboo.json new file mode 100755 index 000000000..8c6047a42 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/blockstates/bamboo.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "biomesoplenty:bamboo" } + } +} diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 7ea99a0f9..6988590a1 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -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 diff --git a/src/main/resources/assets/biomesoplenty/models/block/bamboo.json b/src/main/resources/assets/biomesoplenty/models/block/bamboo.json new file mode 100755 index 000000000..e9f90786e --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/bamboo.json @@ -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" } + } + } + ] +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/bamboo.json b/src/main/resources/assets/biomesoplenty/models/item/bamboo.json new file mode 100755 index 000000000..1c5e64144 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/bamboo.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo.png b/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo.png new file mode 100644 index 000000000..982e896ce Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo_top.png new file mode 100644 index 000000000..3635aa105 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/bamboo_top.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/items/bamboo.png b/src/main/resources/assets/biomesoplenty/textures/items/bamboo.png new file mode 100644 index 000000000..1af181312 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/items/bamboo.png differ