mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Merge branch 'mc1.20.1/feature-dev' into mc1.21.1/dev
This commit is contained in:
commit
e7e1b2cd61
3 changed files with 12 additions and 3 deletions
|
@ -87,6 +87,12 @@ public record PotatoCannonProjectileType(HolderSet<Item> items, int reloadTicks,
|
|||
return onBlockHit.map(i -> i.execute(level, stack, ray)).orElse(false);
|
||||
}
|
||||
|
||||
// Copy the stack so it's not mutated and lost
|
||||
@Override
|
||||
public ItemStack dropStack() {
|
||||
return dropStack.copy();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private ResourceLocation id;
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ public interface PotatoProjectileEntityHitAction {
|
|||
livingEntity.addEffect(effect.createEffectInstance());
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -224,10 +224,10 @@ public class PotatoProjectileEntity extends AbstractHurtingProjectile implements
|
|||
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());
|
||||
kill();
|
||||
|
@ -290,6 +290,9 @@ public class PotatoProjectileEntity extends AbstractHurtingProjectile implements
|
|||
if (!getProjectileType().onBlockHit(level(), stack, ray) && !level().isClientSide)
|
||||
if (random.nextDouble() <= recoveryChance)
|
||||
recoverItem();
|
||||
|
||||
spawnAtLocation(getProjectileType().dropStack());
|
||||
|
||||
super.onHitBlock(ray);
|
||||
kill();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue