当前位置: 首页>>代码示例>>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;未经允许,请勿转载。