Prevent EntityItemBuoyant from floating on falling water

This commit is contained in:
MartinTheDragon 2024-05-26 20:52:07 +02:00
parent b1fd87cae4
commit b1369a365a
No known key found for this signature in database
GPG Key ID: 6027A8A22BDD007B

View File

@ -17,8 +17,12 @@ public class EntityItemBuoyant extends EntityItem {
@Override
public void onUpdate() {
if(worldObj.getBlock((int) Math.floor(posX), (int) Math.floor(posY - 0.0625), (int) Math.floor(posZ)).getMaterial() == Material.water) {
int x = (int) Math.floor(posX);
int y = (int) Math.floor(posY - 0.0625);
int z = (int) Math.floor(posZ);
if(worldObj.getBlock(x, y, z).getMaterial() == Material.water && worldObj.getBlockMetadata(x, y, z) < 8) {
this.motionY += 0.045D;
}