Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED Packet via FFMT Api

    1.7.x
    1.7.10
    2
    7
    1564
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sosoh
      sosoh last edited by

      Salut, j’utilises un systeme d’Extended Entity Proprieties et dans le tuto de Gugu, il utilise le FFMT Api, je l’ai donc installe etc, mais j’ai pas trouvé comment faire pour envoyer des packets avec, car ca m’indique des erreurs dans la class ExtendedEntityProp, dans la fonction sync:

      ​public final void sync() {
      
      if(player.worldObj.isRemote){
      PacketNivpo packetNivpo = new PacketNivpo(this.maxNivpo, this.nivpo);
      ModHarryPotter.network.sendToServer(packetNivpo);
      }
      if (!player.worldObj.isRemote) {
      EntityPlayerMP player1 = (EntityPlayerMP) player;
      ModHarryPotter.network.sendTo(packetNivpo, player1);
      }
      }
      

      Elles sont au niveau de

      ​ModHarryPotter.network.sendToServer(packetNivpo);
      
      ModHarryPotter.network.sendTo(packetNivpo, player1);
      

      Voila ma declaration de mon network dans ma class principale:

      ​network = NetworkRegistry.INSTANCE.newSimpleChannel("HarryPotterMod");
      network.registerMessage(Handler.class, PaquetHandler.class, 0, Side.SERVER);
      
      1 Reply Last reply Reply Quote 0
      • robin4002
        robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

        Ce que tu utilise actuellement est le système de paquet de fml, pas celui de ffmt libs. Où sont et quelles sont les erreurs ?

        1 Reply Last reply Reply Quote 0
        • sosoh
          sosoh last edited by

          Désolé de répondre que maintenant j’étais occupé, voila les erreurs: ici 🙂

          1 Reply Last reply Reply Quote 0
          • robin4002
            robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

            Première erreur : c’est parce que tu mélange les paquets ffmt lib et ceux de fml …
            Deuxième erreur : tu n’as pas fait d’instance de ton packet.

            1 Reply Last reply Reply Quote 0
            • sosoh
              sosoh last edited by

              D’où ma question comment utiliser les Packet ffmt lib?

              1 Reply Last reply Reply Quote 0
              • robin4002
                robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                https://github.com/FFMT/Privatizer/blob/master/privatizer_src/fr/mcnanotech/privatizer/common/PrivatizerMod.java#L48
                https://github.com/FFMT/Privatizer/blob/master/privatizer_src/fr/mcnanotech/privatizer/common/packet/PacketEditor.java
                https://github.com/FFMT/Privatizer/blob/master/privatizer_src/fr/mcnanotech/privatizer/client/GuiPrivateEditor.java#L109

                Le reste est détaillé dans la Java doc.

                1 Reply Last reply Reply Quote 0
                • sosoh
                  sosoh last edited by

                  Ok merci

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1

                  Design by Woryk
                  Contact / Mentions Légales / Faire un don

                  MINECRAFT FORGE FRANCE © 2018

                  Powered by NodeBB