MFF

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

    Hammer qui mine les claims

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    13 Messages 6 Publieurs 1.6k 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.
    • C Hors-ligne
      Circus
      dernière édition par

      Bonjour,

      J’ai trouvé ce code que j’ai refais a ma sauce qui permet de faire un Hammer qui mine du 331

      Or il mine dans les claims quand on mine le bloc de la limite du claim extérieur on mine aussi donc un bloc a l’intérieur du claim je voudrais éviter sa pour les factions n’ayant pas beaucoup de power voici mon code

      :::

      Configuration file

      ##########################################################################################################

      general

      #–------------------------------------------------------------------------------------------------------#

      ATTENTION: Editing this file manually is no longer necessary.

      Type the command ‘/armorstatus config’ without the quotes in-game to modify these settings.

      ##########################################################################################################
      general {
          # Enables or disables the Armor Status HUD display. [default: true]
          B:enabled=true
          # Sets the position of the HUD on the screen. Valid alignment strings are topleft, topcenter, topright, middleleft, middlecenter, middleright, bottomleft, bottomcenter, bottomright [default: bottomleft]
          S:alignMode=topleft
          # Sets the direction to display status items. Valid list mode strings are horizontal and vertical [default: horizontal]
          S:listMode=horizontal
          # Set to true to show item names, false to disable [default: false]
          B:enableItemName=false
          # Set to true to show the standard inventory item overlay (damage bar) [default: true]
          B:showDamageOverlay=true
          # Set to true to show the item count overlay [default: true]
          B:showItemCount=true
          # Set to true to show armor damage values, false to disable [default: true]
          B:showArmorDamage=true
          # Set to true to show held item damage values, false to disable [default: true]
          B:showItemDamage=true
          # Set to true to show the max damage when damageDisplayType=value [default: false]
          B:showMaxDamage=false
          # Set to true to show info for your currently equipped item, false to disable [default: true]
          B:showEquippedItem=true
          # Set to true to show info when chat is open, false to disable info when chat is open [default: false]
          B:showInChat=false
          # This is a list of percent damage thresholds and text color codes that will be used when item damage is <= the threshold. Format used: “,” separates the threshold and the color code, “;” separates each pair. Valid color values are 0-9, a-f (color values can be found here: http://www.minecraftwiki.net/wiki/File:Colors.png) [default: 100,f; 80,7; 60,e; 40,6; 25,c; 10,4]
          S:damageColorList=100,f; 80,7; 60,e; 40,6; 25,c; 10,4
          # Valid damageDisplayType strings are value, percent, or none [default: value]
          S:damageDisplayType=value
          # The type of threshold to use when applying the damageColorList thresholds. Valid values are “percent” and “value”. [default: percent]
          S:damageThresholdType=percent
          # Horizontal offset from the edge of the screen (when using right alignments the x offset is relative to the right edge of the screen) [range: -2147483648 ~ 2147483647, default: 2]
          I:xOffset=2
          # Set to true if you want the xOffset value to be applied when using a center alignment [default: false]
          B:applyXOffsetToCenter=false
          # Vertical offset from the edge of the screen (when using bottom alignments the y offset is relative to the bottom edge of the screen) [range: -2147483648 ~ 2147483647, default: 2]
          I:yOffset=2
          # Set to true if you want the yOffset value to be applied when using a middle alignment [default: false]
          B:applyYOffsetToMiddle=false
          # Vertical offset used only for the bottomcenter alignment to avoid the vanilla HUD [range: -2147483648 ~ 2147483647, default: 41]
          I:yOffsetBottomCenter=41
      }

      :::

      Merci d’avance pour votre aide

      Circus

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

        C’est pas du code, c’est un fichier de config, celui d’ArmorStatus qui plus est…

        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
        • C Hors-ligne
          Circus
          dernière édition par

          @‘Superloup10’:

          C’est pas du code, c’est un fichier de config, celui d’ArmorStatus qui plus est…

          Désolé je me suis trompé de fichier voici le vrai

          :::
          public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase living)
            {
            if(living instanceof EntityPlayer && !world.isRemote)
            {
            switch(determineOrientation(world, x, y, z, living))
            {
            case 0:
            for(int x1 = -1; x1 < 2; x1++)
            {
            for(int z1 = -1; z1 < 2; z1++)
            {
            if(world.getBlock(x + x1, y, z + z1).getBlockHardness(world, x1, y, z1) >= 0.0F)
            {
            world.getBlock(x + x1, y, z + z1).harvestBlock(world, (EntityPlayer)living, x + x1, y, z + z1, world.getBlockMetadata(x + x1, y, z + z1));
            world.setBlockToAir(x + x1, y, z + z1);
            }
            }
            }
            break;
            case 1:
            for(int y1 = -1; y1 < 2; y1++)
            {
            for(int z1 = -1; z1 < 2; z1++)
            {
            if(world.getBlock(x, y + y1, z + z1).getBlockHardness(world, x, y1, z1) >= 0.0F)
            {
            world.getBlock(x, y + y1, z + z1).harvestBlock(world, (EntityPlayer)living, x, y + y1, z + z1, world.getBlockMetadata(x, y + y1, z + z1));
            world.setBlockToAir(x, y + y1, z + z1);
            }
            }
            }
            break;
            case 2:
            for(int x1 = -1; x1 < 2; x1++)
            {
            for(int y1 = -1; y1 < 2; y1++)
            {
            if(world.getBlock(x + x1, y + y1, z).getBlockHardness(world, x1, y1, z) >= 0.0F)
            {
            world.getBlock(x + x1, y + y1, z).harvestBlock(world, (EntityPlayer)living, x + x1, y + y1, z, world.getBlockMetadata(x + x1, y + y1, z));
            world.setBlockToAir(x + x1, y + y1, z);
            }
            }
            }
            break;
            }
            }
            return super.onBlockDestroyed(stack, world, block, x, y, z, living);
            }
            public int determineOrientation(World world, int x, int y, int z, EntityLivingBase living){

          if(MathHelper.abs((float)living.posX - x) < 2.0F && MathHelper.abs((float)living.posZ - z) < 2.0F)
            {
            double d0 = living.posY + 1.82D - (double)living.yOffset;
            if(d0 - y > 2.0D || y - d0 > 0.0D)
            {
            return 0;
            }
            }
            float rotation = MathHelper.abs(living.rotationYaw);
            return (rotation > 45F && rotation < 135F) || (rotation > 225F && rotation < 315F) ? 1 : 2;
            }

          :::

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

            Avec la balise Java, ce sera beaucoup plus lisible et n’oublie pas de formater le code.

            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
            • C Hors-ligne
              Circus
              dernière édition par

               public ItemModLavaHammer(ToolMaterial material)
                {
                super(material);
                }
              
                public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase living)
                {
                if(living instanceof EntityPlayer && !world.isRemote)
                {
                switch(determineOrientation(world, x, y, z, living))
                {
                case 0:
                for(int x1 = -1; x1 < 2; x1++)
                {
                for(int z1 = -1; z1 < 2; z1++)
                {
                if(world.getBlock(x + x1, y, z + z1).getBlockHardness(world, x1, y, z1) >= 0.0F)
                {
                world.getBlock(x + x1, y, z + z1).harvestBlock(world, (EntityPlayer)living, x + x1, y, z + z1, world.getBlockMetadata(x + x1, y, z + z1));
                world.setBlockToAir(x + x1, y, z + z1);
                }
                }
                }
                break;
                case 1:
                for(int y1 = -1; y1 < 2; y1++)
                {
                for(int z1 = -1; z1 < 2; z1++)
                {
                if(world.getBlock(x, y + y1, z + z1).getBlockHardness(world, x, y1, z1) >= 0.0F)
                {
                world.getBlock(x, y + y1, z + z1).harvestBlock(world, (EntityPlayer)living, x, y + y1, z + z1, world.getBlockMetadata(x, y + y1, z + z1));
                world.setBlockToAir(x, y + y1, z + z1);
                }
                }
                }
                break;
                case 2:
                for(int x1 = -1; x1 < 2; x1++)
                {
                for(int y1 = -1; y1 < 2; y1++)
                {
                if(world.getBlock(x + x1, y + y1, z).getBlockHardness(world, x1, y1, z) >= 0.0F)
                {
                world.getBlock(x + x1, y + y1, z).harvestBlock(world, (EntityPlayer)living, x + x1, y + y1, z, world.getBlockMetadata(x + x1, y + y1, z));
                world.setBlockToAir(x + x1, y + y1, z);
                }
                }
                }
                break;
                }
                }
                return super.onBlockDestroyed(stack, world, block, x, y, z, living);
                }
                public int determineOrientation(World world, int x, int y, int z, EntityLivingBase living)
                {
                if(MathHelper.abs((float)living.posX - x) < 2.0F && MathHelper.abs((float)living.posZ - z) < 2.0F)
                {
                double d0 = living.posY + 1.82D - (double)living.yOffset;
                if(d0 - y > 2.0D || y - d0 > 0.0D)
                {
                return 0;
                }
                }
                float rotation = MathHelper.abs(living.rotationYaw);
                return (rotation > 45F && rotation < 135F) || (rotation > 225F && rotation < 315F) ? 1 : 2;
                }
              }
              
              
              1 réponse Dernière réponse Répondre Citer 0
              • FolganskyF Hors-ligne
                Folgansky Correcteurs
                dernière édition par

                Je ne suis pas contre le copier/coller pour accomplir certaines tâches qui nous dépassent, même si au final on comprend à peu près, pas tellement mais qu’on apprend au moins un peu.

                La façon dont ce bout de code est rédigée nous montre que tu n’as fais aucun effort j’usqu’à présent pour le comprendre ou l’appréhender.
                Si tu l’avais seulement mis en ordre… Mais non

                Et c’est vraiment le strict minimum

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

                  N’importe quel problème avec les hammer est déjà résolu sur le forum : https://www.minecraftforgefrance.fr/showthread.php?tid=4079&page=2&highlight=Hammer
                  Il suffit de faire une recherche grâce au bouton prévu à cet effet.

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

                    @‘BrokenSwing’:

                    N’importe quel problème avec les hammer est déjà résolu sur le forum : https://www.minecraftforgefrance.fr/showthread.php?tid=4079&page=2&highlight=Hammer
                    Il suffit de faire une recherche grâce au bouton prévu à cet effet.

                    Ce code présent dans ce tuto ne fonctionne pas non plus, j’avais testé avant de poser la question

                    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

                      Comment ça il ne fonctionne plus ?
                      Il y a des erreurs ? Le résultat attendu n’est pas là ?

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

                        @‘robin4002’:

                        Comment ça il ne fonctionne plus ?
                        Il y a des erreurs ? Le résultat attendu n’est pas là ?

                        C’est que le Hammer permet de miner dans les claim

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

                          en fait cest pas vraiment possible car il faudrait recup les zone claim or je crois pas que l’on puisse faire en sorte de recup des infos de plugin sur un mod mais ya un mod faction et un plugin prend le mod et utilise le pour recuperer les claims et au lieu de mettre la version plugin de faction met la vesrion mod sur ton serveur

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

                            @‘SpyMan’:

                            en fait cest pas vraiment possible car il faudrait recup les zone claim or je crois pas que l’on puisse faire en sorte de recup des infos de plugin sur un mod mais ya un mod faction et un plugin prend le mod et utilise le pour recuperer les claims et au lieu de mettre la version plugin de faction met la vesrion mod sur ton serveur

                            Je test sa pourrais-tu m’envoyer un lien ?

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

                              cherche un peu j’ai aucun lien a te donner (j’ai jamais fait ce genre de chose c’est juste une theorie)

                              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