MFF

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

    Problème enchantement arc !

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    28 Messages 5 Publieurs 4.1k 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.
    • O Hors-ligne
      Oguzcan13
      dernière édition par

      Voici le code de mon arc :

      package fr.minecraftforgefrance.tutoriel.common;
      
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      import net.minecraft.client.renderer.texture.IIconRegister;
      import net.minecraft.creativetab.CreativeTabs;
      import net.minecraft.enchantment.Enchantment;
      import net.minecraft.enchantment.EnchantmentHelper;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.entity.projectile.EntityArrow;
      import net.minecraft.init.Items;
      import net.minecraft.item.EnumAction;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraft.util.IIcon;
      import net.minecraft.world.World;
      import net.minecraftforge.common.MinecraftForge;
      import net.minecraftforge.event.entity.player.ArrowLooseEvent;
      import net.minecraftforge.event.entity.player.ArrowNockEvent;
      
      public class ArcTanzanite extends ItemBow
      {
          public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"};
          @SideOnly(Side.CLIENT)
          private IIcon[] iconArray;
          private static final String __OBFID = "CL_00001777";
      
          public ArcTanzanite()
          {
              this.maxStackSize = 1;
              this.setMaxDamage(384);
              this.setCreativeTab(CreativeTabs.tabCombat);
          }
      
          /**
           * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
           */
          public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_)
          {
              int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
      
              ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
              MinecraftForge.EVENT_BUS.post(event);
              if (event.isCanceled())
              {
                  return;
              }
              j = event.charge;
      
              boolean flag = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
      
              if (flag || p_77615_3_.inventory.hasItem(Items.arrow))
              {
                  float f = (float)j / 20.0F;
                  f = (f * f + f * 2.0F) / 3.0F;
      
                  if ((double)f < 0.1D)
                  {
                      return;
                  }
      
                  if (f > 1.0F)
                  {
                      f = 1.0F;
                  }
      
                  EntityArrow entityarrow = new EntityArrow(p_77615_2_, p_77615_3_, f * 2.0F);
      
                  if (f == 1.0F)
                  {
                      entityarrow.setIsCritical(true);
                  }
      
                  int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, p_77615_1_);
      
                  if (k > 0)
                  {
                      entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
                  }
      
                  int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, p_77615_1_);
      
                  if (l > 0)
                  {
                      entityarrow.setKnockbackStrength(l);
                  }
      
                  if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, p_77615_1_) > 0)
                  {
                      entityarrow.setFire(100);
                  }
      
                  p_77615_1_.damageItem(1, p_77615_3_);
                  p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
      
                  if (flag)
                  {
                      entityarrow.canBePickedUp = 2;
                  }
                  else
                  {
                      p_77615_3_.inventory.consumeInventoryItem(Items.arrow);
                  }
      
                  if (!p_77615_2_.isRemote)
                  {
                      p_77615_2_.spawnEntityInWorld(entityarrow);
                  }
              }
          }
      
          public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_)
          {
              return p_77654_1_;
          }
      
          /**
           * How long it takes to use or consume an item
           */
          public int getMaxItemUseDuration(ItemStack p_77626_1_)
          {
              return 72000;
          }
      
          /**
           * returns the action that specifies what animation to play when the items is being used
           */
          public EnumAction getItemUseAction(ItemStack p_77661_1_)
          {
              return EnumAction.bow;
          }
      
          /**
           * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
           */
          public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
          {
              ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
              MinecraftForge.EVENT_BUS.post(event);
              if (event.isCanceled())
              {
                  return event.result;
              }
      
              if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(Items.arrow))
              {
                  p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
              }
      
              return p_77659_1_;
          }
      
          /**
           * Return the enchantability factor of the item, most of the time is based on material.
           */
          public int getItemEnchantability()
          {
              return 1;
          }
      
          @SideOnly(Side.CLIENT)
          public void registerIcons(IIconRegister p_94581_1_)
          {
              this.itemIcon = p_94581_1_.registerIcon(this.getIconString() + "_standby");
              this.iconArray = new IIcon[bowPullIconNameArray.length];
      
              for (int i = 0; i < this.iconArray.length; ++i)
              {
                  this.iconArray* = p_94581_1_.registerIcon(this.getIconString() + "_" + bowPullIconNameArray*);
              }
          }
      
          /**
           * used to cycle through icons based on their used duration, i.e. for the bow
           */
          @SideOnly(Side.CLIENT)
          public IIcon getItemIconForUseDuration(int p_94599_1_)
          {
              return this.iconArray[p_94599_1_];
          }
      
      1 réponse Dernière réponse Répondre Citer 0
      • Yanis_Y Hors-ligne
        Yanis_
        dernière édition par

        et c’est quoi le problème ?

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

          Salut,
          Par pitié, mets les balises Java, c’est insupportable sinon é_è

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

            Il y’a que du Unbreaking I sur l’arc et ce n’est pas normal du tout

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

              Je n’ai pas compris pourquoi tu exetends ItemBow et tu recopie les fonction de l’arc

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

                C’est possible de me donner un code d’arc fonctionnel ?

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

                  On pourrait, mais ça n’aurait aucun intérêt puisque tu ne progresserais pas. Et comme l’a dis Yanis, ta classe est extends ItemBow et donc si tu ne modifie rien par rapport a la classe ItemBow, tu peux virer ce que tu as copier coller 😉

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

                    Aidez moi juste à ressoudre le bug d’enchantement


                    Mon vraie code est celui ci j’avais copie colle la classe de minecraft pour voir si ca va résoudre le bug d’enchantement mais nan

                    package fr.minecraftforgefrance.tutoriel.common;

                    import cpw.mods.fml.relauncher.Side;
                    import cpw.mods.fml.relauncher.SideOnly;
                    import net.minecraft.client.renderer.texture.IIconRegister;
                    import net.minecraft.enchantment.Enchantment;
                    import net.minecraft.enchantment.EnchantmentHelper;
                    import net.minecraft.entity.player.EntityPlayer;
                    import net.minecraft.entity.projectile.EntityArrow;
                    import net.minecraft.init.Items;
                    import net.minecraft.item.EnumAction;
                    import net.minecraft.item.Item;
                    import net.minecraft.item.ItemStack;
                    import net.minecraft.util.IIcon;
                    import net.minecraft.world.World;
                    import net.minecraftforge.common.MinecraftForge;
                    import net.minecraftforge.event.entity.player.ArrowLooseEvent;
                    import net.minecraftforge.event.entity.player.ArrowNockEvent;

                    public class ArcObsidian extends Item{

                    public static final String[] bowPullIconNameArray = new String[] {“pulling_0”, “pulling_1”, “pulling_2”};
                    @SideOnly(Side.CLIENT)
                    private IIcon[] iconArray;
                    private static final String __OBFID = “CL_00001777”;

                    public ArcObsidian()
                    {
                    this.maxStackSize = 1;
                    this.setMaxDamage(420);
                    this.setFull3D();
                    }

                    /**

                    • called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
                      */
                      public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
                      {
                      int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

                    ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
                    MinecraftForge.EVENT_BUS.post(event);
                    if (event.isCanceled())
                    {
                    return;
                    }
                    j = event.charge;

                    boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

                    if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow))
                    {
                    float f = (float)j / 16.0F;
                    f = (f * f + f * 2.0F) / 3.0F;

                    if ((double)f < 0.1D)
                    {
                    return;
                    }

                    if (f > 1.0F)
                    {
                    f = 1.0F;
                    }

                    EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F);

                    if (f == 1.0F)
                    {
                    entityarrow.setIsCritical(true);
                    }

                    int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

                    if (k > 0)
                    {
                    entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
                    }

                    int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

                    if (l > 0)
                    {
                    entityarrow.setKnockbackStrength(l);
                    }

                    if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
                    {
                    entityarrow.setFire(110);
                    }

                    par1ItemStack.damageItem(1, par3EntityPlayer);
                    par2World.playSoundAtEntity(par3EntityPlayer, “random.bow”, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

                    if (flag)
                    {
                    entityarrow.canBePickedUp = 2;
                    }
                    else
                    {
                    par3EntityPlayer.inventory.consumeInventoryItem(Items.arrow);
                    }

                    if (!par2World.isRemote)
                    {
                    par2World.spawnEntityInWorld(entityarrow);
                    }
                    }
                    }

                    public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
                    {
                    return par1ItemStack;
                    }

                    /**

                    • How long it takes to use or consume an item
                      */
                      public int getMaxItemUseDuration(ItemStack par1ItemStack)
                      {
                      return 8000; //temps avant chaque utilisation
                      }

                    /**

                    • returns the action that specifies what animation to play when the items is being used
                      */
                      public EnumAction getItemUseAction(ItemStack par1ItemStack)
                      {
                      return EnumAction.bow;
                      }

                    /**

                    • Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
                      */
                      public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
                      {
                      ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
                      MinecraftForge.EVENT_BUS.post(event);
                      if (event.isCanceled())
                      {
                      return event.result;
                      }

                    if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow))
                    {
                    par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
                    }

                    return par1ItemStack;
                    }

                    /**

                    • Return the enchantability factor of the item, most of the time is based on material.
                      */
                      public int getItemEnchantability()
                      {
                      return 1;
                      }

                    @SideOnly(Side.CLIENT)
                    public void registerIcons(IIconRegister par1IconRegister)
                    {
                    this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + “_standby”);
                    this.iconArray = new IIcon[bowPullIconNameArray.length];

                    for (int i = 0; i < this.iconArray.length; ++i)
                    {
                    this.iconArray* = par1IconRegister.registerIcon(this.getIconString() + “_” + bowPullIconNameArray*);
                    }
                    }

                    /**

                    • used to cycle through icons based on their used duration, i.e. for the bow
                      */
                      @Override
                      public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
                      {
                      if(usingItem != null && usingItem.getItem().equals(this))
                      {
                      int k = usingItem.getMaxItemUseDuration() - useRemaining;
                      if(k >= 18)
                      return iconArray[2];
                      if(k > 13)
                      return iconArray[1];
                      if(k > 0)
                      return iconArray[0];
                      }
                      return getIconIndex(stack);
                      }
                      }
                    1 réponse Dernière réponse Répondre Citer 0
                    • Yanis_Y Hors-ligne
                      Yanis_
                      dernière édition par

                      C’est encore pire enleve les fonction de minecraft et laisse le extends ItemBow et cherche sur le forum ou sur internet tu va trouvé des tuto sur l’arc.

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

                        @‘Oguzcan13’:

                        Aidez moi juste à ressoudre le bug d’enchantement


                        Mon vraie code est celui ci j’avais copie colle la classe de minecraft pour voir si ca va résoudre le bug d’enchantement mais nan

                        package fr.minecraftforgefrance.tutoriel.common;

                        import cpw.mods.fml.relauncher.Side;
                        import cpw.mods.fml.relauncher.SideOnly;
                        import net.minecraft.client.renderer.texture.IIconRegister;
                        import net.minecraft.enchantment.Enchantment;
                        import net.minecraft.enchantment.EnchantmentHelper;
                        import net.minecraft.entity.player.EntityPlayer;
                        import net.minecraft.entity.projectile.EntityArrow;
                        import net.minecraft.init.Items;
                        import net.minecraft.item.EnumAction;
                        import net.minecraft.item.Item;
                        import net.minecraft.item.ItemStack;
                        import net.minecraft.util.IIcon;
                        import net.minecraft.world.World;
                        import net.minecraftforge.common.MinecraftForge;
                        import net.minecraftforge.event.entity.player.ArrowLooseEvent;
                        import net.minecraftforge.event.entity.player.ArrowNockEvent;

                        public class ArcObsidian extends Item{

                        public static final String[] bowPullIconNameArray = new String[] {“pulling_0”, “pulling_1”, “pulling_2”};
                           @SideOnly(Side.CLIENT)
                           private IIcon[] iconArray;
                           private static final String __OBFID = “CL_00001777”;

                        public ArcObsidian()
                           {
                               this.maxStackSize = 1;
                               this.setMaxDamage(420);
                               this.setFull3D();
                           }

                        /**
                            * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
                            */
                           public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
                           {
                               int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

                        ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
                               MinecraftForge.EVENT_BUS.post(event);
                               if (event.isCanceled())
                               {
                                   return;
                               }
                               j = event.charge;

                        boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

                        if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow))
                               {
                                   float f = (float)j / 16.0F;
                                   f = (f * f + f * 2.0F) / 3.0F;

                        if ((double)f < 0.1D)
                                   {
                                       return;
                                   }

                        if (f > 1.0F)
                                   {
                                       f = 1.0F;
                                   }

                        EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F);

                        if (f == 1.0F)
                                   {
                                       entityarrow.setIsCritical(true);
                                   }

                        int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

                        if (k > 0)
                                   {
                                       entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
                                   }

                        int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

                        if (l > 0)
                                   {
                                       entityarrow.setKnockbackStrength(l);
                                   }

                        if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
                                   {
                                       entityarrow.setFire(110);
                                   }

                        par1ItemStack.damageItem(1, par3EntityPlayer);
                                   par2World.playSoundAtEntity(par3EntityPlayer, “random.bow”, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

                        if (flag)
                                   {
                                       entityarrow.canBePickedUp = 2;
                                   }
                                   else
                                   {
                                       par3EntityPlayer.inventory.consumeInventoryItem(Items.arrow);
                                   }

                        if (!par2World.isRemote)
                                   {
                                       par2World.spawnEntityInWorld(entityarrow);
                                   }
                               }
                           }

                        public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
                           {
                               return par1ItemStack;
                           }

                        /**
                            * How long it takes to use or consume an item
                            */
                           public int getMaxItemUseDuration(ItemStack par1ItemStack)
                           {
                               return 8000; //temps avant chaque utilisation
                           }

                        /**
                            * returns the action that specifies what animation to play when the items is being used
                            */
                           public EnumAction getItemUseAction(ItemStack par1ItemStack)
                           {
                               return EnumAction.bow;
                           }

                        /**
                            * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
                            */
                           public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
                           {
                               ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
                               MinecraftForge.EVENT_BUS.post(event);
                               if (event.isCanceled())
                               {
                                   return event.result;
                               }

                        if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow))
                               {
                                   par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
                               }

                        return par1ItemStack;
                           }

                        /**
                            * Return the enchantability factor of the item, most of the time is based on material.
                            */
                           public int getItemEnchantability()
                           {
                               return 1;
                           }

                        @SideOnly(Side.CLIENT)
                           public void registerIcons(IIconRegister par1IconRegister)
                           {
                               this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + “_standby”);
                               this.iconArray = new IIcon[bowPullIconNameArray.length];

                        for (int i = 0; i < this.iconArray.length; ++i)
                               {
                                   this.iconArray* = par1IconRegister.registerIcon(this.getIconString() + “_” + bowPullIconNameArray*);
                               }
                           }

                        /**
                            * used to cycle through icons based on their used duration, i.e. for the bow
                            */
                           @Override
                           public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
                           {
                           if(usingItem != null && usingItem.getItem().equals(this))
                           {
                           int k = usingItem.getMaxItemUseDuration() - useRemaining;
                           if(k >= 18)
                           return iconArray[2];
                           if(k > 13)
                           return iconArray[1];
                           if(k > 0)
                           return iconArray[0];
                           }
                           return getIconIndex(stack);
                           }
                        }

                        package fr.playflop.extania.common.item;
                        
                        import cpw.mods.fml.common.eventhandler.EventBus;
                        import cpw.mods.fml.relauncher.Side;
                        import cpw.mods.fml.relauncher.SideOnly;
                        import java.util.Random;
                        import net.minecraft.client.renderer.texture.IIconRegister;
                        import net.minecraft.enchantment.Enchantment;
                        import net.minecraft.enchantment.EnchantmentHelper;
                        import net.minecraft.entity.player.EntityPlayer;
                        import net.minecraft.entity.player.InventoryPlayer;
                        import net.minecraft.entity.player.PlayerCapabilities;
                        import net.minecraft.entity.projectile.EntityArrow;
                        import net.minecraft.init.Items;
                        import net.minecraft.item.EnumAction;
                        import net.minecraft.item.ItemBow;
                        import net.minecraft.item.ItemStack;
                        import net.minecraft.nbt.NBTTagCompound;
                        import net.minecraft.util.IIcon;
                        import net.minecraft.world.World;
                        import net.minecraftforge.common.MinecraftForge;
                        import net.minecraftforge.event.entity.player.ArrowLooseEvent;
                        import net.minecraftforge.event.entity.player.ArrowNockEvent;
                        
                        public class Extane_Bow
                          extends ItemBow
                        {
                          public static final String[] a = { "1", "2", "3" };
                          @SideOnly(Side.CLIENT)
                          private IIcon[] b;
                        
                          public Extane_Bow()
                          {
                            this.maxStackSize = 1;
                            setMaxDamage(1000);
                          }
                        
                          public void onPlayerStoppedUsing(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt)
                          {
                            int i = getMaxItemUseDuration(paramItemStack) - paramInt;
                            ArrowLooseEvent localArrowLooseEvent = new ArrowLooseEvent(paramEntityPlayer, paramItemStack, i);
                            MinecraftForge.EVENT_BUS.post(localArrowLooseEvent);
                            if (localArrowLooseEvent.isCanceled()) {
                              return;
                            }
                            i = localArrowLooseEvent.charge;
                            int j = (paramEntityPlayer.capabilities.isCreativeMode) || (EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, paramItemStack) > 0) ? 1 : 0;
                            if ((j != 0) || (paramEntityPlayer.inventory.hasItem(Items.arrow)))
                            {
                              float f = i / 20.0F;
                              f = (f * f + f * 2.0F) / 3.0F;
                              if (f < 0.1D) {
                                return;
                              }
                              if (f > 1.0F) {
                                f = 1.0F;
                              }
                              EntityArrow localEntityArrow = new EntityArrow(paramWorld, paramEntityPlayer, f * 3.0F);
                              if (f == 1.0F) {
                                localEntityArrow.setIsCritical(true);
                              }
                              int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, paramItemStack);
                              if (k > 0) {
                                localEntityArrow.setDamage(localEntityArrow.getDamage() + k * 1.0D + 1.0D);
                              }
                              int m = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, paramItemStack);
                              if (m > 2) {
                                localEntityArrow.setKnockbackStrength(0);
                              }
                              if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, paramItemStack) > 0) {
                                localEntityArrow.setFire(130);
                              }
                              paramItemStack.damageItem(1, paramEntityPlayer);
                              paramWorld.playSoundAtEntity(paramEntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
                              if (j != 0) {
                                localEntityArrow.canBePickedUp = 2;
                              } else {
                                paramEntityPlayer.inventory.consumeInventoryItem(Items.arrow);
                              }
                              if (!paramWorld.isRemote)
                              {
                                localEntityArrow.getEntityData().setBoolean("HaveEffect", true);
                                paramWorld.spawnEntityInWorld(localEntityArrow);
                              }
                            }
                          }
                        
                          public int getMaxItemUseDuration(ItemStack paramItemStack)
                          {
                            return 5000;
                          }
                        
                          public EnumAction getItemUseAction(ItemStack paramItemStack)
                          {
                            return EnumAction.bow;
                          }
                        
                          public ItemStack onItemRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer)
                          {
                            ArrowNockEvent localArrowNockEvent = new ArrowNockEvent(paramEntityPlayer, paramItemStack);
                            MinecraftForge.EVENT_BUS.post(localArrowNockEvent);
                            if (localArrowNockEvent.isCanceled()) {
                              return localArrowNockEvent.result;
                            }
                            if ((paramEntityPlayer.capabilities.isCreativeMode) || (paramEntityPlayer.inventory.hasItem(Items.arrow))) {
                              paramEntityPlayer.setItemInUse(paramItemStack, getMaxItemUseDuration(paramItemStack));
                            }
                            return paramItemStack;
                          }
                        
                          public int getItemEnchantability()
                          {
                            return 1;
                          }
                        
                          @SideOnly(Side.CLIENT)
                          public void registerIcons(IIconRegister paramIIconRegister)
                          {
                            this.itemIcon = paramIIconRegister.registerIcon(getIconString());
                            this.b = new IIcon[a.length];
                            for (int i = 0; i < this.b.length; i++) {
                              this.b* = paramIIconRegister.registerIcon(getIconString() + "_" + a*);
                            }
                          }
                        
                          public IIcon getIcon(ItemStack paramItemStack1, int paramInt1, EntityPlayer paramEntityPlayer, ItemStack paramItemStack2, int paramInt2)
                          {
                            if ((paramItemStack2 != null) && (paramItemStack2.getItem().equals(this)))
                            {
                              int i = paramItemStack2.getMaxItemUseDuration() - paramInt2;
                              if (i >= 18) {
                                return this.b[2];
                              }
                              if (i > 13) {
                                return this.b[1];
                              }
                              if (i > 0) {
                                return this.b[0];
                              }
                            }
                            return getIconIndex(paramItemStack1);
                          }
                        }
                        
                        

                        Tien c’est cadeau

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

                          Il y’a toujours que tu unbreaking

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

                            @‘Oguzcan13’:

                            Il y’a toujours que tu unbreaking

                            Bha l’erreur vient pas de la classe de l’arc alors

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

                              L’erreur vien d’ou s’il te plait ?

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

                                @‘Oguzcan13’:

                                L’erreur vien d’ou s’il te plait ?

                                Est ce que j’ai l’air d’avoir ton mod ou tes classes pour le savoir ?
                                Je ne pense pas ^^

                                Sa peux venir de ton proxy de la main class ou de plein d’autre part

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

                                  J’ai besoin d’aide rapidement

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

                                    @‘Oguzcan13’:

                                    J’ai besoin d’aide rapidement

                                    Bha si tu donne aucune class t’aura aucune aide…

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

                                      Vous voulez quelle classe ?


                                      @EventHandler
                                      public void preInit(FMLPreInitializationEvent event)
                                      {
                                      //ArcObsidian
                                      ArcObsidian = new ArcObsidian().setUnlocalizedName(“ArcObsidian”).setTextureName(MODID + “:ArcObsidian”).setCreativeTab(CreativeTabs.tabCombat);
                                      GameRegistry.registerItem(ArcObsidian, “ArcObsidian”);
                                      //ArcRubis
                                      ArcRubis = new ArcRubis().setUnlocalizedName(“ArcRubis”).setTextureName(MODID + “:ArcRubis”).setCreativeTab(CreativeTabs.tabCombat);
                                      GameRegistry.registerItem(ArcRubis, “ArcRubis”);
                                      //ArcFluonyte
                                      ArcFluonyte = new ArcFluonyte().setUnlocalizedName(“ArcFluonyte”).setTextureName(MODID + “:ArcFluonite”).setCreativeTab(CreativeTabs.tabCombat);
                                      GameRegistry.registerItem(ArcFluonyte, “ArcFluonyte”);
                                      ArcTanzanite = new ArcFluonyte().setUnlocalizedName(“ArcTanzanite”).setTextureName(MODID + “:ArcTanzanite”).setCreativeTab(CreativeTabs.tabCombat);
                                      GameRegistry.registerItem(ArcTanzanite, “ArcTanzanite”);
                                      //Ore

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

                                        @‘Oguzcan13’:

                                        Vous voulez quelle classe ?


                                        @EventHandler
                                        public void preInit(FMLPreInitializationEvent event)
                                        {
                                        //ArcObsidian
                                        ArcObsidian = new ArcObsidian().setUnlocalizedName(“ArcObsidian”).setTextureName(MODID + “:ArcObsidian”).setCreativeTab(CreativeTabs.tabCombat);
                                        GameRegistry.registerItem(ArcObsidian, “ArcObsidian”);
                                        //ArcRubis
                                        ArcRubis = new ArcRubis().setUnlocalizedName(“ArcRubis”).setTextureName(MODID + “:ArcRubis”).setCreativeTab(CreativeTabs.tabCombat);
                                        GameRegistry.registerItem(ArcRubis, “ArcRubis”);
                                        //ArcFluonyte
                                        ArcFluonyte = new ArcFluonyte().setUnlocalizedName(“ArcFluonyte”).setTextureName(MODID + “:ArcFluonite”).setCreativeTab(CreativeTabs.tabCombat);
                                        GameRegistry.registerItem(ArcFluonyte, “ArcFluonyte”);
                                        ArcTanzanite = new ArcFluonyte().setUnlocalizedName(“ArcTanzanite”).setTextureName(MODID + “:ArcTanzanite”).setCreativeTab(CreativeTabs.tabCombat);
                                        GameRegistry.registerItem(ArcTanzanite, “ArcTanzanite”);
                                        //Ore

                                        Premièrement utilise des balises java
                                        Ensuite j’ai dit le ClientProxy et la MainClass
                                        mais sa peut venir de partout allieur

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

                                          package fr.minecraftforgefrance.tutoriel.proxy;

                                          import net.minecraft.client.model.ModelBiped;
                                          import cpw.mods.fml.client.registry.RenderingRegistry;

                                          public class ClientProxy extends CommonProxy
                                          {
                                          @Override
                                          public void registerRender()
                                          {
                                          System.out.println(“méthode côté client”);
                                          }
                                          }


                                          package fr.minecraftforgefrance.tutoriel.proxy;

                                          public class CommonProxy
                                          {
                                          public void registerRender()
                                          {
                                          System.out.println(“méthode côté serveur”);
                                          }
                                          }

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

                                            Client proxy de mon mods ou de minecraft ?

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB