Nouveau fluide en source infini + remplacement fluide nouveau biome
-
je comprend justement rien dans le block de l’eau avec ces noms de fonctions à la noix xD
non le println fait rien donc elle est pas appelé
-
Ajoutes un @Override au dessus de la fonction, si ça fait une erreur ça veut dire que ce n’est pas la bonne fonction.
-
@‘sventus’:
je comprend justement rien dans le block de l’eau avec ces noms de fonctions à la noix xD
non le println fait rien donc elle est pas appelé
Essaye sa
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { if (((entity instanceof EntityLivingBase)) && (!world.isRemote)) { ((EntityLivingBase)entity).attackEntityFrom(DamageSource.wither, 2.0F); } }La c’est pas poison mais juste pour voir
-
le @Override me dit : The method onEntityCollidedWithBlock(World, int, int, int, EntityPlayer) of type BlockFluid must override or implement a supertype method
rien de plus avec ce que tu m’as passé dark
-
@‘sventus’:
le @Override me dit : The method onEntityCollidedWithBlock(World, int, int, int, EntityPlayer) of type BlockFluid must override or implement a supertype method
rien de plus avec ce que tu m’as passé dark
Chez moi le code que j’ai envoyé fonctionne
Ma class: (si sa peut aidé car chez moi il fonctionne)
package fr.darkvince.ultrav2.ultrawather; import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; public class BlockFluidTutorial extends BlockFluidClassic { private IIcon stillIcon; private IIcon flowingIcon; public BlockFluidTutorial(Fluid fluid, Material material) { super(fluid, material); } public IIcon func_149691_a(int side, int meta) { return (side == 0) || (side == 1) ? this.stillIcon : this.flowingIcon; } public void registerBlockIcons(IIconRegister register) { this.stillIcon = register.registerIcon("ultrav2:ultra_fluid_still"); this.flowingIcon = register.registerIcon("ultrav2:ultra_fluid_flow"); } public int getColor() { return new Color(80, 123, 138).getRGB(); } public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { if (((entity instanceof EntityLivingBase)) && (!world.isRemote)) { ((EntityLivingBase)entity).attackEntityFrom(DamageSource.magic, 2.0F); } } public boolean canDisplace(IBlockAccess world, int x, int y, int z) { if (world.getBlock(x, y, z).getMaterial().isLiquid()) { return false; } return super.canDisplace(world, x, y, z); } public boolean displaceIfPossible(World world, int x, int y, int z) { if (world.getBlock(x, y, z).getMaterial().isLiquid()) { return false; } return super.displaceIfPossible(world, x, y, z); } } -
effectivement je prend des dégats merci <3.
-
Bonjour (c’est pas un double post, j’avais un soucis qui je pensais été résolu mais en réalité j’ai remarqué qu’il y avait d’autres problèmes ^^.
-
Finalement, voila les deux points qui bloquent :
- possibilité de faire une source infinie
- remplacer l’eau du biome par le nouveau fluide
-
personne n’a d’idée ? j’ai essayé de changer les extends comme l’a dit robin mais en vain

-
j’ai éssayé de faire cela pour pour changer l’eau par mon block dans mon biome, mais cela ne change rien :
@Override public BiomeDecorator createBiomeDecorator() { MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); int i; int j; int k; int l; int i1; boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); if (doGen && this.generateLakes) { for (j = 0; j < 50; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; (new WorldGenLiquids(Mods.fluidblock)).generate(this.currentWorld, this.randomGenerator, k, l, i1); } for (j = 0; j < 20; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; (new WorldGenLiquids(Mods.fluidblock)).generate(this.currentWorld, this.randomGenerator, k, l, i1); } } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); return super.createBiomeDecorator(); } -
Pour désactiver les lacs, il faut faire
this.theBiomeDecorator.generateLakes = false;dans le constructeur du biome, mais pour remplacer l’eau, il faut que tu override la fonction “createBiomeDecorator”, que tu mettes un BiomeDecorator custome en return et dans celui-ci, tu copies la fonction “genDecorations” de BiomeDecorator, et à la fin tu as le génération de l’eau que tu peux changer
Il faut obligatoirement passer par un BiomeDecorator custom.