當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockRendererDispatcher類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.BlockRendererDispatcher的典型用法代碼示例。如果您正苦於以下問題:Java BlockRendererDispatcher類的具體用法?Java BlockRendererDispatcher怎麽用?Java BlockRendererDispatcher使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BlockRendererDispatcher類屬於net.minecraft.client.renderer包,在下文中一共展示了BlockRendererDispatcher類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public void doRenderLayer(EntityIronGolem entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.getHoldRoseTick() != 0)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(-0.9375F, -0.625F, -0.9375F);
        float f = 0.5F;
        GlStateManager.scale(f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.ironGolemRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(Blocks.red_flower.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:LayerIronGolemFlower.java

示例2: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:27,代碼來源:LayerHeldBlock.java

示例3: renderGhostModel

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public static void renderGhostModel(IBakedModel model, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
	GlStateManager.enableBlend();
       GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
	BufferBuilder vb;
	if(noDepth)
	{
           GlStateManager.depthFunc(519);
		vb = prepRenderBlockDepth(partialTicks, true);
	}
	else
        vb = prepRender(partialTicks, true);
       vb.begin(7, DefaultVertexFormats.BLOCK);
       World world = Minecraft.getMinecraft().world;
       BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
       dispatcher.getBlockModelRenderer().renderModel(world, model, Minecraft.getMinecraft().world.getBlockState(position), position.add(0, noDepth ? 500 : 0, 0), vb, false);
       for(int i = 0; i < vb.getVertexCount(); i++)
       	vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
       vb.color(1, 1, 1, 0.1f);
       postRender();
       GlStateManager.depthFunc(515);
       GlStateManager.disableBlend();
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:24,代碼來源:HarshenClientUtils.java

示例4: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
@Override
public void doRenderLayer(EntityMeeCreeps entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null) {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender();
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:26,代碼來源:LayerRenderHeldBlock.java

示例5: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate.getBlock().getMaterial() != Material.air)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:27,代碼來源:LayerHeldBlock.java

示例6: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
@Override
public void doRenderLayer(EntityEvolvedEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
	IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

	if (iblockstate != null) {
		BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
		GlStateManager.enableRescaleNormal();
		GlStateManager.pushMatrix();
		GlStateManager.translate(0.0F, 0.6875F, -0.75F);
		GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
		GlStateManager.translate(0.25F, 0.1875F, 0.25F);
		GlStateManager.scale(-0.5F, -0.5F, 0.5F);
		int i = entitylivingbaseIn.getBrightnessForRender();
		int j = i % 65536;
		int k = i / 65536;
		OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j, k);
		GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
		endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
		blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
		GlStateManager.popMatrix();
		GlStateManager.disableRescaleNormal();
	}
}
 
開發者ID:p455w0rd,項目名稱:EndermanEvolution,代碼行數:25,代碼來源:LayerHeldBlock2.java

示例7: doRenderLayer

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public void doRenderLayer(EntityIronGolem entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getHoldRoseTick() != 0)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(-0.9375F, -0.625F, -0.9375F);
        float f = 0.5F;
        GlStateManager.scale(0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.ironGolemRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(Blocks.RED_FLOWER.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:LayerIronGolemFlower.java

示例8: renderModel

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
private void renderModel(EntityArtifactFrame entity)
{
    BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    IBakedModel ibakedmodel;

    if (!entity.getDisplayedItem().isEmpty() && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
    {
        //ModelResourceLocation mapModel = new ModelResourceLocation(new ResourceLocation("betterwithaddons",this.mapModel.getResourcePath()),this.mapModel.getVariant());
        ibakedmodel = modelmanager.getModel(mapModel);
    }
    else
    {
        //ModelResourceLocation itemFrameModel = new ModelResourceLocation(new ResourceLocation("betterwithaddons",this.itemFrameModel.getResourcePath()),this.itemFrameModel.getVariant());
        ibakedmodel = modelmanager.getModel(itemFrameModel);
    }

    //GlStateManager.pushMatrix();
    //GlStateManager.translate(-0.5F, -0.5F, -0.5F);

    blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:23,代碼來源:RenderArtifactFrame.java

示例9: buildCoverQuads

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public static List<CustomBakedQuad> buildCoverQuads(IBlockAccess world, BlockPos pos, IBlockState state, int side, AxisAlignedBB bounds, final CoverCutter.ITransformer[] cutType){
	final EnumFacing face = EnumFacing.getFront(side);
       final IBlockAccess coverAccess = new PipeBlockAccessWrapper(world, pos, face);
       final BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
       try {
           state = state.getActualState(coverAccess, pos);
       }
       catch (Exception ex) {}
       final IBakedModel model = dispatcher.getModelForState(state);
       try {
           state = state.getBlock().getExtendedState(state, coverAccess, pos);
       }
       catch (Exception ex2) {}
       final List<BakedQuad> bakedQuads = new LinkedList<BakedQuad>();
       final long posRand = MathHelper.getPositionRandom(pos);
       bakedQuads.addAll(model.getQuads(state, (EnumFacing)null, posRand));
       for (final EnumFacing face2 : EnumFacing.VALUES) {
           bakedQuads.addAll(model.getQuads(state, face2, posRand));
       }
       List<CustomBakedQuad> quads = CustomBakedQuad.fromArray(bakedQuads);
       if (cutType != null) {
           quads = CoverCutter.cut(quads, side, cutType);
       }
       quads = sliceQuads(quads, side, bounds);
       return quads;
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:27,代碼來源:CoverRender.java

示例10: renderOnScreen

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
/**
 * Render in GUIs just like any other entity, 45 degree rotate  by 
 * X and Y. 
 */
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
    Minecraft mc = Minecraft.getMinecraft();

    GlStateManager.enableDepth();
    BlockRendererDispatcher blockrendererdispatcher = mc.getBlockRendererDispatcher();
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, 0);
    GlStateManager.scale((-scale), -scale, -scale);
    GlStateManager.rotate(45.0F, -1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0, 1, 0);

    mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    blockrendererdispatcher.renderBlockBrightness(this.block, 1.0F);
    GlStateManager.popMatrix();
    GlStateManager.disableDepth();
}
 
開發者ID:mchorse,項目名稱:metamorph,代碼行數:25,代碼來源:BlockMorph.java

示例11: render

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
/**
 * Render the block morph on player's position
 */
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    Minecraft mc = Minecraft.getMinecraft();

    BlockRendererDispatcher blockrendererdispatcher = mc.getBlockRendererDispatcher();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float) x, (float) y + 0.5F, (float) z);

    mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, 0.5F);
    blockrendererdispatcher.renderBlockBrightness(this.block, 1.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);
    GlStateManager.popMatrix();
}
 
開發者ID:mchorse,項目名稱:metamorph,代碼行數:21,代碼來源:BlockMorph.java

示例12: doRender

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
public void doRender(EntityOres entity, double x, double y, double z, float entityYaw, float partialTicks) {
	BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();

	GlStateManager.pushMatrix();

	GlStateManager.translate((float) x, (float) y + 0.5F, (float) z);
	GlStateManager.rotate(entity.rotationYawHead, 0, 1, 0);
	GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.translate(-0.5F, -0.5F, 0.5F);

	this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
	//blockrendererdispatcher.renderBlockBrightness(this.iblockState, entity.getBrightness(partialTicks));
	blockrendererdispatcher.renderBlockBrightness(this.iblockState, entity.getBrightness());
	GlStateManager.translate(0.0F, 0.0F, 1.0F);
	if (this.renderOutlines) {
		GlStateManager.enableColorMaterial();
		GlStateManager.enableOutlineMode(this.getTeamColor(entity));
		blockrendererdispatcher.renderBlockBrightness(this.iblockState, 1.0F);
		GlStateManager.disableOutlineMode();
		GlStateManager.disableColorMaterial();
	}

	GlStateManager.popMatrix();

	super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:elias54,項目名稱:Fake-Ores-2,代碼行數:27,代碼來源:RenderOres.java

示例13: renderStaticPart

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
private void renderStaticPart(double x, double y, double z) {
	final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
	IBlockState state = Blocks.trophy.getDefaultState();

	IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(state);

	Tessellator tessellator = Tessellator.getInstance();
	final BufferBuilder wr = tessellator.getBuffer();
	bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

	wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
	wr.setTranslation(x, y, z);

	for (EnumFacing face : EnumFacing.values())
		renderQuads(wr, model.getQuads(state, face, 0));

	renderQuads(wr, model.getQuads(state, null, 0));
	tessellator.draw();

	wr.setTranslation(0, 0, 0);
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:22,代碼來源:TileEntityTrophyRenderer.java

示例14: drawBlock

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
private void drawBlock() {
	final Tessellator tessellator = Tessellator.getInstance();
	final BufferBuilder wr = tessellator.getBuffer();
	final BlockRendererDispatcher dispatcher = parent.getMinecraft().getBlockRendererDispatcher();
	for (BlockRenderLayer layer : BlockRenderLayer.values()) {
		if (blockState.getBlock().canRenderInLayer(blockState, layer)) {
			net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer);
			wr.setTranslation(-0.5, -0.5, -0.5);
			wr.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
			dispatcher.renderBlock(blockState, FakeBlockAccess.ORIGIN, access, wr);
			tessellator.draw();
		}
	}
	wr.setTranslation(0.0D, 0.0D, 0.0D);

	net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:18,代碼來源:GuiComponentSideSelector.java

示例15: renderBase

import net.minecraft.client.renderer.BlockRendererDispatcher; //導入依賴的package包/類
private void renderBase() {
  BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
  BlockModelShapes modelShapes = blockrendererdispatcher.getBlockModelShapes();
  IBakedModel bakedModel = modelShapes
      .getModelForState(MachineObject.block_enchanter.getBlockNN().getDefaultState().withProperty(EnumRenderMode.RENDER, EnumRenderMode.FRONT));

  RenderUtil.bindBlockTexture();
  GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  GlStateManager.enableRescaleNormal();
  GlStateManager.pushMatrix();

  Tessellator tessellator = Tessellator.getInstance();
  VertexBuffer vertexbuffer = tessellator.getBuffer();
  vertexbuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);

  for (EnumFacing enumfacing : EnumFacing.values()) {
    this.renderQuads(vertexbuffer, bakedModel.getQuads((IBlockState) null, enumfacing, 0L));
  }

  this.renderQuads(vertexbuffer, bakedModel.getQuads((IBlockState) null, (EnumFacing) null, 0L));
  tessellator.draw();

  GlStateManager.popMatrix();
  GlStateManager.disableRescaleNormal();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:26,代碼來源:EnchanterModelRenderer.java


注:本文中的net.minecraft.client.renderer.BlockRendererDispatcher類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。