@‘robin4002’:
https://github.com/FFMT/ModTutoriel/commit/09c080dc1959a79f5cdf5251214454ba88a21e33
Tu as juste a regarder tout ce qui concerne le fluide.
Edit:
C’ets bon da marche sauf que je voudrai mettre des dégat quand je vais dans l’eau en question comment faire j’ai essayé de changé la température est sa marche pas faut passez par une autre fonction ?
J’ai trouvé sa :
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
if (this.blockMaterial == Material.lava)
{
int l = p_149674_5_.nextInt(3);
int i1;
for (i1 = 0; i1 < l; ++i1)
{
p_149674_2_ += p_149674_5_.nextInt(3) - 1;
++p_149674_3_;
p_149674_4_ += p_149674_5_.nextInt(3) - 1;
Block block = p_149674_1_.getBlock(p_149674_2_, p_149674_3_, p_149674_4_);
if (block.blockMaterial == Material.air)
{
if (this.isFlammable(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_))
{
p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.fire);
return;
}
}
else if (block.blockMaterial.blocksMovement())
{
return;
}
}
if (l == 0)
{
i1 = p_149674_2_;
int k1 = p_149674_4_;
for (int j1 = 0; j1 < 3; ++j1)
{
p_149674_2_ = i1 + p_149674_5_.nextInt(3) - 1;
p_149674_4_ = k1 + p_149674_5_.nextInt(3) - 1;
if (p_149674_1_.isAirBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_) && this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_))
{
p_149674_1_.setBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_, Blocks.fire);
}
}
}
}
}
/**
* Checks to see if the block is flammable.
*/
private boolean isFlammable(World p_149817_1_, int p_149817_2_, int p_149817_3_, int p_149817_4_)
{
return p_149817_1_.getBlock(p_149817_2_, p_149817_3_, p_149817_4_).getMaterial().getCanBurn();
}
Est essayé une collision aussi
public void onEntityCollidedWithBlock(World world, int x, int y, int z, EntityPlayer player)
{
if(player instanceof EntityLivingBase && !world.isRemote)
{
player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20, 0));
}
}