mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed crash when throwing horseshoes
This commit is contained in:
parent
c5f33d0abd
commit
0603ebf281
1 changed files with 5 additions and 3 deletions
|
@ -268,9 +268,11 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl
|
||||||
|
|
||||||
if (!isBouncy()) {
|
if (!isBouncy()) {
|
||||||
if (stack.isIn(UTags.Items.HORSE_SHOES)) {
|
if (stack.isIn(UTags.Items.HORSE_SHOES)) {
|
||||||
stack.damage(1 + random.nextInt(10), (ServerWorld)getWorld(), null, i -> {
|
if (getWorld() instanceof ServerWorld sw) {
|
||||||
|
stack.damage(1 + random.nextInt(10), sw, null, i -> {
|
||||||
playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1);
|
playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
if (stack.isEmpty()) {
|
if (stack.isEmpty()) {
|
||||||
discard();
|
discard();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue