mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Fixed most bounding boxes
This commit is contained in:
parent
5aa63f2822
commit
1757f38bd1
14 changed files with 77 additions and 56 deletions
|
@ -26,13 +26,16 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//TODO Fix bounding box
|
||||
public class BlockCoffeeMachine extends BlockContainerBase{
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0625, 0, 0.0625, 1-0.0625*2, 1-0.0625, 1-0.0625);
|
||||
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
|
||||
|
||||
public BlockCoffeeMachine(String name){
|
||||
|
@ -43,6 +46,11 @@ public class BlockCoffeeMachine extends BlockContainerBase{
|
|||
this.setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state){
|
||||
return false;
|
||||
|
|
|
@ -28,16 +28,28 @@ import net.minecraft.item.EnumRarity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.profiler.Profiler;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0625, 0, 0.0625, 1-0.0625, 11*0.0625, 1-0.0625);
|
||||
protected static final AxisAlignedBB AABB_LEGS = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.3125D, 1.0D);
|
||||
protected static final AxisAlignedBB AABB_WALL_NORTH = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D);
|
||||
protected static final AxisAlignedBB AABB_WALL_SOUTH = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 1.0D, 1.0D);
|
||||
protected static final AxisAlignedBB AABB_WALL_EAST = new AxisAlignedBB(0.875D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
|
||||
protected static final AxisAlignedBB AABB_WALL_WEST = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.125D, 1.0D, 1.0D);
|
||||
|
||||
public BlockCompost(String name){
|
||||
super(Material.WOOD, name);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
|
@ -48,27 +60,19 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
|
|||
//this.setBlockBoundsForItemRender();
|
||||
}
|
||||
|
||||
//TODO Fix bounding box
|
||||
/*@Override
|
||||
public void setBlockBoundsForItemRender(){
|
||||
float f = 1.0F/16.0F;
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11*f, 1.0F-f);
|
||||
}
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity){
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
float f = 0.125F, y = 0.7F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, y, f);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, y, 1.0F);
|
||||
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBoundsForItemRender();
|
||||
}*/
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn){
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_LEGS);
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_WEST);
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_NORTH);
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_EAST);
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
|
|
|
@ -18,18 +18,26 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockFishingNet extends BlockContainerBase{
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.0625, 1);
|
||||
|
||||
public BlockFishingNet(String name){
|
||||
super(Material.WOOD, name);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
this.setHardness(0.5F);
|
||||
this.setResistance(3.0F);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
//TODO Fix block bounds
|
||||
//this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,19 +18,27 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockFurnaceSolar extends BlockContainerBase{
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 6*0.0625, 1);
|
||||
|
||||
public BlockFurnaceSolar(String name){
|
||||
super(Material.ROCK, name);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
this.setHardness(1.5F);
|
||||
this.setResistance(10.0F);
|
||||
this.setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
//TODO Block bounds
|
||||
//this.setBlockBounds(0F, 0F, 0F, 1F, 6F/16F, 1F);
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,10 +22,11 @@ import net.minecraft.item.EnumRarity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//TODO Fix bounding box
|
||||
public class BlockLaserRelay extends BlockContainerBase{
|
||||
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
|
||||
|
|
|
@ -18,20 +18,26 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPhantomBooster extends BlockContainerBase{
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(2*0.0625, 0, 2*0.0625, 1-2*0.0625, 1, 1-2*0.0625);
|
||||
|
||||
public BlockPhantomBooster(String name){
|
||||
super(Material.ROCK, name);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
this.setHardness(1.5F);
|
||||
this.setResistance(10.0F);
|
||||
this.setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
//TODO Fix block bounds
|
||||
//float f = 1F/16F;
|
||||
//this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f);
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -87,6 +87,7 @@ public class BlockSlabs extends BlockBase{
|
|||
return this.getStateFromMeta(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return state.getValue(META) == 1 ? AABB_TOP_HALF : AABB_BOTTOM_HALF;
|
||||
}
|
||||
|
@ -114,6 +115,7 @@ public class BlockSlabs extends BlockBase{
|
|||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||
if(stack.stackSize != 0 && playerIn.canPlayerEdit(pos.offset(facing), facing, stack)){
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
|
@ -141,6 +143,7 @@ public class BlockSlabs extends BlockBase{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack){
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
|
|
|
@ -57,32 +57,6 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
|||
return false;
|
||||
}
|
||||
|
||||
//TODO Fix bounding box
|
||||
/*@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
|
||||
int meta = PosUtil.getMetadata(pos, world);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(meta == 1){
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F);
|
||||
}
|
||||
if(meta == 3){
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F);
|
||||
}
|
||||
if(meta == 0){
|
||||
this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F);
|
||||
}
|
||||
if(meta == 2){
|
||||
this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
return false;
|
||||
|
|
|
@ -77,11 +77,13 @@ public class BlockWallAA extends BlockBase{
|
|||
return side != EnumFacing.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
state = this.getActualState(state, source, pos);
|
||||
return field_185751_g[figureOutSomeWallStuff(state)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState blockState, World worldIn, BlockPos pos){
|
||||
blockState = this.getActualState(blockState, worldIn, pos);
|
||||
return field_185750_B[figureOutSomeWallStuff(blockState)];
|
||||
|
|
|
@ -51,6 +51,7 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
|
|||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRendering(){
|
||||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID, "itemPaxel"));
|
||||
ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID, "itemPaxel"));
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ItemAxeAA extends ItemToolAA{
|
|||
super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, IBlockState state){
|
||||
Material material = state.getMaterial();
|
||||
return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
|
|
@ -214,6 +214,7 @@ public class ItemDrill extends ItemEnergy{
|
|||
return EnumRarity.EPIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){
|
||||
Multimap<String, AttributeModifier> map = super.getAttributeModifiers(slot, stack);
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ItemPickaxeAA extends ItemToolAA{
|
|||
super(1.0F, -2.8F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockState blockIn){
|
||||
Block block = blockIn.getBlock();
|
||||
|
||||
|
@ -74,6 +75,7 @@ public class ItemPickaxeAA extends ItemToolAA{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, IBlockState state){
|
||||
Material material = state.getMaterial();
|
||||
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
|
|
@ -43,11 +43,13 @@ public class ItemShovelAA extends ItemToolAA{
|
|||
super(1.5F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockState blockIn){
|
||||
Block block = blockIn.getBlock();
|
||||
return block == Blocks.SNOW_LAYER || block == Blocks.SNOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||
return Items.IRON_HOE.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue