MFF

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

    "Arc" avec effet.

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.2
    41 Messages 5 Publieurs 10.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.
    • FlowF Hors-ligne
      Flow
      dernière édition par

      Toujours le même crash je vais te passer tous mes codes je pense que tu pourra t’y retrouver plus facilement et cibler plus facilement également le problème ! 😉

      Classe principale

      package mod.common;
      
      import net.minecraft.block.Block;
      import net.minecraft.creativetab.CreativeTabs;
      import net.minecraft.init.Blocks;
      import net.minecraft.init.Items;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import mod.proxy.CommonProxy;
      import cpw.mods.fml.common.Mod;
      import cpw.mods.fml.common.Mod.EventHandler;
      import cpw.mods.fml.common.Mod.Instance;
      import cpw.mods.fml.common.SidedProxy;
      import cpw.mods.fml.common.event.FMLInitializationEvent;
      import cpw.mods.fml.common.event.FMLPostInitializationEvent;
      import cpw.mods.fml.common.event.FMLPreInitializationEvent;
      import cpw.mods.fml.common.registry.EntityRegistry;
      import cpw.mods.fml.common.registry.GameRegistry;
      
      @Mod(modid = "modminecraft", name = "Mod Minecraft", version ="1.0")
      
      public class ModMinecraft
      {
      public static Item itemFlechette;
      public static Item itemSarbacane;
      public static Item itemSeve;
      public static Item itemSevewithmosquito;
      
      @Instance("modminecraft")
      public static ModMinecraft instance;
      public static final String MODID = "modminecraft";
      
      @SidedProxy(clientSide = "mod.proxy.ClientProxy", serverSide = "mod.proxy.CommonProxy")
      public static CommonProxy proxy;
      
      @EventHandler
      public void preInit(FMLPreInitializationEvent event)
      {
      itemFlechette = new DinoItem().setUnlocalizedName("itemFlechette").setCreativeTab(CreativeTabs.tabCombat);
      itemSarbacane = new SarbacaneItem().setUnlocalizedName("itemSarbacane").setCreativeTab(CreativeTabs.tabCombat);
      itemSeve = new SeveItem().setUnlocalizedName("itemSeve").setCreativeTab(CreativeTabs.tabMaterials);
      itemSevewithmosquito = new ItemSevewithmosquito().setUnlocalizedName("itemSevewithmosquito").setCreativeTab(CreativeTabs.tabMaterials);
      
      GameRegistry.registerItem(itemFlechette, "item_Flechette");
      GameRegistry.registerItem(itemSarbacane, "item_Sarbacane");
      GameRegistry.registerItem(itemSeve, "item_Seve");
      GameRegistry.registerItem(itemSevewithmosquito, "item_Sevewithmosquito");
      
      }
      
      @EventHandler
      public void init(FMLInitializationEvent event)
      {
      proxy.registerRender();
      
      GameRegistry.addRecipe(new ItemStack(itemFlechette, 4), new Object[]{"ZX ", "XYX", " XE", 'X', Items.stick,
      'Y', new ItemStack(Items.potionitem, 1, 16426), 'Z', Items.iron_ingot, 'E', new ItemStack(Blocks.wool, 1, 14)});
      
      GameRegistry.addRecipe(new ItemStack(itemSarbacane), new Object[]{"XZ ", "ZXZ", " ZX", 'X', Items.reeds, 'Z', Items.string});
      
      EntityRegistry.registerGlobalEntityID(EntityFlechette.class, "RenderFlechetteun", EntityRegistry.findGlobalUniqueEntityId());
      EntityRegistry.registerModEntity(EntityFlechette.class, "RenderFlechetteun", 420, this.instance, 40, 1, true);
      }
      
      @EventHandler
      public void postInit(FMLPostInitializationEvent event)
      {
      
      }
      }
      
      

      La classe de l"arc" qui est une sarbacane

      package mod.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.Entity;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.entity.projectile.EntityArrow;
      import net.minecraft.entity.projectile.EntityThrowable;
      import net.minecraft.init.Items;
      import net.minecraft.item.EnumAction;
      import net.minecraft.init.Items;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraft.potion.Potion;
      import net.minecraft.potion.PotionEffect;
      import net.minecraft.util.IIcon;
      import net.minecraft.util.MovingObjectPosition;
      import net.minecraft.world.World;
      import net.minecraftforge.common.MinecraftForge;
      import net.minecraftforge.event.entity.player.ArrowLooseEvent;
      import net.minecraftforge.event.entity.player.ArrowNockEvent;
      import cpw.mods.fml.common.Mod;
      import cpw.mods.fml.common.Mod.EventHandler;
      import cpw.mods.fml.common.Mod.Instance;
      import cpw.mods.fml.common.SidedProxy;
      import cpw.mods.fml.common.event.FMLInitializationEvent;
      import cpw.mods.fml.common.event.FMLPostInitializationEvent;
      import cpw.mods.fml.common.event.FMLPreInitializationEvent;
      import cpw.mods.fml.common.registry.GameRegistry;
      
      public class SarbacaneItem extends Item
      {
      
      @SideOnly(Side.CLIENT)
      private IIcon[] iconArray;
      private static final String __OBFID = "CL_00001777";
      
      public SarbacaneItem()
      {
      this.maxStackSize = 1;
      this.setMaxDamage(0);
      this.setCreativeTab(CreativeTabs.tabCombat);
      }
      
      /**
      * 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(ModMinecraft.itemFlechette))
      {
      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;
      }
      
      EntityFlechette entityflechette= new EntityFlechette(par2World, par3EntityPlayer, f * 2.0F);
      
      if (f == 1.0F)
      {
      entityflechette.setIsCritical(true);
      }
      
      par1ItemStack.damageItem(1, par3EntityPlayer);
      par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
      
      if (flag)
      {
      entityflechette.canBePickedUp = 2;
      }
      else
      {
      par3EntityPlayer.inventory.consumeInventoryItem(ModMinecraft.itemFlechette);
      }
      
      if (!par2World.isRemote)
      {
      par2World.spawnEntityInWorld(entityflechette);
      }
      }
      }
      
      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 72000;
      }
      
      /**
      * 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(ModMinecraft.itemFlechette))
      {
      par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
      }
      
      return par1ItemStack;
      }
      
      /**
      * Return the enchantability factor of the item, most of the time is based on material.
      */
      
      @SideOnly(Side.CLIENT)
      public void registerIcons(IIconRegister iconregister)
      {
      this.itemIcon = iconregister.registerIcon(ModMinecraft.MODID + ":itemSarbacane");
      }
      
      /**
      * used to cycle through icons based on their used duration, i.e. for the bow
      */
      @SideOnly(Side.CLIENT)
      public IIcon getItemIconForUseDuration(int par1)
      {
      return this.iconArray[par1];
      }
      
      }
      
      

      La classe de l’entity Flechette

      package mod.common;
      
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      
      import java.util.List;
      
      import net.minecraft.block.Block;
      import net.minecraft.block.material.Material;
      import net.minecraft.enchantment.EnchantmentHelper;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.entity.IProjectile;
      import net.minecraft.entity.monster.EntityEnderman;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.entity.player.EntityPlayerMP;
      import net.minecraft.entity.projectile.EntityThrowable;
      import net.minecraft.init.Items;
      import net.minecraft.item.ItemStack;
      import net.minecraft.nbt.NBTTagCompound;
      import net.minecraft.network.play.server.S2BPacketChangeGameState;
      import net.minecraft.potion.Potion;
      import net.minecraft.potion.PotionEffect;
      import net.minecraft.util.AxisAlignedBB;
      import net.minecraft.util.DamageSource;
      import net.minecraft.util.EntityDamageSourceIndirect;
      import net.minecraft.util.MathHelper;
      import net.minecraft.util.MovingObjectPosition;
      import net.minecraft.util.Vec3;
      import net.minecraft.world.World;
      import cpw.mods.fml.common.Mod;
      import cpw.mods.fml.common.Mod.EventHandler;
      import cpw.mods.fml.common.Mod.Instance;
      import cpw.mods.fml.common.SidedProxy;
      import cpw.mods.fml.common.event.FMLInitializationEvent;
      import cpw.mods.fml.common.event.FMLPostInitializationEvent;
      import cpw.mods.fml.common.event.FMLPreInitializationEvent;
      import cpw.mods.fml.common.registry.GameRegistry;
      
      public class EntityFlechette extends Entity implements IProjectile
      {
      private int field_145791_d = -1;
      private int field_145792_e = -1;
      private int field_145789_f = -1;
      private Block field_145790_g;
      private int inData;
      private boolean inGround;
      /** 1 if the player can pick up the arrow */
      public int canBePickedUp;
      /** Seems to be some sort of timer for animating an arrow. */
      public int arrowShake;
      /** The owner of this arrow. */
      public Entity shootingEntity;
      private int ticksInGround;
      private int ticksInAir;
      private double damage = 2.0D;
      /** The amount of knockback an arrow applies when it hits a mob. */
      private int knockbackStrength;
      private static final String __OBFID = "CL_00001715";
      
      public EntityFlechette(World par1World)
      {
      super(par1World);
      this.renderDistanceWeight = 10.0D;
      this.setSize(0.5F, 0.5F);
      }
      
      public EntityFlechette(World par1World, double par2, double par4, double par6)
      {
      super(par1World);
      this.renderDistanceWeight = 10.0D;
      this.setSize(0.5F, 0.5F);
      this.setPosition(par2, par4, par6);
      this.yOffset = 0.0F;
      }
      
      public EntityFlechette (World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5)
      {
      super(par1World);
      this.renderDistanceWeight = 10.0D;
      this.shootingEntity = par2EntityLivingBase;
      
      if (par2EntityLivingBase instanceof EntityPlayer)
      {
      this.canBePickedUp = 1;
      }
      
      this.posY = par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
      double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
      double d1 = par3EntityLivingBase.boundingBox.minY + (double)(par3EntityLivingBase.height / 3.0F) - this.posY;
      double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
      double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2);
      
      if (d3 >= 1.0E-7D)
      {
      float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
      float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
      double d4 = d0 / d3;
      double d5 = d2 / d3;
      this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3);
      this.yOffset = 0.0F;
      float f4 = (float)d3 * 0.2F;
      this.setThrowableHeading(d0, d1 + (double)f4, d2, par4, par5);
      }
      }
      
      public EntityFlechette(World par1World, EntityLivingBase par2EntityLivingBase, float par3)
      {
      super(par1World);
      this.renderDistanceWeight = 10.0D;
      this.shootingEntity = par2EntityLivingBase;
      
      if (par2EntityLivingBase instanceof EntityPlayer)
      {
      this.canBePickedUp = 1;
      }
      
      this.setSize(0.5F, 0.5F);
      this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch);
      this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
      this.posY -= 0.10000000149011612D;
      this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
      this.setPosition(this.posX, this.posY, this.posZ);
      this.yOffset = 0.0F;
      this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
      this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
      this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
      this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F);
      }
      
      protected void entityInit()
      {
      this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
      }
      
      /**
      * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
      */
      public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8)
      {
      float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
      par1 /= (double)f2;
      par3 /= (double)f2;
      par5 /= (double)f2;
      par1 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
      par3 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
      par5 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8;
      par1 *= (double)par7;
      par3 *= (double)par7;
      par5 *= (double)par7;
      this.motionX = par1;
      this.motionY = par3;
      this.motionZ = par5;
      float f3 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
      this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
      this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)f3) * 180.0D / Math.PI);
      this.ticksInGround = 0;
      }
      
      /**
      * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
      * posY, posZ, yaw, pitch
      */
      @SideOnly(Side.CLIENT)
      public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
      {
      this.setPosition(par1, par3, par5);
      this.setRotation(par7, par8);
      }
      
      /**
      * Sets the velocity to the args. Args: x, y, z
      */
      @SideOnly(Side.CLIENT)
      public void setVelocity(double par1, double par3, double par5)
      {
      this.motionX = par1;
      this.motionY = par3;
      this.motionZ = par5;
      
      if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
      {
      float f = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
      this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
      this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)f) * 180.0D / Math.PI);
      this.prevRotationPitch = this.rotationPitch;
      this.prevRotationYaw = this.rotationYaw;
      this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
      this.ticksInGround = 0;
      }
      }
      
      /**
      * Called to update the entity's position/logic.
      */
      public void onUpdate()
      {
      super.onUpdate();
      
      if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
      {
      float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
      this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
      this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
      }
      
      Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
      
      if (block.getMaterial() != Material.air)
      {
      block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
      AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
      
      if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ)))
      {
      this.inGround = true;
      }
      }
      
      if (this.arrowShake > 0)
      {
      –this.arrowShake;
      }
      
      if (this.inGround)
      {
      int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
      
      if (block == this.field_145790_g && j == this.inData)
      {
      ++this.ticksInGround;
      
      if (this.ticksInGround == 1200)
      {
      this.setDead();
      }
      }
      else
      {
      this.inGround = false;
      this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
      this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
      this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
      this.ticksInGround = 0;
      this.ticksInAir = 0;
      }
      }
      else
      {
      ++this.ticksInAir;
      Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
      Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
      MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
      vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
      vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
      
      if (movingobjectposition != null)
      {
      vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
      }
      
      Entity entity = null;
      List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
      double d0 = 0.0D;
      int i;
      float f1;
      
      for (i = 0; i < list.size(); ++i)
      {
      Entity entity1 = (Entity)list.get(i);
      
      if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
      {
      f1 = 0.3F;
      AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1);
      MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
      
      if (movingobjectposition1 != null)
      {
      double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
      
      if (d1 < d0 || d0 == 0.0D)
      {
      entity = entity1;
      d0 = d1;
      }
      }
      }
      }
      
      if (entity != null)
      {
      movingobjectposition = new MovingObjectPosition(entity);
      }
      
      if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
      {
      EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
      
      if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
      {
      movingobjectposition = null;
      }
      }
      
      float f2;
      float f4;
      
      if (movingobjectposition != null)
      {
      if (movingobjectposition.entityHit != null)
      {
      f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
      int k = MathHelper.ceiling_double_int((double)f2 * this.damage);
      
      if (this.getIsCritical())
      {
      k += this.rand.nextInt(k / 2 + 2);
      }
      
      if(movingobjectposition.entityHit instanceof EntityLivingBase)
      {
      ((EntityLivingBase) movingobjectposition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 99999999));
      }
      }
      else
      {
      this.field_145791_d = movingobjectposition.blockX;
      this.field_145792_e = movingobjectposition.blockY;
      this.field_145789_f = movingobjectposition.blockZ;
      this.field_145790_g = block;
      this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
      this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
      this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
      this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
      f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
      this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
      this.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
      this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
      this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
      this.inGround = true;
      this.arrowShake = 7;
      this.setIsCritical(false);
      
      if (this.field_145790_g.getMaterial() != Material.air)
      {
      this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
      }
      }
      }
      if (this.getIsCritical())
      {
      for (i = 0; i < 4; ++i)
      {
      this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ);
      }
      }
      
      this.posX += this.motionX;
      this.posY += this.motionY;
      this.posZ += this.motionZ;
      f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
      this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
      
      for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
      {
      ;
      }
      
      while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
      {
      this.prevRotationPitch += 360.0F;
      }
      
      while (this.rotationYaw - this.prevRotationYaw < -180.0F)
      {
      this.prevRotationYaw -= 360.0F;
      }
      
      while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
      {
      this.prevRotationYaw += 360.0F;
      }
      
      this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
      this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
      float f3 = 0.99F;
      f1 = 0.05F;
      
      if (this.isInWater())
      {
      for (int l = 0; l < 4; ++l)
      {
      f4 = 0.25F;
      this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ);
      }
      
      f3 = 0.8F;
      }
      
      if (this.isWet())
      {
      this.extinguish();
      }
      
      this.motionX *= (double)f3;
      this.motionY *= (double)f3;
      this.motionZ *= (double)f3;
      this.motionY -= (double)f1;
      this.setPosition(this.posX, this.posY, this.posZ);
      this.func_145775_I();
      }
      }
      
      /**
      * (abstract) Protected helper method to write subclass entity data to NBT.
      */
      public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
      {
      par1NBTTagCompound.setShort("xTile", (short)this.field_145791_d);
      par1NBTTagCompound.setShort("yTile", (short)this.field_145792_e);
      par1NBTTagCompound.setShort("zTile", (short)this.field_145789_f);
      par1NBTTagCompound.setShort("life", (short)this.ticksInGround);
      par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
      par1NBTTagCompound.setByte("inData", (byte)this.inData);
      par1NBTTagCompound.setByte("shake", (byte)this.arrowShake);
      par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
      par1NBTTagCompound.setByte("pickup", (byte)this.canBePickedUp);
      par1NBTTagCompound.setDouble("damage", this.damage);
      }
      
      /**
      * (abstract) Protected helper method to read subclass entity data from NBT.
      */
      public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
      {
      this.field_145791_d = par1NBTTagCompound.getShort("xTile");
      this.field_145792_e = par1NBTTagCompound.getShort("yTile");
      this.field_145789_f = par1NBTTagCompound.getShort("zTile");
      this.ticksInGround = par1NBTTagCompound.getShort("life");
      this.field_145790_g = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255);
      this.inData = par1NBTTagCompound.getByte("inData") & 255;
      this.arrowShake = par1NBTTagCompound.getByte("shake") & 255;
      this.inGround = par1NBTTagCompound.getByte("inGround") == 1;
      
      if (par1NBTTagCompound.hasKey("damage", 99))
      {
      this.damage = par1NBTTagCompound.getDouble("damage");
      }
      
      if (par1NBTTagCompound.hasKey("pickup", 99))
      {
      this.canBePickedUp = par1NBTTagCompound.getByte("pickup");
      }
      else if (par1NBTTagCompound.hasKey("player", 99))
      {
      this.canBePickedUp = par1NBTTagCompound.getBoolean("player") ? 1 : 0;
      }
      }
      
      /**
      * Called by a player entity when they collide with an entity
      */
      public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
      {
      if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
      {
      boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode;
      
      if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModMinecraft.itemFlechette, 1)))
      {
      flag = false;
      }
      
      if (flag)
      {
      this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
      par1EntityPlayer.onItemPickup(this, 1);
      this.setDead();
      }
      }
      }
      
      /**
      * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
      * prevent them from trampling crops
      */
      protected boolean canTriggerWalking()
      {
      return false;
      }
      
      @SideOnly(Side.CLIENT)
      public float getShadowSize()
      {
      return 0.0F;
      }
      
      public void setDamage(double par1)
      {
      this.damage = par1;
      }
      
      public double getDamage()
      {
      return this.damage;
      }
      
      /**
      * Whether the arrow has a stream of critical hit particles flying behind it.
      */
      public void setIsCritical(boolean par1)
      {
      byte b0 = this.dataWatcher.getWatchableObjectByte(16);
      
      if (par1)
      {
      this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
      }
      else
      {
      this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
      }
      }
      
      /**
      * Whether the arrow has a stream of critical hit particles flying behind it.
      */
      public boolean getIsCritical()
      {
      byte b0 = this.dataWatcher.getWatchableObjectByte(16);
      return (b0 & 1) != 0;
      }
      
      public class EntitySlowingArrow extends EntityThrowable
      {
      public EntitySlowingArrow(World world)
      {
      super(world);
      }
      
      protected void onImpact(MovingObjectPosition mop)
      {
      Entity e = mop.entityHit;
      if (e != null && e instanceof EntityLivingBase)
      {
      ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 67, 1200));
      }
      }
      }
      
      }
      
      

      Le render de la flechette

      package mod.common;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      import net.minecraft.client.renderer.Tessellator;
      import net.minecraft.client.renderer.entity.Render;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.projectile.EntityArrow;
      import net.minecraft.util.MathHelper;
      import net.minecraft.util.ResourceLocation;
      
      import org.lwjgl.opengl.GL11;
      import org.lwjgl.opengl.GL12;
      
      @SideOnly(Side.CLIENT)
      
      public class RenderFlechette extends Render
      
      {
      
      public final ResourceLocation FlechetteTextures = new ResourceLocation(ModMinecraft.MODID, "textures/entity/itemFlechette.png");
      
      protected ResourceLocation getEntityTexture(EntityFlechette par1EntityFlechette)
      {
      return this.FlechetteTextures ;
      }
      /**
      * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
      */
      private ResourceLocation getEntityFlechettesTexture(EntityFlechette RenderFlechetteun)
      {
      return FlechetteTextures;
      }
      
      /**
      * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
      * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
      * (Render <t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br="">* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
      */
      public void doRender(EntityFlechette par1EntityFlechette, double par2, double par4, double par6, float par8, float par9)
      {
      this.bindEntityTexture(par1EntityFlechette);
      GL11.glPushMatrix();
      GL11.glTranslatef((float)par2, (float)par4, (float)par6);
      GL11.glRotatef(par1EntityFlechette.prevRotationYaw + (par1EntityFlechette.rotationYaw - par1EntityFlechette.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(par1EntityFlechette.prevRotationPitch + (par1EntityFlechette.rotationPitch - par1EntityFlechette.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
      Tessellator tessellator = Tessellator.instance;
      byte b0 = 0;
      float f2 = 0.0F;
      float f3 = 0.5F;
      float f4 = (float)(0 + b0 * 10) / 32.0F;
      float f5 = (float)(5 + b0 * 10) / 32.0F;
      float f6 = 0.0F;
      float f7 = 0.15625F;
      float f8 = (float)(5 + b0 * 10) / 32.0F;
      float f9 = (float)(10 + b0 * 10) / 32.0F;
      float f10 = 0.05625F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      
      GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
      GL11.glScalef(f10, f10, f10);
      GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
      GL11.glNormal3f(f10, 0.0F, 0.0F);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
      tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
      tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
      tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
      tessellator.draw();
      GL11.glNormal3f(-f10, 0.0F, 0.0F);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
      tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
      tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
      tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
      tessellator.draw();
      
      for (int i = 0; i < 4; ++i)
      {
      GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
      GL11.glNormal3f(0.0F, 0.0F, f10);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
      tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
      tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
      tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
      tessellator.draw();
      }
      
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      GL11.glPopMatrix();
      }
      
      /**
      * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
      */
      
      /**
      * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
      * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
      * (Render <t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br="">* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
      */
      public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
      {
      this.doRender((EntityFlechette)par1Entity, par2, par4, par6, par8, par9);
      }
      @Override
      protected ResourceLocation getEntityTexture(Entity var1)
      {
      // TODO Auto-generated method stub
      return null;
      }
      
      }
      
      

      Le client proxy ```
      package mod.proxy;

      import mod.common.EntityFlechette;
      import mod.common.RenderFlechette;
      import cpw.mods.fml.client.registry.RenderingRegistry;

      public class ClientProxy extends CommonProxy
      {

      @Override
      public void registerRender()
      {
      System.out.println(“render”);

      RenderingRegistry.registerEntityRenderingHandler(EntityFlechette.class, new RenderFlechette());
      }

      }

      Oui ce gif est drôle.

      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

        Renvoie quand même le crash actuelle, car tu as bougé certains trucs dans le code.

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

          Le voici le voila 🙂

          –-- Minecraft Crash Report ----
          // Shall we play a game?
          
          Time: 13/07/14 23:02
          Description: Registering texture
          
          java.lang.NullPointerException: Registering texture
          at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63)
          at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35)
          at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)
          at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45)
          at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:62)
          at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:57)
          at mod.common.RenderFlechette.doRender(RenderFlechette.java:44)
          at mod.common.RenderFlechette.doRender(RenderFlechette.java:110)
          at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300)
          at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278)
          at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251)
          at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:532)
          at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1298)
          at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1095)
          at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1024)
          at net.minecraft.client.Minecraft.run(Minecraft.java:912)
          at net.minecraft.client.main.Main.main(Main.java:112)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
          at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
          
          A detailed walkthrough of the error, its code path and all known details is as follows:
          ---------------------------------------------------------------------------------------
          
          -- Head --
          Stacktrace:
          at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63)
          at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35)
          
          -- Resource location being registered --
          Details:
          Resource location: ~~NULL~~
          Texture object class: net.minecraft.client.renderer.texture.SimpleTexture
          Stacktrace:
          at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)
          at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45)
          at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:62)
          at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:57)
          at mod.common.RenderFlechette.doRender(RenderFlechette.java:44)
          at mod.common.RenderFlechette.doRender(RenderFlechette.java:110)
          
          -- Entity being rendered --
          Details:
          Entity Type: RenderFlechetteun (mod.common.EntityFlechette)
          Entity ID: 246
          Entity Name: entity.RenderFlechetteun.name
          Entity's Exact location: 417,98, 70,05, -11,59
          Entity's Block location: World: (417,70,-12), Chunk: (at 1,4,4 in 26,-1; contains blocks 416,0,-16 to 431,255,-1), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
          Entity's Momentum: 0,00, -0,09, 0,00
          
          -- Renderer details --
          Details:
          Assigned renderer: mod.common.RenderFlechette@27c9500c
          Location: 4,25,-1,57,8,45 - World: (4,-2,8), Chunk: (at 4,-1,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
          Rotation: 42.006824
          Delta: 0.77625656
          Stacktrace:
          at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300)
          at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278)
          at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251)
          at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:532)
          at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1298)
          
          -- Affected level --
          Details:
          Level name: MpServer
          All players: 1 total; [EntityClientPlayerMP['Player468'/348, l='MpServer', x=413,73, y=71,62, z=-20,04]]
          Chunk stats: MultiplayerChunkCache: 70, 70
          Level seed: 0
          Level generator: ID 00 - default, ver 1\. Features enabled: false
          Level generator options:
          Level spawn location: World: (409,64,-37), Chunk: (at 9,4,11 in 25,-3; contains blocks 400,0,-48 to 415,255,-33), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
          Level time: 316 game time, 316 day time
          Level dimension: 0
          Level storage version: 0x00000 - Unknown?
          Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
          Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
          Forced entities: 94 total; [EntityBat['Bat'/259, l='MpServer', x=433,08, y=27,83, z=-50,02], EntityHorse['Horse'/260, l='MpServer', x=436,28, y=72,00, z=-55,56], EntityHorse['Horse'/261, l='MpServer', x=438,50, y=71,00, z=-54,25], EntityBat['Bat'/133, l='MpServer', x=383,88, y=13,89, z=-73,24], EntitySquid['Squid'/134, l='MpServer', x=383,94, y=55,00, z=-53,56], EntityHorse['Horse'/262, l='MpServer', x=438,00, y=72,00, z=-51,13], EntitySquid['Squid'/135, l='MpServer', x=379,16, y=61,34, z=-54,31], EntityHorse['Horse'/263, l='MpServer', x=434,34, y=72,00, z=-53,72], EntitySquid['Squid'/136, l='MpServer', x=379,66, y=55,84, z=-53,63], EntityHorse['Horse'/264, l='MpServer', x=436,88, y=72,00, z=-53,34], EntityBat['Bat'/265, l='MpServer', x=437,50, y=26,92, z=-29,52], EntitySquid['Squid'/137, l='MpServer', x=369,14, y=58,78, z=-56,90], EntityItem['item.item.seeds'/266, l='MpServer', x=434,09, y=71,13, z=-31,94], EntitySquid['Squid'/138, l='MpServer', x=368,47, y=58,31, z=-46,97], EntitySquid['Squid'/139, l='MpServer', x=369,22, y=59,97, z=-39,19], EntityZombie['Zombie'/267, l='MpServer', x=445,78, y=21,00, z=32,09], EntitySquid['Squid'/140, l='MpServer', x=372,44, y=62,41, z=-46,71], EntitySquid['Squid'/141, l='MpServer', x=368,78, y=61,31, z=-39,31], EntitySquid['Squid'/142, l='MpServer', x=370,81, y=61,38, z=-26,50], EntityBat['Bat'/143, l='MpServer', x=382,00, y=22,00, z=15,75], EntityCreeper['Creeper'/144, l='MpServer', x=383,50, y=28,00, z=31,50], EntitySpider['Spider'/273, l='MpServer', x=448,63, y=20,00, z=29,22], EntitySkeleton['Skeleton'/145, l='MpServer', x=382,50, y=25,00, z=17,50], EntityCreeper['Creeper'/146, l='MpServer', x=373,44, y=38,00, z=19,00], EntityCreeper['Creeper'/278, l='MpServer', x=471,66, y=15,00, z=-5,34], EntityZombie['Zombie'/279, l='MpServer', x=472,59, y=15,00, z=-5,53], EntityCreeper['Creeper'/280, l='MpServer', x=476,50, y=17,00, z=-4,50], EntityCreeper['Creeper'/281, l='MpServer', x=479,53, y=17,00, z=-2,47], EntityCreeper['Creeper'/282, l='MpServer', x=473,50, y=22,00, z=32,50], EntitySpider['Spider'/162, l='MpServer', x=394,91, y=26,00, z=-51,56], EntitySkeleton['Skeleton'/163, l='MpServer', x=397,63, y=18,00, z=-58,09], EntitySquid['Squid'/164, l='MpServer', x=386,38, y=61,19, z=-52,78], EntityZombie['Zombie'/165, l='MpServer', x=386,50, y=14,00, z=-33,50], EntityItem['item.tile.mushroom'/166, l='MpServer', x=389,88, y=16,13, z=-4,88], EntitySkeleton['Skeleton'/167, l='MpServer', x=390,70, y=16,24, z=-2,70], EntityBat['Bat'/168, l='MpServer', x=392,56, y=31,25, z=-13,38], EntityZombie['Zombie'/169, l='MpServer', x=386,50, y=17,00, z=-1,50], EntitySkeleton['Skeleton'/170, l='MpServer', x=395,50, y=41,00, z=-6,50], EntitySkeleton['Skeleton'/171, l='MpServer', x=389,94, y=20,00, z=26,50], EntityEnderman['Enderman'/172, l='MpServer', x=392,06, y=35,00, z=40,44], EntitySkeleton['Skeleton'/173, l='MpServer', x=400,00, y=32,00, z=36,66], EntitySpider['Spider'/174, l='MpServer', x=389,28, y=35,00, z=36,44], EntityBat['Bat'/175, l='MpServer', x=400,05, y=34,58, z=33,62], EntitySquid['Squid'/190, l='MpServer', x=411,34, y=45,81, z=-79,24], EntitySquid['Squid'/191, l='MpServer', x=410,44, y=45,84, z=-77,25], EntitySquid['Squid'/192, l='MpServer', x=404,09, y=46,38, z=-77,91], EntityCreeper['Creeper'/193, l='MpServer', x=414,50, y=30,00, z=-55,50], EntityZombie['Zombie'/194, l='MpServer', x=402,67, y=14,36, z=-18,92], EntityCreeper['Creeper'/195, l='MpServer', x=411,69, y=15,00, z=-16,31], EntityCreeper['Creeper'/196, l='MpServer', x=413,63, y=28,00, z=-16,25], EntitySkeleton['Skeleton'/197, l='MpServer', x=415,50, y=42,00, z=-16,50], EntityBat['Bat'/198, l='MpServer', x=409,49, y=35,89, z=-20,21], EntitySkeleton['Skeleton'/199, l='MpServer', x=411,50, y=14,00, z=30,50], EntityBat['Bat'/200, l='MpServer', x=414,83, y=14,89, z=18,95], EntityCreeper['Creeper'/201, l='MpServer', x=405,50, y=22,00, z=23,50], EntitySquid['Squid'/73, l='MpServer', x=364,19, y=61,00, z=-53,53], EntityCreeper['Creeper'/202, l='MpServer', x=407,13, y=22,00, z=26,44], EntitySquid['Squid'/74, l='MpServer', x=366,61, y=58,04, z=-58,69], EntityBat['Bat'/203, l='MpServer', x=414,46, y=15,60, z=22,70], EntitySquid['Squid'/75, l='MpServer', x=363,38, y=62,34, z=-49,50], EntitySquid['Squid'/76, l='MpServer', x=365,31, y=61,28, z=-54,47], EntitySkeleton['Skeleton'/204, l='MpServer', x=411,50, y=11,55, z=41,31], EntitySquid['Squid'/77, l='MpServer', x=366,41, y=60,02, z=-53,41], EntityCreeper['Creeper'/205, l='MpServer', x=414,97, y=14,00, z=46,34], EntitySquid['Squid'/78, l='MpServer', x=368,46, y=59,82, z=-46,27], EntityEnderman['Enderman'/206, l='MpServer', x=403,50, y=26,00, z=46,34], EntitySquid['Squid'/79, l='MpServer', x=355,00, y=59,95, z=-29,47], EntityEnderman['Enderman'/207, l='MpServer', x=410,11, y=25,00, z=44,76], EntitySquid['Squid'/80, l='MpServer', x=355,62, y=59,74, z=-22,09], EntityCreeper['Creeper'/208, l='MpServer', x=404,38, y=28,00, z=35,00], EntitySquid['Squid'/81, l='MpServer', x=364,98, y=61,24, z=-20,39], EntityBat['Bat'/209, l='MpServer', x=405,06, y=27,14, z=40,44], EntitySquid['Squid'/82, l='MpServer', x=352,25, y=58,38, z=-23,94], EntitySquid['Squid'/83, l='MpServer', x=359,90, y=60,30, z=-30,55], EntitySquid['Squid'/84, l='MpServer', x=362,94, y=61,25, z=-31,72], EntityClientPlayerMP['Player468'/348, l='MpServer', x=413,73, y=71,62, z=-20,04], EntityHorse['Horse'/233, l='MpServer', x=419,97, y=70,00, z=-67,35], EntityHorse['Horse'/234, l='MpServer', x=426,59, y=71,00, z=-65,84], EntityZombie['Zombie'/235, l='MpServer', x=431,56, y=26,00, z=-49,74], EntityHorse['Horse'/236, l='MpServer', x=424,78, y=71,00, z=-63,22], EntityHorse['Horse'/237, l='MpServer', x=424,78, y=72,00, z=-60,22], EntityHorse['Horse'/238, l='MpServer', x=430,78, y=72,00, z=-49,22], EntityHorse['Horse'/239, l='MpServer', x=423,03, y=71,00, z=-62,75], EntityHorse['Horse'/240, l='MpServer', x=426,28, y=71,00, z=-62,75], EntitySpider['Spider'/241, l='MpServer', x=424,59, y=20,00, z=-34,19], EntitySkeleton['Skeleton'/242, l='MpServer', x=421,88, y=21,00, z=-35,50], EntityEnderman['Enderman'/243, l='MpServer', x=420,50, y=42,00, z=-33,50], EntityBat['Bat'/244, l='MpServer', x=415,44, y=17,76, z=-20,88], EntityFlechette['entity.RenderFlechetteun.name'/245, l='MpServer', x=419,53, y=71,00, z=-10,81], EntityFlechette['entity.RenderFlechetteun.name'/246, l='MpServer', x=417,98, y=70,05, z=-11,59], EntityCreeper['Creeper'/247, l='MpServer', x=417,63, y=20,00, z=27,84], EntityCreeper['Creeper'/248, l='MpServer', x=417,38, y=20,00, z=28,69], EntitySkeleton['Skeleton'/249, l='MpServer', x=421,22, y=21,00, z=24,50], EntityCreeper['Creeper'/250, l='MpServer', x=416,69, y=13,00, z=45,66]]
          Retry entities: 0 total; []
          Server brand: fml,forge
          Server type: Integrated singleplayer server
          Stacktrace:
          at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412)
          at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523)
          at net.minecraft.client.Minecraft.run(Minecraft.java:934)
          at net.minecraft.client.main.Main.main(Main.java:112)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
          at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
          
          – System Details --
          Details:
          Minecraft Version: 1.7.2
          Operating System: Windows 8.1 (amd64) version 6.3
          Java Version: 1.8.0_05, Oracle Corporation
          Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
          Memory: 825580592 bytes (787 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
          JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
          AABB Pool Size: 17891 (1001896 bytes; 0 MB) allocated, 3629 (203224 bytes; 0 MB) used
          IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
          FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active
          mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
          FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
          Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
          modminecraft{1.0} [Mod Minecraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
          Launched Version: 1.6
          LWJGL: 2.9.0
          OpenGL: GeForce GTX 650/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation
          Is Modded: Definitely; Client brand changed to 'fml,forge'
          Type: Client (map_client.txt)
          Resource Packs: []
          Current Language: ~~ERROR~~ NullPointerException: null
          Profiler Position: N/A (disabled)
          Vec3 Pool Size: 22530 (1261680 bytes; 1 MB) allocated, 7629 (427224 bytes; 0 MB) used
          Anisotropic Filtering: Off (1)
          

          Oui ce gif est drôle.

          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

            at mod.common.RenderFlechette.doRender(RenderFlechette.java:44)
            Tu peux envoyer la ligne 44 dans la classe RenderFlechette ?

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

              this.bindEntityTexture(par1EntityFlechette);

              Mais je viens de découvrir quelque chose vois tu ^^ Je viens de créer un nouveau mob avec model etc mais mtn quand je tire avec ma sarbacane c’est mon nouveau mob qui sort Oo Donc est-ce qu’il faut un model pour la flèche ? Aussi ma textures de mon mob que j’ai créer ne se load pas alors que j’ai bien mis sa

              @Override
              protected ResourceLocation getEntityTexture(Entity var1) {
              return new ResourceLocation(ModMinecraft.MODID + “textures/entity/frog.png”);
              }

              je pense que j’ai du oublier quelque chose pour ce qui est de mes flèches 😕

              Oui ce gif est drôle.

              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

                Heu tu peux réexpliqué ça car j’ai pas tout suivis x)
                Ça ne crash plus maintenant mais il y a le mauvais rendu si c’est j’ai bien compris ?

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

                  Tout à fait donc pendant que tu essayais de régler le soucis moi de mon coter j’ai créer un nouveau mob , je l’ai register dans le proxy et dans ma classe principale et maintenant quand j’utilise ma sarbacane c’est le mob que je viens de créer qui sort alors que dans ma classes entityFlechette il est bien mis d’utiliser itemFlechette dans le dossier entity donc je ne comprend pas x-)


                  Halalalalalalala j’apporte de bonne nouvelle j’ai changer dans mon RenderFlechette

                  public class RenderFlechette extends Render
                  
                  {
                  
                  public final ResourceLocation FlechetteTextures = new ResourceLocation(ModMinecraft.MODID, "textures/entity/itemFlechette.png");
                  
                  protected ResourceLocation getEntityTexture(EntityFlechette par1EntityFlechette)
                  {
                  return this.FlechetteTextures ;
                  }
                  /**
                  * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
                  */
                  private ResourceLocation getEntityFlechettesTexture(EntityFlechette RenderFlechetteun)
                  {
                  return FlechetteTextures;
                  }
                  
                  ``` en ceci
                  
                  

                  public class RenderFlechette extends RenderLiving
                  {
                  public RenderFlechette(ModelBase par1ModelBase, float par2) {
                  super(par1ModelBase, par2);
                  }

                  @Override
                  protected ResourceLocation getEntityTexture(Entity var1) {
                  return new ResourceLocation(ModMinecraft.MODID, “textures/entity/itemFlechette.png”);
                  }

                  
                  Et la texture est maintenant loader et la flèche est tirré !! Oh mon dieu , on y est ;)
                  
                  Pour la texture qui ne se loadais pas dans mon RenderFrog j'ai changer en ceci :
                  
                  

                  public class RenderFrog extends RenderLiving
                  {
                  public RenderFrog(ModelBase par1ModelBase, float par2) {
                  super(par1ModelBase, par2);
                  }

                  @Override
                  protected ResourceLocation getEntityTexture(Entity var1) {
                  return new ResourceLocation(ModMinecraft.MODID, “textures/entity/frog.png”);
                  }
                  }

                  
                  Désolé je suis super content et ai je le droit de citer les pseudos "AlphaSwittleTeam" & "robin4002" dans mon mod info ?

                  Oui ce gif est drôle.

                  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

                    Si tu veux oui.
                    Mets aussi la balise résolu !

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

                      Il me reste quand même le problème du cadre slowness qui apparaît dans l’inventaire alors qu’il ne devrait pas et je n’arrive pas a changer la durée.

                      Oui ce gif est drôle.

                      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

                        Étrange pour le temps, normalement la durée est en tick.
                        Pour le cadre qui apparait dans l’inventaire, remplace
                        if(movingobjectposition.entityHit instanceof EntityLivingBase)
                        par :
                        if(movingobjectposition.entityHit instanceof EntityLivingBase && !this.worldObj.isRemote)

                        Et enlève la fonction :

                        protected void onImpact(MovingObjectPosition mop)
                        {
                        Entity e = mop.entityHit;
                        if (e != null && e instanceof EntityLivingBase)
                        {
                        ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 67, 1200));
                        }
                        }
                        
                        1 réponse Dernière réponse Répondre Citer 0
                        • FlowF Hors-ligne
                          Flow
                          dernière édition par

                          Ca marche le cadre slowness est enlevé et maintenant la durée change en fonction de ce que je met merci !! Je met en résolu 😛

                          Oui ce gif est drôle.

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

                          MINECRAFT FORGE FRANCE © 2024

                          Powered by NodeBB