fix a mis-applied hunk in Projectile

This commit is contained in:
Jake Potrebic 2024-12-15 12:09:18 -08:00
parent 8cca65b8ac
commit de10a277e2
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
2 changed files with 11 additions and 21 deletions

View File

@ -139,7 +139,7 @@
Executor dispatcher,
LevelStorageSource.LevelStorageAccess levelStorageAccess,
- ServerLevelData serverLevelData,
+ PrimaryLevelData serverLevelData, // CraftBukkit
+ net.minecraft.world.level.storage.PrimaryLevelData serverLevelData, // CraftBukkit
ResourceKey<Level> dimension,
LevelStem levelStem,
ChunkProgressListener progressListener,

View File

@ -78,30 +78,20 @@
factory.create(level, owner, spawnedFrom),
level,
spawnedFrom,
@@ -200,7 +_,22 @@
float velocity,
float inaccuracy
@@ -206,7 +_,12 @@
public static <T extends Projectile> T spawnProjectileUsingShoot(
T projectile, ServerLevel level, ItemStack spawnedFrom, double x, double y, double z, float velocity, float inaccuracy
) {
- return spawnProjectile(factory.create(level, owner, spawnedFrom), level, spawnedFrom, projectile -> projectile.shoot(x, y, z, velocity, inaccuracy));
+ // Paper start - fixes and addition to spawn reason API
+ return Projectile.spawnProjectileUsingShootDelayed(factory, level, spawnedFrom, owner, x, y, z, velocity, inaccuracy).spawn();
- return spawnProjectile(projectile, level, spawnedFrom, projectile1 -> projectile.shoot(x, y, z, velocity, inaccuracy));
+ // Paper start - fixes and addition to spawn reason API
+ return spawnProjectileUsingShootDelayed(projectile, level, spawnedFrom, x, y, z, velocity, inaccuracy).spawn();
+ }
+ public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(
+ Projectile.ProjectileFactory<T> factory,
+ ServerLevel level,
+ ItemStack spawnedFrom,
+ LivingEntity owner,
+ double x,
+ double y,
+ double z,
+ float velocity,
+ float inaccuracy
+ ) {
+ return spawnProjectileDelayed(factory.create(level, owner, spawnedFrom), level, spawnedFrom, projectile -> projectile.shoot(x, y, z, velocity, inaccuracy));
+ // Paper end - fixes and addition to spawn reason API
+ public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel level, ItemStack spawnedFrom, double x, double y, double z, float velocity, float inaccuracy) {
+ return spawnProjectileDelayed(projectile, level, spawnedFrom, projectile1 -> projectile.shoot(x, y, z, velocity, inaccuracy));
+ // Paper end - fixes and addition to spawn reason API
}
public static <T extends Projectile> T spawnProjectileUsingShoot(
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel level, ItemStack spawnedFrom) {
@@ -214,11 +_,45 @@
}