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


Java TileEntityRendererDispatcher類代碼示例

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


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

示例1: render

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
void render() {
	Tessellator tessellator = Tessellator.getInstance();
	BufferBuilder buff = tessellator.getBuffer();

	buff.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
	buff.setTranslation(
			-TileEntityRendererDispatcher.staticPlayerX,
			-TileEntityRendererDispatcher.staticPlayerY,
			-TileEntityRendererDispatcher.staticPlayerZ
	);
	buff.pos(from.x, from.y, from.z).color(getRedColorF(), getGreenColorF(), getBlueColorF(), alpha * particleAlpha)
			.endVertex();
	buff.pos(to.x, to.y, to.z).color(getRedColorF(), getGreenColorF(), getBlueColorF(), alpha * particleAlpha)
			.endVertex();
	buff.setTranslation(0,0,0);
	tessellator.draw();
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:18,代碼來源:ParticleBolt.java

示例2: makeEntityRender

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
    TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance;
    TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityShulkerBox.class);

    if (!(tileentityspecialrenderer instanceof TileEntityShulkerBoxRenderer))
    {
        return null;
    }
    else
    {
        if (tileentityspecialrenderer.getEntityClass() == null)
        {
            tileentityspecialrenderer = new TileEntityShulkerBoxRenderer((ModelShulker)modelBase);
            tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher);
        }

        if (!Reflector.TileEntityShulkerBoxRenderer_model.exists())
        {
            Config.warn("Field not found: TileEntityShulkerBoxRenderer.model");
            return null;
        }
        else
        {
            Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityShulkerBoxRenderer_model, modelBase);
            return tileentityspecialrenderer;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:30,代碼來源:ModelAdapterShulkerBox.java

示例3: renderChest

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
public void renderChest(EntityBoatChest entity, float partialTicks) {
    TileEntitySpecialRenderer<TileEntityChest> renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(DUMMY_CHEST);
    if(renderer != null) {
        GlStateManager.pushMatrix();

        GlStateManager.translate(-0.5, 0.125, -0.5);
        GlStateManager.rotate(180, 1, 0, 0);
        GlStateManager.rotate(90, 0, 1, 0);

        DUMMY_CHEST.numPlayersUsing = entity.getPlayersUsing();
        DUMMY_CHEST.lidAngle = entity.getLidAngle();
        DUMMY_CHEST.prevLidAngle = entity.getPrevLidAngle();
        DUMMY_CHEST.setWorld(Boatifull.proxy.getClientWorld());
        renderer.renderTileEntityAt(DUMMY_CHEST, 0, 0, 0, partialTicks, -1);

        GlStateManager.popMatrix();
    }
}
 
開發者ID:InfinityRaider,項目名稱:Boatifull,代碼行數:19,代碼來源:RenderEntityBoatChest.java

示例4: renderTileEntityAt

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public void renderTileEntityAt(TileEntityElectricOutlet te, double x, double y, double z, float partialTicks, int destroyStage) {
	if(te != null && te.hasWorld() && te.getPos() != null && te.getWorld().getBlockState(te.getPos()).getBlock() == ARKCraftBlocks.electricOutlet){
		GlStateManager.pushMatrix();
		GlStateManager.disableTexture2D();
		GlStateManager.disableLighting();
		Tessellator tessellator = Tessellator.getInstance();
		VertexBuffer vertexbuffer = tessellator.getBuffer();
		te.getConsumersClient().forEach(c -> {
			double xEnd = c.xCoord - TileEntityRendererDispatcher.staticPlayerX;
			double yEnd = c.yCoord - TileEntityRendererDispatcher.staticPlayerY;
			double zEnd = c.zCoord - TileEntityRendererDispatcher.staticPlayerZ;
			double xStart = x + .5;
			double yStart = y + .5;
			double zStart = z + .5;

			vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
			vertexbuffer.pos(xStart, yStart, zStart).color(0, 0, 0, 255).endVertex();
			vertexbuffer.pos(xEnd, yEnd, zEnd).color(0, 0, 0, 255).endVertex();
			tessellator.draw();
		});
		GlStateManager.enableLighting();
		GlStateManager.enableTexture2D();
		GlStateManager.popMatrix();
	}
}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:27,代碼來源:TileEntityElectricOutletSpecialRenderer.java

