Fix all (known) instances of ugly 2D item model rendering
This commit is contained in:
parent
731f92a7fd
commit
40cb3a501a
3 changed files with 26 additions and 6 deletions
|
@ -6,6 +6,7 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
|
@ -59,6 +60,10 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
if (tileAltar.getStackInSlot(1) != null)
|
if (tileAltar.getStackInSlot(1) != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
|
||||||
|
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
|
@ -80,6 +85,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,6 +94,10 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
if (tileAltar.getStackInSlot(0) != null)
|
if (tileAltar.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
|
||||||
|
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
|
@ -109,6 +119,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal;
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
@ -52,7 +53,8 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
if (tileAltar.getStackInSlot(0) != null)
|
if (tileAltar.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
float rotationAngle = Minecraft.isFancyGraphicsEnabled() ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
|
||||||
|
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
@ -37,7 +38,7 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (tileEntity instanceof TEPlinth)
|
if (tileEntity instanceof TEPlinth)
|
||||||
{
|
{
|
||||||
TEPlinth tileAltar = (TEPlinth) tileEntity;
|
TEPlinth tilePlinth = (TEPlinth) tileEntity;
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png");
|
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png");
|
||||||
|
@ -49,12 +50,16 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
if (tileAltar.getStackInSlot(0) != null)
|
if (tilePlinth.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
|
||||||
|
|
||||||
|
float scaleFactor = getGhostItemScaleFactor(tilePlinth.getStackInSlot(0));
|
||||||
|
EntityItem ghostEntityItem = new EntityItem(tilePlinth.getWorldObj());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tilePlinth.getStackInSlot(0));
|
||||||
float displacement = 0.2F;
|
float displacement = 0.2F;
|
||||||
|
|
||||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||||
|
@ -72,6 +77,8 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue