mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
83698cb73c
commit
84c2239244
561 files changed
+8872
-9300
No files matched your search
@@ -3,14 +3,16 @@ package tconstruct.client;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.library.weaponry.IAmmo;
|
||||
|
||||
public class AmmoItemRenderer extends FlexibleToolRenderer {
|
||||
// public static FontRenderer fontRenderer;
|
||||
|
||||
public AmmoItemRenderer() {
|
||||
// super(true);
|
||||
// super(true);
|
||||
// fontRenderer = new FontRenderer(Minecraft.getMinecraft().gameSettings, new
|
||||
// ResourceLocation(Reference.RESOURCE, "textures/font/border_numbers.png"),
|
||||
// Minecraft.getMinecraft().renderEngine, false);
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import mantle.common.network.AbstractPacket;
|
||||
import modwarriors.notenoughkeys.api.Api;
|
||||
import modwarriors.notenoughkeys.api.KeyBindingPressedEvent;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyClient;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
@@ -23,11 +21,16 @@ import tconstruct.util.network.AccessoryInventoryPacket;
|
||||
import tconstruct.util.network.BeltPacket;
|
||||
import tconstruct.util.network.DoubleJumpPacket;
|
||||
import tconstruct.util.network.GogglePacket;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
|
||||
public class ArmorControls {
|
||||
|
||||
public static final String keybindCategory = "tconstruct.keybindings";
|
||||
public static final String[] keyDescs = new String[] {"key.tarmor", "key.tgoggles", "key.tbelt", "key.tzoom"};
|
||||
public static final String[] keyDescs = new String[] { "key.tarmor", "key.tgoggles", "key.tbelt", "key.tzoom" };
|
||||
public static KeyBinding armorKey = new KeyBinding(keyDescs[0], Keyboard.KEY_NONE, keybindCategory);
|
||||
public static KeyBinding toggleGoggles = new KeyBinding(keyDescs[1], Keyboard.KEY_NONE, keybindCategory);
|
||||
public static KeyBinding beltSwap = new KeyBinding(keyDescs[2], Keyboard.KEY_NONE, keybindCategory);
|
||||
@@ -51,7 +54,7 @@ public class ArmorControls {
|
||||
|
||||
public ArmorControls() {
|
||||
getVanillaKeyBindings();
|
||||
keys = new KeyBinding[] {armorKey, toggleGoggles, beltSwap, zoomKey, null, null};
|
||||
keys = new KeyBinding[] { armorKey, toggleGoggles, beltSwap, zoomKey, null, null };
|
||||
}
|
||||
|
||||
public void registerKeys() {
|
||||
@@ -122,8 +125,8 @@ public class ArmorControls {
|
||||
mc.thePlayer.motionY = 0.42D;
|
||||
mc.thePlayer.fallDistance = 0;
|
||||
if (mc.thePlayer.isPotionActive(Potion.jump)) {
|
||||
mc.thePlayer.motionY +=
|
||||
(float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
|
||||
mc.thePlayer.motionY += (float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1)
|
||||
* 0.1F;
|
||||
}
|
||||
midairJumps--;
|
||||
resetFallDamage();
|
||||
@@ -131,16 +134,12 @@ public class ArmorControls {
|
||||
if (!jumping) {
|
||||
jumping = mc.thePlayer.isAirBorne;
|
||||
ItemStack shoes = mc.thePlayer.getCurrentArmor(0);
|
||||
if (shoes != null
|
||||
&& shoes.hasTagCompound()
|
||||
&& shoes.getTagCompound().hasKey("TinkerArmor")) {
|
||||
if (shoes != null && shoes.hasTagCompound() && shoes.getTagCompound().hasKey("TinkerArmor")) {
|
||||
NBTTagCompound shoeTag = shoes.getTagCompound().getCompoundTag("TinkerArmor");
|
||||
midairJumps += shoeTag.getInteger("Double-Jump");
|
||||
}
|
||||
ItemStack wings = mc.thePlayer.getCurrentArmor(1);
|
||||
if (wings != null
|
||||
&& wings.hasTagCompound()
|
||||
&& wings.getTagCompound().hasKey("TinkerArmor")) {
|
||||
if (wings != null && wings.hasTagCompound() && wings.getTagCompound().hasKey("TinkerArmor")) {
|
||||
NBTTagCompound shoeTag = wings.getTagCompound().getCompoundTag("TinkerArmor");
|
||||
midairJumps += shoeTag.getInteger("Double-Jump");
|
||||
}
|
||||
@@ -150,10 +149,8 @@ public class ArmorControls {
|
||||
private void checkAndToggleNightVision() {
|
||||
ItemStack goggles = mc.thePlayer.getCurrentArmor(3);
|
||||
if (goggles != null && goggles.getItem() instanceof TravelGear) { // TODO: Genericize this
|
||||
if (goggles.hasTagCompound()
|
||||
&& goggles.getTagCompound()
|
||||
.getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName())
|
||||
.getBoolean("Night Vision")) {
|
||||
if (goggles.hasTagCompound() && goggles.getTagCompound()
|
||||
.getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName()).getBoolean("Night Vision")) {
|
||||
activeGoggles = !activeGoggles;
|
||||
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
|
||||
toggleGoggles();
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,14 +1,16 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class BreakingFX extends EntityFX {
|
||||
|
||||
public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) {
|
||||
this(par1World, par2, par4, par6, par8Item, 0);
|
||||
}
|
||||
@@ -21,16 +23,8 @@ public class BreakingFX extends EntityFX {
|
||||
this.particleScale /= 2.0F;
|
||||
}
|
||||
|
||||
public BreakingFX(
|
||||
World par1World,
|
||||
double par2,
|
||||
double par4,
|
||||
double par6,
|
||||
double par8,
|
||||
double par10,
|
||||
double par12,
|
||||
Item par14Item,
|
||||
int par15) {
|
||||
public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12,
|
||||
Item par14Item, int par15) {
|
||||
this(par1World, par2, par4, par6, par14Item, par15);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
@@ -46,8 +40,8 @@ public class BreakingFX extends EntityFX {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(
|
||||
Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6,
|
||||
float par7) {
|
||||
float f6 = ((float) this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F;
|
||||
float f7 = f6 + 0.015609375F;
|
||||
float f8 = ((float) this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F;
|
||||
@@ -67,12 +61,28 @@ public class BreakingFX extends EntityFX {
|
||||
float f14 = 1.0F;
|
||||
par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f6, f9);
|
||||
f11 - par3 * f10 - par6 * f10,
|
||||
f12 - par4 * f10,
|
||||
f13 - par5 * f10 - par7 * f10,
|
||||
f6,
|
||||
f9);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f6, f8);
|
||||
f11 - par3 * f10 + par6 * f10,
|
||||
f12 + par4 * f10,
|
||||
f13 - par5 * f10 + par7 * f10,
|
||||
f6,
|
||||
f8);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f7, f8);
|
||||
f11 + par3 * f10 + par6 * f10,
|
||||
f12 + par4 * f10,
|
||||
f13 + par5 * f10 + par7 * f10,
|
||||
f7,
|
||||
f8);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f7, f9);
|
||||
f11 + par3 * f10 - par6 * f10,
|
||||
f12 - par4 * f10,
|
||||
f13 + par5 * f10 - par7 * f10,
|
||||
f7,
|
||||
f9);
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public class CustomBowRenderer implements IItemRenderer {
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
private final RenderBlocks renderBlocksInstance = new RenderBlocks();
|
||||
|
||||
@@ -39,9 +41,8 @@ public class CustomBowRenderer implements IItemRenderer {
|
||||
IIcon icon;
|
||||
if (living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
if (player.getItemInUse() != null)
|
||||
icon = stack.getItem()
|
||||
.getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount());
|
||||
if (player.getItemInUse() != null) icon = stack.getItem()
|
||||
.getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount());
|
||||
else icon = living.getItemIcon(stack, renderPass);
|
||||
} else {
|
||||
icon = living.getItemIcon(stack, renderPass);
|
||||
|
||||
@@ -4,19 +4,21 @@ import java.awt.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheObliterator
|
||||
*
|
||||
* A class to create and draw true type fonts onto the Minecraft game
|
||||
* engine.
|
||||
* A class to create and draw true type fonts onto the Minecraft game engine.
|
||||
*/
|
||||
public class CustomFont {
|
||||
|
||||
private int texID;
|
||||
private final int[] xPos;
|
||||
private final int[] yPos;
|
||||
@@ -25,39 +27,29 @@ public class CustomFont {
|
||||
private final FontMetrics metrics;
|
||||
|
||||
/**
|
||||
* Instantiates the font, filling in default start and end character
|
||||
* parameters.
|
||||
* Instantiates the font, filling in default start and end character parameters.
|
||||
*
|
||||
* 'new CustomFont(ModLoader.getMinecraftInstance(), "Arial", 12);
|
||||
*
|
||||
* @param mc
|
||||
* The Minecraft instance for the font to be bound to.
|
||||
* @param fontName
|
||||
* The name of the font to be drawn.
|
||||
* @param size
|
||||
* The size of the font to be drawn.
|
||||
* @param mc The Minecraft instance for the font to be bound to.
|
||||
* @param fontName The name of the font to be drawn.
|
||||
* @param size The size of the font to be drawn.
|
||||
*/
|
||||
public CustomFont(Minecraft mc, Object font, int size) {
|
||||
this(mc, font, size, 0, 4000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates the font, pre-rendering a sprite font image by using a true
|
||||
* type font on a bitmap. Then allocating that bitmap to the Minecraft
|
||||
* rendering engine for later use.
|
||||
* Instantiates the font, pre-rendering a sprite font image by using a true type font on a bitmap. Then allocating
|
||||
* that bitmap to the Minecraft rendering engine for later use.
|
||||
*
|
||||
* 'new CustomFont(ModLoader.getMinecraftInstance(), "Arial", 12, 32, 126);'
|
||||
*
|
||||
* @param mc
|
||||
* The Minecraft instance for the font to be bound to.
|
||||
* @param fontName
|
||||
* The name of the font to be drawn.
|
||||
* @param size
|
||||
* The size of the font to be drawn.
|
||||
* @param startChar
|
||||
* The starting ASCII character id to be drawable. (Default 32)
|
||||
* @param endChar
|
||||
* The ending ASCII character id to be drawable. (Default 126)
|
||||
* @param mc The Minecraft instance for the font to be bound to.
|
||||
* @param fontName The name of the font to be drawn.
|
||||
* @param size The size of the font to be drawn.
|
||||
* @param startChar The starting ASCII character id to be drawable. (Default 32)
|
||||
* @param endChar The ending ASCII character id to be drawable. (Default 126)
|
||||
*/
|
||||
public CustomFont(Minecraft mc, Object font, int size, int startChar, int endChar) {
|
||||
this.startChar = startChar;
|
||||
@@ -75,12 +67,10 @@ public class CustomFont {
|
||||
if (font instanceof String) {
|
||||
String fontName = (String) font;
|
||||
if (fontName.contains("/"))
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName))
|
||||
.deriveFont((float) size));
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName)).deriveFont((float) size));
|
||||
else g.setFont(new Font(fontName, 0, size));
|
||||
} else if (font instanceof InputStream) {
|
||||
g.setFont(
|
||||
Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size));
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size));
|
||||
} else if (font instanceof File) {
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, (File) font).deriveFont((float) size));
|
||||
}
|
||||
@@ -120,16 +110,11 @@ public class CustomFont {
|
||||
/**
|
||||
* Draws a given string with an automatically calculated shadow below it.
|
||||
*
|
||||
* @param gui
|
||||
* The gui/subclass to be drawn on
|
||||
* @param text
|
||||
* The string to be drawn
|
||||
* @param x
|
||||
* The x position to start drawing
|
||||
* @param y
|
||||
* The y position to start drawing
|
||||
* @param color
|
||||
* The color of the non-shadowed text (Hex)
|
||||
* @param gui The gui/subclass to be drawn on
|
||||
* @param text The string to be drawn
|
||||
* @param x The x position to start drawing
|
||||
* @param y The y position to start drawing
|
||||
* @param color The color of the non-shadowed text (Hex)
|
||||
*/
|
||||
public void drawStringS(Gui gui, String text, int x, int y, int color) {
|
||||
int l = color & 0xff000000;
|
||||
@@ -142,16 +127,11 @@ public class CustomFont {
|
||||
/**
|
||||
* Draws a given string onto a gui/subclass.
|
||||
*
|
||||
* @param gui
|
||||
* The gui/subclass to be drawn on
|
||||
* @param text
|
||||
* The string to be drawn
|
||||
* @param x
|
||||
* The x position to start drawing
|
||||
* @param y
|
||||
* The y position to start drawing
|
||||
* @param color
|
||||
* The color of the non-shadowed text (Hex)
|
||||
* @param gui The gui/subclass to be drawn on
|
||||
* @param text The string to be drawn
|
||||
* @param x The x position to start drawing
|
||||
* @param y The y position to start drawing
|
||||
* @param color The color of the non-shadowed text (Hex)
|
||||
*/
|
||||
public void drawString(Gui gui, String text, int x, int y, int color) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -180,8 +160,7 @@ public class CustomFont {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the created FontMetrics which is used to retrive various
|
||||
* information about the True Type Font
|
||||
* Returns the created FontMetrics which is used to retrive various information about the True Type Font
|
||||
*
|
||||
* @return FontMetrics of the created font.
|
||||
*/
|
||||
@@ -192,8 +171,7 @@ public class CustomFont {
|
||||
/**
|
||||
* Gets the drawing width of a given string of string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @param text The string to be measured
|
||||
* @return The width of the given string.
|
||||
*/
|
||||
public int getStringWidth(String text) {
|
||||
@@ -203,8 +181,7 @@ public class CustomFont {
|
||||
/**
|
||||
* Gets the drawing height of a given string of string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @param text The string to be measured
|
||||
* @return The height of the given string.
|
||||
*/
|
||||
public int getStringHeight(String text) {
|
||||
@@ -212,13 +189,10 @@ public class CustomFont {
|
||||
}
|
||||
|
||||
/**
|
||||
* A method that returns a Rectangle that contains the width and height
|
||||
* demensions of the given string.
|
||||
* A method that returns a Rectangle that contains the width and height demensions of the given string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @return Rectangle containing width and height that the text will consume
|
||||
* when drawn.
|
||||
* @param text The string to be measured
|
||||
* @return Rectangle containing width and height that the text will consume when drawn.
|
||||
*/
|
||||
private Rectangle getBounds(String text) {
|
||||
int w = 0;
|
||||
@@ -265,7 +239,11 @@ public class CustomFont {
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((x + 0), (y + height), 0, ((u + 0) * offsetWidth), ((v + height) * offsetHeight));
|
||||
tessellator.addVertexWithUV(
|
||||
(x + width), (y + height), 0, ((u + width) * offsetWidth), ((v + height) * offsetHeight));
|
||||
(x + width),
|
||||
(y + height),
|
||||
0,
|
||||
((u + width) * offsetWidth),
|
||||
((v + height) * offsetHeight));
|
||||
tessellator.addVertexWithUV((x + width), (y + 0), 0, ((u + width) * offsetWidth), ((v + 0) * offsetHeight));
|
||||
tessellator.addVertexWithUV((x + 0), (y + 0), 0, ((u + 0) * offsetWidth), ((v + 0) * offsetHeight));
|
||||
tessellator.draw();
|
||||
|
||||
@@ -6,12 +6,15 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class FlexibleToolRenderer implements IItemRenderer {
|
||||
|
||||
public float depth = 1 / 32f;
|
||||
|
||||
public void setDepth(float d) {
|
||||
@@ -248,19 +251,17 @@ public class FlexibleToolRenderer implements IItemRenderer {
|
||||
ToolCore tool = (ToolCore) item.getItem();
|
||||
|
||||
IIcon[] tempParts = new IIcon[iconParts];
|
||||
label:
|
||||
{
|
||||
label: {
|
||||
if (!isInventory && ent instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) ent;
|
||||
ItemStack itemInUse = player.getItemInUse();
|
||||
if (itemInUse != null) {
|
||||
int useCount = player.getItemInUseCount();
|
||||
for (int i = iconParts; i-- > 0; )
|
||||
tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
break label;
|
||||
}
|
||||
}
|
||||
for (int i = iconParts; i-- > 0; ) tempParts[i] = tool.getIcon(item, i);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i);
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.util.IIcon;
|
||||
|
||||
// required to fix Mojansg bugs...
|
||||
public class IconFlipped extends net.minecraft.client.renderer.IconFlipped {
|
||||
|
||||
private final IIcon baseIcon;
|
||||
private final boolean flipV;
|
||||
|
||||
|
||||
@@ -2,15 +2,20 @@ package tconstruct.client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import javax.xml.parsers.*;
|
||||
|
||||
import mantle.client.SmallFontRenderer;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.init.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyClient;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
@@ -18,6 +23,7 @@ import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.tools.items.ManualInfo;
|
||||
|
||||
public class TProxyClient extends TProxyCommon {
|
||||
|
||||
public static DecimalFormat df = new DecimalFormat("##.#");
|
||||
|
||||
/* TODO: Split this class up into its respective parts */
|
||||
@@ -35,7 +41,10 @@ public class TProxyClient extends TProxyCommon {
|
||||
public void registerRenderer() {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
smallFontRenderer = new SmallFontRenderer(
|
||||
mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
|
||||
mc.gameSettings,
|
||||
new ResourceLocation("textures/font/ascii.png"),
|
||||
mc.renderEngine,
|
||||
false);
|
||||
}
|
||||
|
||||
public static Document diary;
|
||||
@@ -47,10 +56,7 @@ public class TProxyClient extends TProxyCommon {
|
||||
|
||||
public void readManuals() {
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
String CurrentLanguage = Minecraft.getMinecraft()
|
||||
.getLanguageManager()
|
||||
.getCurrentLanguage()
|
||||
.getLanguageCode();
|
||||
String CurrentLanguage = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||
|
||||
Document diary_cl = readManual("/assets/tinker/manuals/" + CurrentLanguage + "/diary.xml", dbFactory);
|
||||
Document volume1_cl = readManual("/assets/tinker/manuals/" + CurrentLanguage + "/firstday.xml", dbFactory);
|
||||
@@ -62,8 +68,8 @@ public class TProxyClient extends TProxyCommon {
|
||||
volume1 = volume1_cl != null ? volume1_cl : readManual("/assets/tinker/manuals/en_US/firstday.xml", dbFactory);
|
||||
volume2 = volume2_cl != null ? volume2_cl : readManual("/assets/tinker/manuals/en_US/materials.xml", dbFactory);
|
||||
smelter = smelter_cl != null ? smelter_cl : readManual("/assets/tinker/manuals/en_US/smeltery.xml", dbFactory);
|
||||
weaponry =
|
||||
weaponry_cl != null ? weaponry_cl : readManual("/assets/tinker/manuals/en_US/weaponry.xml", dbFactory);
|
||||
weaponry = weaponry_cl != null ? weaponry_cl
|
||||
: readManual("/assets/tinker/manuals/en_US/weaponry.xml", dbFactory);
|
||||
|
||||
initManualIcons();
|
||||
initManualRecipes();
|
||||
|
||||
@@ -6,11 +6,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class ToolCoreRenderer implements IItemRenderer {
|
||||
|
||||
private final boolean isEntity;
|
||||
private final boolean noEntityTranslation;
|
||||
|
||||
@@ -66,19 +69,17 @@ public class ToolCoreRenderer implements IItemRenderer {
|
||||
// (requires more logic rewrite than it sounds like)
|
||||
|
||||
IIcon[] tempParts = new IIcon[iconParts];
|
||||
label:
|
||||
{
|
||||
label: {
|
||||
if (!isInventory && ent instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) ent;
|
||||
ItemStack itemInUse = player.getItemInUse();
|
||||
if (itemInUse != null) {
|
||||
int useCount = player.getItemInUseCount();
|
||||
for (int i = iconParts; i-- > 0; )
|
||||
tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
break label;
|
||||
}
|
||||
}
|
||||
for (int i = iconParts; i-- > 0; ) tempParts[i] = tool.getIcon(item, i);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i);
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
@@ -164,9 +165,8 @@ public class ToolCoreRenderer implements IItemRenderer {
|
||||
GL11.glTranslatef(0, -4 / 16f, 0);
|
||||
break;
|
||||
case ENTITY:
|
||||
if (!noEntityTranslation)
|
||||
GL11.glTranslatef(
|
||||
-0.5f, 0f, depth); // correction of the rotation point when items lie on the ground
|
||||
if (!noEntityTranslation) GL11.glTranslatef(-0.5f, 0f, depth); // correction of the rotation point
|
||||
// when items lie on the ground
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package tconstruct.client.entity.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.mechworks.entity.item.ExplosivePrimed;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ExplosiveRender extends Render {
|
||||
|
||||
private final RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public ExplosiveRender() {
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
||||
public void renderPrimedTNT(
|
||||
ExplosivePrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void renderPrimedTNT(ExplosivePrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
float f2;
|
||||
@@ -67,8 +70,7 @@ public class ExplosiveRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
@@ -76,12 +78,10 @@ public class ExplosiveRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.BlockUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.*;
|
||||
@@ -11,14 +12,18 @@ import net.minecraft.client.renderer.texture.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class ArrowRender extends Render {
|
||||
private static final ResourceLocation RES_ITEM_GLINT =
|
||||
new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
|
||||
"textures/misc/enchanted_item_glint.png");
|
||||
private final RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
@@ -39,8 +44,8 @@ public class ArrowRender extends Render {
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(
|
||||
ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void doRenderItem(ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
this.bindEntityTexture(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
@@ -61,10 +66,8 @@ public class ArrowRender extends Render {
|
||||
Block block;
|
||||
block = BlockUtils.getBlockFromItem(itemstack.getItem());
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
&& RenderBlocks.renderItemIn3d(
|
||||
BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
float f7 = 0.25F;
|
||||
@@ -136,26 +139,26 @@ public class ArrowRender extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(ArrowEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem(
|
||||
ArrowEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7) {
|
||||
private void renderDroppedItem(ArrowEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5,
|
||||
float par6, float par7) {
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem(
|
||||
ArrowEntity arrow, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) {
|
||||
private void renderDroppedItem(ArrowEntity arrow, IIcon par2Icon, int par3, float par4, float par5, float par6,
|
||||
float par7, int pass) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null) {
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
ResourceLocation resourcelocation =
|
||||
texturemanager.getResourceLocation(arrow.getEntityItem().getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = texturemanager
|
||||
.getResourceLocation(arrow.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -211,7 +214,14 @@ public class ArrowRender extends Render {
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12);
|
||||
tessellator,
|
||||
f5,
|
||||
f6,
|
||||
f4,
|
||||
f7,
|
||||
par2Icon.getIconWidth(),
|
||||
par2Icon.getIconHeight(),
|
||||
f12);
|
||||
|
||||
if (itemstack.hasEffect(pass)) {
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
@@ -253,12 +263,10 @@ public class ArrowRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
@@ -9,12 +9,16 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class ArrowRenderCustom extends Render {
|
||||
|
||||
private static final RenderItem renderer = new RenderItem();
|
||||
private final Random random = new Random();
|
||||
|
||||
@@ -30,7 +34,10 @@ public class ArrowRenderCustom extends Render {
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(
|
||||
arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F,
|
||||
0.0F,
|
||||
1.0F,
|
||||
0.0F);
|
||||
GL11.glRotatef(
|
||||
arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par9 - 45.0F,
|
||||
0.0F,
|
||||
@@ -49,47 +56,33 @@ public class ArrowRenderCustom extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -102,7 +95,7 @@ public class ArrowRenderCustom extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(ArrowEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.BlockUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -13,14 +14,18 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class DaggerRender extends Render {
|
||||
private static final ResourceLocation RES_ITEM_GLINT =
|
||||
new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
|
||||
"textures/misc/enchanted_item_glint.png");
|
||||
private final RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
@@ -41,8 +46,8 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(
|
||||
DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void doRenderItem(DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
this.bindEntityTexture(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
@@ -62,10 +67,8 @@ public class DaggerRender extends Render {
|
||||
|
||||
Block block = BlockUtils.getBlockFromItem(itemstack.getItem());
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
&& RenderBlocks.renderItemIn3d(
|
||||
BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if (renderInFrame) {
|
||||
@@ -153,26 +156,26 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(DaggerEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem(
|
||||
DaggerEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7) {
|
||||
private void renderDroppedItem(DaggerEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5,
|
||||
float par6, float par7) {
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem(
|
||||
DaggerEntity dagger, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) {
|
||||
private void renderDroppedItem(DaggerEntity dagger, IIcon par2Icon, int par3, float par4, float par5, float par6,
|
||||
float par7, int pass) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null) {
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
ResourceLocation resourcelocation =
|
||||
texturemanager.getResourceLocation(dagger.getEntityItem().getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = texturemanager
|
||||
.getResourceLocation(dagger.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -222,28 +225,27 @@ public class DaggerRender extends Render {
|
||||
GL11.glRotatef(90, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rotation, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12);
|
||||
tessellator,
|
||||
f5,
|
||||
f6,
|
||||
f4,
|
||||
f7,
|
||||
par2Icon.getIconWidth(),
|
||||
par2Icon.getIconHeight(),
|
||||
f12);
|
||||
|
||||
/*
|
||||
* if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
* GL11.glDisable(GL11.GL_LIGHTING);
|
||||
* this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT);
|
||||
* GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR,
|
||||
* GL11.GL_ONE); float f13 = 0.76F; GL11.glColor4f(0.5F * f13, 0.25F
|
||||
* * f13, 0.8F * f13, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
* GL11.glPushMatrix(); float f14 = 0.125F; GL11.glScalef(f14, f14,
|
||||
* f14); float f15 = (float) (Minecraft.getSystemTime() % 3000L) /
|
||||
* 3000.0F * 8.0F; GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
* GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F,
|
||||
* 255, 255, f12); GL11.glPopMatrix(); GL11.glPushMatrix();
|
||||
* GL11.glScalef(f14, f14, f14); f15 = (float)
|
||||
* (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
* GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F,
|
||||
* 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F,
|
||||
* 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING);
|
||||
* this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f13 = 0.76F; GL11.glColor4f(0.5F * f13, 0.25F *
|
||||
* f13, 0.8F * f13, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); float f14 = 0.125F;
|
||||
* GL11.glScalef(f14, f14, f14); float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
* GL11.glTranslatef(f15, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glPushMatrix(); GL11.glScalef(f14, f14, f14); f15 = (float) (Minecraft.getSystemTime() % 4873L) /
|
||||
* 4873.0F * 8.0F; GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
*/
|
||||
}
|
||||
@@ -254,22 +256,13 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false);
|
||||
}
|
||||
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5,
|
||||
boolean renderEffect) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) {
|
||||
Item k = par3ItemStack.getItem();
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
IIcon iIcon = par3ItemStack.getIconIndex();
|
||||
@@ -279,8 +272,7 @@ public class DaggerRender extends Render {
|
||||
float f2;
|
||||
|
||||
Block block = BlockUtils.getBlockFromItem(k);
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(k).getRenderType())) {
|
||||
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GL11.glPushMatrix();
|
||||
@@ -309,8 +301,7 @@ public class DaggerRender extends Render {
|
||||
|
||||
for (int j1 = 0; j1 < k.getRenderPasses(l); ++j1) {
|
||||
par2TextureManager.bindTexture(
|
||||
par3ItemStack.getItemSpriteNumber() == 0
|
||||
? TextureMap.locationBlocksTexture
|
||||
par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture
|
||||
: TextureMap.locationItemsTexture);
|
||||
IIcon icon = k.getIcon(par3ItemStack, j1);
|
||||
int k1 = k.getColorFromItemStack(par3ItemStack, j1);
|
||||
@@ -332,13 +323,12 @@ public class DaggerRender extends Render {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
} else {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceLocation resourcelocation =
|
||||
par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = par2TextureManager
|
||||
.getResourceLocation(par3ItemStack.getItemSpriteNumber());
|
||||
par2TextureManager.bindTexture(resourcelocation);
|
||||
|
||||
if (iIcon == null) {
|
||||
iIcon = ((TextureMap)
|
||||
Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation))
|
||||
iIcon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation))
|
||||
.getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -382,32 +372,28 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
if (par3ItemStack != null) {
|
||||
if (!ForgeHooksClient.renderInventoryItem(
|
||||
field_147909_c, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float)
|
||||
par5)) {
|
||||
field_147909_c,
|
||||
par2TextureManager,
|
||||
par3ItemStack,
|
||||
renderWithColor,
|
||||
zLevel,
|
||||
(float) par4,
|
||||
(float) par5)) {
|
||||
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Modders must handle this themselves if they use custom renderers!
|
||||
* if (par3ItemStack.hasEffect()) {
|
||||
* GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
* GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false);
|
||||
* par2TextureManager.bindTexture(RES_ITEM_GLINT); this.zLevel -=
|
||||
* 50.0F; GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
* GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); this.renderGlint(par4 *
|
||||
* 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true);
|
||||
* this.zLevel += 50.0F; GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
* Modders must handle this themselves if they use custom renderers! if (par3ItemStack.hasEffect()) {
|
||||
* GL11.glDepthFunc(GL11.GL_GREATER); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false);
|
||||
* par2TextureManager.bindTexture(RES_ITEM_GLINT); this.zLevel -= 50.0F; GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
* this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); this.zLevel += 50.0F;
|
||||
* GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -424,8 +410,7 @@ public class DaggerRender extends Render {
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873))
|
||||
/ (3000.0F + (float) (j1 * 1873))
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873))
|
||||
* 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
@@ -437,7 +422,11 @@ public class DaggerRender extends Render {
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(
|
||||
par2 + 0, par3 + par5, this.zLevel, (f2 + (float) par5 * f4) * f, (f3 + (float) par5) * f1);
|
||||
par2 + 0,
|
||||
par3 + par5,
|
||||
this.zLevel,
|
||||
(f2 + (float) par5 * f4) * f,
|
||||
(f3 + (float) par5) * f1);
|
||||
tessellator.addVertexWithUV(
|
||||
par2 + par4,
|
||||
par3 + par5,
|
||||
@@ -451,44 +440,36 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, null);
|
||||
}
|
||||
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5,
|
||||
String par6Str) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5, String par6Str) {
|
||||
if (par3ItemStack != null) {
|
||||
if (par3ItemStack.stackSize > 1 || par6Str != null) {
|
||||
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
par1FontRenderer.drawStringWithShadow(
|
||||
s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
s1,
|
||||
par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1),
|
||||
par5 + 6 + 3,
|
||||
16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (par3ItemStack.isItemDamaged()) {
|
||||
int k = (int) Math.round(13.0D
|
||||
- (double) par3ItemStack.getItemDamageForDisplay()
|
||||
* 13.0D
|
||||
int k = (int) Math.round(
|
||||
13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D
|
||||
/ (double) par3ItemStack.getMaxDamage());
|
||||
int l = (int) Math.round(255.0D
|
||||
- (double) par3ItemStack.getItemDamageForDisplay()
|
||||
* 255.0D
|
||||
int l = (int) Math.round(
|
||||
255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D
|
||||
/ (double) par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
@@ -508,8 +489,8 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a quad to the tesselator at the specified position with the set
|
||||
* width and height and color. Args: tessellator, x, y, width, height, color
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) {
|
||||
par1Tessellator.startDrawingQuads();
|
||||
@@ -537,12 +518,10 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -577,8 +556,7 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* Allows for a subclass to override how many rendered items appear in a "mini item 3d stack"
|
||||
*
|
||||
* @param stack
|
||||
* @return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.client.renderer.texture.*;
|
||||
@@ -9,13 +9,17 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.client.ToolCoreRenderer;
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class DaggerRenderCustom extends Render {
|
||||
|
||||
private static final RenderItem renderer = new RenderItem();
|
||||
private static final ToolCoreRenderer toolCoreRenderer = new ToolCoreRenderer(true, true);
|
||||
private final Random random = new Random();
|
||||
@@ -49,9 +53,8 @@ public class DaggerRenderCustom extends Render {
|
||||
float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9;
|
||||
GL11.glRotatef(dagger.rotationYaw + 90, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(rotation * 15, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(
|
||||
-0.25f, -0.25f,
|
||||
0f); // translate to the middle. This makes it so that the dagger rotates around its center
|
||||
GL11.glTranslatef(-0.25f, -0.25f, 0f); // translate to the middle. This makes it so that the dagger rotates
|
||||
// around its center
|
||||
float shake = dagger.arrowShake - par9;
|
||||
if (shake > 0.0F) GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
// GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
@@ -72,47 +75,33 @@ public class DaggerRenderCustom extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -125,7 +114,7 @@ public class DaggerRenderCustom extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(DaggerEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -8,11 +7,15 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.LaunchedPotion;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LaunchedItemRender extends Render {
|
||||
|
||||
private final Item field_94151_a;
|
||||
private final int field_94150_f;
|
||||
|
||||
@@ -26,12 +29,10 @@ public class LaunchedItemRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public abstract class RangedRenderBase extends Render {
|
||||
|
||||
public RangedRenderBase() {}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,13 +2,16 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class BlockCastPage extends BookPage {
|
||||
|
||||
String text;
|
||||
ItemStack[] icons;
|
||||
|
||||
@@ -18,8 +21,7 @@ public class BlockCastPage extends BookPage {
|
||||
if (nodes != null) text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("recipe");
|
||||
if (nodes != null)
|
||||
icons = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,20 +36,31 @@ public class BlockCastPage extends BookPage {
|
||||
manual.renderitem.zLevel = 100;
|
||||
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 110) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 138) / 2,
|
||||
(localHeight + 110) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth + 70) / 2, (localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth + 70) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], (localWidth + 70) / 2, (localHeight + 110) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 70) / 2,
|
||||
(localHeight + 110) / 2);
|
||||
|
||||
if (icons[0].stackSize > 1)
|
||||
manual.renderitem.renderItemOverlayIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 106) / 2,
|
||||
(localHeight + 74) / 2,
|
||||
String.valueOf(icons[0].stackSize));
|
||||
if (icons[0].stackSize > 1) manual.renderitem.renderItemOverlayIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 106) / 2,
|
||||
(localHeight + 74) / 2,
|
||||
String.valueOf(icons[0].stackSize));
|
||||
|
||||
manual.renderitem.zLevel = 0;
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
@@ -2,17 +2,21 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.util.HarvestLevels;
|
||||
|
||||
public class MaterialPage extends BookPage {
|
||||
|
||||
String title;
|
||||
ItemStack[] icons;
|
||||
String iconText;
|
||||
@@ -29,8 +33,7 @@ public class MaterialPage extends BookPage {
|
||||
if (nodes != null) iconText = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("icon");
|
||||
if (nodes != null)
|
||||
icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
|
||||
nodes = element.getElementsByTagName("toolmaterial");
|
||||
if (nodes != null && nodes.getLength() > 0)
|
||||
@@ -98,17 +101,28 @@ public class MaterialPage extends BookPage {
|
||||
// renderitem.renderItemAndEffectIntoGUI(fonts, getMC().renderEngine,
|
||||
// icons[0], localWidth + 50, localHeight + 0);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], localWidth + 108, localHeight + 50);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
localWidth + 108,
|
||||
localHeight + 50);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], localWidth + 108, localHeight + 82);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
localWidth + 108,
|
||||
localHeight + 82);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[3], localWidth + 108, localHeight + 114);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[3],
|
||||
localWidth + 108,
|
||||
localHeight + 114);
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
String icon =
|
||||
icons[1].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
String icon = icons[1].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
int iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(icon, localWidth + 128, localHeight + 50 + iconOffset, 52, 0);
|
||||
@@ -118,9 +132,7 @@ public class MaterialPage extends BookPage {
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(
|
||||
icons[2].getTooltip(manual.getMC().thePlayer, false)
|
||||
.get((0))
|
||||
.toString(),
|
||||
icons[2].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(),
|
||||
localWidth + 128,
|
||||
localHeight + 82 + iconOffset,
|
||||
52,
|
||||
@@ -131,9 +143,7 @@ public class MaterialPage extends BookPage {
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(
|
||||
icons[3].getTooltip(manual.getMC().thePlayer, false)
|
||||
.get((0))
|
||||
.toString(),
|
||||
icons[3].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(),
|
||||
localWidth + 128,
|
||||
localHeight + 114 + iconOffset,
|
||||
52,
|
||||
@@ -141,8 +151,8 @@ public class MaterialPage extends BookPage {
|
||||
}
|
||||
|
||||
manual.fonts.drawString(durability + ": " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
manual.fonts.drawString(
|
||||
handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts
|
||||
.drawString(handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts.drawString(
|
||||
fullToolDurability + ": " + (int) (material.durability() * material.handleDurability()),
|
||||
localWidth,
|
||||
@@ -151,19 +161,20 @@ public class MaterialPage extends BookPage {
|
||||
|
||||
manual.fonts.drawString(miningSpeed + ": " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
manual.fonts.drawString(
|
||||
miningLevel + ": " + material.harvestLevel() + " ("
|
||||
+ HarvestLevels.getHarvestLevelName(material.harvestLevel()) + ")",
|
||||
miningLevel + ": "
|
||||
+ material.harvestLevel()
|
||||
+ " ("
|
||||
+ HarvestLevels.getHarvestLevelName(material.harvestLevel())
|
||||
+ ")",
|
||||
localWidth,
|
||||
localHeight + 90,
|
||||
0);
|
||||
int attack = material.attack();
|
||||
String heart = attack == 2 ? " " + heart_ : " " + hearts;
|
||||
if (attack % 2 == 0)
|
||||
manual.fonts.drawString(
|
||||
baseAttack + ": " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else
|
||||
manual.fonts.drawString(
|
||||
baseAttack + ": " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
if (attack % 2 == 0) manual.fonts
|
||||
.drawString(baseAttack + ": " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else manual.fonts
|
||||
.drawString(baseAttack + ": " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
|
||||
int offset = 0;
|
||||
String ability = material.ability();
|
||||
@@ -178,17 +189,26 @@ public class MaterialPage extends BookPage {
|
||||
manual.fonts.drawString(traitReinforced, localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
manual.fonts.drawString(
|
||||
reinforcedLevel + ": " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
reinforcedLevel + ": " + material.reinforced(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (material.shoddy() > 0) {
|
||||
manual.fonts.drawString(
|
||||
stoneboundLevel + ": " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
stoneboundLevel + ": " + material.shoddy(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
} else if (material.shoddy() < 0) {
|
||||
manual.fonts.drawString(
|
||||
splinteringLevel + ": " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
splinteringLevel + ": " + -material.shoddy(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package tconstruct.client.pages;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class ModifierPage extends BookPage {
|
||||
|
||||
String type;
|
||||
ItemStack[] icons;
|
||||
ItemStack[][] iconsMulti;
|
||||
@@ -31,10 +35,9 @@ public class ModifierPage extends BookPage {
|
||||
if (type.equals("travelmulti")) {
|
||||
List<ItemStack[]> stacks = new LinkedList<>();
|
||||
List<String> tools = new LinkedList<>();
|
||||
String[] suffixes = new String[] {"goggles", "vest", "wings", "boots", "glove", "belt"};
|
||||
String[] suffixes = new String[] { "goggles", "vest", "wings", "boots", "glove", "belt" };
|
||||
for (String suffix : suffixes) {
|
||||
ItemStack[] icons2 =
|
||||
MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent() + suffix);
|
||||
ItemStack[] icons2 = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent() + suffix);
|
||||
if (icons2 != null) {
|
||||
stacks.add(icons2);
|
||||
tools.add(suffix);
|
||||
@@ -78,8 +81,7 @@ public class ModifierPage extends BookPage {
|
||||
if (type.equals("travelmulti")) toolstack = toolMulti[counter];
|
||||
|
||||
// update displayed item
|
||||
if (iconsMulti != null
|
||||
&& iconsMulti.length > 0
|
||||
if (iconsMulti != null && iconsMulti.length > 0
|
||||
&& type.equals("travelmulti")
|
||||
&& System.currentTimeMillis() - lastUpdate > 1000) {
|
||||
lastUpdate = System.currentTimeMillis();
|
||||
@@ -104,14 +106,17 @@ public class ModifierPage extends BookPage {
|
||||
(localWidth + 130) / 2,
|
||||
(localHeight + 54) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2);
|
||||
if (icons[2] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
if (icons[2] != null) manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
} else {
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
@@ -126,18 +131,29 @@ public class ModifierPage extends BookPage {
|
||||
(localWidth + 140) / 2,
|
||||
(localHeight + 54) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth - 2) / 2, (localHeight + 36) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth - 2) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], (localWidth - 2) / 2, (localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth - 2) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[3], (localWidth + 36) / 2, (localHeight + 36) / 2);
|
||||
if (icons[4] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[4],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[3],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
if (icons[4] != null) manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[4],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
|
||||
|
||||
@@ -2,13 +2,16 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class ToolPage extends BookPage {
|
||||
|
||||
String title;
|
||||
ItemStack[] icons;
|
||||
String[] iconText;
|
||||
@@ -35,8 +38,7 @@ public class ToolPage extends BookPage {
|
||||
}
|
||||
|
||||
nodes = element.getElementsByTagName("icon");
|
||||
if (nodes != null)
|
||||
icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +62,11 @@ public class ToolPage extends BookPage {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
localWidth + 50,
|
||||
localHeight + 0);
|
||||
for (int i = 1; i < icons.length; i++) {
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
@@ -70,7 +76,11 @@ public class ToolPage extends BookPage {
|
||||
localHeight + 20 + 10 * size + 18 * i);
|
||||
int partOffset = iconText[i + 1].length() > 11 ? -3 : 0;
|
||||
manual.fonts.drawSplitString(
|
||||
iconText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i + partOffset, 44, 0);
|
||||
iconText[i + 1],
|
||||
localWidth + 140,
|
||||
localHeight + 24 + 10 * size + 18 * i + partOffset,
|
||||
44,
|
||||
0);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -6,9 +6,11 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public abstract class AbstractTab extends GuiButton {
|
||||
|
||||
ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
|
||||
ItemStack renderStack;
|
||||
RenderItem itemRenderer = new RenderItem();
|
||||
@@ -37,9 +39,17 @@ public abstract class AbstractTab extends GuiButton {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
this.itemRenderer.renderItemAndEffectIntoGUI(
|
||||
mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
mc.fontRenderer,
|
||||
mc.renderEngine,
|
||||
renderStack,
|
||||
xPosition + 6,
|
||||
yPosition + 8);
|
||||
this.itemRenderer.renderItemOverlayIntoGUI(
|
||||
mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
mc.fontRenderer,
|
||||
mc.renderEngine,
|
||||
renderStack,
|
||||
xPosition + 6,
|
||||
yPosition + 8);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
@@ -50,8 +60,7 @@ public abstract class AbstractTab extends GuiButton {
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
|
||||
boolean inWindow = this.enabled
|
||||
&& this.visible
|
||||
boolean inWindow = this.enabled && this.visible
|
||||
&& mouseX >= this.xPosition
|
||||
&& mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
|
||||
@@ -2,9 +2,11 @@ package tconstruct.client.tabs;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class InventoryTabArmorExtended extends AbstractTab {
|
||||
|
||||
public InventoryTabArmorExtended() {
|
||||
super(0, 0, 0, new ItemStack(Items.diamond_chestplate));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package tconstruct.client.tabs;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import tconstruct.armor.*;
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class InventoryTabKnapsack extends AbstractTab {
|
||||
|
||||
public InventoryTabKnapsack() {
|
||||
super(0, 0, 0, new ItemStack(TinkerArmor.knapsack));
|
||||
}
|
||||
@@ -16,8 +18,7 @@ public class InventoryTabKnapsack extends AbstractTab {
|
||||
|
||||
@Override
|
||||
public boolean shouldAddToList() {
|
||||
return ArmorProxyClient.armorExtended != null
|
||||
&& ArmorProxyClient.armorExtended.inventory[2] != null
|
||||
return ArmorProxyClient.armorExtended != null && ArmorProxyClient.armorExtended.inventory[2] != null
|
||||
&& ArmorProxyClient.armorExtended.inventory[2].getItem() == TinkerArmor.knapsack;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class InventoryTabVanilla extends AbstractTab {
|
||||
|
||||
public InventoryTabVanilla() {
|
||||
super(0, 0, 0, new ItemStack(Blocks.crafting_table));
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
package tconstruct.client.tabs;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.*;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
|
||||
public class TabRegistry {
|
||||
|
||||
private static final ArrayList<AbstractTab> tabList = new ArrayList<>();
|
||||
|
||||
public static void registerTab(AbstractTab tab) {
|
||||
@@ -81,8 +84,7 @@ public class TabRegistry {
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
} else {
|
||||
// If NEI is not installed, offset the tabs
|
||||
return 60;
|
||||
|
||||
Reference in new issue
Block a user