diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java index f52541dcd..598087514 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java @@ -38,7 +38,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear // add properties (note we inherit HALF from BlockDoubleDecoration) public static enum DoublePlantType implements IStringSerializable { - FLAX, TALL_CATTAIL; + FLAX, TALL_CATTAIL, EYEBULB; @Override public String getName() { @@ -156,12 +156,13 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { + boolean isLower = ((Half) worldIn.getBlockState(pos).getValue(HALF) == Half.LOWER); switch ((DoublePlantType) worldIn.getBlockState(pos).getValue(VARIANT)) { default: - this.setBlockBoundsByRadiusAndHeight(0.4F, 0.8F); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(0.4F, isLower ? 1.0F : 0.8F, pos); break; - } + } } @@ -173,6 +174,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear Block groundBlock = groundState.getBlock(); boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.mycelium || groundBlock == Blocks.grass); boolean onGrass = (groundBlock == Blocks.grass); + boolean onHellish = (groundBlock == Blocks.netherrack || groundBlock == BOPBlocks.flesh); if (groundBlock instanceof BlockBOPGrass) { switch ((BlockBOPGrass.BOPGrassType) groundState.getValue(BlockBOPGrass.VARIANT)) @@ -181,6 +183,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear break; case OVERGROWN_NETHERRACK: onFertile = true; + onHellish = true; break; case LOAMY: case SANDY: case SILTY: case ORIGIN: default: onFertile = true; @@ -193,9 +196,11 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear case TALL_CATTAIL: boolean hasWater = (world.getBlockState(lowerPos.add(-1, -1, 0)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(1,-1,0)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(0,-1,-1)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(0,-1,1)).getBlock().getMaterial() == Material.water); return onGrass && hasWater; + case EYEBULB: + return onHellish; case FLAX: default: return onFertile; - } + } } diff --git a/src/main/java/biomesoplenty/common/block/BlockDecoration.java b/src/main/java/biomesoplenty/common/block/BlockDecoration.java index ccca4e234..fde2427c9 100644 --- a/src/main/java/biomesoplenty/common/block/BlockDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockDecoration.java @@ -21,6 +21,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -55,7 +56,6 @@ public class BlockDecoration extends Block implements IBOPBlock this.setTickRandomly(true); this.setHardness(0.0F); this.setStepSound(Block.soundTypeGrass); - this.setBlockBoundsByRadiusAndHeight(0.3F, 0.6F); this.setDefaultState(this.blockState.getBaseState()); } @@ -169,5 +169,11 @@ public class BlockDecoration extends Block implements IBOPBlock return Block.EnumOffsetType.XZ; } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { + this.setBlockBoundsByRadiusAndHeightWithXZOffset(0.3F, 0.6F, pos); + } + + } diff --git a/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java index 06c86ba55..d51a4b14c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java @@ -175,10 +175,10 @@ public class BlockDoubleDecoration extends BlockDecoration { switch ((Half) state.getValue(HALF)) { case LOWER: - super.setBlockBoundsByRadiusAndHeight(this.radius, this.fromTop ? this.height : 1.0F, this.fromTop); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(this.radius, this.fromTop ? this.height : 1.0F, this.fromTop, pos); break; case UPPER: - super.setBlockBoundsByRadiusAndHeight(this.radius, this.fromTop ? 1.0F : this.height, this.fromTop); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(this.radius, this.fromTop ? 1.0F : this.height, this.fromTop, pos); break; } } diff --git a/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json b/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json index 055487112..e40170997 100644 --- a/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json +++ b/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json @@ -3,6 +3,8 @@ "half=upper,variant=flax": { "model": "biomesoplenty:flax_upper" }, "half=lower,variant=flax": { "model": "biomesoplenty:flax_lower" }, "half=upper,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_upper" }, - "half=lower,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_lower" } + "half=lower,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_lower" }, + "half=upper,variant=eyebulb": { "model": "biomesoplenty:eyebulb_upper" }, + "half=lower,variant=eyebulb": { "model": "biomesoplenty:eyebulb_lower" } } } \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json new file mode 100644 index 000000000..f821fd6f1 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/eyebulb_lower" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json new file mode 100644 index 000000000..37d098afe --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/eyebulb_upper" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json b/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json new file mode 100644 index 000000000..8585d499c --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "biomesoplenty:blocks/eyebulb_upper" + }, + "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/eyebulb_lower.png b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_lower.png new file mode 100644 index 000000000..c4255b79f Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_lower.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png new file mode 100644 index 000000000..feb121fe5 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png differ