MFF

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

    [ Probleme Modification KB] '' coter client''

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.9.4
    4 Messages 3 Publieurs 1.0k 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.
    • A Hors-ligne
      AYMANOUH
      dernière édition par

      Bonjour,Bonsoir,

      Voila je fait appelle a vous , car j’ai recemment commencer a essayer de comprendre le java …. mon niveau global en java ‘’ Debutant ‘’ , je n’ai pas encore assez d’experience dans le domaine , c est pour ca que je fait apelle a vous …

      Mon Problem : J ai cree un mod , qui importe les .class qui concerne le Kb coter client …
      et j ai copier coller ceci :

      Permier .Class = ExampleMod

      
      package ExampleMod;
      
      import net.minecraft.init.Blocks;
      import net.minecraftforge.fml.common.Mod;
      import net.minecraftforge.fml.common.Mod.EventHandler;
      import net.minecraftforge.fml.common.event.FMLInitializationEvent;
      import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
      import net.minecraft.network.play.client.*;
      import net.minecraft.entity.*;
      import net.minecraftforge.fml.client.*;
      import net.minecraftforge.event.entity.*;
      import net.minecraft.client.Minecraft;
      import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
      
      @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
      public class ExampleMod
      {
      public static final String MODID = "JingoClient";
      public static final String VERSION = "0.1 Beta";
      private boolean isAirBorne;
      public double motionZ;
      public double motionY;
      public double motionX;
      public double posZ;
      public double posX;
      public double posY;
      
      public boolean velocityChanged;
      protected void setBeenAttacked()
      {
      this.velocityChanged = true;
      }
      
      @EventHandler
      public void addVelocity(double x, double y, double z)
      {
      this.motionX += x;
      this.motionY += y;
      this.motionZ += z;
      this.isAirBorne = true;
      }
      
      public static double Pmmmmlll = 1.8D;
      public static double vz1 = 1.8D;
      public static double vz2 = 1.8D;
      public void setVelocity(double x, double y, double z)
      {
      this.motionX = x / Pmmmmlll;
      this.motionY = y / vz1;
      this.motionZ = z /vz2;
      
      }
      public Minecraft mc = Minecraft.getMinecraft();
      
      }
      
      

      Deuxieme .Class = SPacketEntityVelocity

      
      package net.minecraft.minecraft;
      
      import java.io.IOException;
      import net.minecraft.entity.Entity;
      import net.minecraft.network.Packet;
      import net.minecraft.network.PacketBuffer;
      import net.minecraft.network.play.*;
      import net.minecraftforge.fml.common.Mod.EventHandler;
      import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
      import net.minecraft.client.multiplayer.*;
      import mcp.MethodsReturnNonnullByDefault;
      import javax.annotation.ParametersAreNonnullByDefault;
      
      public class SPacketEntityVelocity implements Packet <inethandlerplayclient>{
      private int entityID;
      private int motionX;
      private int motionY;
      private int motionZ;
      private net.minecraft.network.play.server.SPacketEntityVelocity packetIn;
      
      public SPacketEntityVelocity()
      {
      }
      
      public SPacketEntityVelocity(Entity entityIn)
      {
      this(entityIn.getEntityId(), entityIn.motionX, entityIn.motionY, entityIn.motionZ);
      }
      
      public SPacketEntityVelocity(int entityIdIn, double motionXIn, double motionYIn, double motionZIn)
      {
      this.entityID = entityIdIn;
      double d0 = 3.9D;
      
      if (motionXIn < -d0)
      {
      motionXIn = -d0;
      }
      
      if (motionYIn < -d0)
      {
      motionYIn = -d0;
      }
      
      if (motionZIn < -d0)
      {
      motionZIn = -d0;
      }
      
      if (motionXIn > d0)
      {
      motionXIn = d0;
      }
      
      if (motionYIn > d0)
      {
      motionYIn = d0;
      }
      
      if (motionZIn > d0)
      {
      motionZIn = d0;
      }
      
      this.motionX = (int)(motionXIn * 8000.0D);
      this.motionY = (int)(motionYIn * 8000.0D);
      this.motionZ = (int)(motionZIn * 8000.0D);
      }
      
      /**
      * Reads the raw packet data from the data stream.
      */
      public void readPacketData(PacketBuffer buf) throws IOException
      {
      this.entityID = buf.readVarIntFromBuffer();
      this.motionX = buf.readShort();
      this.motionY = buf.readShort();
      this.motionZ = buf.readShort();
      }
      
      /**
      * Writes the raw packet data to the data stream.
      */
      public void writePacketData(PacketBuffer buf) throws IOException
      {
      buf.writeVarIntToBuffer(this.entityID);
      buf.writeShort(this.motionX);
      buf.writeShort(this.motionY);
      buf.writeShort(this.motionZ);
      }
      
      /**
      * Passes this Packet on to the NetHandler for processing.
      */
      @EventHandler
      public void processPacket(INetHandlerPlayClient handler)
      {
      handler.handleEntityVelocity(packetIn);
      }
      
      public int getEntityID()
      {
      return this.entityID;
      }
      
      public int getMotionX()
      {
      return this.motionX;
      }
      
      public int getMotionY()
      {
      return this.motionY;
      }
      
      public int getMotionZ()
      {
      return this.motionZ;
      }
      }
      
      

      Croyez moi , je sais pas si c est bon , mais ca ma mis aucune erreur … j’ai fait pas mal de version modifier , pour comprendre le system de minecraft ( Importation , modification de Reach , KnockBack, ajout d’item modder ect …) mais je m’en rend comte que Forge et Version , c est pas la meme chose …

      Merci de bien vouloir m’aider ( un peu )…</inethandlerplayclient>

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

        C’est un troll ? Si la réponse est non, c’est encore + affligeant de nous faire croire que MFF t’aiderait à parfaire ton joli hack…

        1 réponse Dernière réponse Répondre Citer 0
        • Superloup10S Hors-ligne
          Superloup10 Modérateurs
          dernière édition par

          C’est quoi Version ?

          Si vous souhaitez me faire un don, il vous suffit de cliquer sur le bouton situé en dessous.

          Je suis un membre apprécié et joueur, j'ai déjà obtenu 17 points de réputation.

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

            En quoi c est ‘’ Mechant ‘’ de faire un mod qui sers a reduire ou augmenter le kb ? a la base je voulais faire un mod ‘’ Troll Kb ‘’ , en gros je prend genre 15 block en Y et 20 block en X ……


            J’ai deja une version que j ai modifier et qui me permet de prendre 10 block en X et 5 en Y

            Mais moi je veux cette fois-ci le faire en MOD

            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