Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onRendered2D() {
- if(this.getState() && this.mods.gui.getState()) {
- if(!(this.wrapper.getMinecraft().currentScreen instanceof GuiChat)) {
- ScaledResolution var0 = new ScaledResolution(Minecraft.getMinecraft().gameSettings, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
- this.posY = var0.getScaledHeight() - 18;
- this.drawStatusItem(2, this.posY, this.wrapper.getPlayer().getCurrentEquippedItem());
- this.drawStatusItem(2, this.posY, this.wrapper.getPlayer().inventory.armorInventory[0]);
- this.drawStatusItem(2, this.posY, this.wrapper.getPlayer().inventory.armorInventory[1]);
- this.drawStatusItem(2, this.posY, this.wrapper.getPlayer().inventory.armorInventory[2]);
- this.drawStatusItem(2, this.posY, this.wrapper.getPlayer().inventory.armorInventory[3]);
- }
- }
- }
- public void drawStatusItem(int x, int y, ItemStack var0) {
- if(var0 != null) {
- this.methods.drawItemTag(x, y, var0);
- if(var0.getItem().isItemTool(var0)) {
- this.methods.drawTinyString(var0.getDisplayName(), x + 16, y + 6, 16777215);
- this.methods.drawTinyString((var0.getMaxDamage() - var0.getItemDamageForDisplay()) + "/" + var0.getMaxDamage(), x + 16, y + 11, 8355711);
- }
- this.posY -= 16;
- }
- }
- @Override
- public void onRendered2D() {
- if(this.getState() && this.mods.gui.getState()) {
- this.renderEffects();
- }
- }
- public void renderEffects() {
- ScaledResolution var13 = new ScaledResolution(Minecraft.getMinecraft().gameSettings, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
- int var1 = 1;
- int var2 = 1;
- Collection var4 = this.wrapper.getPlayer().getActivePotionEffects();
- if(!var4.isEmpty()) {
- int var5 = this.wrapper.getRenderEngine().getTexture("/gui/inventory.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glDisable(GL11.GL_LIGHTING);
- int var6 = -16;
- for(Iterator var7 = this.wrapper.getPlayer().getActivePotionEffects().iterator(); var7.hasNext(); var2 += var6) {
- PotionEffect var8 = (PotionEffect)var7.next();
- Potion var9 = Potion.potionTypes[var8.getPotionID()];
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.wrapper.getRenderEngine().bindTexture(var5);
- if(var9.hasStatusIcon()) {
- int var10 = var9.getStatusIconIndex();
- this.methods.drawTexturedModalRect(var1 + var13.getScaledWidth() - 20, var2 + var13.getScaledHeight() - 20, 0 + var10 % 8 * 18, 198 + var10 / 8 * 18, 18, 18);
- }
- String var12 = StatCollector.translateToLocal(var9.getName());
- if(var8.getAmplifier() == 1) {
- var12 = var12 + " II";
- } else if (var8.getAmplifier() == 2) {
- var12 = var12 + " III";
- } else if (var8.getAmplifier() == 3) {
- var12 = var12 + " IV";
- }
- int var14 = var13.getScaledWidth() - this.wrapper.getFontRenderer().getStringWidth(var12) / 2 - 21;
- this.methods.drawTinyString(var12, var1 + var14, var2 + var13.getScaledHeight() - 14, 16777215);
- String var11 = Potion.getDurationString(var8);
- var14 = var13.getScaledWidth() - this.wrapper.getFontRenderer().getStringWidth(var11) / 2 - 21;
- this.methods.drawTinyString(var11, var1 + var14, var2 + var13.getScaledHeight() - 8, 8355711);
- }
- }
- }
- @Override
- public void onBlockClicked(int var0, int var1, int var2, int var3) {
- if(this.getState()) {
- Block var4 = Block.blocksList[this.wrapper.getWorld().getBlockId(var0, var1, var2)];
- for(int var5 = 0; var5 < 9; var5++) {
- ItemStack var6 = this.wrapper.getPlayer().inventory.mainInventory[var5];
- if(this.wrapper.getPlayer().getCurrentEquippedItem() != null) {
- if(var6.getStrVsBlock(var4) > this.wrapper.getPlayer().getCurrentEquippedItem().getStrVsBlock(var4)) {
- this.wrapper.getPlayer().inventory.currentItem = var5;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement