Modifié le GameSetting



  • Salut,

    Je cherche a modifié le GameSetting du chat en modifient l'opacité

    package fr.darkvince.proxy;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.gui.GuiButton;
    import net.minecraft.client.gui.GuiChat;
    import net.minecraft.client.gui.GuiControls;
    import net.minecraft.client.gui.GuiLanguage;
    import net.minecraft.client.gui.GuiOptionButton;
    import net.minecraft.client.gui.GuiScreen;
    import net.minecraft.client.gui.GuiScreenOptionsSounds;
    import net.minecraft.client.gui.GuiScreenResourcePacks;
    import net.minecraft.client.gui.GuiSnooper;
    import net.minecraft.client.gui.GuiVideoSettings;
    import net.minecraft.client.gui.ScreenChatOptions;
    import net.minecraft.client.gui.inventory.GuiInventory;
    import net.minecraft.client.gui.stream.GuiStreamOptions;
    import net.minecraft.client.gui.stream.GuiStreamUnavailable;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.client.settings.GameSettings;
    import net.minecraft.client.stream.IStream;
    import net.minecraftforge.client.event.GuiScreenEvent;
    import net.minecraftforge.client.event.RenderGameOverlayEvent;
    import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
    import org.lwjgl.opengl.GL11;
    
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import fr.darkvince.ultrav2.Main;
    import fr.darkvince.ultrav2.potionbuton.GuiButtonPotions;
    
    public class ClickCounterRenderer extends GuiScreen
    {
      private final Minecraft mc = Minecraft.getMinecraft();
      public float chatOpacity;
    
      }
      @SideOnly(Side.CLIENT)
      @SubscribeEvent
      public void onGuiPostInit(GuiScreenEvent.InitGuiEvent.Post event)
      {
        if (event.gui == null) {
          return;
        }
    
        int y = 0;
        int w = 17;
        int h = 17;
    
        if ((event.gui instanceof GuiChat))
        {
          int x = 0;
          event.buttonList.add(new GuiButton(1, x, y + 17, w, h, "X"));
          event.buttonList.add(new GuiButton(2, x, y, w, h, "+"));
        }
      }
      protected void actionPerformed(GuiButton p_146284_1_)
      {
          if (p_146284_1_.enabled)
          {
              if (p_146284_1_.id == 1)
              {
                  this.chatOpacity = 0.0F;
              }
              if (p_146284_1_.id == 2)
              {
             this.chatOpacity = 1.0F;
              }
    
          }
      }
    }
    
    

    Voilà se que j'ai essayé de faire



  • Modifier l'opacité c'est à dire ? Tu aimerais rendre le chat transparent ?



  • Minecraft.getMinecraft().gameSettings.chatOpacity