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)
|
if (targetIsEnderman)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!projectileType.onEntityHit(stack, ray) && onServer)
|
if (!projectileType.onEntityHit(stack, ray) && onServer) {
|
||||||
if (random.nextDouble() <= recoveryChance) {
|
if (random.nextDouble() <= recoveryChance) {
|
||||||
recoverItem();
|
recoverItem();
|
||||||
|
} else {
|
||||||
|
spawnAtLocation(projectileType.dropStack());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
spawnAtLocation(projectileType.dropStack());
|
|
||||||
|
|
||||||
if (!(target instanceof LivingEntity livingentity)) {
|
if (!(target instanceof LivingEntity livingentity)) {
|
||||||
playHitSound(level(), position());
|
playHitSound(level(), position());
|
||||||
|
@ -295,11 +296,13 @@ public class PotatoProjectileEntity extends AbstractHurtingProjectile implements
|
||||||
protected void onHitBlock(BlockHitResult ray) {
|
protected void onHitBlock(BlockHitResult ray) {
|
||||||
Vec3 hit = ray.getLocation();
|
Vec3 hit = ray.getLocation();
|
||||||
pop(hit);
|
pop(hit);
|
||||||
if (!getProjectileType().onBlockHit(level(), stack, ray) && !level().isClientSide)
|
if (!getProjectileType().onBlockHit(level(), stack, ray) && !level().isClientSide) {
|
||||||
if (random.nextDouble() <= recoveryChance)
|
if (random.nextDouble() <= recoveryChance) {
|
||||||
recoverItem();
|
recoverItem();
|
||||||
|
} else {
|
||||||
spawnAtLocation(getProjectileType().dropStack());
|
spawnAtLocation(getProjectileType().dropStack());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
super.onHitBlock(ray);
|
super.onHitBlock(ray);
|
||||||
kill();
|
kill();
|
||||||
|
|
Loading…
Add table
Reference in a new issue