More assets for Reagent guage

This commit is contained in:
WayofTime 2014-12-09 20:34:48 -05:00
parent 9ad3330e08
commit a2b0f59765
6 changed files with 45 additions and 55 deletions

View file

@ -6,7 +6,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -52,7 +51,7 @@ public class CompressionRegistry
{ {
for(Entry<ItemStack, Integer> entry : thresholdMap.entrySet()) for(Entry<ItemStack, Integer> entry : thresholdMap.entrySet())
{ {
if(SpellHelper.areItemStacksEqual(entry.getKey(), stack)) if(areItemStacksEqual(entry.getKey(), stack))
{ {
return entry.getValue(); return entry.getValue();
} }
@ -60,4 +59,9 @@ public class CompressionRegistry
return 0; return 0;
} }
public static boolean areItemStacksEqual(ItemStack stack, ItemStack compressedStack)
{
return stack.isItemEqual(compressedStack) && (stack.getTagCompound() == null ? compressedStack.getTagCompound() == null : stack.getTagCompound().equals(compressedStack.getTagCompound()));
}
} }

View file

@ -6,10 +6,7 @@ import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -21,8 +18,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler; import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
@ -154,55 +151,44 @@ public class RenderHelper
return r; return r;
} }
private static void renderTestHUD(Minecraft mc) public static void drawTexturedModalRect(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, double p_73729_5_, double p_73729_6_)
{ {
int x = 0; float f = 0.00390625F;
int y = 0; float f1 = 0.00390625F;
int l; Tessellator tessellator = Tessellator.instance;
float f; tessellator.startDrawingQuads();
float f3; tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + p_73729_6_), (double)zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
float f4; tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + p_73729_6_), (double)zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
TextureManager p_77015_2_ = mc.getTextureManager(); tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + 0), (double)zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + 0) * f1));
ItemStack p_77015_3_ = new ItemStack(ModItems.activationCrystal); tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + 0), (double)zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + 0) * f1));
tessellator.draw();
Object object = p_77015_3_.getIconIndex();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
ResourceLocation resourcelocation = p_77015_2_.getResourceLocation(p_77015_3_.getItemSpriteNumber());
p_77015_2_.bindTexture(resourcelocation);
if (object == null)
{
object = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
} }
l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0); private static void renderTestHUD(Minecraft mc)
f3 = (float)(l >> 16 & 255) / 255.0F; {
f4 = (float)(l >> 8 & 255) / 255.0F; Reagent reagent = ReagentRegistry.incendiumReagent;
f = (float)(l & 255) / 255.0F; int xSize = 32;
int ySize = 32;
// if (this.renderWithColor) int x = (10 - xSize) / 2 * 8;
// { int y = (150 - ySize) / 2 * 8;
// GL11.glColor4f(f3, f4, f, 1.0F);
// }
GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up. ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/container1.png");
GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 0.5F);
GL11.glEnable(GL11.GL_BLEND); mc.getTextureManager().bindTexture(test2);
renderIcon(x, y, (IIcon)object, 16, 16); GL11.glScalef(1f/8f, 1f/8f, 1f/8f);
drawTexturedModalRect(x, y, 0, 0, 256, 256);
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "textures/gui/container.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(test);
drawTexturedModalRect(x, y, 0, 0, 256, 256);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND);
// if (renderEffect && p_77015_3_.hasEffect(0))
// {
// renderEffect(p_77015_2_, x, y);
// }
GL11.glEnable(GL11.GL_LIGHTING);
} }
public static void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_) public static void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_)

View file

@ -1,14 +1,15 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui; package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import net.minecraft.client.gui.inventory.GuiBrewingStand;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
public class GuiWritingTable extends GuiContainer public class GuiWritingTable extends GuiContainer
{ {
public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity) public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity)
@ -38,6 +39,5 @@ public class GuiWritingTable extends GuiContainer
int x = (width - xSize) / 2; int x = (width - xSize) / 2;
int y = (height - ySize) / 2; int y = (height - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
GuiBrewingStand d;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B