本文整理匯總了Java中net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer.renderTileEntityAt方法的典型用法代碼示例。如果您正苦於以下問題:Java TileEntitySpecialRenderer.renderTileEntityAt方法的具體用法?Java TileEntitySpecialRenderer.renderTileEntityAt怎麽用?Java TileEntitySpecialRenderer.renderTileEntityAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer
的用法示例。
在下文中一共展示了TileEntitySpecialRenderer.renderTileEntityAt方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderChest
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的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();
}
}
示例2: renderEntity
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的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;
}
示例3: renderTileItem
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的package包/類
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);
}
}
}
示例4: renderEntity
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的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.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glTranslatef(x, y, 75);
GL11.glRotatef(180F, 0.0F, 0.25F, 1.0F);
GL11.glRotatef(rotation, 0, 1f, 0);
GL11.glRotatef(rotation, 0.0F, 1F, 0.0F);
GL11.glTranslatef(20,0,0);
GL11.glScalef(-scale, scale, scale);
GL11.glTranslatef(0, 0, 0);
GL11.glRectf(1, 1, 10, 10);
RenderHelper.enableStandardItemLighting();
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;
}
示例5: renderTick
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的package包/類
public static void renderTick(RenderWorldLastEvent event) {
RenderGlobal renderContext = event.context;
float ptt = event.partialTicks;
for (Map.Entry<Point3D, BlockWithData> entry : lockCache.entrySet()) {
Block block = entry.getValue().block;
Point3D point = entry.getKey();
TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(point.getX(), point.getY(), point.getZ());
if (block == null) return;
if (block.renderAsNormalBlock()) {
RenderBlocks.getInstance().renderStandardBlock(block, point.getX(), point.getY(), point.getZ());
} else {
if (block.getRenderType() == -1) {
if (tile != null) {
TileEntitySpecialRenderer renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(tile);
if (renderer != null)
renderer.renderTileEntityAt(tile, point.getX(), point.getY(), point.getZ(), ptt);
}
} else {
Tessellator.instance.startDrawingQuads();
//RenderingRegistry.instance().renderWorldBlock(RenderBlocks.getInstance(), Minecraft.getMinecraft().theWorld, point.getX(), point.getY(), point.getZ(), block, block.getRenderType());
System.err.println("WORLD: " + Minecraft.getMinecraft().theWorld);
RenderBlocks.getInstance().blockAccess = Minecraft.getMinecraft().theWorld;
RenderBlocks.getInstance().renderBlockByRenderType(block, point.getX(), point.getY(), point.getZ());
Tessellator.instance.draw();
}
}
}
}
示例6: renderTileEntityAt
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; //導入方法依賴的package包/類
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
if(tile != null && tile instanceof TileStickyJar && ((TileStickyJar) tile).isValid()) {
TileStickyJar stickyJar = (TileStickyJar) tile;
TileJarFillable parent = stickyJar.getParent();
World world = tile.getWorldObj();
Block block = stickyJar.getParentBlock();
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
rotateJar(stickyJar.placedOn, ForgeDirection.getOrientation(stickyJar.facing));
//TESR
TileEntitySpecialRenderer renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(parent);
if(renderer != null) {
stickyJar.syncToParent();
renderer.renderTileEntityAt(parent, 0, 0, 0, partialTicks);
stickyJar.syncFromParent();
}
//ISimpleBlockHandler
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(TextureMap.locationBlocksTexture);
RENDER_BLOCKS.blockAccess = world;
Tessellator tess = Tessellator.instance;
tess.startDrawingQuads();
tess.setNormal(0, -stickyJar.placedOn.offsetY, -Math.abs(stickyJar.placedOn.offsetZ + stickyJar.placedOn.offsetX));
tess.setTranslation(-tile.xCoord, -tile.yCoord, -tile.zCoord);
RENDER_BLOCKS.renderBlockByRenderType(block, tile.xCoord, tile.yCoord, tile.zCoord);
tess.setTranslation(0, 0, 0);
tess.draw();
GL11.glPopAttrib();
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}