Perfect soup II

This commit is contained in:
IThundxr 2025-02-23 21:48:00 -05:00
parent 20491b3caa
commit 3e10dbe4bc
Failed to generate hash of commit

View file

@ -228,12 +228,13 @@ public class PotatoProjectileEntity extends AbstractHurtingProjectile implements
if (targetIsEnderman)
return;
if (!projectileType.onEntityHit(stack, ray) && onServer)
if (!projectileType.onEntityHit(stack, ray) && onServer) {
if (random.nextDouble() <= recoveryChance) {
recoverItem();
} else {
spawnAtLocation(projectileType.dropStack());
}
spawnAtLocation(projectileType.dropStack());
}
if (!(target instanceof LivingEntity livingentity)) {
playHitSound(level(), position());
@ -295,11 +296,13 @@ public class PotatoProjectileEntity extends AbstractHurtingProjectile implements
protected void onHitBlock(BlockHitResult ray) {
Vec3 hit = ray.getLocation();
pop(hit);
if (!getProjectileType().onBlockHit(level(), stack, ray) && !level().isClientSide)
if (random.nextDouble() <= recoveryChance)
if (!getProjectileType().onBlockHit(level(), stack, ray) && !level().isClientSide) {
if (random.nextDouble() <= recoveryChance) {
recoverItem();
spawnAtLocation(getProjectileType().dropStack());
} else {
spawnAtLocation(getProjectileType().dropStack());
}
}
super.onHitBlock(ray);
kill();