Merge pull request #1505 from MartinTheDragon/master

Prevent EntityItemBuoyant from floating on falling water
This commit is contained in:
HbmMods 2024-05-26 21:17:38 +02:00 committed by GitHub
commit a75615b8e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}