summaryrefslogtreecommitdiff
path: root/java/darkknight/jewelrycraft/client
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:25:27 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:25:27 +0000
commite86949a1ad3269ec66c9de65e2c92f5e66251411 (patch)
treeabe7a3b14d7a5f7bb27a916a991f8911de94c1d2 /java/darkknight/jewelrycraft/client
parent12cb40ba14e76b999a381b1f122bfce73223fd38 (diff)
More stuff. I don't even know by this point....
Diffstat (limited to 'java/darkknight/jewelrycraft/client')
-rw-r--r--java/darkknight/jewelrycraft/client/AbstractTab.java3
-rw-r--r--java/darkknight/jewelrycraft/client/ClientProxy.java20
-rw-r--r--java/darkknight/jewelrycraft/client/GuiGuide.java29
3 files changed, 47 insertions, 5 deletions
diff --git a/java/darkknight/jewelrycraft/client/AbstractTab.java b/java/darkknight/jewelrycraft/client/AbstractTab.java
index d0124fa..6728181 100644
--- a/java/darkknight/jewelrycraft/client/AbstractTab.java
+++ b/java/darkknight/jewelrycraft/client/AbstractTab.java
@@ -7,10 +7,13 @@ import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.*;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
* @author TinkersCOnstruct
*/
+@SideOnly(Side.CLIENT)
public abstract class AbstractTab extends GuiButton
{
ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
diff --git a/java/darkknight/jewelrycraft/client/ClientProxy.java b/java/darkknight/jewelrycraft/client/ClientProxy.java
index 8f95d9e..9baadcb 100644
--- a/java/darkknight/jewelrycraft/client/ClientProxy.java
+++ b/java/darkknight/jewelrycraft/client/ClientProxy.java
@@ -1,8 +1,10 @@
package darkknight.jewelrycraft.client;
+import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient;
+import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
@@ -11,6 +13,8 @@ import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.entities.EntityHalfHeart;
import darkknight.jewelrycraft.entities.EntityHeart;
import darkknight.jewelrycraft.entities.renders.HeartRender;
+import darkknight.jewelrycraft.events.PlayerRenderHandler;
+import darkknight.jewelrycraft.events.ScreenHandler;
import darkknight.jewelrycraft.model.ModelDisplayer;
import darkknight.jewelrycraft.model.ModelHalfHeart;
import darkknight.jewelrycraft.model.ModelHandPedestal;
@@ -35,11 +39,12 @@ import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender;
import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender;
import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender;
import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
public class ClientProxy extends CommonProxy
{
@Override
- public void registerRenderers()
+ public void preInit()
{
ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png");
TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation);
@@ -65,5 +70,18 @@ public class ClientProxy extends CommonProxy
RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F));
RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F));
+
+ TabRegistry.registerTab(new InventoryTabVanilla());
+ TabRegistry.registerTab(new TabJewelry());
+ MinecraftForge.EVENT_BUS.register(new TabRegistry());
+ MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler());
+ ResourceLocation jeweleryTexture = new ResourceLocation("jewelrycraft", "textures/gui/curses.png");
+ MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture));
+ }
+
+ @Override
+ public void postInit()
+ {
+ JewelrycraftUtil.addStuff();
}
}
diff --git a/java/darkknight/jewelrycraft/client/GuiGuide.java b/java/darkknight/jewelrycraft/client/GuiGuide.java
index 503e681..09fc6a3 100644
--- a/java/darkknight/jewelrycraft/client/GuiGuide.java
+++ b/java/darkknight/jewelrycraft/client/GuiGuide.java
@@ -2,9 +2,12 @@ package darkknight.jewelrycraft.client;
import java.util.ArrayList;
import java.util.List;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.Container;
@@ -13,12 +16,15 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.block.BlockShadowEye;
import darkknight.jewelrycraft.container.GuiRectangle;
import darkknight.jewelrycraft.container.GuiTab;
import darkknight.jewelrycraft.container.GuiTabBlocks;
import darkknight.jewelrycraft.container.GuiTabGemsAndIngots;
+import darkknight.jewelrycraft.container.GuiTabIntroduction;
import darkknight.jewelrycraft.container.GuiTabItems;
import darkknight.jewelrycraft.container.GuiTabModifiers;
+import darkknight.jewelrycraft.container.GuiTabRitual;
public class GuiGuide extends GuiContainer
{
@@ -42,7 +48,7 @@ public class GuiGuide extends GuiContainer
rot = 0;
del = 0;
this.world = world;
- tabs = new GuiTab[]{new GuiTabBlocks(0), new GuiTabItems(1), new GuiTabGemsAndIngots(2), new GuiTabModifiers(3)};
+ tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)};
activeTab = tabs[0];
pageTexture = pageTex;
flippedPageTexture = flipPageTex;
@@ -146,7 +152,12 @@ public class GuiGuide extends GuiContainer
if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){
GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){
+ GL11.glScalef(1.2F, 1.2F, 1.2F);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glTranslatef(0F, 0.05F, 0F);
}else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
else{
GL11.glRotatef(180F, 0F, 1F, 0F);
@@ -154,6 +165,7 @@ public class GuiGuide extends GuiContainer
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@@ -164,7 +176,7 @@ public class GuiGuide extends GuiContainer
* @param y
* @param scale
*/
- public void renderItem(ItemStack item, float x, float y, float scale)
+ public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot)
{
GL11.glPushMatrix();
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
@@ -172,14 +184,23 @@ public class GuiGuide extends GuiContainer
GL11.glTranslatef(x, y, 100);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
+ if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
+ else{
+ // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0);
+ GL11.glRotatef(xRot, 1, 0, 0);
+ GL11.glRotatef(yRot, 0, 1, 0);
+ GL11.glRotatef(zRot, 0, 0, 1);
+ if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F);
+ if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F);
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
else{
RenderManager.instance.options.fancyGraphics = true;
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderManager.instance.options.fancyGraphics = false;
}
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
GL11.glPopMatrix();
}