use of net.mcft.copy.betterstorage.tile.stand.TileArmorStand in project BetterStorage by copygirl.
the class ClientProxy method drawBlockHighlight.
@SubscribeEvent
public void drawBlockHighlight(DrawBlockHighlightEvent event) {
EntityPlayer player = event.player;
World world = player.worldObj;
MovingObjectPosition target = WorldUtils.rayTrace(player, event.partialTicks);
if ((target == null) || (target.typeOfHit != MovingObjectType.BLOCK))
return;
int x = target.blockX;
int y = target.blockY;
int z = target.blockZ;
AxisAlignedBB box = null;
Block block = world.getBlock(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (block instanceof TileArmorStand)
box = getArmorStandHighlightBox(player, world, x, y, z, target.hitVec);
else if (block == Blocks.iron_door)
box = getIronDoorHightlightBox(player, world, x, y, z, target.hitVec, block);
else if (tileEntity instanceof IHasAttachments)
box = getAttachmentPointsHighlightBox(player, tileEntity, target);
if (box == null)
return;
double xOff = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.partialTicks;
double yOff = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.partialTicks;
double zOff = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.partialTicks;
box.offset(-xOff, -yOff, -zOff);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(false);
RenderGlobal.drawOutlinedBoundingBox(box, -1);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
event.setCanceled(true);
}
Aggregations