BlockSystemRenderer.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:BlockSystems 作者:
private void renderBlockSelection(Entity viewEntity) {
    RenderHelper.enableStandardItemLighting();
    ServerBlockSystemHandler structureHandler = BlockSystems.PROXY.getBlockSystemHandler(this.blockSystem.getMainWorld());
    if (viewEntity instanceof EntityPlayer && structureHandler.getMousedOver((EntityPlayer) viewEntity) == this.blockSystem) {
        BlockSystemPlayerHandler handler = structureHandler.get(this.blockSystem, MC.player);
        if (handler != null) {
            RayTraceResult result = handler.getMouseOver();
            BlockPos pos = result.getBlockPos();
            GlStateManager.enableBlend();
            GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
            GlStateManager.glLineWidth(2.0F);
            GlStateManager.disableTexture2D();
            GlStateManager.depthMask(false);
            IBlockState state = this.blockSystem.getBlockState(pos);
            if (state.getMaterial() != Material.AIR) {
                RenderGlobal.drawSelectionBoundingBox(state.getSelectedBoundingBox(this.blockSystem, pos).expandXyz(0.002), 0.0F, 0.0F, 0.0F, 0.4F);
            }
            GlStateManager.depthMask(true);
            GlStateManager.enableTexture2D();
            GlStateManager.disableBlend();
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号