当前位置: 首页>>代码示例>>Java>>正文


Java MinecraftForgeClient.getRenderPass方法代码示例

本文整理汇总了Java中net.minecraftforge.client.MinecraftForgeClient.getRenderPass方法的典型用法代码示例。如果您正苦于以下问题:Java MinecraftForgeClient.getRenderPass方法的具体用法?Java MinecraftForgeClient.getRenderPass怎么用?Java MinecraftForgeClient.getRenderPass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.client.MinecraftForgeClient的用法示例。


在下文中一共展示了MinecraftForgeClient.getRenderPass方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderBlock

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
protected void renderBlock(SuperTileEntity te, BufferBuilder buffer)
{
    SuperBlock block = (SuperBlock) te.getBlockType();
    if(block.blockRenderMode != BlockRenderMode.TESR) return;
    
    if(MinecraftForgeClient.getRenderPass() == 0)
    {
        ForgeHooksClient.setRenderLayer(BlockRenderLayer.SOLID);
        
        // FIXME: only do this when texture demands it and use FastTESR other times
        GlStateManager.disableAlpha();
        renderBlockInner(te, block, false, buffer);
        GlStateManager.enableAlpha();
        ForgeHooksClient.setRenderLayer(null);
    }
    else if(MinecraftForgeClient.getRenderPass() == 1)
    {
        ForgeHooksClient.setRenderLayer(BlockRenderLayer.TRANSLUCENT);
        renderBlockInner(te, block, true, buffer);
        ForgeHooksClient.setRenderLayer(null);
    }
}
 
开发者ID:grondag,项目名称:Hard-Science,代码行数:23,代码来源:SuperBlockTESR.java

