Updated block bounding boxes

This commit is contained in:
Forstride 2019-01-28 12:42:52 -05:00
parent 5bb7155286
commit 7a6abc9022
4 changed files with 183 additions and 0 deletions

View file

@ -20,16 +20,34 @@ import net.minecraft.init.Particles;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public class BlockFlowerBOP extends BlockFlower
{
protected static final VoxelShape NORMAL = Block.makeCuboidShape(5.0D, 0.0D, 5.0D, 11.0D, 10.0D, 11.0D);
protected static final VoxelShape LARGE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
public BlockFlowerBOP(Block.Builder properties)
{
super(properties);
}
@Override
public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
Block block = state.getBlock();
if (block == BOPBlocks.lavender || block == BOPBlocks.pink_hibiscus)
{
return LARGE;
}
return NORMAL;
}
@Override
public void onEntityCollision(IBlockState stateIn, World worldIn, BlockPos pos, Entity entityIn)

View file

@ -7,17 +7,98 @@
******************************************************************************/
package biomesoplenty.common.block;
import java.util.Random;
import javax.annotation.Nullable;
import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
public class BlockFoliageBOP extends BlockBush
{
protected static final VoxelShape NORMAL = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected static final VoxelShape SHORT = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 7.0D, 15.0D);
public BlockFoliageBOP(Block.Builder properties)
{
super(properties);
}
@Override
public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
Block block = state.getBlock();
if (block == BOPBlocks.short_grass || block == BOPBlocks.desert_grass)
{
return SHORT;
}
return NORMAL;
}
@Override
public IItemProvider getItemDropped(IBlockState state, World worldIn, BlockPos pos, int fortune)
{
return Items.AIR;
}
@Override
public int getItemsToDropCount(IBlockState state, int fortune, World worldIn, BlockPos pos, Random random)
{
return 1 + random.nextInt(fortune * 2 + 1);
}
@Override
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
{
if (!worldIn.isRemote && stack.getItem() == Items.SHEARS)
{
player.addStat(StatList.BLOCK_MINED.get(this));
player.addExhaustion(0.005F);
spawnAsEntity(worldIn, pos, new ItemStack(this));
}
else
{
super.harvestBlock(worldIn, player, pos, state, te, stack);
}
}
public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune)
{
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 11);
return java.util.Arrays.asList(new ItemStack(this));
}
@Override
public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune)
{
Block block = state.getBlock();
if (block == BOPBlocks.short_grass || block == BOPBlocks.barley)
{
if (world.rand.nextInt(8) != 0) return;
ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(world.rand, fortune);
if (!seed.isEmpty())
drops.add(seed);
}
}
@Override
public Block.EnumOffsetType getOffsetType()
{

View file

@ -19,6 +19,7 @@ import net.minecraft.tags.FluidTags;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReaderBase;
import net.minecraft.world.World;
@ -27,11 +28,27 @@ import net.minecraftforge.common.IPlantable;
public class BlockPlantBOP extends BlockBush implements IPlantable
{
protected static final VoxelShape NORMAL = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected static final VoxelShape ROOT = Block.makeCuboidShape(2.0D, 2.0D, 2.0D, 14.0D, 16.0D, 14.0D);
public BlockPlantBOP(Block.Builder properties)
{
super(properties);
}
@Override
public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
Block block = state.getBlock();
if (block == BOPBlocks.root)
{
return ROOT;
}
return NORMAL;
}
@Override
public Block.EnumOffsetType getOffsetType()
{

View file

@ -19,6 +19,73 @@
"generator.biomesoplenty": "Biomes O' Plenty",
"itemGroup.biomesoplenty": "Biomes O' Plenty",
"item.forge.bucketFilled": "%s Bucket",
"biome.biomesoplenty.alps": "Alps",
"biome.biomesoplenty.alps_foothills": "Alps Foothills",
"biome.biomesoplenty.bayou": "Bayou",
"biome.biomesoplenty.bog": "Bog",
"biome.biomesoplenty.boreal_forest": "Boreal Forest",
"biome.biomesoplenty.brushland": "Brushland",
"biome.biomesoplenty.chaparral": "Chaparral",
"biome.biomesoplenty.cherry_blossom_grove": "Cherry Blossom Grove",
"biome.biomesoplenty.cold_desert": "Cold Desert",
"biome.biomesoplenty.coniferous_forest": "Coniferous Forest",
"biome.biomesoplenty.corrupted_sands": "Corrupted Sands",
"biome.biomesoplenty.crag": "Crag",
"biome.biomesoplenty.dead_forest": "Dead Forest",
"biome.biomesoplenty.dead_plains": "Dead Plains",
"biome.biomesoplenty.dead_swamp": "Dead Swamp",
"biome.biomesoplenty.fen": "Fen",
"biome.biomesoplenty.floodplains": "Floodplains",
"biome.biomesoplenty.flower_meadow": "Flower Meadow",
"biome.biomesoplenty.frosted_tundra": "Frosted Tundra",
"biome.biomesoplenty.fungi_forest": "Fungi Forest",
"biome.biomesoplenty.grassland": "Grassland",
"biome.biomesoplenty.gravel_beach": "Gravel Beach",
"biome.biomesoplenty.grove": "Grove",
"biome.biomesoplenty.highland": "Highland",
"biome.biomesoplenty.highland_moor": "Highland Moor",
"biome.biomesoplenty.lake": "Lake",
"biome.biomesoplenty.lavender_fields": "Lavender Fields",
"biome.biomesoplenty.lush_swamp": "Lush Swamp",
"biome.biomesoplenty.mangrove": "Mangrove",
"biome.biomesoplenty.maple_woods": "Maple Woods",
"biome.biomesoplenty.marsh": "Marsh",
"biome.biomesoplenty.meadow": "Meadow",
"biome.biomesoplenty.mire": "Mire",
"biome.biomesoplenty.mystic_grove": "Mystic Grove",
"biome.biomesoplenty.oasis": "Oasis",
"biome.biomesoplenty.ominous_woods": "Ominous Woods",
"biome.biomesoplenty.orchard": "Orchard",
"biome.biomesoplenty.origin_beach": "Origin Beach",
"biome.biomesoplenty.origin_island": "Origin Island",
"biome.biomesoplenty.outback": "Outback",
"biome.biomesoplenty.overgrown_cliffs": "Overgrown Cliffs",
"biome.biomesoplenty.pasture": "Pasture",
"biome.biomesoplenty.phantasmagoric_inferno": "Phantasmagoric Inferno",
"biome.biomesoplenty.prairie": "Prairie",
"biome.biomesoplenty.rainforest": "Rainforest",
"biome.biomesoplenty.redwood_forest": "Redwood Forest",
"biome.biomesoplenty.redwood_forest_edge": "Redwood Forest Edge",
"biome.biomesoplenty.scrubland": "Scrubland",
"biome.biomesoplenty.seasonal_forest": "Seasonal Forest",
"biome.biomesoplenty.shield": "Shield",
"biome.biomesoplenty.shrubland": "Shrubland",
"biome.biomesoplenty.snowy_coniferous_forest": "Snowy Coniferous Forest",
"biome.biomesoplenty.snowy_forest": "Snowy Forest",
"biome.biomesoplenty.steppe": "Steppe",
"biome.biomesoplenty.temperate_rainforest": "Temperate Rainforest",
"biome.biomesoplenty.tropical_island": "Tropical Island",
"biome.biomesoplenty.tropical_rainforest": "Tropical Rainforest",
"biome.biomesoplenty.tundra": "Tundra",
"biome.biomesoplenty.undergarden": "Undergarden",
"biome.biomesoplenty.visceral_heap": "Visceral Heap",
"biome.biomesoplenty.volcanic_island": "Volcanic Island",
"biome.biomesoplenty.wasteland": "Wasteland",
"biome.biomesoplenty.wetland": "Wetland",
"biome.biomesoplenty.white_beach": "White Beach",
"biome.biomesoplenty.woodland": "Woodland",
"biome.biomesoplenty.xeric_shrubland": "Xeric Shrubland",
"effect.biomesoplenty.curse": "Curse",