Java 类net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher 实例源码

项目:Solar    文件:ParticleBolt.java   
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();
}
项目:Backmemed    文件:ModelAdapterShulkerBox.java   
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;
        }
    }
}
项目:Boatifull    文件:RenderEntityBoatChest.java   
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();
    }
}
项目:ARKCraft    文件:TileEntityElectricOutletSpecialRenderer.java   
@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();
    }
}
项目:PopularMMOS-EpicProportions-Mod    文件:TileEntityRendererJenChestHelper.java   
/**
 * 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);
    }
}
项目:PopularMMOS-EpicProportions-Mod    文件:TileEntityRendererPatChestHelper.java   
/**
 * 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);
    }
}
项目:Factorization    文件:MiscClientCommands.java   
@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";
    }
}
项目:Culinary-Cultivation    文件:TileEntityCauldronRenderer.java   
@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();
        }
    }
}
项目:DynamicLib    文件:DefaultBlockRenderer.java   
@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);
}
项目:Minegate    文件:PageTileEntity.java   
@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;
}
项目:Real-Life-Mod-1.8    文件:ClientHandler.java   
@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();
}
项目:RidiculousWorld    文件:ClientProxy.java   
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();
}
项目:BluePower    文件:MultipartBPPart.java   
@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;
}
项目:Quantum-Anomalies    文件:SimpleTileProxy.java   
@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);
}
项目:Quantum-Anomalies    文件:AdvancedTileProxy.java   
@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);
}
项目:projectzulu1.7.10-pre-1.3a    文件:GuiTombstone.java   
/**
 * 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);
}
项目:projectzulu1.7.10    文件:GuiTombstone.java   
/**
 * 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);
}
项目:TheMinersFriend    文件:BlockGrinderRenderer.java   
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    TileEntityGrinder tile = new TileEntityGrinder();
    tile.blockType = block;
    GL11.glPushMatrix();
    GL11.glTranslatef(-0.2F,
                      0.0F,
                      -0.3F);
    GL11.glRotatef(-5,
                   0,
                   1,
                   0);
    GL11.glRotatef(5,
                   0,
                   0,
                   1);
    GL11.glScalef(1.35F,
                  1.35F,
                  1.35F);
    TileEntityRendererDispatcher.instance.renderTileEntityAt(tile,
                                                             -0.3D,
                                                             -0.3D,
                                                             -0.3D,
                                                             0.0F);
    GL11.glPopMatrix();
}
项目:PneumaticCraft    文件:PartPressureTube.java   
@SideOnly(Side.CLIENT)
@Override
public void renderDynamic(Vector3 pos, float partialTicks, int renderPass){
    if(renderPass == 0) {
        /*   GL11.glPushMatrix(); // start
           // GL11.glDisable(GL11.GL_TEXTURE_2D);
           // GL11.glEnable(GL11.GL_BLEND);
           // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
           FMLClientHandler.instance().getClient().getTextureManager().bindTexture(getTexture());

           // GL11.glColor4f(0.82F, 0.56F, 0.09F, 1.0F);
           GL11.glTranslatef((float)pos.x + 0.5F, (float)pos.y + 1.5F, (float)pos.z + 0.5F); // size
           GL11.glRotatef(0, 0.0F, 1.0F, 0.0F);

           GL11.glScalef(1.0F, -1F, -1F);
           if(tubeModel == null) tubeModel = new ModelPressureTube();
           tubeModel.renderModel(0.0625F, tube.sidesConnected);
           GL11.glPopMatrix();*/
        TileEntityRendererDispatcher.instance.getSpecialRenderer(tube).renderTileEntityAt(tube, pos.x, pos.y, pos.z, partialTicks);

    }
}
项目:connor41-etfuturum2    文件:ItemBannerRenderer.java   
private void renderBanner(float x, float y, float z, float angle, float scale) {
    OpenGLHelper.pushMatrix();
    OpenGLHelper.rotate(angle, 0, 1, 0);
    OpenGLHelper.scale(scale, scale, scale);
    OpenGLHelper.translate(x, y, z);

    TileEntityRendererDispatcher.instance.renderTileEntityAt(banner, 0, 0, 0, 0);

    OpenGLHelper.popMatrix();
}
项目:Backmemed    文件:ModelAdapterBanner.java   
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
    TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance;
    TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityBanner.class);

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

        if (!Reflector.TileEntityBannerRenderer_bannerModel.exists())
        {
            Config.warn("Field not found: TileEntityBannerRenderer.bannerModel");
            return null;
        }
        else
        {
            Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityBannerRenderer_bannerModel, modelBase);
            return tileentityspecialrenderer;
        }
    }
}
项目:Backmemed    文件:ModelAdapterEnderChest.java   
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
    TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance;
    TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnderChest.class);

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

        if (!Reflector.TileEntityEnderChestRenderer_modelChest.exists())
        {
            Config.warn("Field not found: TileEntityEnderChestRenderer.modelChest");
            return null;
        }
        else
        {
            Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnderChestRenderer_modelChest, modelBase);
            return tileentityspecialrenderer;
        }
    }
}
项目:Backmemed    文件:ModelAdapterBook.java   
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
    TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance;
    TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnchantmentTable.class);

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

        if (!Reflector.TileEntityEnchantmentTableRenderer_modelBook.exists())
        {
            Config.warn("Field not found: TileEntityEnchantmentTableRenderer.modelBook");
            return null;
        }
        else
        {
            Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnchantmentTableRenderer_modelBook, modelBase);
            return tileentityspecialrenderer;
        }
    }
}
项目:CustomWorldGen    文件:ForgeHooksClient.java   
public static void renderTileItem(Item item, int metadata)
{
    Class<? extends TileEntity> tileClass = tileItemMap.get(Pair.of(item, metadata));
    if (tileClass != null)
    {
        TileEntitySpecialRenderer<?> r = TileEntityRendererDispatcher.instance.getSpecialRendererByClass(tileClass);
        if (r != null)
        {
            r.renderTileEntityAt(null, 0, 0, 0, 0, -1);
        }
    }
}
项目:WorldProtect    文件:RenderUtils.java   
@SideOnly(Side.CLIENT)
public static void translateAgainstPlayer (BlockPos pos) {

    final float x = (float) (pos.getX() - TileEntityRendererDispatcher.staticPlayerX);
    final float y = (float) (pos.getY() - TileEntityRendererDispatcher.staticPlayerY);
    final float z = (float) (pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ);
    GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5);
}
项目:4Space-5    文件:BlockRendererTier2TreasureChest.java   
public void renderChest(Block par1Block, int par2, float par3)
{
    if (par1Block == MarsBlocks.tier2TreasureChest)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
项目:4Space-5    文件:BlockRendererTier3TreasureChest.java   
public void renderChest(Block par1Block, int par2, float par3)
{
    if (par1Block == AsteroidBlocks.treasureChestTier3)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
项目:4Space-5    文件:BlockRendererParachest.java   
public void renderChest(Block par1Block, int par2, float par3)
{
    if (par1Block == GCBlocks.parachest)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
项目:4Space-5    文件:BlockRendererNasaWorkbench.java   
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -1.1F, -0.1F);
    GL11.glScalef(0.7F, 0.6F, 0.7F);
    TileEntityRendererDispatcher.instance.renderTileEntityAt(this.table, 0.0D, 0.0D, 0.0D, 0.0F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
项目:4Space-5    文件:BlockRendererTreasureChest.java   
public void renderChest(Block par1Block, int par2, float par3)
{
    if (par1Block == GCBlocks.treasureChestTier1)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
项目:Wizardry    文件:CapeHandler.java   
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Post event) {
    EntityPlayer player = event.getEntityPlayer();
    float delta = event.getPartialRenderTick();

    boolean iWalked = new Vec3d(player.posX, player.posY, player.posZ).distanceTo(new Vec3d(player.prevPosX, player.prevPosY, player.prevPosZ)) > 0.15;

    if (!player.isInvisible() && ((player.getActivePotionEffect(ModPotions.VANISH) != null && iWalked) || player.getActivePotionEffect(ModPotions.VANISH) == null))
        if (delta < 1) { // not rendering in inventory
            double x = -TileEntityRendererDispatcher.staticPlayerX;
            double y = -TileEntityRendererDispatcher.staticPlayerY;
            double z = -TileEntityRendererDispatcher.staticPlayerZ;
            instance().getCape(player).render(player, x, y, z, delta);
        }
}
项目:SignPicture    文件:SignPicRender.java   
@CoreEvent
public void onRender(final @Nonnull RenderWorldLastEvent event) {
    float opacity = Config.getConfig().renderPreviewFixedOpacity.get().floatValue();
    if (CurrentMode.instance.isMode(CurrentMode.Mode.SETPREVIEW)||CurrentMode.instance.isMode(CurrentMode.Mode.PLACE)) {
        Sign.preview.capturePlace();
        opacity = Config.getConfig().renderPreviewFloatedOpacity.get().floatValue();
    }
    if (CurrentMode.instance.isState(CurrentMode.State.PREVIEW))
        if (Sign.preview.isRenderable()&&Sign.preview.isVisible()) {
            final TileEntitySign tile = Sign.preview.getRenderTileEntity();
            Client.renderer.renderSignPictureBase(tile, tile.xCoord-TileEntityRendererDispatcher.staticPlayerX, tile.yCoord-TileEntityRendererDispatcher.staticPlayerY, tile.zCoord-TileEntityRendererDispatcher.staticPlayerZ, event.partialTicks, opacity);
        }
}
项目:Aether-Legacy    文件:ChestMimicRenderer.java   
public void renderTileEntityAt(TileEntityChest te, double x, double y, double z, float partialTicks, int destroyStage)
{
    if (te == null)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityChestMimic(), 0, 0, 0, 0);
        return;
    }

    super.renderTileEntityAt(te, x, y, z, partialTicks, destroyStage);
}
项目:InspiringWorld    文件:ClientRenderUtils.java   
public static Vector3d getRealPositionX(BlockPos pos)
{
    Vector3d vector3d = new Vector3d();
    vector3d.x = pos.getX() - TileEntityRendererDispatcher.staticPlayerX;
    vector3d.y = pos.getY() - TileEntityRendererDispatcher.staticPlayerY;
    vector3d.z = pos.getZ() - TileEntityRendererDispatcher.staticPlayerZ;
    return vector3d;
}
项目:EnderStorage    文件:RenderTileEnderChest.java   
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.translate(x, y + 1.0, z + 1.0F);
    GlStateManager.scale(1.0F, -1F, -1F);
    GlStateManager.translate(0.5F, 0.5F, 0.5F);
    GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    model.chestLid.rotateAngleX = lidAngle;
    model.render(freq.hasOwner());
    GlStateManager.popMatrix();

    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    renderButtons(freq, rotation, lidAngle);
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    GlStateManager.pushMatrix();

    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
项目:EnderStorage    文件:RenderTileEnderTank.java   
public static void renderTank(CCRenderState ccrs, int rotation, float valve, Frequency freq, double x, double y, double z, int offset) {
    ccrs.reset();
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5, y, z + 0.5);
    GlStateManager.rotate(-90 * (rotation + 2), 0, 1, 0);

    TextureUtils.changeTexture("enderstorage:textures/endertank.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    tankModel.render(ccrs);
    valveModel.render(ccrs, new Rotation(valve, new Vector3(0, 0, 1)).at(new Vector3(0, 0.4165, 0)), new UVTranslation(0, freq.hasOwner() ? 13 / 64D : 0));
    ccrs.draw();

    TextureUtils.changeTexture("enderstorage:textures/buttons.png");
    ccrs.startDrawing(7, POSITION_TEX_COLOR_NORMAL);
    EnumColour[] colours = freq.toArray();
    for (int i = 0; i < 3; i++) {
        buttons[i].render(ccrs, new UVTranslation(0.25 * (colours[i].getWoolMeta() % 4), 0.25 * (colours[i].getWoolMeta() / 4)));
    }
    ccrs.draw();
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.45 + RenderUtils.getPearlBob(time) * 2, z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.enableLighting();
    ccrs.reset();
}
项目:Toms-Mod    文件:MultiblockRenderer.java   
public static <T extends TileEntity> void registerTESR(Block controller, int id, MultiblockRenderer<T> renderer) {
    if (!TESR_REGISTRY.containsKey(controller)) {
        TESR_REGISTRY.put(controller, new HashMap<>());
    }
    renderer.setRendererDispatcher(TileEntityRendererDispatcher.instance);
    TESR_REGISTRY.get(controller).put(id, renderer);
}
项目:Toms-Mod    文件:MultiblockRenderer.java   
public static void drawNameplate(BlockPos pos, String str, double x, double y, double z, int maxDistance) {
    Entity entity = TileEntityRendererDispatcher.instance.entity;
    double d0 = pos.distanceSq(entity.posX, entity.posY, entity.posZ);

    if (d0 <= maxDistance * maxDistance) {
        float f = TileEntityRendererDispatcher.instance.entityYaw;
        float f1 = TileEntityRendererDispatcher.instance.entityPitch;
        EntityRenderer.drawNameplate(Minecraft.getMinecraft().fontRenderer, str, (float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F, 0, f, f1, false, false);
    }
}
项目:OpenTechnology    文件:RenderingRadarHandler.java   
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    if (block == Blocks.radar) {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityRadar(), 0.0D, 0.0D, 0.0D, 0.0F);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    }
}
项目:Factorization    文件:RenderDimensionSliceEntity.java   
void renderDamage(World world, DestroyBlockProgress damage, TextureAtlasSprite[] icons, BlockRendererDispatcher brd, float partial) {
    IBlockState bs = world.getBlockState(damage.getPosition());
    Block block = bs.getBlock();
    if (block.getMaterial() == Material.air) return;
    int dmg = damage.getPartialBlockDamage();
    brd.renderBlockDamage(bs, damage.getPosition(), icons[dmg], world);
    if (block.hasTileEntity(bs)) {
        TileEntity te = world.getTileEntity(damage.getPosition());
        TileEntityRendererDispatcher.instance.renderTileEntity(te, partial, damage.getPartialBlockDamage());
    }
}