[Résolu] culture 1.7.10
Règles du forum
[En Attente] - Qui est défini par défaut à l'ouverture de la demande d'aide
[En Cours] - Qui est à mettre lorsque vous venez d'avoir une réponse à votre demande d'aide
[Résolu] - Qui est à mettre lorsque votre problème est résolu
Version de Forge: (Il s'agit du numéro de version indiqué sur le nom de votre dossier forge téléchargé)
Description du problème:
(Un maximum d'informations sera utile, quel code fait crash ?, quand cela ce produit ?, ne pas hésiter à mettre des captures d'écran et fichiers de log en pièces jointes)
[En Attente] - Qui est défini par défaut à l'ouverture de la demande d'aide
[En Cours] - Qui est à mettre lorsque vous venez d'avoir une réponse à votre demande d'aide
[Résolu] - Qui est à mettre lorsque votre problème est résolu
Version de Minecraft:Merci de respecter ce modèle pour toutes demandes d'assistances !
Merci de mettre votre code dans les balises code prévus à cet effet, icon </>
Version de Forge: (Il s'agit du numéro de version indiqué sur le nom de votre dossier forge téléchargé)
Description du problème:
(Un maximum d'informations sera utile, quel code fait crash ?, quand cela ce produit ?, ne pas hésiter à mettre des captures d'écran et fichiers de log en pièces jointes)
Re: culture 1.7.10
ok je vais voir mais il faut que j'aille voir dans la classe de cultures ou du BlocksCrops, et j'ai un autre problème quand je recompile mon mod je n'ai aucune texture n'y nom que j'ai modifier normal ??
L'homme et la sante viagrasansordonnancefr.com patients en France
- Checconio
- Site Admin
- Messages : 660
- Inscription : 20 juil. 2019 18:53
- Localisation : Istres
- Contact :
Re: culture 1.7.10
la class des culture c'est la class BlocksCrops
et si les nom et texture sont plus la quand tu compile c'est que sur les nom de fichier dans le le fichier lang tu n'a pas respecté les majuscules et minuscules
Ton dossier modid doit aussi etre en minuscule
et si les nom et texture sont plus la quand tu compile c'est que sur les nom de fichier dans le le fichier lang tu n'a pas respecté les majuscules et minuscules
Ton dossier modid doit aussi etre en minuscule
Tu veux des réductions et du cashback ? passe par iGraal 
3€ Offert en passant par mon lien
https://fr.igraal.com/?parrain=AG_577542b686c1d


3€ Offert en passant par mon lien

https://fr.igraal.com/?parrain=AG_577542b686c1d

Re: culture 1.7.10
bin si normalement tout devrais aller
Code : Tout sélectionner
[
{
"modid": "plutonium",
"name": "Plutonium Mod",
"description": "Minecraft Mod Plutonium.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["thecascou"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
L'homme et la sante viagrasansordonnancefr.com patients en France
Re: culture 1.7.10
j'ai trouver le code à modifier mais quand je lance mon minecraft mon jeux crash
Code : Tout sélectionner
public class BlockCropsMod extends BlockCrops
{
public IIcon[] field_149867_a;
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.field_149867_a = new IIcon[4];
for (int i = 0; i < this.field_149867_a.length; ++i)
{
this.field_149867_a[i] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + i);
}
}
}
L'homme et la sante viagrasansordonnancefr.com patients en France
Re: culture 1.7.10
c'est bon j'ai trouver mon problème pour les textures mais pour la culture je suis bloquer
L'homme et la sante viagrasansordonnancefr.com patients en France
- Checconio
- Site Admin
- Messages : 660
- Inscription : 20 juil. 2019 18:53
- Localisation : Istres
- Contact :
Re: culture 1.7.10
comment ça pour la texture tu es bloqué ?
Tu veux des réductions et du cashback ? passe par iGraal 
3€ Offert en passant par mon lien
https://fr.igraal.com/?parrain=AG_577542b686c1d


3€ Offert en passant par mon lien

https://fr.igraal.com/?parrain=AG_577542b686c1d

Re: culture 1.7.10
nn les textures etc c'est bon j'ai regler le problème mais pour les cultures je ne sais pas se qu'il faut modifier pour avoir que 4 stage
L'homme et la sante viagrasansordonnancefr.com patients en France
- Checconio
- Site Admin
- Messages : 660
- Inscription : 20 juil. 2019 18:53
- Localisation : Istres
- Contact :
Re: culture 1.7.10
envoi la class complète BlockCrops
Tu veux des réductions et du cashback ? passe par iGraal 
3€ Offert en passant par mon lien
https://fr.igraal.com/?parrain=AG_577542b686c1d


3€ Offert en passant par mon lien

https://fr.igraal.com/?parrain=AG_577542b686c1d

Re: culture 1.7.10
Code : Tout sélectionner
public class BlockCrops extends BlockBush implements IGrowable
{
@SideOnly(Side.CLIENT)
private IIcon[] field_149867_a;
private static final String __OBFID = "CL_00000222";
protected BlockCrops()
{
this.setTickRandomly(true);
float f = 0.5F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
this.setCreativeTab((CreativeTabs)null);
this.setHardness(0.0F);
this.setStepSound(soundTypeGrass);
this.disableStats();
}
/**
* is the block grass, dirt or farmland
*/
protected boolean canPlaceBlockOn(Block p_149854_1_)
{
return p_149854_1_ == Blocks.farmland;
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_);
if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9)
{
int l = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_);
if (l < 7)
{
float f = this.func_149864_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
if (p_149674_5_.nextInt((int)(25.0F / f) + 1) == 0)
{
++l;
p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, l, 2);
}
}
}
}
public void func_149863_m(World p_149863_1_, int p_149863_2_, int p_149863_3_, int p_149863_4_)
{
int l = p_149863_1_.getBlockMetadata(p_149863_2_, p_149863_3_, p_149863_4_) + MathHelper.getRandomIntegerInRange(p_149863_1_.rand, 2, 5);
if (l > 7)
{
l = 7;
}
p_149863_1_.setBlockMetadataWithNotify(p_149863_2_, p_149863_3_, p_149863_4_, l, 2);
}
private float func_149864_n(World p_149864_1_, int p_149864_2_, int p_149864_3_, int p_149864_4_)
{
float f = 1.0F;
Block block = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ - 1);
Block block1 = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ + 1);
Block block2 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_);
Block block3 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_);
Block block4 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ - 1);
Block block5 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ - 1);
Block block6 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ + 1);
Block block7 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ + 1);
boolean flag = block2 == this || block3 == this;
boolean flag1 = block == this || block1 == this;
boolean flag2 = block4 == this || block5 == this || block6 == this || block7 == this;
for (int l = p_149864_2_ - 1; l <= p_149864_2_ + 1; ++l)
{
for (int i1 = p_149864_4_ - 1; i1 <= p_149864_4_ + 1; ++i1)
{
float f1 = 0.0F;
if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
{
f1 = 1.0F;
if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
{
f1 = 3.0F;
}
}
if (l != p_149864_2_ || i1 != p_149864_4_)
{
f1 /= 4.0F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* Gets the block's texture. Args: side, meta
*/
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
{
if (p_149691_2_ < 0 || p_149691_2_ > 7)
{
p_149691_2_ = 7;
}
return this.field_149867_a[p_149691_2_];
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 6;
}
protected Item func_149866_i()
{
return Items.wheat_seeds;
}
protected Item func_149865_P()
{
return Items.wheat;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
{
super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return p_149650_1_ == 7 ? this.func_149865_P() : this.func_149866_i();
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random p_149745_1_)
{
return 1;
}
public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_)
{
return p_149851_1_.getBlockMetadata(p_149851_2_, p_149851_3_, p_149851_4_) != 7;
}
public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_)
{
return true;
}
/**
* Gets an item for the block being called on. Args: world, x, y, z
*/
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
return this.func_149866_i();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.field_149867_a = new IIcon[8];
for (int i = 0; i < this.field_149867_a.length; ++i)
{
this.field_149867_a[i] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + i);
}
}
public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_)
{
this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
if (metadata >= 7)
{
for (int i = 0; i < 3 + fortune; ++i)
{
if (world.rand.nextInt(15) <= metadata)
{
ret.add(new ItemStack(this.func_149866_i(), 1, 0));
}
}
}
return ret;
}
}
L'homme et la sante viagrasansordonnancefr.com patients en France
- Checconio
- Site Admin
- Messages : 660
- Inscription : 20 juil. 2019 18:53
- Localisation : Istres
- Contact :
Re: culture 1.7.10
Voila les fonctions qui gères le nombre de stage
Code : Tout sélectionner
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_);
if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9)
{
int l = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_);
if (l < 7)
{
float f = this.func_149864_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
if (p_149674_5_.nextInt((int)(25.0F / f) + 1) == 0)
{
++l;
p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, l, 2);
}
}
}
}
public void func_149863_m(World p_149863_1_, int p_149863_2_, int p_149863_3_, int p_149863_4_)
{
int l = p_149863_1_.getBlockMetadata(p_149863_2_, p_149863_3_, p_149863_4_) + MathHelper.getRandomIntegerInRange(p_149863_1_.rand, 2, 5);
if (l > 7)
{
l = 7;
}
p_149863_1_.setBlockMetadataWithNotify(p_149863_2_, p_149863_3_, p_149863_4_, l, 2);
}
private float func_149864_n(World p_149864_1_, int p_149864_2_, int p_149864_3_, int p_149864_4_)
{
float f = 1.0F;
Block block = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ - 1);
Block block1 = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ + 1);
Block block2 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_);
Block block3 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_);
Block block4 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ - 1);
Block block5 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ - 1);
Block block6 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ + 1);
Block block7 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ + 1);
boolean flag = block2 == this || block3 == this;
boolean flag1 = block == this || block1 == this;
boolean flag2 = block4 == this || block5 == this || block6 == this || block7 == this;
for (int l = p_149864_2_ - 1; l <= p_149864_2_ + 1; ++l)
{
for (int i1 = p_149864_4_ - 1; i1 <= p_149864_4_ + 1; ++i1)
{
float f1 = 0.0F;
if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
{
f1 = 1.0F;
if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
{
f1 = 3.0F;
}
}
if (l != p_149864_2_ || i1 != p_149864_4_)
{
f1 /= 4.0F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
Tu veux des réductions et du cashback ? passe par iGraal 
3€ Offert en passant par mon lien
https://fr.igraal.com/?parrain=AG_577542b686c1d


3€ Offert en passant par mon lien

https://fr.igraal.com/?parrain=AG_577542b686c1d