示例5: renderChest

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
/**
 * Renders a chest at 0,0,0 - used for item rendering
 */
public void renderChest(Block p_147715_1_, int p_147715_2_, float p_147715_3_)
{
    /*if (p_147715_1_ == Blocks.ender_chest)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147716_d, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else if (p_147715_1_ == Blocks.trapped_chest)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else*/
	
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
 
開發者ID:jtrent238,項目名稱:PopularMMOS-EpicProportions-Mod,代碼行數:20,代碼來源:TileEntityRendererJenChestHelper.java

示例6: tesrtoggle

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@help("Disable or enable TileEntity special renderers")
public static String tesrtoggle() {
    if (backup == null) {
        if (TileEntityRendererDispatcher.instance.mapSpecialRenderers == null) {
            return "no TESRs!";
        }
        backup = TileEntityRendererDispatcher.instance.mapSpecialRenderers;
        TileEntityRendererDispatcher.instance.mapSpecialRenderers = empty;
        return "TESRs disabled";
    } else {
        empty.clear();
        TileEntityRendererDispatcher.instance.mapSpecialRenderers = backup;
        backup = null;
        return "TESRs enabled; requires chunk update to restart drawing";
    }
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:17,代碼來源:MiscClientCommands.java

示例7: render

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public void render(TileEntityCauldron cauldron, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    if (cauldron != null) {
        final TileFluidTank tank = cauldron.tank;

        if (tank != null && tank.getFluid() != null && tank.getFluidAmount() > 0) {
            FluidStack fluid = tank.getFluid();
            BlockPos pos = cauldron.getPos();

            GlStateManager.pushMatrix();
            GlStateManager.enableBlend();

            final float staticX = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
            final float staticY = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
            final float staticZ = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);

            GlStateManager.translate(staticX, staticY, staticZ);
            RenderUtils.renderFluid(fluid, cauldron.getPos(), 0.06D, 0.14D, 0.00D, 0.06D, 0.06D, 0.1D, 0.82D, (double) tank.getFluidAmount() / (double) tank.getCapacity() * 0.8d, 0.88d, fluid.getFluid().getColor(fluid));

            GlStateManager.disableBlend();
            GlStateManager.popMatrix();
        }
    }
}
 
開發者ID:GirafiStudios,項目名稱:Culinary-Cultivation,代碼行數:25,代碼來源:TileEntityCauldronRenderer.java

示例8: renderInventoryBlock

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    DynamicBlock dynamicBlock = (block instanceof DynamicBlock) ? (DynamicBlock) block : null;
    final TileEntity te;
    if (dynamicBlock != null && dynamicBlock.shouldRenderTesrInInventory())
        te = getTileEntityForBlock(dynamicBlock);
    else
        te = null;

    if (te instanceof DynamicTileEntity) ((DynamicTileEntity) te).prepareForInventoryRender(block, metadata);

    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    if (te != null) {
        GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, -0.5, -0.5);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(te, 0.0D, 0.0D, 0.0D, 0.0F);
        GL11.glPopMatrix();
        GL11.glPopAttrib();
    }

    RenderUtils.renderInventoryBlock(renderer, block);
    RenderUtils.resetFacesOnRenderer(renderer);
}
 
開發者ID:awesommist,項目名稱:DynamicLib,代碼行數:26,代碼來源:DefaultBlockRenderer.java

示例9: renderEntity

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void renderEntity(IGuiLexiconEntry gui, TileEntity entity, int x, int y, int scale, float rotation) {
	entity.setWorldObj(Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().theWorld : null);

	GL11.glEnable(GL11.GL_COLOR_MATERIAL);
	GL11.glPushMatrix();
	GL11.glTranslatef(x, y, 75.0F);
	GL11.glScalef(-scale, scale, scale);
	GL11.glRotatef(180F, 0.0F, 0.25F, 1.0F);
	GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
	RenderHelper.enableStandardItemLighting();
	GL11.glTranslatef(0.0F, 0, 0.0F);
	RenderManager.instance.playerViewY = 180.0F;
	TileEntitySpecialRenderer render = TileEntityRendererDispatcher.instance.getSpecialRenderer(te);
	if(render != null)
		render.renderTileEntityAt(entity, 0, 0, 0, 1);
	GL11.glPopMatrix();
	RenderHelper.disableStandardItemLighting();
	GL11.glDisable(GL12.GL_RESCALE_NORMAL);
	OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);

	if(relativeMouseX >= x - width * scale / 2 - 10  && relativeMouseY >= y - height * scale - 20 && relativeMouseX <= x + width * scale / 2 + 10 && relativeMouseY <= y + 20)
		tooltipEntity = true;
}
 
