MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Anti-Xray = Xray ?

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    4 Messages 3 Publieurs 991 Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • ? Hors-ligne
      Un Ancien Utilisateur
      dernière édition par

      Bonjour, j’ai un anti textures packs xray :

      package com.adamitemod.mod.proxy;
      
      import java.util.List;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.gui.FontRenderer;
      import net.minecraft.client.gui.GuiButton;
      import net.minecraft.client.gui.GuiMainMenu;
      import net.minecraft.client.gui.GuiScreen;
      import net.minecraft.client.resources.I18n;
      
      public class GuiIllegalResourcePack
        extends GuiScreen
      {
        public void initGui()
        {
          this.buttonList.clear();
          this.buttonList.add(new GuiButton(0, this.width / 2 - 50, this.height - 20, 100, 20, I18n.format("gui.back", new Object[0])));
        }
      
        protected void actionPerformed(GuiButton guibutton)
        {
          if (guibutton.id == 0) {
            this.mc.displayGuiScreen(new GuiMainMenu());
          }
        }
      
        public void drawScreen(int mouseX, int mouseY, float partialRenderTick)
        {
          drawDefaultBackground();
          List <string>strings = this.fontRendererObj.listFormattedStringToWidth(I18n.format("Les textures packs Xray ne sont pas autorisee", new Object[0]), this.width - 80);
          for (int i = 0; i < strings.size(); i++) {
            drawCenteredString(this.fontRendererObj, (String)strings.get(i), this.width / 2, this.height / 2 - 50 + i * 11, 16777215);
          }
          super.drawScreen(mouseX, mouseY, partialRenderTick);
        }
      }
      
      
      package com.adamitemod.mod.proxy;
      
      import cpw.mods.fml.common.eventhandler.SubscribeEvent;
      import cpw.mods.fml.common.gameevent.TickEvent;
      import cpw.mods.fml.common.gameevent.TickEvent.Phase;
      import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      
      import java.io.IOException;
      
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.multiplayer.WorldClient;
      import net.minecraft.client.renderer.texture.ITextureObject;
      import net.minecraft.client.renderer.texture.SimpleTexture;
      import net.minecraft.client.renderer.texture.TextureManager;
      import net.minecraft.client.renderer.texture.TextureUtil;
      import net.minecraft.util.ResourceLocation;
      
      @SideOnly(Side.CLIENT)
      public class ClientEventHandlerAntiXray
      {
        private Minecraft mc;
        private int cheatTimer;
        private int timer = 1;
      
        public ClientEventHandlerAntiXray(Minecraft mc)
        {
          this.mc = mc;
        }
      
        @SubscribeEvent
        public void onRenderTick(TickEvent.RenderTickEvent event)
        {
          if (event.phase == TickEvent.Phase.START) {
            checkTexture();
          }
        }
      
        private void checkTexture()
        {
          if (this.cheatTimer <= 0)
          {
            if ((hasIllegalTexture()) && (this.mc.theWorld != null))
            {
              this.mc.theWorld.sendQuittingDisconnectingPacket();
              this.mc.loadWorld((WorldClient)null);
              this.mc.displayGuiScreen(new GuiIllegalResourcePack());
            }
            this.cheatTimer = (this.timer * 20);
          }
          else
          {
            this.cheatTimer -= 1;
          }
        }
      
        public static boolean hasIllegalTexture()
        {
          ResourceLocation r = new ResourceLocation("minecraft:textures/blocks/stone.png");
          ITextureObject textureObject = Minecraft.getMinecraft().getTextureManager().getTexture(r);
          if (textureObject == null)
          {
            textureObject = new SimpleTexture(r);
            Minecraft.getMinecraft().getTextureManager().loadTexture(r, textureObject);
          }
          int id = textureObject.getGlTextureId();
          try
          {
            int[] textureData = TextureUtil.readImageData(Minecraft.getMinecraft().getResourceManager(), r);
            for (int color : textureData)
            {
              int alpha = color >> 24 & 0xFF;
              if (alpha != 255) {
                return true;
              }
            }
          }
          catch (IOException e)
          {
            e.printStackTrace();
          }
          return false;
        }
      }
      
      

      le truc c’est que l’ont peux toujours xray en mettant un contour de n’import quelle couleurs et de laisser le millieu des blocks transparent . . .

      comment patcher sa ?</string>

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R Hors-ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        Ton code vérifies tous les pixel du bloc, donc ça devrait prendre en compte même les bords.

        En passant ton titre n’a pas de sens.

        1 réponse Dernière réponse Répondre Citer 0
        • ? Hors-ligne
          Un Ancien Utilisateur
          dernière édition par

          bah j’arrive quand meme a mettre un xray . . .

          1 réponse Dernière réponse Répondre Citer 0
          • SCAREXS Hors-ligne
            SCAREX
            dernière édition par

            Fais du debug pour voir d’où vient le problème

            Site web contenant mes scripts : http://SCAREXgaming.github.io

            Pas de demandes de support par MP ni par skype SVP.
            Je n'accepte sur skype que l…

            1 réponse Dernière réponse Répondre Citer 0
            • 1 / 1
            • Premier message
              Dernier message
            Design by Woryk
            ContactMentions Légales

            MINECRAFT FORGE FRANCE © 2024

            Powered by NodeBB