MFF

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

    Crash report serveur

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.2
    12 Messages 5 Publieurs 2.7k 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.
    • darkvince37D Hors-ligne
      darkvince37
      dernière édition par

      package fr.darkvince.ultra.hammer;
      
      import java.util.Arrays;
      
      import fr.darkvince.ultra.Main;
      import net.minecraft.block.Block;
      import net.minecraft.block.material.Material;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.item.EntityXPOrb;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.init.Blocks;
      import net.minecraft.item.ItemStack;
      import net.minecraft.item.crafting.FurnaceRecipes;
      import net.minecraft.util.MathHelper;
      import net.minecraft.util.MovingObjectPosition;
      import net.minecraft.util.Vec3;
      import net.minecraft.world.World;
      
      public class HandlerTool
      {
       public static Block[] minerals = { Main.blockMineraiCinabre, Blocks.coal_ore, Blocks.redstone_ore, Blocks.diamond_ore, Blocks.emerald_ore, Blocks.quartz_ore, Blocks.iron_ore, Blocks.lapis_ore, Main.blockMineraiIridium, Main.blockMineraiNether, Main.blockMineraiWulfenite, Blocks.gold_ore, Blocks.lit_redstone_ore };
      
       public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean smelt, int fortune, boolean dispose)
       {
         float blockHardness = block == null ? 1.0F : block.getBlockHardness(world, x, y, z);
         for (int x1 = xs; x1 < xe; x1++) {
           for (int y1 = ys; y1 < ye; y1++) {
             for (int z1 = zs; z1 < ze; z1++) {
               removeBlockWithDrops(player, stack, world, x1 + x, y1 + y, z1 + z, x, y, z, block, materialsListing, smelt, fortune, blockHardness, dispose);
             }
           }
         }
       }
      
       public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean smelt, int fortune, float blockHardness, boolean dispose)
       {
         removeBlockWithDrops(player, stack, world, x, y, z, bx, by, bz, block, materialsListing, smelt, fortune, blockHardness, dispose, true);
       }
      
       public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean smelt, int fortune, float blockHardness, boolean dispose, boolean particles)
       {
         if (!world.blockExists(x, y, z)) {
           return;
         }
         Block blk = world.getBlock(x, y, z);
         int meta = world.getBlockMetadata(x, y, z);
         if ((block != null) && (blk != block)) {
           return;
         }
         Material mat = world.getBlock(x, y, z).getMaterial();
         boolean flag = false;
         if ((!world.isRemote) && (blk != null) && (!blk.isAir(world, x, y, z)) && 
           (blk.getPlayerRelativeBlockHardness(player, world, x, y, z) > 0.0F))
         {
           if ((!blk.canHarvestBlock(player, meta)) || (!isRightMaterial(blk, materialsListing)) || (blk == Blocks.obsidian)) {
             return;
           }
           if (!player.capabilities.isCreativeMode)
           {
             int localMeta = world.getBlockMetadata(x, y, z);
             blk.onBlockHarvested(world, x, y, z, localMeta, player);
             if (blk.removedByPlayer(world, player, x, y, z, true)) {
               blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
             }
             if (smelt)
             {
               float count = 1.0F; 
               if (Arrays.asList(minerals).contains(blk)) {
                 count = (float)(count + (fortune * 0.7D - world.rand.nextInt(fortune)));
               }
               if (count <= 0.0F) {
                 count = 1.0F;
               }
               ItemStack result = FurnaceRecipes.smelting().getSmeltingResult((ItemStack)blk.getDrops(world, x, y, z, blk.getDamageValue(world, x, y, z), fortune).get(0));
               if (result != null)
               {
                 if (result.stackSize < 1) {
                   result.stackSize = ((int)count);
                 }
                 PlayerH.spawnItemAtPlayer(player, result);
                 flag = true;
               }
               else
               {
                 blk.dropBlockAsItem(world, x, y, z, localMeta, fortune);
               }
             }
             else
             {
               blk.dropBlockAsItem(world, x, y, z, localMeta, fortune);
             }
             int xpDrop = blk.getExpDrop(world, blk.getDamageValue(world, x, y, z), fortune);
             EntityXPOrb xp = new EntityXPOrb(world, x, y, z, xpDrop);
             if (xpDrop > 0) {
               world.spawnEntityInWorld(xp);
             }
           }
           else
           {
             world.setBlockToAir(x, y, z);
           }
           world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12));
         }
         if (flag)
         {
           world.spawnParticle("flame", x + 0.5D + 0.5D * world.rand.nextDouble(), y - 0.1D, z + 0.5D * world.rand
             .nextDouble(), 0.0D, 0.0D, 0.0D);
           world.spawnParticle("flame", x + 0.5D + 0.5D * world.rand.nextDouble(), y - 0.1D, z + 0.5D * world.rand
             .nextDouble(), 0.0D, 0.0D, 0.0D);
           world.spawnParticle("smoke", x + 0.5D + 0.5D * world.rand.nextDouble(), y - 0.1D, z + 0.5D * world.rand
             .nextDouble(), 0.0D, 0.0D, 0.0D);
         }
       }
      
       public static boolean isRightMaterial(Block block, Material[] materialsListing)
       {
         Material material = block.getMaterial();
         for (Material mat : materialsListing) {
           if (material == mat) {
             return true;
           }
         }
         return false;
       }
      
       public static boolean isRightBlock(Block block, Block[] list)
       {
         for (Block blk : list) {
           if (block == blk) {
             return false;
           }
         }
         return true;
       }
      
       public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range)
       {
         float f = 1.0F;
         float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
         float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
         double d0 = player.prevPosX + (player.posX - player.prevPosX) * f;
         double d1 = player.prevPosY + (player.posY - player.prevPosY) * f;
         if ((!world.isRemote) && ((player instanceof EntityPlayer))) {
           d1 += ((EntityPlayer)player).eyeHeight;
         }
         double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
         Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
         float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F);
         float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F);
         float f5 = -MathHelper.cos(-f1 * 0.017453292F);
         float f6 = MathHelper.sin(-f1 * 0.017453292F);
         float f7 = f4 * f5;
         float f8 = f3 * f5;
         double d3 = range;
         Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
         return world.rayTraceBlocks(vec3, vec31, par3);
       }
      }
      

      Voilà

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

        Cette fonction (removedByPlayer) n’est pas Client Only (du moins en 1.8), donc peut-être que la version de Forge de ton serveur n’est pas la même que celle que tu utilises pour coder, vérifies bien.

        PS : 1.7.2 ? Sérieux c’est vraiment ancien comme version, pourquoi ne passes-tu pas au moins en 1.7.10 ?

        Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

        AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

        Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
        Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

          Quel est le but de ton code ?

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

            a mon avis (hammer de 3x3 qui cuit auto ou un truc du genre) a la tinker construct non ? =p

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

              @‘AymericRed’:

              Cette fonction (removedByPlayer) n’est pas Client Only (du moins en 1.8), donc peut-être que la version de Forge de ton serveur n’est pas la même que celle que tu utilises pour coder, vérifies bien.

              PS : 1.7.2 ? Sérieux c’est vraiment ancien comme version, pourquoi ne passes-tu pas au moins en 1.7.10 ?

              Je code en 1.7.10 mais mon serveur va passez en 1.7.10 la mais j’aurai penser que sa aurai était compatible quand meme
              @‘SCAREX’:

              Quel est le but de ton code ?

              Un hammer
              @‘moscaphone421’:

              a mon avis (hammer de 3x3 qui cuit auto ou un truc du genre) a la tinker construct non  ? =p

              Oui c’est sa

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

                Tu devrais déjà créer une partie du code pour le serveur et le reste pour le client avec if (!world.isRemote)

                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
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  En effet la fonction removedByPlayer n’existait pas en 1.7.2 ce qui explique le problème.

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

                    @‘robin4002’:

                    En effet la fonction removedByPlayer n’existait pas en 1.7.2 ce qui explique le problème.

                    elle est arrivé en quelle version ?

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

                      1.7.10 puisque tu l’as en 1.7.10.

                      Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                      AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                      Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                      Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                        @‘AymericRed’:

                        1.7.10 puisque tu l’as en 1.7.10.

                        Ok comme je vais passez mon serveur en 1.7.10 sa devrai plus poser probleme

                        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