開發者ID:UnderMybrella,項目名稱:Minegate,代碼行數:27,代碼來源:PageTileEntity.java

示例10: onBlockHighlight

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@SubscribeEvent
public void onBlockHighlight(DrawBlockHighlightEvent e) {
	GL11.glPushMatrix();
	if (e.player.getCurrentEquippedItem() != null) {
		Item i = e.player.getCurrentEquippedItem().getItem();
		if (Block.getBlockFromItem(i) instanceof RLMBlockContainer && e.target.getBlockPos() != null) {
			if (e.player.worldObj.getBlockState(e.target.getBlockPos()).getBlock() != Blocks.air) {
				if (TileEntityRendererDispatcher.instance != null) {
					RLMBlockContainer b = (RLMBlockContainer) Block.getBlockFromItem(i);
					if (b != null) {
						BlockPos p = e.target.getBlockPos();
						GL11.glTranslated(p.getX(), p.getY(), p.getZ());
						// if
						// (b.createNewTileEntity(Minecraft.getMinecraft().theWorld,
						// 0) != null);
						// TileEntityRendererDispatcher.instance.renderTileEntity(b.createNewTileEntity(Minecraft.getMinecraft().theWorld,
						// 0),0.0f,1);
					}
				}
			}
		}
	}
	GL11.glPopMatrix();
}
 
開發者ID:ItsAMysterious,項目名稱:Real-Life-Mod-1.8,代碼行數:25,代碼來源:ClientHandler.java

示例11: doTheRenderThing

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
public void doTheRenderThing(){
    RenderingRegistry.registerEntityRenderingHandler(EntityFrankenstein.class, new RenderFrankenstein());
    RenderingRegistry.registerEntityRenderingHandler(EntityWarhorse.class, new RenderWarhorse());
    RenderingRegistry.registerEntityRenderingHandler(EntityPeep.class, new RenderPeep());
    RenderingRegistry.registerEntityRenderingHandler(EntityUnicorn.class, new RenderUnicorn());
    RenderingRegistry.registerEntityRenderingHandler(EntityCalavera.class, new RenderCalavera());
    RenderingRegistry.registerEntityRenderingHandler(EntityGingerbread.class, new RenderGingerbread());
    RenderingRegistry.registerEntityRenderingHandler(EntityShoggoth.class, new RenderShoggoth());
    RenderingRegistry.registerEntityRenderingHandler(EntityDaySkeleton.class, new RenderSkeleton());
    RenderingRegistry.registerEntityRenderingHandler(EntityDayZombie.class, new RenderZombie());
    RenderingRegistry.registerEntityRenderingHandler(EntityShadowSlime.class, new RenderShadowSlime());
    RenderingRegistry.registerEntityRenderingHandler(EntityCandySheep.class, new RenderCandySheep(new ModelSheep2(), new ModelSheep1(), 0.7F));
    RenderingRegistry.registerEntityRenderingHandler(EntityOldEnderman.class, new RenderOldEnderman());

    if(Config.heads && !Loader.isModLoaded("foxlib")){
        TileEntityRendererDispatcher.instance.mapSpecialRenderers.remove(TileEntitySkull.class);
        BlockSkullRenderer blockSkullRenderer = new BlockSkullRenderer();
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, blockSkullRenderer);
    }

    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChestRidiculous.class, new RenderTileEntityChest());
    BlockChestRidiculous.render = RenderingRegistry.getNextAvailableRenderId();
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RidiculousBlocks.chest), new RenderItemChest());

    ShaderHelper.initShaders();
}
 
開發者ID:SpitefulFox,項目名稱:RidiculousWorld,代碼行數:27,代碼來源:ClientProxy.java

