diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java index cead25f06..1a928423d 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLaserRelay.java @@ -22,6 +22,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockLaserRelay extends BlockContainerBase implements IActAddItemOrBlock{ @@ -34,6 +35,31 @@ public class BlockLaserRelay extends BlockContainerBase implements IActAddItemOr this.setStepSound(soundTypeStone); } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ + int meta = world.getBlockMetadata(x, y, z); + + float pixel = 1F/16F; + if(meta == 0){ + this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F, 1F-3*pixel); + } + else if(meta == 1){ + this.setBlockBounds(3*pixel, 0F, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); + } + else if(meta == 2){ + this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F); + } + else if(meta == 3){ + this.setBlockBounds(3*pixel, 3*pixel, 0F, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); + } + else if(meta == 4){ + this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F, 1F-3*pixel, 1F-3*pixel); + } + else if(meta == 5){ + this.setBlockBounds(0F, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); + } + } + @Override public boolean renderAsNormalBlock(){ return false; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java index ac614e96f..9f909f2ce 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java @@ -29,30 +29,30 @@ public class RenderLaserRelay extends RenderTileEntity{ GL11.glTranslatef(0.0F, -2.0F, 0.0F); this.bindTexture(resLoc); - if(theModel.doesRotate()){ - int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord); - if(meta == 0){ - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(0F, -2F, 0F); - } - if(meta == 3){ - GL11.glRotatef(-90, 1F, 0F, 0F); - GL11.glTranslatef(0F, -1F, 1F); - } - if(meta == 2){ - GL11.glRotatef(90, 1F, 0F, 0F); - GL11.glTranslatef(0F, -1F, -1F); - } - if(meta == 4){ - GL11.glRotatef(90, 0F, 0F, 1F); - GL11.glTranslatef(1F, -1F, 0F); - } - if(meta == 5){ - GL11.glRotatef(90, 0F, 0F, -1F); - GL11.glTranslatef(-1F, -1F, 0F); - } + int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord); + if(meta == 0){ + GL11.glRotatef(180F, 1F, 0F, 0F); + GL11.glTranslatef(0F, -2F, 0F); + } + else if(meta == 3){ + GL11.glRotatef(-90, 1F, 0F, 0F); + GL11.glTranslatef(0F, -1F, 1F); + } + else if(meta == 2){ + GL11.glRotatef(90, 1F, 0F, 0F); + GL11.glTranslatef(0F, -1F, -1F); + } + else if(meta == 4){ + GL11.glRotatef(90, 0F, 0F, 1F); + GL11.glTranslatef(1F, -1F, 0F); + } + else if(meta == 5){ + GL11.glRotatef(90, 0F, 0F, -1F); + GL11.glTranslatef(-1F, -1F, 0F); } + GL11.glScalef(0.85F, 0.85F, 0.85F); + GL11.glTranslatef(0F, 0.2657F, 0F); theModel.render(0.0625F); GL11.glPopMatrix(); }