mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Perfect soup II
This commit is contained in:
parent
20491b3caa
commit
3e10dbe4bc
1 changed files with 10 additions and 7 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue