From a961870caca932967c3828c8f799e9c698fc8ed8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 23 Dec 2015 22:44:25 +0100 Subject: [PATCH] Fixed Smiley Cloud's and Laser Relay's Collision Bounding Box sometimes freaking out --- .../actuallyadditions/blocks/BlockLaserRelay.java | 10 ++++++++++ .../actuallyadditions/blocks/BlockSmileyCloud.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java index 5260d40fd..1acfcc609 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java @@ -17,14 +17,18 @@ import ellpeck.actuallyadditions.tile.TileEntityLaserRelay; import ellpeck.actuallyadditions.util.AssetUtil; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; + public class BlockLaserRelay extends BlockContainerBase{ public BlockLaserRelay(String name){ @@ -35,6 +39,12 @@ public class BlockLaserRelay extends BlockContainerBase{ 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 public boolean renderAsNormalBlock(){ return false; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java index 370b5c472..9a9505649 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java @@ -22,17 +22,20 @@ import ellpeck.actuallyadditions.util.Util; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; import java.util.Random; public class BlockSmileyCloud extends BlockContainerBase{ @@ -92,6 +95,12 @@ public class BlockSmileyCloud extends BlockContainerBase{ 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 public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ int meta = world.getBlockMetadata(x, y, z);