Fixed Smiley Cloud's and Laser Relay's Collision Bounding Box sometimes freaking out

This commit is contained in:
Ellpeck 2015-12-23 22:44:25 +01:00
parent 89978a5c8c
commit a961870cac
2 changed files with 19 additions and 0 deletions

View file

@ -17,14 +17,18 @@ import ellpeck.actuallyadditions.tile.TileEntityLaserRelay;
import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.AssetUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List;
public class BlockLaserRelay extends BlockContainerBase{ public class BlockLaserRelay extends BlockContainerBase{
public BlockLaserRelay(String name){ public BlockLaserRelay(String name){
@ -35,6 +39,12 @@ public class BlockLaserRelay extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, x, y, z);
super.addCollisionBoxesToList(world, x, y, z, axis, list, entity);
}
@Override @Override
public boolean renderAsNormalBlock(){ public boolean renderAsNormalBlock(){
return false; return false;

View file

@ -22,17 +22,20 @@ import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List;
import java.util.Random; import java.util.Random;
public class BlockSmileyCloud extends BlockContainerBase{ public class BlockSmileyCloud extends BlockContainerBase{
@ -92,6 +95,12 @@ public class BlockSmileyCloud extends BlockContainerBase{
return true; return true;
} }
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, x, y, z);
super.addCollisionBoxesToList(world, x, y, z, axis, list, entity);
}
@Override @Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);