本文整理汇总了Java中net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.instance方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityRendererDispatcher.instance方法的具体用法?Java TileEntityRendererDispatcher.instance怎么用?Java TileEntityRendererDispatcher.instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
的用法示例。
在下文中一共展示了TileEntityRendererDispatcher.instance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
}
示例2: 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();
}
示例3: makeEntityRender
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
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;
}
}
}
示例4: makeEntityRender
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
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;
}
}
}
示例5: makeEntityRender
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
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;
}
}
}
示例6: renderChest
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
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();
}
示例7: renderTank
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
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();
}
示例8: drawVillagerHead
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
public void drawVillagerHead(double x, double y, double z, IBlockState block, VillagerProfession profession)
{
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslated(x + 0.5, y, z + 0.5);
GL11.glScalef(0.33333F, -0.33333F, -0.33333F);
ResourceLocation villagerTexture = profession.getSkin();
if(this.rendererDispatcher == null)
{
this.rendererDispatcher = TileEntityRendererDispatcher.instance;
}
this.bindTexture(villagerTexture);
Block b = block.getBlock();
int direction = b.getMetaFromState(block);
this.head.rotateAngleX = 0F;
this.head.rotateAngleY = direction * ((float)Math.PI / 2);
this.head.rotateAngleZ = 0F;
//this.setLightmapDisabled(true);
this.head.render(0.3F);
//this.setLightmapDisabled(false);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例9: RenderConfigurableMachine
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
public RenderConfigurableMachine()
{
field_147501_a = TileEntityRendererDispatcher.instance;
}
示例10: bindTexture
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; //导入方法依赖的package包/类
public static void bindTexture(ResourceLocation location) {
if (TileEntityRendererDispatcher.instance != null && TileEntityRendererDispatcher.instance.field_147553_e != null) {
TileEntityRendererDispatcher.instance.field_147553_e.bindTexture(location);
}
}