13
0
geforkt von Mirrors/Paper

fix a mis-applied hunk in Projectile

Dieser Commit ist enthalten in:
Jake Potrebic 2024-12-15 12:09:18 -08:00
Ursprung 8cca65b8ac
Commit de10a277e2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
2 geänderte Dateien mit 11 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -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,

Datei anzeigen

@ -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 @@
}