• Potions, Armures pré-enchanté etc..

    Résolu 1.6.x
    17
    0 Votes
    17 Messages
    4k Vues
    T
    Oui j’ai trouvé un truc qui me semble très complet, je vais le traduire, le comprendre et j’en ferai surement un tutoriel, mais mon java est quelques peu insuffisant à mon gout, pour expliquer le code.
  • Problème ClientTick Pluie Acide

    Résolu 1.5.2
    21
    0 Votes
    21 Messages
    7k Vues
    AmaA
    Bien ! mon problème est résolu !
  • [1.4.7] Probleme pour jouer un son (CD)

    Résolu
    14
    0 Votes
    14 Messages
    5k Vues
    S
    En fait le problème est réglé ! Cela venez d’une erreur conversion de la musique de .mp3 en .ogg Merci pour vos reponces! Cordialement Sidney
  • Empêcher le vol de mods.

    Résolu 1.6.x
    8
    0 Votes
    8 Messages
    2k Vues
    azatomA
    Elle va passer par un systeme d’auth perso et pour le multi pas besoin , je sais supprimer le bouton et ajouter un bouton de co a mon serveur
  • [1.4.7] Probleme slab lors du lancement du mod sur serveur

    Résolu
    11
    0 Votes
    11 Messages
    6k Vues
    S
    Ok Merci, je vais crée l autre discussion. UN GRAND MERCI a toi pour RedPower !!
  • Généré un minerai dans une chunk déjà existante

    Résolu 1.6.4
    7
    0 Votes
    7 Messages
    5k Vues
    azatomA
    Salut je crois avoir trouvé alors pour ceux qui verraient ce topic bien après ce post je vous donne la solution qui je crois est la bonne : 1-Allez dans votre world painter A ne pas faire si c’est déjà fait passez a l’étape 3 directement. 2-créez votre map (a ne pas faire si c’est déjà fais) 3-créez votre minerai et intégré le au gen du world 4-finissez votre mod et installez le comme un mod forge dans le dossier mod (je ne sais pas si ça marche avec les mods normaux par contre) 5-téléchargez MC edit 6-Ouvrez votre map (Load level) 7-Cliquez sur chunks editor 8-Sélectionnez les chunks où vous voulez qu’il y est votre minerai (attention ne pas prendre trop de chunks si vous n’avez pas un monstre guerre en pc, une 50 ène max) 9-Cliquez sur REPOP 10-Attendez, Cliquez sur SAVE 11-Creusez la chunks que vous avez REPOP : (cherchez bien n’abandonnez pas direct si vous ne trouvez pas en casser 3 cubes) Et HO ! Surprise ! il y a les minerais ! Pour le moment je n’ai tester qu’avec Galacticraft sur une map gen sous world painter, je vous ferais part si ça marche avec mon minerai de cuivre EDIT : J’ai fais les dernier test pour voir d’ou venez ces minerais, ils viennent bien du minecraft moddé , technique validée
  • Méthode pour faire jouer un son lorsqu'un bloc est posé

    Résolu 1.6.4
    2
    0 Votes
    2 Messages
    1k Vues
    robin4002R
    public void breakBlock(World world, int x, int y, int z, int id, int metadata) { world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, null, 0.0F, 0.0F); super.breakBlock(world, x, y, z, id, metadata); } Normalement ça devrait couper le son lors de la destruction. Le reste je sais pas, je peux juste te dire que si tu veux faire une musique, il faut utiliser event.manager.addMusic et pour le jouer playSound à la place de playSoundEffect.
  • Noel mod

    Résolu 1.6.4
    11
    0 Votes
    11 Messages
    3k Vues
    robin4002R
    Pour la collision, tu fais la même chose avec getCollisionBoundingBoxFromPool, ça devrait régler le problème de quand tu marches dessus. Pour quand tu regarde le bloc du haut, ça va pas être possible, car la hitbox est cherché en fonction des coordonnées. Ce qui faudrait, c’est mettre un deuxième bloc au coordonnées y + 1. Exemple ici : https://github.com/FFMT/nanotech_mod/blob/master/common/fr/mcnanotech/kevin_68/nanotech_mod/city/blocks/BlockLamp.java https://github.com/FFMT/nanotech_mod/blob/master/common/fr/mcnanotech/kevin_68/nanotech_mod/city/blocks/ItemBlockLamp.java
  • Faire un mod en plusieurs parties

    Résolu 1.6.4
    6
    0 Votes
    6 Messages
    2k Vues
    bin4r1sB
    D’accord merci de votre aide
  • Problème de rendu d'item

    Résolu 1.6.4
    6
    0 Votes
    6 Messages
    2k Vues
    A
    Déjà mis et mon modeleur me dis que la rotation est sur le manche___ Ou ça viens peut-être de mon moding ?
  • Problème render teche

    Résolu 1.6.x
    5
    0 Votes
    5 Messages
    2k Vues
    A
    Marche impec
  • Problème item

    Résolu 1.6.4
    5
    0 Votes
    5 Messages
    2k Vues
    A
    ça passe nickel merci robin
  • Problème de texture.

    Résolu 1.6.4
    3
    1
    0 Votes
    3 Messages
    2k Vues
    azatomA
    Merci j’ai remplacé par net.minecraft.item.ItemArmor et ça marche ^^
  • Problème : EnumHelper

    Résolu 1.6.4
    3
    0 Votes
    3 Messages
    1k Vues
    azatomA
    Merci je venais de trouver justement et j’allais vous prévenir ^^ Merci quand même
  • Faire une commande avec un item

    Résolu 1.6.4
    10
    0 Votes
    10 Messages
    3k Vues
    SugarshyS
    @‘robin4002’: Une méthode du type boolean doit toujours avoir un return true ou false. Mais oui, suis-je bête –’ Bon, a part unpeu de modding je ne connais rien à java, mai quand même, j’aurai du y penser… J’essaye sa de suite, merci !
  • Faire un objet pour faire spawn un mob

    Résolu 1.6.4
    19
    0 Votes
    19 Messages
    5k Vues
    bin4r1sB
    ça marche parfaitement, merci encore
  • Problème de craft

    Résolu 1.6.4
    6
    0 Votes
    6 Messages
    2k Vues
    robin4002R
    Pour être plus precis, quand tu as des importations à faire, utilise toujours les net.minecraft.quelque chose s’ils sont présent dans la liste (les plus fréquents sont Block, Item et Entity) L’autre problème, c’est que tu as créer une variable local, et donc la variable de classe est resté null, d’où le NPE (NullPointerException)
  • Problème de render avec un dragon

    Résolu 1.6.4
    4
    0 Votes
    4 Messages
    2k Vues
    bin4r1sB
    Ah d’accord. Merci Je teste immédiatement. EDIT: ça marche ! Par contre, il y a autre chose : Je voulais que le dragon ne casse pas de blocs, j’ai donc supprimé la condition pour. Le problème c’est qu’il peut encore traverser les blocs. Deuxième point : Mon dragon disparait(visuellement) au bout de 1 chunk de distance avec moi au lieu de disparaitre dans le brouillard. Pouvez-vous m’aider ? RenderFireDragon : package fr.MrBlockTNT.Dragons.render; import java.util.Random; import org.lwjgl.opengl.GL11; import fr.MrBlockTNT.Dragons.entity.firedragon.EntityFireDragon; import fr.MrBlockTNT.Dragons.models.ModelFireDragon; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelDragon; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.client.renderer.entity.RenderDragon; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.boss.BossStatus; import net.minecraft.entity.boss.EntityDragon; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; public class RenderFireDragon extends RenderLiving { private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("dragons:entity/firedragon/dragon_exploding.png"); private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("dragons:entity/firecrystal/firecrystal_beam.png"); private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("dragons:entity/firedragon/dragon_eyes.png"); private static final ResourceLocation enderDragonTextures = new ResourceLocation("dragons:entity/firedragon/dragon.png"); /** An instance of the dragon model in RenderDragon */ protected ModelFireDragon modelDragon; public RenderFireDragon() { super(new ModelFireDragon(0.0F), 0.5F); this.modelDragon = (ModelFireDragon)this.mainModel; this.setRenderPassModel(this.mainModel); } /** * Used to rotate the dragon as a whole in RenderDragon. It's called in the rotateCorpse method. */ protected void rotateDragonBody(EntityFireDragon par1EntityDragon, float par2, float par3, float par4) { float f3 = (float)par1EntityDragon.getMovementOffsets(7, par4)[0]; float f4 = (float)(par1EntityDragon.getMovementOffsets(5, par4)[1] - par1EntityDragon.getMovementOffsets(10, par4)[1]); GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F); GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, 0.0F, 1.0F); if (par1EntityDragon.deathTime > 0) { float f5 = ((float)par1EntityDragon.deathTime + par4 - 1.0F) / 20.0F * 1.6F; f5 = MathHelper.sqrt_float(f5); if (f5 > 1.0F) { f5 = 1.0F; } GL11.glRotatef(f5 * this.getDeathMaxRotation(par1EntityDragon), 0.0F, 0.0F, 1.0F); } } /** * Renders the dragon model. Called by renderModel. */ protected void renderDragonModel(EntityFireDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7) { if (par1EntityDragon.deathTicks > 0) { float f6 = (float)par1EntityDragon.deathTicks / 200.0F; GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, f6); this.bindTexture(enderDragonExplodingTextures); this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDepthFunc(GL11.GL_EQUAL); } this.bindEntityTexture(par1EntityDragon); this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); if (par1EntityDragon.hurtTime > 0) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthFunc(GL11.GL_LEQUAL); } } /** * Renders the dragon, along with its dying animation */ public void renderDragon(EntityFireDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) { BossStatus.setBossStatus(par1EntityDragon, false); super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); if (par1EntityDragon.healingEnderCrystal != null) { float f2 = (float)par1EntityDragon.healingEnderCrystal.innerRotation + par9; float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F; f3 = (f3 * f3 + f3) * 0.2F; float f4 = (float)(par1EntityDragon.healingEnderCrystal.posX - par1EntityDragon.posX - (par1EntityDragon.prevPosX - par1EntityDragon.posX) * (double)(1.0F - par9)); float f5 = (float)((double)f3 + par1EntityDragon.healingEnderCrystal.posY - 1.0D - par1EntityDragon.posY - (par1EntityDragon.prevPosY - par1EntityDragon.posY) * (double)(1.0F - par9)); float f6 = (float)(par1EntityDragon.healingEnderCrystal.posZ - par1EntityDragon.posZ - (par1EntityDragon.prevPosZ - par1EntityDragon.posZ) * (double)(1.0F - par9)); float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6); float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6); GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4 + 2.0F, (float)par6); GL11.glRotatef((float)(-Math.atan2((double)f6, (double)f4)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef((float)(-Math.atan2((double)f7, (double)f5)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); Tessellator tessellator = Tessellator.instance; RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL11.GL_CULL_FACE); this.bindTexture(enderDragonCrystalBeamTextures); GL11.glShadeModel(GL11.GL_SMOOTH); float f9 = 0.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; tessellator.startDrawing(5); byte b0 = 8; for (int i = 0; i <= b0; ++i) { float f11 = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F; float f12 = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F; float f13 = (float)(i % b0) * 1.0F / (float)b0; tessellator.setColorOpaque_I(0); tessellator.addVertexWithUV((double)(f11 * 0.2F), (double)(f12 * 0.2F), 0.0D, (double)f13, (double)f10); tessellator.setColorOpaque_I(16777215); tessellator.addVertexWithUV((double)f11, (double)f12, (double)f8, (double)f13, (double)f9); } tessellator.draw(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glShadeModel(GL11.GL_FLAT); RenderHelper.enableStandardItemLighting(); GL11.glPopMatrix(); } } protected ResourceLocation getEnderDragonTextures(EntityFireDragon par1EntityDragon) { return enderDragonTextures; } /** * Renders the animation for when an enderdragon dies */ protected void renderDragonDying(EntityFireDragon par1EntityDragon, float par2) { super.renderEquippedItems(par1EntityDragon, par2); Tessellator tessellator = Tessellator.instance; if (par1EntityDragon.deathTicks > 0) { RenderHelper.disableStandardItemLighting(); float f1 = ((float)par1EntityDragon.deathTicks + par2) / 200.0F; float f2 = 0.0F; if (f1 > 0.8F) { f2 = (f1 - 0.8F) / 0.2F; } Random random = new Random(432L); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -1.0F, -2.0F); for (int i = 0; (float)i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i) { GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F); tessellator.startDrawing(6); float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F; float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F; tessellator.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - f2))); tessellator.addVertex(0.0D, 0.0D, 0.0D); tessellator.setColorRGBA_I(16711935, 0); tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); tessellator.addVertex(0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); tessellator.addVertex(0.0D, (double)f3, (double)(1.0F * f4)); tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); tessellator.draw(); } GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glShadeModel(GL11.GL_FLAT); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); RenderHelper.enableStandardItemLighting(); } } /** * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. */ protected int renderGlow(EntityFireDragon par1EntityDragon, int par2, float par3) { if (par2 == 1) { GL11.glDepthFunc(GL11.GL_LEQUAL); } if (par2 != 0) { return -1; } else { this.bindTexture(enderDragonEyesTextures); float f1 = 1.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_EQUAL); 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.glEnable(GL11.GL_LIGHTING); GL11.glColor4f(1.0F, 1.0F, 1.0F, f1); return 1; } } public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { this.renderDragon((EntityFireDragon)par1EntityLiving, par2, par4, par6, par8, par9); } /** * Queries whether should render the specified pass or not. */ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { return this.renderGlow((EntityFireDragon)par1EntityLivingBase, par2, par3); } protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { this.renderDragonDying((EntityFireDragon)par1EntityLivingBase, par2); } protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { this.rotateDragonBody((EntityFireDragon)par1EntityLivingBase, par2, par3, par4); } /** * Renders the model in RenderLiving */ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { this.renderDragonModel((EntityFireDragon)par1EntityLivingBase, par2, par3, par4, par5, par6, par7); } public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { this.renderDragon((EntityFireDragon)par1EntityLivingBase, par2, par4, par6, par8, par9); } /** * 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.getEnderDragonTextures((EntityFireDragon)par1Entity); } /** * 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="" dorender(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.renderDragon((EntityFireDragon)par1Entity, par2, par4, par6, par8, par9); } } ```</t>
  • Problème mob

    Résolu 1.6.4
    7
    0 Votes
    7 Messages
    2k Vues
    A
    Merci marche impec
  • Faire pivoter la hitbox

    Résolu 1.6.4
    5
    0 Votes
    5 Messages
    2k Vues
    SugarshyS
    Sa marche, merci infiniment !