PaperMC/paper-server/patches/sources/net/minecraft/world/entity/OminousItemSpawner.java.patch
2024-12-14 12:36:08 +01:00

29 lines
1.6 KiB
Diff

--- a/net/minecraft/world/entity/OminousItemSpawner.java
+++ b/net/minecraft/world/entity/OminousItemSpawner.java
@@ -76,7 +_,7 @@
entity = this.spawnProjectile(serverLevel, projectileItem, item);
} else {
entity = new ItemEntity(serverLevel, this.getX(), this.getY(), this.getZ(), item);
- serverLevel.addFreshEntity(entity);
+ serverLevel.addFreshEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.OMINOUS_ITEM_SPAWNER); // Paper - fixes and addition to spawn reason API
}
serverLevel.levelEvent(3021, this.blockPosition(), 1);
@@ -90,7 +_,7 @@
ProjectileItem.DispenseConfig dispenseConfig = projectileItem.createDispenseConfig();
dispenseConfig.overrideDispenseEvent().ifPresent(i -> level.levelEvent(i, this.blockPosition(), 0));
Direction direction = Direction.DOWN;
- Projectile projectile = Projectile.spawnProjectileUsingShoot(
+ Projectile projectile = Projectile.spawnProjectileUsingShootDelayed( // Paper - fixes and addition to spawn reason API
projectileItem.asProjectile(level, this.position(), stack, direction),
level,
stack,
@@ -99,7 +_,7 @@
direction.getStepZ(),
dispenseConfig.power(),
dispenseConfig.uncertainty()
- );
+ ).spawn(org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.OMINOUS_ITEM_SPAWNER); // Paper - fixes and addition to spawn reason API
projectile.setOwner(this);
return projectile;
}