Petits problèmes plutôt ennuyant
-
Bizarre
Euuh , je vais relire encore une fois le tuto , voir si j’ai rien manquer et je te tiens au courant 
EDIT EDIT : J’ai relu et tout me semble OK. /:
-
Tu génère ton arbre avec quel code ?
-
Fait voir la classe generator avec la classe de génération de ton arbre.
-
Voici :
package mod.common; import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import cpw.mods.fml.common.IWorldGenerator; public class Generator implements IWorldGenerator { @Override public void generate(Random rand, int X, int Z, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: this.generateNether(world, X * 16, Z * 16, rand); case 0: this.generateSurface(world, X * 16, Z * 16, rand); case 1: this.generateEnd(world, X * 16, Z * 16, rand); } } private void generateSurface(World world, int x, int z, Random rand) { if(world.getBiomeGenForCoords(x, z).equals(ModMinecraft.AncientBiome)) { for (int i = 0; i < 50; i++) { int x1 = x + rand.nextInt(16); int y1 = rand.nextInt(128); int z1 = z + rand.nextInt(16); (new WorldGeneration()).generate(world, rand, x1, y1, z1); } } } private void generateEnd(World world, int x, int z, Random rand) { } private void generateNether(World world, int x, int z, Random rand) { } } -
Petit UP du sujet

-
UP

-
Up . . .
-
Tu peux aussi arrêter de spam –’
-
Je up , il me semble qu’on pouvais Up après 24heures . . . Excuse moi ^^
-
Si personne ne te répond c’est que personne ne sait donc up tous les jours ça fait lourd….
-
Oui mais si je up pas le sujet disparait et la on sait me répondre puisque Diangle me demande ma classe Generator soit.
-
En dehors du fait que Diangles t’aurais sûrement parler avant si il avait la réponse.
-
Fin soit je ne le ferais plus désolé et je laisserais un sujet non résolu alors.
-
Je suis vraiment désolé

-
Tu peux me donner ton code (scr) par mp ?
-
@‘gagoi’:
Je suis vraiment désolé

Euuuh pourquoi ?, C’est de l’ironie ou ? XD
Et Diangle je ne vois pas ce que tu veut dire la src , le dossier ?
-
Bah non c’est sérieux. Tu auras peut être jamais de solutions XD
-
Ne te fait pas de soucis (j’ai son code).
-
voilà, tous marche (en même temps il ne générer pas son biome xD), tu pourras passer en résolut.
-
Problème bien con au final ^^ , Il me reste encore un soucis je quote pour rappeler
:
[size=xx-smallHello tout le monde ça fait longtemps que je n’ai plus poster de sujet ]
[size=xx-small Mais je reviens avec quelques petits problème que j’arrive pas à résoudre par tout les moyens … :/][size=xx-smallVoila j’ai créer un arbre et lorsque qu’on le casse avec une hache spécial il drop random , soit rien , soit de la seve , soit de la seve avec un moustique pré-historique , le problème c’est que du coup il ne drop pas mon bloc wood, ]
- public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase living)
- {
- if (world.getBlock(x, y, z) == ModMinecraft.BlockTronc)
- {
- System.out.println(“je vais drop”);
- world.setBlockToAir(x, y, z);
- if ((living instanceof EntityPlayer))
- {
- EntityPlayer player = (EntityPlayer)living;
- int randInt = world.rand.nextInt(11);
- if (randInt == 0)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt == 1)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt == 2)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSevewithmosquito, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt == 3)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt != 4)
- {
- if (randInt != 5)
- {
- if (randInt != 6)
- {
- if (randInt != 7)
- {
- if (randInt == 8)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt == 9)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- else if (randInt == 10)
- {
- float f = 0.7F;
- double d0 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d1 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- double d2 = world.rand.nextFloat() %(#666600)
- f + (1.0F - f) %(#666600)
- 0.5D;
- EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, new ItemStack(ModMinecraft.itemSeve, 1));
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- }
- }
- }
- }
- }
- }
- }
- else
- {
- System.out.println("le bloc correspond pas, je drop rien " + world.getBlock(x, y, z).getUnlocalizedName());
- }
- return super.onBlockDestroyed(stack, world, block, x, y, z, living);
- }
[size=xx-smallVoici le code , je ne sais pas comment faire j’ai essayer d’ajouter dans la classe du block tronc un ligne pour qu’il drop justement à chaque fois le bloc avec la seve mais impossible :/]
[size=xx-smallDe plus j’ai créer mon propre WorldType mais j’aimerais que mes nouveaux arbres créer spawn dans mon biome , le problème c’est que quand j’essaye de mettre mon biome dans cette ligne de code :]
- if(world.getBiomeGenForCoords(x, z).equals(BiomeGenBase.//Votre biome.))
- {
- }
[size=xx-smallMais mon biome n’est pas trouvé et si j’essaye autre chose sa ne marche pas… /=]
[size=xx-smallVoila voila , merci à ceux qui m’aiderons ]

[size=xx-small( Désoler si les questions on déjà été posé j’ai regardé mais je n’ai pas trouvé )]
Il me reste le soucis de faire drop a chaque fois qu’on coupe le bois , il drop le bloc bois mais aussi par random il doit dropé soit de la seve , rien ou seve avec moustique.
