MFF

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

    Immobiliser un mob et quelques autres demandes.

    Planifier Épinglé Verrouillé Déplacé Résolu Anciennes versions
    1.6.4
    38 Messages 4 Publieurs 11.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.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      LivingHurtEvent pour ça. (ou alors la fonction onEntityHurt dans ton mob, il me semble que ça existe aussi).

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

        je cherchais onEntityHurt justement, me semblait l’avoir vu mais j’ai pas trouvé en fouillant dans entity et EntityLiving… Donc j’ai préféré m’assurer savoir si j’étais aveugle ou si elle existe pas x)

        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


          Ça te va ça ?
          Avec ce tutoriel de Kévin : http://www.minecraftforgefrance.fr/showthread.php?tid=130

          Mon IItemRenderer :

          package tutoriel.client;
          
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.renderer.ItemRenderer;
          import net.minecraft.client.renderer.Tessellator;
          import net.minecraft.client.renderer.texture.TextureManager;
          import net.minecraft.entity.EntityLivingBase;
          import net.minecraft.item.ItemStack;
          import net.minecraft.util.Icon;
          import net.minecraft.util.ResourceLocation;
          import net.minecraftforge.client.IItemRenderer;
          import net.minecraftforge.client.IItemRenderer.ItemRenderType;
          
          import org.lwjgl.opengl.GL11;
          import org.lwjgl.opengl.GL12;
          
          import cpw.mods.fml.client.FMLClientHandler;
          
          public class ItemTutorielRender implements IItemRenderer
          {
          private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png");
          
          @Override
          public boolean handleRenderType(ItemStack item, ItemRenderType type)
          {
          switch(type)
          {
          case EQUIPPED:
          return true;
          default:
          return false;
          }
          }
          
          @Override
          public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
          {
          return false;
          }
          
          @Override
          public void renderItem(ItemRenderType type, ItemStack item, Object… data)
          {
          switch(type)
          {
          case EQUIPPED:
          {
          EntityLivingBase living = (EntityLivingBase)data[1];
          int renderPass = item.getItem().requiresMultipleRenderPasses() ? 1 : 0;
          
          GL11.glPushMatrix();
          GL11.glScalef(2F, 2F, 2F);
          GL11.glTranslatef(0.3F, 0.2F, 0F);
          
          GL11.glRotatef(-35.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(30.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F);
          this.renderItem(living, item, renderPass);
          GL11.glPopMatrix();
          break;
          }
          default:
          break;
          }
          
          }
          
          public void renderItem(EntityLivingBase living, ItemStack stack, int pass)
          {
          TextureManager texturemanager = FMLClientHandler.instance().getClient().getTextureManager();
          GL11.glPushMatrix();
          Icon icon = living.getItemIcon(stack, pass);
          if(icon == null)
          {
          GL11.glPopMatrix();
          return;
          }
          texturemanager.bindTexture(texturemanager.getResourceLocation(stack.getItemSpriteNumber()));
          Tessellator tessellator = Tessellator.instance;
          float f = icon.getMinU();
          float f1 = icon.getMaxU();
          float f2 = icon.getMinV();
          float f3 = icon.getMaxV();
          float f4 = 0.0F;
          float f5 = 0.3F;
          GL11.glEnable(GL12.GL_RESCALE_NORMAL);
          GL11.glTranslatef(-f4, -f5, 0.0F);
          float f6 = 1.5F;
          GL11.glScalef(f6, f6, f6);
          GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
          GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
          ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
          
          if(stack.hasEffect(pass))
          {
          GL11.glDepthFunc(GL11.GL_EQUAL);
          GL11.glDisable(GL11.GL_LIGHTING);
          texturemanager.bindTexture(RES_ITEM_GLINT);
          GL11.glEnable(GL11.GL_BLEND);
          GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
          float f7 = 0.76F;
          GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
          GL11.glMatrixMode(GL11.GL_TEXTURE);
          GL11.glPushMatrix();
          float f8 = 0.125F;
          GL11.glScalef(f8, f8, f8);
          float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
          GL11.glTranslatef(f9, 0.0F, 0.0F);
          GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
          ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
          GL11.glPopMatrix();
          GL11.glPushMatrix();
          GL11.glScalef(f8, f8, f8);
          f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
          GL11.glTranslatef(-f9, 0.0F, 0.0F);
          GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
          ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
          GL11.glPopMatrix();
          GL11.glMatrixMode(GL11.GL_MODELVIEW);
          GL11.glDisable(GL11.GL_BLEND);
          GL11.glEnable(GL11.GL_LIGHTING);
          GL11.glDepthFunc(GL11.GL_LEQUAL);
          }
          
          GL11.glDisable(GL12.GL_RESCALE_NORMAL);
          GL11.glPopMatrix();
          }
          }
          

          Après il faut jouer sur le translate, rotate et le scale

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

            Et bien, je vais regarder ça cette nuit, je te redirai demain ou dans la nuit afin de savoir si j’ai réussis, mais bon normalement oui 😉

            Au passage, j’ai réussis pour mon VI)
            Mais je n’ai pas trouvé la fonction qui gérer le hit directement dans entity, enfin bon je l’ai fais avec un event et cela va tout aussi bien 🙂

            Je vais au passage envoyer un mp à celui qui cherchait la solution, savoir si il l’a trouvé sinon je l’enverrai vers cette page, si il ne l’a pas déja remarqué 🙂

            Edit: Je me disais bien que j’avais pas finis mon message, honte à moi:

            Merci beaucoup du temps que tu as pris pour rechercher cela et pour me répondre tout au long de ce post robin, par l’aide que tu nous apporte à travers ce forum, certe tu ne sauves pas le monde, mais tu évites bien des tortures cérébrales à des débutants tels que moi :3

            Thanks you very much 😄

            Bien sur merci aux autres membres permettant l’entraide sur ce forum, mais bon, on ne peut nier que robin est l’un des plus actifs à l’heure actuelle ( je ne sais point si cela à toujours était le cas :3)

            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

              @‘totos51’:

              certe tu ne sauves pas le monde

              Pas encore, pas encore 😛
              De rien !

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

                Après avoir fait quelques trucs, quelques ajouts, et autres, j’ai quelques petits soucis:
                Quand je fais spawn mon boss, je ne peux pas le taper, je dois quitter et relancer pour pouvoir le tuer…
                la fonction est la suivante:

                
                public void updateEntity()
                {
                Compteur++;
                if (Compteur == 10)
                {
                CompteurParMillier++;
                Compteur = 0;
                }
                if (CompteurParMillier == 20)
                {
                CompteurParMillier = 0;
                System.out.println("Mommy Creepy Respawn!");
                new MommyDungeon(this.worldObj, rand, this.xCoord, this.yCoord, this.zCoord);
                spawnMommyCreepy(this.worldObj, (double)(this.xCoord + 23), (double)(this.yCoord + 1), (double)(this.zCoord + 24));
                }
                }
                
                public void spawnMommyCreepy(World world, double posX, double posY, double posZ)
                {
                Entity creepy = new EntityMommyCreepy(world);
                creepy.setPosition(posX, posY, posZ);
                world.spawnEntityInWorld(creepy);
                }
                
                

                Au passage, est ce la bonne méthode pour faire spawn un mob et un donjon toutes les 1020 tick (en réalité c’est 1000864)
                De plus, depuis que j’ai fais mon zombie, j’ai un bug et je ne sais comment le régler ni dou il vient, mon zombie est un simple model bipd avec une texture de zombie différente…
                Voici son render et le message d’erreur:

                Edit: Rectification! après tets il semblerait que cela vienne de mon araignée, je paste son render, à la place de celui du zombie:

                
                package Gallad.Mineald;
                
                import net.minecraft.client.model.ModelSpider;
                import net.minecraft.client.renderer.OpenGlHelper;
                import net.minecraft.client.renderer.entity.RenderLiving;
                import net.minecraft.client.renderer.entity.RenderSpider;
                import net.minecraft.entity.Entity;
                import net.minecraft.entity.EntityLivingBase;
                import net.minecraft.entity.boss.BossStatus;
                import net.minecraft.entity.monster.EntitySpider;
                import net.minecraft.util.ResourceLocation;
                
                import org.lwjgl.opengl.GL11;
                
                public class RenderLittleSpider extends RenderLiving
                {
                private static final ResourceLocation LittleSpiderTextures = new ResourceLocation("mineald:textures/entity/LittleSpider.png");
                private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png");
                
                public RenderLittleSpider()
                {
                super(new ModelSpider(), 1.0F);
                this.shadowSize *= 0.25F;
                }
                
                protected void scaleSpider(EntityLittleSpider par1EntityLittleSpider, float par2)
                {
                GL11.glScalef(0.25F, 0.25F, 0.25F);
                }
                
                protected ResourceLocation getLittleSpiderTextures(EntityLittleSpider par1EntityLittleSpider)
                {
                return LittleSpiderTextures;
                }
                
                protected ResourceLocation getSpiderTextures(EntityLittleSpider par1EntitySpider)
                {
                return this.getLittleSpiderTextures((EntityLittleSpider)par1EntitySpider);
                }
                
                /**
                * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
                * entityLiving, partialTickTime
                */
                protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
                {
                this.scaleSpider((EntityLittleSpider)par1EntityLivingBase, par2);
                }
                
                /**
                * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
                */
                protected ResourceLocation getEntityTexture(Entity par1Entity)
                {
                return this.getLittleSpiderTextures((EntityLittleSpider)par1Entity);
                }
                
                protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3)
                {
                return this.setSpiderEyeBrightness((EntityLittleSpider)par1EntityLivingBase, par2, par3);
                }
                
                protected int setSpiderEyeBrightness(EntityLittleSpider par1EntityGiantSpider, int par2, float par3)
                {
                if (par2 != 0)
                {
                return -1;
                }
                else
                {
                this.bindTexture(spiderEyesTextures);
                float f1 = 1.0F;
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glDisable(GL11.GL_ALPHA_TEST);
                GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
                
                if (par1EntityGiantSpider.isInvisible())
                {
                GL11.glDepthMask(false);
                }
                else
                {
                GL11.glDepthMask(true);
                }
                
                char c0 = 61680;
                int j = c0 % 65536;
                int k = c0 / 65536;
                OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
                return 1;
                }
                }
                }
                
                
                
                java.lang.NullPointerException
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RendererLivingEntity.doRenderLiving(RendererLivingEntity.java:168)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderLiving.doRenderLiving(RenderLiving.java:28)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:142)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:312)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:281)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:524)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:838)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.client.main.Main.main(Main.java:93)
                2014-02-21 11:28:00 [Infos] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                2014-02-21 11:28:00 [Infos] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                2014-02-21 11:28:00 [Infos] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                2014-02-21 11:28:00 [Infos] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
                2014-02-21 11:28:00 [Infos] [STDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
                
                

                Ce qui me trouble, c’est l’absence d’évocation d’un de mes fichiers…
                En fait j’ai l’impression que cela ne vient pas de mon zombie… j’ai essayé de voir ce que j’ai rajouté d’autres qui pourrait en être la cause mais je ne vois pas…

                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

                  C’est un problème du côté de ton client proxy.

                  Pour le tile entity, je sais pas, à mon avis il serait mieux de faire un constructeur avec les coordonnées plutôt qu’utiliser setPosition(x, y, z)

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

                    Et bien je résume entiérement le problèpme car je ne vois pas d’où cela vient…

                    Quand je regarde une entité que j’ai faite, plus précisément mes 2 araignées, j’ai sans cesse plein de message d’erreur, alors que avec mon zombie ou ma man creeper non, je pense donc que ça vient du rendu car rien d’autre ne diffère, voici donc leur rendus et mon client proxy:

                    #RenderLittleSpider.java(RenderLittleSpider.java)

                    
                    package Gallad.Mineald;
                    
                    import net.minecraft.client.model.ModelSpider;
                    import net.minecraft.client.renderer.OpenGlHelper;
                    import net.minecraft.client.renderer.entity.RenderLiving;
                    import net.minecraft.client.renderer.entity.RenderSpider;
                    import net.minecraft.entity.Entity;
                    import net.minecraft.entity.EntityLivingBase;
                    import net.minecraft.entity.boss.BossStatus;
                    import net.minecraft.entity.monster.EntitySpider;
                    import net.minecraft.util.ResourceLocation;
                    
                    import org.lwjgl.opengl.GL11;
                    
                    public class RenderLittleSpider extends RenderLiving
                    {
                    private static final ResourceLocation LittleSpiderTextures = new ResourceLocation("mineald:textures/entity/LittleSpider.png");
                    private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png");
                    
                    public RenderLittleSpider()
                    {
                    super(new ModelSpider(), 1.0F);
                    this.shadowSize *= 0.25F;
                    }
                    
                    protected void scaleSpider(EntityLittleSpider par1EntityLittleSpider, float par2)
                    {
                    GL11.glScalef(0.25F, 0.25F, 0.25F);
                    }
                    
                    protected ResourceLocation getLittleSpiderTextures(EntityLittleSpider par1EntityLittleSpider)
                    {
                    return LittleSpiderTextures;
                    }
                    
                    /**
                    * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
                    * entityLiving, partialTickTime
                    */
                    protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
                    {
                    this.scaleSpider((EntityLittleSpider)par1EntityLivingBase, par2);
                    }
                    
                    /**
                    * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
                    */
                    protected ResourceLocation getEntityTexture(Entity par1Entity)
                    {
                    return this.getLittleSpiderTextures((EntityLittleSpider)par1Entity);
                    }
                    
                    protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3)
                    {
                    return this.setSpiderEyeBrightness((EntityLittleSpider)par1EntityLivingBase, par2, par3);
                    }
                    
                    protected int setSpiderEyeBrightness(EntityLittleSpider par1EntityGiantSpider, int par2, float par3)
                    {
                    if (par2 != 0)
                    {
                    return -1;
                    }
                    else
                    {
                    this.bindTexture(spiderEyesTextures);
                    float f1 = 1.0F;
                    GL11.glEnable(GL11.GL_BLEND);
                    GL11.glDisable(GL11.GL_ALPHA_TEST);
                    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
                    
                    if (par1EntityGiantSpider.isInvisible())
                    {
                    GL11.glDepthMask(false);
                    }
                    else
                    {
                    GL11.glDepthMask(true);
                    }
                    
                    char c0 = 61680;
                    int j = c0 % 65536;
                    int k = c0 / 65536;
                    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
                    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                    GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
                    return 1;
                    }
                    }
                    }
                    
                    

                    #ClientProxy.java(ClientProxy.java)

                    
                    package Gallad.Mineald.client;
                    
                    import net.minecraft.client.renderer.entity.RenderCreeper;
                    import net.minecraftforge.client.IItemRenderer;
                    import net.minecraftforge.client.MinecraftForgeClient;
                    import Gallad.Mineald.EntityBlueZombie;
                    import Gallad.Mineald.EntityGiantSpider;
                    import Gallad.Mineald.EntityGolemZombie;
                    import Gallad.Mineald.EntityLittleSpider;
                    import Gallad.Mineald.EntityMommyCreepy;
                    import Gallad.Mineald.EntityPhytriteArrow;
                    import Gallad.Mineald.EntityRuBoat;
                    import Gallad.Mineald.Import;
                    import Gallad.Mineald.RenderBlueZombie;
                    import Gallad.Mineald.RenderChair;
                    import Gallad.Mineald.RenderGiantSpider;
                    import Gallad.Mineald.RenderLittleSpider;
                    import Gallad.Mineald.RenderMommyCreepy;
                    import Gallad.Mineald.RenderPhytriteArrow;
                    import Gallad.Mineald.RenderRuBoat;
                    import Gallad.Mineald.RenderTable;
                    import Gallad.Mineald.RenderZombieGolem;
                    import Gallad.Mineald.UltimateSwordRender;
                    import cpw.mods.fml.client.registry.RenderingRegistry;
                    
                    public class ClientProxy extends Gallad.Mineald.CommonProxy
                    {
                    public static int renderTableId;
                    public static int renderChairId;
                    @Override
                    public void registerRenderers()
                    {
                    RenderingRegistry.registerEntityRenderingHandler(EntityGolemZombie.class, new RenderZombieGolem());
                    RenderingRegistry.registerEntityRenderingHandler(EntityPhytriteArrow.class, new RenderPhytriteArrow());
                    RenderingRegistry.registerEntityRenderingHandler(EntityGiantSpider.class, new RenderGiantSpider());
                    RenderingRegistry.registerEntityRenderingHandler(EntityLittleSpider.class, new RenderLittleSpider());
                    RenderingRegistry.registerEntityRenderingHandler(EntityRuBoat.class, new RenderRuBoat());
                    RenderingRegistry.registerEntityRenderingHandler(EntityMommyCreepy.class, new RenderMommyCreepy());
                    renderTableId = RenderingRegistry.getNextAvailableRenderId();
                    RenderingRegistry.registerBlockHandler(renderTableId, new RenderTable());
                    renderChairId = RenderingRegistry.getNextAvailableRenderId();
                    RenderingRegistry.registerBlockHandler(renderChairId, new RenderChair());
                    MinecraftForgeClient.registerItemRenderer(Import.UltimateSword.itemID, (IItemRenderer)new UltimateSwordRender());
                    RenderingRegistry.registerEntityRenderingHandler(EntityBlueZombie.class, new RenderBlueZombie());
                    }
                    }
                    
                    

                    Et voici donc le message d’erreur qui va avec:

                    
                    2014-02-21 20:27:09 [Infos] [STDERR] java.lang.NullPointerException
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RendererLivingEntity.doRenderLiving(RendererLivingEntity.java:168)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderLiving.doRenderLiving(RenderLiving.java:28)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:142)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:312)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:281)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:524)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:838)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.client.main.Main.main(Main.java:93)
                    2014-02-21 20:27:09 [Infos] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    2014-02-21 20:27:09 [Infos] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    2014-02-21 20:27:09 [Infos] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    2014-02-21 20:27:09 [Infos] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
                    2014-02-21 20:27:09 [Infos] [STDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
                    
                    

                    Egalement, je ne sais pas si cela peut aider, mais à cause de ce bug, certaines entités sont temporairement et aléatoirement touchés par ce phénomène:

                    #Second problème(Second problème)
                    Je souhaiterai, que mon bloc qui créer une structure et qui fait spawn un boss, s’assure qu’il n’y est pas déja un boss pour en faire respawn un, je ne trouve cependant aucun moyen de faire cela, une solution alternative serait de faire déspawn le précédent avant d’en refaire spawn un, voici le code du block qui fait spawn le boss et la structure:

                    TileEntityCreepyBlock

                    
                    package Gallad.Mineald;
                    
                    import java.util.Random;
                    
                    import net.minecraft.entity.Entity;
                    import net.minecraft.entity.monster.EntityCreeper;
                    import net.minecraft.nbt.NBTTagCompound;
                    import net.minecraft.tileentity.TileEntity;
                    import net.minecraft.world.World;
                    import Gallad.Mineald.MommyDungeon;
                    
                    public class TileEntityCreepyBlock extends TileEntity
                    {
                    public int Compteur;
                    public int CompteurParMillier;
                    public Random rand;
                    EntityMommyCreepy entity;
                    
                    public void readFromNBT(NBTTagCompound nbtTag)
                    {
                    super.readFromNBT(nbtTag);
                    Compteur = nbtTag.getInteger("Compteur");
                    CompteurParMillier = nbtTag.getInteger("CompteurParMillier");
                    }
                    
                    public void writeToNBT(NBTTagCompound nbtTag)
                    {
                    super.writeToNBT(nbtTag);
                    nbtTag.setInteger("Compteur", Compteur);
                    nbtTag.setInteger("CompteurParMillier", CompteurParMillier);
                    }
                    
                    public void updateEntity()
                    {
                    Compteur++;
                    if (Compteur >= 10)
                    {
                    CompteurParMillier++;
                    Compteur = 0;
                    }
                    if (CompteurParMillier >= 200)
                    {
                    CompteurParMillier = 0;
                    System.out.println("Mommy Creepy Respawn!");
                    new MommyDungeon(this.worldObj, rand, this.xCoord, this.yCoord, this.zCoord);
                    spawnMommyCreepy(this.worldObj, (double)(this.xCoord + 23), (double)(this.yCoord + 1), (double)(this.zCoord + 24));
                    }
                    }
                    
                    public void spawnMommyCreepy(World world, double posX, double posY, double posZ)
                    {
                    entity = new EntityMommyCreepy(world);
                    entity.setPosition(posX, posY, posZ);
                    world.spawnEntityInWorld(entity);
                    }
                    }
                    
                    

                    Merci de votre aide, j’ai essayé de rajouter comme constructeur à mon entité sa position comme tu m’as dis robin mais cela faisait crash lors de la génération par cet TileEntity, et étrangement, comme ça, cela résoud le soucis.
                    Il ne me reste plus que le soucis que j’ai précédamment évoqué.

                    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

                      Pour l’araignée, visiblement tu as un NPE ici :

                      this.renderPassModel.setLivingAnimations(par1EntityLivingBase, f8, f7, par9);
                      this.renderPassModel.render(par1EntityLivingBase, f8, f7, f4, f3 - f2, f5, f6);
                      

                      (c’est dans le code de mc).
                      Dans le constructeur de l’araignée il y a ça : this.setRenderPassModel(new ModelSpider());
                      Et c’est ce code qu’il te manque.

                      Pour le second problème, il y a plus simple, il suffit de check si il y a un boss dans les alentours. Sur nanotech mod j’utilise ça :
                      https://github.com/FFMT/nanotech_mod/blob/master/common/fr/mcnanotech/kevin_68/nanotechmod/main/items/ItemNanomiteArrowGun.java#L118-L122
                      Et la classe du sélecteur :
                      https://github.com/FFMT/nanotech_mod/blob/master/common/fr/mcnanotech/kevin_68/nanotechmod/main/items/NanoArrowGunEntityFilter.java
                      Il te suffit de remplacer return entity instanceof EntityLivingBase; par return entity instanceof TonBoss;
                      Après tu regardes avec l’autre code si la liste est vide ou pas, si elle est vide le boss est mort.

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

                        Comment j’utilise:
                        .selectEntitiesWithinAABB()

                        Sachant que je peux pas prendre player. pour avoir les coordonnées mais que c’est une TileEntity?

                        EN fait, j’ai retest… je peux toujours pas frapper Maman Creep’ à moins de déco/reco, ce qui se traduirai par éteindre rallumer le serveur :s
                        Une idée?

                        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

                          int radius = 64;
                          AxisAlignedBB axis = AxisAlignedBB.getAABBPool().getAABB(this.coordX - radius, this.coordY - radius, this.coordZ - radius, this.coordX + radius, this.coordY + radius, this.coordZ + radius);
                          List entityTagetList = world.selectEntitiesWithinAABB(Entity.class, axis, bossFilter);
                          Comme ça je pense que ça devrait fonctionner. Le deuxième problème, je sais vraiment pas.

                          1 réponse Dernière réponse Répondre Citer 1
                          • T Hors-ligne
                            totos51
                            dernière édition par

                            Pour le second problème, cela peut il venir de mon entité?

                            Edit: J’ai compris pourquoi je pouvais pas la taper je crois, avec le code tel qu’il est au moment ou le tick est bon, il fait spawn 2 entité, dont une que je peux pas frapper alors que l’autre oui

                            J’avais eu ce soucis pour faire spawn les creeper et en le mettant dans une fonction séparér comme j’ai fais la ça avais marché alors que la non… je vois pas

                            J’ai continué à chercher des pistes… Il y a dans mon code la ligner:

                            System.out.println(“Mommy Creepy Respawn!”);

                            Etrangement, lors de la première création de ma structure , ce message apparait 2 fois dans mon log, ce qui veut donc dire que l’ensemble est répété 2 fois,
                            J’ai donc voulu modifier mon code mais même avec un code comme celui ci, cela ne fonctionne pas:

                            [code_java]
                            package Gallad.Mineald;

                            import java.util.List;
                            import java.util.Random;

                            import net.minecraft.command.IEntitySelector;
                            import net.minecraft.entity.Entity;
                            import net.minecraft.nbt.NBTTagCompound;
                            import net.minecraft.tileentity.TileEntity;
                            import net.minecraft.util.AxisAlignedBB;
                            import net.minecraft.world.World;

                            public class TileEntityCreepyBlock extends TileEntity
                            {
                            public int Compteur;
                            public int CompteurParMillier;
                            public Random rand;
                            public int count;

                            public void readFromNBT(NBTTagCompound nbtTag)
                            {
                            super.readFromNBT(nbtTag);
                            Compteur = nbtTag.getInteger(“Compteur”);
                            CompteurParMillier = nbtTag.getInteger(“CompteurParMillier”);
                            }

                            public void writeToNBT(NBTTagCompound nbtTag)
                            {
                            super.writeToNBT(nbtTag);
                            nbtTag.setInteger(“Compteur”, Compteur);
                            nbtTag.setInteger(“CompteurParMillier”, CompteurParMillier);
                            }

                            @Override
                            public void updateEntity()
                            {
                            Compteur++;
                            if (Compteur < 0)
                            {
                            Compteur = 0;
                            }
                            if (CompteurParMillier < 0)
                            {
                            CompteurParMillier = 0;
                            }
                            if (CompteurParMillier == 1)
                            {
                            count = 0;
                            }
                            if (Compteur >= 10)
                            {
                            CompteurParMillier++;
                            Compteur = 0;
                            }
                            if (CompteurParMillier >= 200)
                            {
                            if (count != 1)
                            {
                            CompteurParMillier = 0;
                            System.out.println(“Mommy Creepy Respawn!”);
                            final IEntitySelector livingFilter = new MommyFilter();
                            AxisAlignedBB Axis = AxisAlignedBB.getAABBPool().getAABB(this.xCoord - 24, this.yCoord - 2, this.zCoord - 25, this.xCoord + 24, this.yCoord + 2, this.zCoord + 25);
                            List entityTargetList = this.worldObj.selectEntitiesWithinAABB(Entity.class, Axis, livingFilter);
                            for (int i = 0; i < entityTargetList.size(); i++)
                            {
                            Entity entityTarget = (Entity)entityTargetList.get(i);
                            if (entityTarget instanceof EntityMommyCreepy)
                            {
                            entityTarget.setDead();
                            }
                            }
                            new MommyDungeon(this.worldObj, rand, this.xCoord, this.yCoord, this.zCoord);
                            spawnMommyCreepy(this.worldObj, (double)(this.xCoord + 23), (double)(this.yCoord + 1), (double)(this.zCoord + 24));
                            count = 1;
                            }

                            }
                            }

                            public void spawnMommyCreepy(World world, double posX, double posY, double posZ)
                            {
                            Entity entity = new EntityMommyCreepy(world);
                            entity.setPosition(posX, posY, posZ);
                            world.spawnEntityInWorld(entity);
                            }
                            }
                            [/code_java]

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

                            MINECRAFT FORGE FRANCE © 2024

                            Powered by NodeBB