示例12: drawHighlight

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public boolean drawHighlight(MovingObjectPosition mop, EntityPlayer player, float frame) {

    ForgeDirection face = ForgeDirection.getOrientation(mop.sideHit);
    
    AxisAlignedBB c = net.quetzi.bluepower.util.RayTracer.getSelectedCuboid(mop, player, face, getSubParts(), true);
    
    if (c == null) return true;
    
    GL11.glPushMatrix();
    {
        GL11.glTranslated(x() - TileEntityRendererDispatcher.staticPlayerX, y() - TileEntityRendererDispatcher.staticPlayerY, z()
                - TileEntityRendererDispatcher.staticPlayerZ);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glColor4d(0, 0, 0, 0);
        RenderUtils.drawCuboidOutline(new Cuboid6(c).expand(0.001));
        GL11.glColor4d(1, 1, 1, 1);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
    GL11.glPopMatrix();
    
    return true;
}
 
開發者ID:Quetzi,項目名稱:BluePower,代碼行數:24,代碼來源:MultipartBPPart.java

示例13: renderInventoryBlock

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
    if (block instanceof ITileEntityProvider) {
        ITileEntityProvider prov = (ITileEntityProvider) block;
        te = prov.createNewTileEntity(null, metadata);
        te.blockMetadata = metadata;
    } else return;

    if (block instanceof IBlockRenderHook) {
        IBlockRenderHook hook = (IBlockRenderHook) block;
        hook.callbackInventory(te);
    }

    glRotatef(90F, 0F, 1F, 0F);
    glTranslatef(-0.5F, -0.5F, -0.5F);
    float scale = 1F;
    glScalef(scale, scale, scale);

    glAlphaFunc(GL_GREATER, 0.1F);
    TileEntityRendererDispatcher.instance.renderTileEntityAt(te, 0.0D, 0.0D, 0.0D, 0.0F);
}
 
開發者ID:MSourceCoded,項目名稱:Quantum-Anomalies,代碼行數:22,代碼來源:SimpleTileProxy.java

示例14: renderInventoryBlock

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderBlocks) {
    if (block instanceof ITileEntityProvider) {
        ITileEntityProvider prov = (ITileEntityProvider) block;
        te = prov.createNewTileEntity(null, metadata);
        te.blockMetadata = metadata;
    } else return;

    if (block instanceof IBlockRenderHook) {
        IBlockRenderHook hook = (IBlockRenderHook) block;
        hook.callbackInventory(te);
    }

    glRotatef(90F, 0F, 1F, 0F);
    glTranslatef(-0.5F, -0.5F, -0.5F);
    float scale = 1F;
    glScalef(scale, scale, scale);

    glAlphaFunc(GL_GREATER, 0.1F);
    TESRStaticHandler renderer = (TESRStaticHandler) TileEntityRendererDispatcher.instance.mapSpecialRenderers.get(te.getClass());
    renderer.renderTile(te, 0.0, 0.0, 0.0, 0, true, renderBlocks);

    renderer.renderTile(te, 0.0, 0.0, 0.0, 0, false, renderBlocks);
}
 
開發者ID:MSourceCoded,項目名稱:Quantum-Anomalies,代碼行數:25,代碼來源:AdvancedTileProxy.java

示例15: drawScreen

import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //導入依賴的package包/類
/**
 * Draws the screen and all the components in it.
 */
@Override
public void drawScreen(int par1, int par2, float par3) {
    this.drawDefaultBackground();

    drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215);
    GL11.glPushMatrix();
    GL11.glTranslatef(width / 2, 0.0F, 50.0F);
    float var4 = 93.75F;
    GL11.glScalef(-var4, -var4, -var4);

    float var7 = 0.0F;
    GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, -1.0625F, 0.0F);

    if (updateCounter / 6 % 2 == 0) {
        entitySign.lineBeingEdited = editLine;
    }

    TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f);
    entitySign.lineBeingEdited = -1;
    GL11.glPopMatrix();
    super.drawScreen(par1, par2, par3);
}
 
開發者ID:soultek101,項目名稱:projectzulu1.7.10-pre-1.3a,代碼行數:27,代碼來源:GuiTombstone.java


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