示例2: renderWorldBlock

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) {
	if (blck == null || !(blck instanceof BlockMultiLayerBase))
		return false;
	BlockMultiLayerBase block = (BlockMultiLayerBase) blck;

	if (MinecraftForgeClient.getRenderPass() == 0) {
		if (block.icon != null) {
			renderer.overrideBlockTexture = block.icon;
			renderer.renderStandardBlock(block, x, y, z);
			renderer.overrideBlockTexture = null;
			return true;
		} else if (block.base != null) {
			renderer.renderBlockByRenderType(block.base, x, y, z);
			return true;
		}
	} else {
		renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
		return renderer.renderStandardBlock(block, x, y, z);
	}

	return false;
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:24,代码来源:RendererMultiLayer.java

示例3: render

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public void render(TileEntityProjector projector, double x, double y, double z, float partialTickTime, int destroyProgess, float alpha) {
	int pass = MinecraftForgeClient.getRenderPass();

	GlStateManager.color(1, 1, 1);

	GlStateManager.disableLighting();
	int mapId = projector.mapId();
	if (pass <= 0) {
		renderProjector(projector, partialTickTime, x, y, z);
	} else {

		renderMap(projector, mapId, x, y, z);

	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:17,代码来源:TileEntityProjectorRenderer.java

示例4: renderTileEntity

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public void renderTileEntity(@Nonnull TileTelePad te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
  if (MinecraftForgeClient.getRenderPass() == 0) {

    render(te, lights);

    Random rand = new Random(te.getPos().toLong());
    for (int i = 0; i < 3; i++) {
      GlStateManager.pushMatrix();
      GlStateManager.translate(0.5, 0, 0.5);
      GlStateManager.rotate(te.bladeRots[i] + rand.nextInt(360) + (te.spinSpeed * partialTicks * ((i * 2) + 20)), 0, 1, 0);
      GlStateManager.translate(-0.5, i * 2f / 16f, -0.5);
      render(te, blade);
      GlStateManager.popMatrix();
    }
  } else {
    RenderHelper.disableStandardItemLighting();

    render(te, glass);

    if (TelePadConfig.telepadIsTravelAnchor.get() && super.shouldRender(te, blockState, 1)) {
      RenderHelper.enableStandardItemLighting();
      super.renderTileEntity(te, blockState, partialTicks, destroyStage);
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:27,代码来源:TelePadSpecialRenderer.java

示例5: renderTile

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
void renderTile(TileQuantumMirror mirror, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
	float tick = RenderHelper.getRenderWorldTime(partialTicks);
	int layer = MinecraftForgeClient.getRenderPass();

	final float prevU = OpenGlHelper.lastBrightnessX;
	final float prevV = OpenGlHelper.lastBrightnessY;
	switch(layer) {
		case 0:
			Optional<UUID> optional = mirror.getKey();
			if(optional.isPresent()) {
				ItemStack stack = QuantumHandler.getEntanglementStack(optional.get(), 0);
				if(stack.isEmpty()) break;

				GlStateManager.pushMatrix();
				GLHelper.lightMap(255F, 255F);
				GlStateManager.translate(x + 0.5, y + 0.38, z + 0.5);

				GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
				RenderHelper.renderItemStack(stack);

				GlStateManager.popMatrix();
			}
			break;
		case 1:
			renderModel(tick, x, y, z);
			break;
	}
	GLHelper.lightMap(prevU, prevV);
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:31,代码来源:QuantumMirrorRenderer.java

示例6: renderTileEntityAt

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileJar tile, double x, double y, double z, float partialTicks, int destroyState)
{
	int pass = MinecraftForgeClient.getRenderPass();
	if(tile == null)return;
	renderInternalJar(x, y, z, tile.getPotion(), tile.getPotionCount(), tile.isShulkerLamp(), tile.getLabelMap(), pass);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:8,代码来源:RenderTileJar.java

示例7: beginRenderEntities

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
public static void beginRenderEntities(float partialTicks) {
    int pass = MinecraftForgeClient.getRenderPass();

    if (pass == 0) {
        // Update matrices
        acquireMatrix(GL_MODELVIEW_MATRIX, playerViewMatrix);
        acquireMatrix(GL_PROJECTION_MATRIX, projMatrix);
        Matrix4f.mul(projMatrix, playerViewMatrix, pvpMatrix);
    }

    MinecraftForge.EVENT_BUS.post(new RenderAllEntityEvent(pass, partialTicks));
}
 
开发者ID:LambdaInnovation,项目名称:Pipeline,代码行数:13,代码来源:RenderEventDispatch.java

示例8: render

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
/**
 * Renders routable fluid.
 *
 * @param  TE the {@link TEBase}
 * @param  renderBlocks the {@link RenderBlocks}
 * @param  x the x coordinate
 * @param  y the y coordinate
 * @param  z the z coordinate
 * @return true if fluid rendered in space
 */
public static boolean render(TEBase TE, RenderBlocks renderBlocks, int x, int y, int z)
{
    // Do not render if fluid is above block
    Class clazz_YP = renderBlocks.blockAccess.getBlock(x, y + 1, z).getClass();
    for (Class clazz : liquidClasses) {
        if (clazz.isAssignableFrom(clazz_YP)) {
            return false;
        }
    }

    ItemStack itemStack = getFluidBlock(renderBlocks.blockAccess, x, y, z);

    if (itemStack != null) {

        Block block = BlockProperties.toBlock(itemStack);
        int metadata = itemStack.getItemDamage();

        if (block.getRenderBlockPass() == MinecraftForgeClient.getRenderPass())
        {
            if (!block.hasTileEntity(metadata))
            {
                if (block instanceof BlockLiquid) {
                    renderLiquidSurface(TE, renderBlocks, itemStack, x, y, z);
                } else {
                    RenderBlockFluid.instance.renderWorldBlock(renderBlocks.blockAccess, x, y, z, block, 0, renderBlocks);
                }
                return true;
            }
        }

    }

    return false;
}
 
开发者ID:Mineshopper,项目名称:carpentersblocks,代码行数:45,代码来源:RoutableFluidsHelper.java

示例9: render

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public void render(TileEntityBuilderGuide te, double x, double y, double z, float partialTickTime, int destroyProgress, float alpha) {
	if (MinecraftForgeClient.getRenderPass() == 0) {
		GL11.glPushMatrix();
		GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
		renderCubes(te.getTicks() + partialTickTime);
		GL11.glPopMatrix();
	} else {
		super.render(te, x, y, z, partialTickTime, destroyProgress, alpha);
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:12,代码来源:TileEntityBuilderGuideRenderer.java

示例10: renderTileEntity

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected void renderTileEntity(@Nonnull TileKillerJoe te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
  if (MinecraftForgeClient.getRenderPass() == 0) {
    renderSword(te.facing, te.getWeapon(), te.getSwingProgress(partialTicks), Minecraft.getMinecraft().player.getPrimaryHand() == EnumHandSide.LEFT);
  } else if (MinecraftForgeClient.getRenderPass() == 1) {
    HalfBakedList buffer = TankRenderHelper.mkTank(te.tank, 2.51, 1, 14, false);
    if (buffer != null) {
      buffer.render();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:12,代码来源:KillerJoeRenderer.java

示例11: beginRenderEntities

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
public static void beginRenderEntities(float partialTicks) {
    int pass = MinecraftForgeClient.getRenderPass();
    long time = GameTimer.getTime();

    float deltaTime;

    if (pass == 0) {
        // Update matrices
        acquireMatrix(GL_MODELVIEW_MATRIX, playerViewMatrix);
        acquireMatrix(GL_PROJECTION_MATRIX, projMatrix);
        Matrix4f.mul(projMatrix, playerViewMatrix, pvpMatrix);

        // Find camera up vector and camera position
        {
            Matrix4f inv = tmpResult;
            Matrix4f.invert(playerViewMatrix, inv);

            cameraPos.x = inv.m30;
            cameraPos.y = inv.m31;
            cameraPos.z = inv.m32;

            Vector4f tmp = Matrix4f.transform(inv, UP_VEC4, null);
            Vector3f p = new Vector3f(tmp.x, tmp.y, tmp.z);
            Vector3f.sub(p, cameraPos, cameraUp);
            cameraUp.normalise();
        }

        // Update delta time
        if (firstFrame) {
            firstFrame = false;
            deltaTime = 0;
        } else {
            deltaTime = (time - lastFrameTime) / 1000.0f;
        }

        lastFrameTime = time;
        thisFrameDeltaTime = deltaTime;
    } else {
        deltaTime = thisFrameDeltaTime;
    }

    MinecraftForge.EVENT_BUS.post(new RenderAllEntityEvent(pass, partialTicks, deltaTime));
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:44,代码来源:RenderEventDispatch.java

示例12: renderWorldBlock

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelID, RenderBlocks renderBlocks)
{
    VertexHelper.vertexCount = 0;
    renderPass = MinecraftForgeClient.getRenderPass();
    TileEntity TE_default = blockAccess.getTileEntity(x, y, z);

    if (TE_default != null && TE_default instanceof TEBase) {

        TE = (TEBase) TE_default;
        srcBlock = block;
        this.renderBlocks = renderBlocks;
        lightingHelper = new LightingHelper(renderBlocks);

        renderCarpentersBlock(x, y, z);
        renderSideBlocks(x, y, z);

        if (FeatureRegistry.enableRoutableFluids) {
            VertexHelper.vertexCount += RoutableFluidsHelper.render(TE, renderBlocks, x, y, z) ? 4 : 0;
        }

        if (FeatureRegistry.enableRailSlopes)
        {
            Block blockYP = blockAccess.getBlock(x, y + 1, z);
            if (blockAccess.isSideSolid(x, y, z, ForgeDirection.UP, false) && blockYP instanceof BlockRailBase)
            {
                int metadata = ((BlockRailBase)blockYP).getBasicRailMetadata(blockAccess, null, x, y + 1, z);

                BlockHandlerCarpentersSlope slopeHandler = new BlockHandlerCarpentersSlope();
                slopeHandler.renderBlocks = this.renderBlocks;
                slopeHandler.TE = TE;
                slopeHandler.lightingHelper = lightingHelper;
                slopeHandler.srcBlock = srcBlock;
                slopeHandler.suppressOverlay = true;

                switch (metadata)
                {
                    case 2: // Sloping down -X (West)
                        slopeHandler.renderSlope(getCoverForRendering(TE), Slope.WEDGE_POS_W, x, y + 1, z, true);
                        break;
                    case 3: // Sloping down +X (East)
                        slopeHandler.renderSlope(getCoverForRendering(TE), Slope.WEDGE_POS_E, x, y + 1, z, true);
                        break;
                    case 4: // Sloping down +Z (South)
                        slopeHandler.renderSlope(getCoverForRendering(TE), Slope.WEDGE_POS_S, x, y + 1, z, true);
                        break;
                    case 5: // Sloping down -Z (North)
                        slopeHandler.renderSlope(getCoverForRendering(TE), Slope.WEDGE_POS_N, x, y + 1, z, true);
                        break;
                    default: {}
                }
            }
        }
    }

    return VertexHelper.vertexCount > 0;
}
 
开发者ID:Mineshopper,项目名称:carpentersblocks,代码行数:58,代码来源:BlockHandlerBase.java

示例13: renderTileEntityAt

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
{
    if (MinecraftForgeClient.getRenderPass() == 0)
    {
        super.renderTileEntityAt(tileEntity, x, y, z, tick);
    }
    else if (tileEntity instanceof TileSortingAlchemicalChest)
    {
        TileSortingAlchemicalChest tileAlchemicalChest = (TileSortingAlchemicalChest) tileEntity;
        ForgeDirection direction = null;

        if (tileAlchemicalChest.getWorldObj() != null)
        {
            direction = tileAlchemicalChest.getOrientation();
        }

        FMLClientHandler.instance().getClient().renderEngine.bindTexture(Resources.MODEL_TEXTURE_OVERLAY_ALCHEMICAL_CHEST);

        GL11.glPushMatrix();
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F);
        GL11.glScalef(1.0F, -1.0F, -1.0F);
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
        short angle = 0;

        if (direction != null)
        {
            if (direction == ForgeDirection.NORTH)
            {
                angle = 180;
            }
            else if (direction == ForgeDirection.SOUTH)
            {
                angle = 0;
            }
            else if (direction == ForgeDirection.WEST)
            {
                angle = 90;
            }
            else if (direction == ForgeDirection.EAST)
            {
                angle = -90;
            }
        }

        GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        float adjustedLidAngle = tileAlchemicalChest.prevLidAngle + (tileAlchemicalChest.lidAngle - tileAlchemicalChest.prevLidAngle) * tick;
        adjustedLidAngle = 1.0F - adjustedLidAngle;
        adjustedLidAngle = 1.0F - adjustedLidAngle * adjustedLidAngle * adjustedLidAngle;
        modelChest.chestLid.rotateAngleX = -(adjustedLidAngle * (float) Math.PI / 2.0F);
        modelChest.renderAll();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    }
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:60,代码来源:RendererSortingAlchemicalChest.java

示例14: renderTileEntityChestAt

import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
/**
 * Renders the TileEntity for the chest at a position.
 */
public void renderTileEntityChestAt(TileSortingChest par1TileEntityChest, double par2, double par4, double par6, float par8)
{
    int i;

    if (!par1TileEntityChest.hasWorldObj())
    {
        i = 0;
    }
    else
    {
        i = par1TileEntityChest.getFacing();
    }

    ModelChest modelchest = this.chestModel;

    if (MinecraftForgeClient.getRenderPass() == 0)
    {
        bindTexture(RES_NORMAL_SINGLE);
    }
    else
    {
        bindTexture(Resources.MODEL_TEXTURE_OVERLAY_CHEST);
    }

    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glTranslatef((float) par2, (float) par4 + 1.0F, (float) par6 + 1.0F);
    GL11.glScalef(1.0F, -1.0F, -1.0F);
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    short short1 = 0;

    if (i == 2)
    {
        short1 = 180;
    }

    if (i == 3)
    {
        short1 = 0;
    }

    if (i == 4)
    {
        short1 = 90;
    }

    if (i == 5)
    {
        short1 = -90;
    }

    GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;

    f1 = 1.0F - f1;
    f1 = 1.0F - f1 * f1 * f1;
    modelchest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F);
    modelchest.renderAll();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:68,代码来源:RendererSortingChest.java


注:本文中的net.minecraftforge.client.MinecraftForgeClient.getRenderPass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。