mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Tiny planet bauble render
This commit is contained in:
1 parent
4df1d500ed
commit
f87e2373f8
2 files changed
+4
-1
No files matched your search
@@ -21,6 +21,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
import vazkii.botania.api.item.IBaubleRender.RenderType;
|
||||
@@ -80,6 +81,7 @@ public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
|
||||
ItemStack cosmetic = attachable.getCosmeticItem(stack);
|
||||
if(cosmetic != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, player, type, partialTicks);
|
||||
GlStateManager.popMatrix();
|
||||
@@ -89,6 +91,7 @@ public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
|
||||
|
||||
if(item instanceof IBaubleRender) {
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, player, type, partialTicks);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
@@ -105,8 +105,8 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender {
|
||||
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
|
||||
if(type == RenderType.HEAD) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.translate(0.25F, -0.5F, 0F);
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0, -1.5F, 0.5F);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(ModBlocks.tinyPlanet.getDefaultState(), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user