3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-14 18:40:10 +01:00

Some more compilation fixes

Dieser Commit ist enthalten in:
Bjarne Koll 2024-04-25 19:42:24 +02:00
Ursprung f4c7639986
Commit 9c580566b9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27F6CCCF55D2EE62
24 geänderte Dateien mit 164 neuen und 72 gelöschten Zeilen

Datei anzeigen

@ -192,12 +192,54 @@ index 43b049b68a8af548cd05c67dafc23dabd07bab27..6da6c20b684eba64b85d67db2482b4a9
// Paper end
}
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
index 2072f048e10eba829cef047d854b5a22c8f055a3..eb189e170bc4975c5378f95f86ecf2cc880bd931 100644
index 2072f048e10eba829cef047d854b5a22c8f055a3..f81bbaa6d4a991f265e630dc9a3d3945bac78fff 100644
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
@@ -45,4 +45,25 @@ public interface PotionBrewer {
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
* Represents a brewer that can create {@link PotionEffect}s.
*/
public interface PotionBrewer {
-
+ // Paper start - keep old spigot methods, removal in 1.20.6
/**
* Creates a {@link PotionEffect} from the given {@link PotionEffectType},
* applying duration modifiers and checks.
@@ -16,9 +16,13 @@ public interface PotionBrewer {
* @param duration The duration in ticks
* @param amplifier The amplifier of the effect
* @return The resulting potion effect
+ * @deprecated use {@link PotionEffectType#createEffect(int, int)} instead.
*/
+ @Deprecated(forRemoval = true, since = "1.20.5")
@NotNull
@Deprecated
- public PotionEffect createEffect(@NotNull PotionEffectType potion, int duration, int amplifier);
+ default PotionEffect createEffect(@NotNull PotionEffectType potion, int duration, int amplifier) {
+ return potion.createEffect(duration, amplifier);
+ }
/**
* Returns a collection of {@link PotionEffect} that would be applied from
@@ -28,9 +32,12 @@ public interface PotionBrewer {
* @return The list of effects
* @deprecated Non-Functional
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.5")
@NotNull
- public Collection<PotionEffect> getEffectsFromDamage(int damage);
+ default Collection<PotionEffect> getEffectsFromDamage(final int damage) {
+ return new java.util.ArrayList<>();
+ }
+ // Paper start - keep old spigot methods, removal in 1.20.6
/**
* Returns a collection of {@link PotionEffect} that would be applied from
@@ -43,6 +50,27 @@ public interface PotionBrewer {
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link PotionType#getPotionEffects()} instead
*/
@NotNull
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.5")
public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended);
+
+ // Paper start

Datei anzeigen

@ -172,18 +172,26 @@ index 3ebfd564d4bbf00da5919e966f3d047285845640..c1254088fc65fe46101c82cf2629cf02
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 05c5b52a15be83b6b1043cd85872854696d66a4b..0c8268a6b3079efd3387265dd9e2c0c3e2519b61 100644
index 05c5b52a15be83b6b1043cd85872854696d66a4b..baaa8188e3be7baa99ca8a51b33a14759a50caa7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -308,6 +308,7 @@ public final class CraftServer implements Server {
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
public static Exception excessiveVelEx; // Paper - Velocity warnings
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
+ private final org.bukkit.craftbukkit.potion.CraftPotionBrewer potionBrewer = new org.bukkit.craftbukkit.potion.CraftPotionBrewer(); // Paper - Custom Potion Mixes
+ private final org.bukkit.craftbukkit.potion.CraftPotionBrewer potionBrewer; // Paper - Custom Potion Mixes
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
@@ -3098,5 +3099,10 @@ public final class CraftServer implements Server {
@@ -389,6 +390,7 @@ public final class CraftServer implements Server {
if (this.configuration.getBoolean("settings.use-map-color-cache")) {
MapPalette.setMapColorCache(new CraftMapColorCache(this.logger));
}
+ this.potionBrewer = new org.bukkit.craftbukkit.potion.CraftPotionBrewer(playerList.getServer()); // Paper - custom potion mixes
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
}
@@ -3098,5 +3100,10 @@ public final class CraftServer implements Server {
return datapackManager;
}
@ -212,40 +220,58 @@ index 139dff90561ac6c51954c6289918a07aeea13a1b..6ba29875d78ede4aa7978ff689e588f7
if (bukkit == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
new file mode 100644
index 0000000000000000000000000000000000000000..2909a2736a0c9d863c7ab01e0ec259f7952080cc
index 0000000000000000000000000000000000000000..5c08be880b81ce8627e7679942f273a948bed934
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
@@ -0,0 +1,48 @@
@@ -0,0 +1,66 @@
+package org.bukkit.craftbukkit.potion;
+
+import com.google.common.base.Preconditions;
+import java.util.ArrayList;
+import java.util.Collection;
+import org.bukkit.potion.PotionBrewer;
+import org.bukkit.potion.PotionData;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.potion.PotionType;
+
+public class CraftPotionBrewer implements PotionBrewer {
+
+ private final net.minecraft.server.MinecraftServer minecraftServer;
+
+ public CraftPotionBrewer(net.minecraft.server.MinecraftServer minecraftServer) {
+ this.minecraftServer = minecraftServer;
+ }
+
+ // Paper start - keep old spigot methods, removal in 1.20.6
+ @Override
+ public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, boolean extended) {
+ Preconditions.checkArgument(!type.getKey().getKey().startsWith("strong_"), "Strong potion type cannot be used directly, got %s", type.getKey());
+ Preconditions.checkArgument(!type.getKey().getKey().startsWith("long_"), "Extended potion type cannot be used directly, got %s", type.getKey());
+ final org.bukkit.NamespacedKey key = type.getKey();
+
+ return CraftPotionUtil.fromBukkit(new PotionData(type, upgraded, extended)).getPotionEffects();
+ Preconditions.checkArgument(!key.getKey().startsWith("strong_"), "Strong potion type cannot be used directly, got %s", key);
+ Preconditions.checkArgument(!key.getKey().startsWith("long_"), "Extended potion type cannot be used directly, got %s", key);
+
+ org.bukkit.NamespacedKey effectiveKey = key;
+ if (upgraded) {
+ effectiveKey = new org.bukkit.NamespacedKey(key.namespace(), "strong_" + key.key());
+ } else if (extended) {
+ effectiveKey = new org.bukkit.NamespacedKey(key.namespace(), "long_" + key.key());
+ }
+
+ final org.bukkit.potion.PotionType effectivePotionType = org.bukkit.Registry.POTION.get(effectiveKey);
+ Preconditions.checkNotNull(type, "Unknown potion type from data " + effectiveKey.asMinimalString()); // Legacy error message in 1.20.4
+ return effectivePotionType.getPotionEffects();
+ }
+
+ @Override
+ public Collection<PotionEffect> getEffectsFromDamage(int damage) {
+ return new ArrayList<PotionEffect>();
+ return new ArrayList<>();
+ }
+
+ @Override
+ public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) {
+ return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier);
+ return new PotionEffect(potion, potion.isInstant() ? 1 : duration, amplifier);
+ }
+ // Paper end - keep old spigot methods, removal in 1.20.6
+
+ // Paper start
+ @Override
@ -260,7 +286,7 @@ index 0000000000000000000000000000000000000000..2909a2736a0c9d863c7ab01e0ec259f7
+
+ @Override
+ public void resetPotionMixes() {
+ net.minecraft.world.item.alchemy.PotionBrewing.reload();
+ this.minecraftServer.potionBrewing().reload(this.minecraftServer.getWorldData().enabledFeatures());
+ }
+ // Paper end
+}

Datei anzeigen

@ -15,17 +15,15 @@ piercing arrows to avoid duplicate damage being applied.
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 8e8258333e181491b2d5b61ebdb80de36e8179a9..2df84bc367f650c3d468e0f09ed565e68de43a82 100644
index 8e8258333e181491b2d5b61ebdb80de36e8179a9..fc5913910f5614cd3e10cd9c1aa482a4b70ac260 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -305,10 +305,18 @@ public abstract class AbstractArrow extends Projectile {
@@ -305,6 +305,19 @@ public abstract class AbstractArrow extends Projectile {
}
}
+ // Paper start - Fix cancelling ProjectileHitEvent for piercing arrows
@Override
- protected double getDefaultGravity() {
- return 0.05D;
+ @Override
+ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult hitResult) {
+ if (hitResult instanceof EntityHitResult entityHitResult && this.hitCancelled && this.getPierceLevel() > 0) {
+ if (this.piercingIgnoreEntityIds == null) {
@ -33,9 +31,10 @@ index 8e8258333e181491b2d5b61ebdb80de36e8179a9..2df84bc367f650c3d468e0f09ed565e6
+ }
+ this.piercingIgnoreEntityIds.add(entityHitResult.getEntity().getId());
+ }
+ super.preHitTargetOrDeflectSelf(hitResult);
}
+ return super.preHitTargetOrDeflectSelf(hitResult);
+ }
+ // Paper end - Fix cancelling ProjectileHitEvent for piercing arrows
private boolean shouldFall() {
return this.inGround && this.level().noCollision((new AABB(this.position(), this.position())).inflate(0.06D));
+
@Override
protected double getDefaultGravity() {
return 0.05D;

Datei anzeigen

@ -132,6 +132,32 @@ index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc
+ }
+ // Paper end - More projectile API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
index 98f46fadd60ea688fefa8d83dbd6fe9b61b6a96f..54daf160748ae4c952ee605a2d55ee7533c42093 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java
@@ -60,20 +60,7 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr
this.getHandle().setCritArrow(critical);
}
- @Override
- public ProjectileSource getShooter() {
- return this.getHandle().projectileSource;
- }
-
- @Override
- public void setShooter(ProjectileSource shooter) {
- if (shooter instanceof Entity) {
- this.getHandle().setOwner(((CraftEntity) shooter).getHandle());
- } else {
- this.getHandle().setOwner(null);
- }
- this.getHandle().projectileSource = shooter;
- }
+ // Paper - moved to AbstractProjectil
@Override
public boolean isInBlock() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index 62fe1ae5cfdcba84d8d1456a9939e4649aea8794..291e97eedda1c6d77d53631253be8c3333b88ff2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0c8268a6b3079efd3387265dd9e2c0c3e2519b61..c1e558c4c68d098f2e6e32c08044b092d6dda4cc 100644
index baaa8188e3be7baa99ca8a51b33a14759a50caa7..0fe4a3a4357b9bbcb71f3b473253bea7c7e4645d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1349,7 +1349,7 @@ public final class CraftServer implements Server {
@@ -1350,7 +1350,7 @@ public final class CraftServer implements Server {
try {
if (save) {

Datei anzeigen

@ -13,7 +13,7 @@ we'll also only gen a trace for the first one, I see no real pressing need
to generate more, given that that would *massively* negate this patch otherwise
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 744efc6cdc99f653a1eb9d4f26af8a7c34627f5e..a343bb1b1ee2cd2ecd75be00aa91d5418dcdec76 100644
index 744efc6cdc99f653a1eb9d4f26af8a7c34627f5e..68a6572da2acf2ea2e6996e653a0ffe405846575 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -283,6 +283,7 @@ public class WorldGenRegion implements WorldGenLevel {
@ -28,10 +28,9 @@ index 744efc6cdc99f653a1eb9d4f26af8a7c34627f5e..a343bb1b1ee2cd2ecd75be00aa91d541
return true;
} else {
- Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
+ // Paper start - Buffer OOB setBlock calls
+ if (!hasSetFarWarned) {
+ Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
+ hasSetFarWarned = true;
+ if (this.getServer() != null && this.getServer().isDebugging()) {
+ io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call");

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c1e558c4c68d098f2e6e32c08044b092d6dda4cc..c95818aa6227985341236f2e735c46ea8742896b 100644
index 0fe4a3a4357b9bbcb71f3b473253bea7c7e4645d..dedd5c3d7cc2b83a78a480c7ab5c70aed1848b15 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1308,6 +1308,14 @@ public final class CraftServer implements Server {
@@ -1309,6 +1309,14 @@ public final class CraftServer implements Server {
internal.setSpawnSettings(true, true);
// Paper - Put world into worldlist before initing the world; move up

Datei anzeigen

@ -45,10 +45,10 @@ index 79f7e0fb2f1aa6af441c6e09d2c443d7d4bb47ef..00457548d43e1d2143d1f6027593a117
this.profiler.popPush("connection");
MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c95818aa6227985341236f2e735c46ea8742896b..f4c03148751f563ad3e1bfdc06266509f8c92df8 100644
index dedd5c3d7cc2b83a78a480c7ab5c70aed1848b15..fb1f4db17fb91d972fd78fed389e75f663c0f29b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -886,6 +886,11 @@ public final class CraftServer implements Server {
@@ -887,6 +887,11 @@ public final class CraftServer implements Server {
return new ArrayList<World>(this.worlds.values());
}
@ -60,7 +60,7 @@ index c95818aa6227985341236f2e735c46ea8742896b..f4c03148751f563ad3e1bfdc06266509
public DedicatedPlayerList getHandle() {
return this.playerList;
}
@@ -1146,6 +1151,7 @@ public final class CraftServer implements Server {
@@ -1147,6 +1152,7 @@ public final class CraftServer implements Server {
@Override
public World createWorld(WorldCreator creator) {
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
@ -68,7 +68,7 @@ index c95818aa6227985341236f2e735c46ea8742896b..f4c03148751f563ad3e1bfdc06266509
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
String name = creator.name();
@@ -1330,6 +1336,7 @@ public final class CraftServer implements Server {
@@ -1331,6 +1337,7 @@ public final class CraftServer implements Server {
@Override
public boolean unloadWorld(World world, boolean save) {

Datei anzeigen

@ -20,10 +20,10 @@ index e40069d937de5fd00741ae6873abeecc46b93732..552f7ab11dc09fa69034f009235cb224
Date date = new Date();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f4c03148751f563ad3e1bfdc06266509f8c92df8..2bbb40a5c7a61fb51dfaea320724bdd60cf41d64 100644
index fb1f4db17fb91d972fd78fed389e75f663c0f29b..5fdb632410e1449a6526ace12f39abba488cc7a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1899,7 +1899,7 @@ public final class CraftServer implements Server {
@@ -1900,7 +1900,7 @@ public final class CraftServer implements Server {
// Paper end
Set<CommandSender> recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {

Datei anzeigen

@ -228,10 +228,10 @@ index 49627a02cb15e94e7c3ddfe65aa663d982a34408..21d97c2b533a6528dd73c4e514d49273
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2bbb40a5c7a61fb51dfaea320724bdd60cf41d64..1e6e27eff630c70775d9654181933c70e61b5c29 100644
index 5fdb632410e1449a6526ace12f39abba488cc7a4..8f2298f3e7b2cfa310b8672861193aaba21bb698 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -815,7 +815,7 @@ public final class CraftServer implements Server {
@@ -816,7 +816,7 @@ public final class CraftServer implements Server {
@Override
public long getConnectionThrottle() {
// Spigot Start - Automatically set connection throttle for bungee configurations

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix async entity add due to fungus trees
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index a343bb1b1ee2cd2ecd75be00aa91d5418dcdec76..713509e08c6325816fef7c09477d36aacb0008ef 100644
index 68a6572da2acf2ea2e6996e653a0ffe405846575..a59eece9c7a8c33cb8ce963906e993c3462684fb 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -236,6 +236,7 @@ public class WorldGenRegion implements WorldGenLevel {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1e6e27eff630c70775d9654181933c70e61b5c29..f7ec95f30700bb1a72c0ca75674908dd2752e82d 100644
index 8f2298f3e7b2cfa310b8672861193aaba21bb698..fe1083203e15467612e584e8cab1c149cce9728a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -354,7 +354,11 @@ public final class CraftServer implements Server {

Datei anzeigen

@ -1251,12 +1251,12 @@ index 16f36d1bfe6458f9aa935cdc63066c082bc83f8e..638aeef75dc5f7ab8b8e050118a7c709
public void setLevelCallback(EntityInLevelCallback changeListener) {
this.levelCallback = changeListener;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f7ec95f30700bb1a72c0ca75674908dd2752e82d..8c3348b1265b16d159e19a48c4e2ee69a6523d72 100644
index fe1083203e15467612e584e8cab1c149cce9728a..4a9b928d5e4439a43d4a47006949c1f69cb3a057 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -310,6 +310,76 @@ public final class CraftServer implements Server {
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
private final org.bukkit.craftbukkit.potion.CraftPotionBrewer potionBrewer = new org.bukkit.craftbukkit.potion.CraftPotionBrewer(); // Paper - Custom Potion Mixes
private final org.bukkit.craftbukkit.potion.CraftPotionBrewer potionBrewer; // Paper - Custom Potion Mixes
+ // Paper start - Folia region threading API
+ private final io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler();

Datei anzeigen

@ -39,10 +39,10 @@ index b00da578cb4ba037a540584738b3f866acfa9f88..2f62af670441d422133b18d00d9e5e5e
Iterator iterator1 = this.players.iterator();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8c3348b1265b16d159e19a48c4e2ee69a6523d72..5485c8d60db7db6eec2da49470230bba7ce4b766 100644
index 4a9b928d5e4439a43d4a47006949c1f69cb3a057..10d3bfe2c28dfbb6d862909c7501ab1a91e8f2bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1142,6 +1142,18 @@ public final class CraftServer implements Server {
@@ -1143,6 +1143,18 @@ public final class CraftServer implements Server {
ReloadCommand.reload(this.console);
}
@ -61,7 +61,7 @@ index 8c3348b1265b16d159e19a48c4e2ee69a6523d72..5485c8d60db7db6eec2da49470230bba
private void loadIcon() {
this.icon = new CraftIconCache(null);
try {
@@ -1529,6 +1541,13 @@ public final class CraftServer implements Server {
@@ -1530,6 +1542,13 @@ public final class CraftServer implements Server {
@Override
public boolean addRecipe(Recipe recipe) {
@ -75,7 +75,7 @@ index 8c3348b1265b16d159e19a48c4e2ee69a6523d72..5485c8d60db7db6eec2da49470230bba
CraftRecipe toAdd;
if (recipe instanceof CraftRecipe) {
toAdd = (CraftRecipe) recipe;
@@ -1558,6 +1577,11 @@ public final class CraftServer implements Server {
@@ -1559,6 +1578,11 @@ public final class CraftServer implements Server {
}
}
toAdd.addToCraftingManager();
@ -87,7 +87,7 @@ index 8c3348b1265b16d159e19a48c4e2ee69a6523d72..5485c8d60db7db6eec2da49470230bba
return true;
}
@@ -1738,10 +1762,23 @@ public final class CraftServer implements Server {
@@ -1739,10 +1763,23 @@ public final class CraftServer implements Server {
@Override
public boolean removeRecipe(NamespacedKey recipeKey) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Use correct seed on api world load
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5485c8d60db7db6eec2da49470230bba7ce4b766..c0fa5bb020ba5fa2a6fce98ec652eadb42237918 100644
index 10d3bfe2c28dfbb6d862909c7501ab1a91e8f2bc..53d4f38eabd3759737f2cacee38d337e8989220b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1364,7 +1364,7 @@ public final class CraftServer implements Server {
@@ -1365,7 +1365,7 @@ public final class CraftServer implements Server {
net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistrycustom_dimension, this.console.options.has("recreateRegionFiles"));
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c0fa5bb020ba5fa2a6fce98ec652eadb42237918..2f721887c6b7a212e441d61ef37c1f0da8c2681e 100644
index 53d4f38eabd3759737f2cacee38d337e8989220b..a1ea2f64f877ed2c7aecfb99db53a84677bf4134 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1977,6 +1977,11 @@ public final class CraftServer implements Server {
@@ -1978,6 +1978,11 @@ public final class CraftServer implements Server {
ServerLevel worldServer = ((CraftWorld) world).getHandle();
Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored);
@ -20,7 +20,7 @@ index c0fa5bb020ba5fa2a6fce98ec652eadb42237918..2f721887c6b7a212e441d61ef37c1f0d
BlockPos structurePosition = CraftLocation.toBlockPosition(structureLocation);
// Create map with trackPlayer = true, unlimitedTracking = true
@@ -1987,6 +1992,31 @@ public final class CraftServer implements Server {
@@ -1988,6 +1993,31 @@ public final class CraftServer implements Server {
return CraftItemStack.asBukkitCopy(stack);
}

Datei anzeigen

@ -85,10 +85,10 @@ index 506101a692c73f6acf2e647c3ab18024ccdff866..4f2148d13fc26ad2c43460f46c376832
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 2df84bc367f650c3d468e0f09ed565e68de43a82..7ea5f496dc9ffab8311fcc79de47362a66c703e6 100644
index fc5913910f5614cd3e10cd9c1aa482a4b70ac260..31b8a8bf78d52b5f11b68e780ec09bf78e7bda84 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -556,7 +556,7 @@ public abstract class AbstractArrow extends Projectile {
@@ -561,7 +561,7 @@ public abstract class AbstractArrow extends Projectile {
this.setCritArrow(nbt.getBoolean("crit"));
this.setPierceLevel(nbt.getByte("PierceLevel"));
if (nbt.contains("SoundEvent", 8)) {

Datei anzeigen

@ -707,10 +707,10 @@ index 2e96308696e131f3f013469a395e5ddda2c5d529..65a66e484c1c39c5f41d97db52f31c67
} catch (Throwable e) {
LOGGER.error("Failed to run bootstrapper for %s. This plugin will not be loaded.".formatted(provider.getSource()), e);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2f721887c6b7a212e441d61ef37c1f0da8c2681e..4cff20b3d5a8384f8311474bb606890dc41e1ce7 100644
index a1ea2f64f877ed2c7aecfb99db53a84677bf4134..8c24d64db2b63ba4098e3322e3944602a90c1913 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1017,6 +1017,11 @@ public final class CraftServer implements Server {
@@ -1018,6 +1018,11 @@ public final class CraftServer implements Server {
@Override
public void reload() {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] improve BanList types
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4cff20b3d5a8384f8311474bb606890dc41e1ce7..1baf861ba5a59d3413647331f19391968ac2e8db 100644
index 8c24d64db2b63ba4098e3322e3944602a90c1913..5bf4a91a061f7cfdb9fd25212cad49237a737571 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2230,6 +2230,21 @@ public final class CraftServer implements Server {
@@ -2231,6 +2231,21 @@ public final class CraftServer implements Server {
};
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix creation of invalid block entity during world generation
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 713509e08c6325816fef7c09477d36aacb0008ef..8f8cbb9cc7febe3eb1c7de2be3953f67b0b58116 100644
index a59eece9c7a8c33cb8ce963906e993c3462684fb..333a02e08cccf5cb0efa2076582cbd69e95ff0c0 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -339,6 +339,7 @@ public class WorldGenRegion implements WorldGenLevel {

Datei anzeigen

@ -4858,7 +4858,7 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..6051e5f272838ef23276a90e21c2fc82
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
return new TicketType<>(name, argumentComparator, 0L);
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 8f8cbb9cc7febe3eb1c7de2be3953f67b0b58116..9297ae20ce5ea5f5a7e8e6d080ef7b2ddff7058c 100644
index 333a02e08cccf5cb0efa2076582cbd69e95ff0c0..ca4c8e256047a4af45811c3e772b5a959e2ae941 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -109,6 +109,27 @@ public class WorldGenRegion implements WorldGenLevel {

Datei anzeigen

@ -19266,7 +19266,7 @@ index 6051e5f272838ef23276a90e21c2fc821ca155d1..658e63ebde81dc14c8ab5850fb246dc0
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
return new TicketType<>(name, argumentComparator, 0L);
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 9297ae20ce5ea5f5a7e8e6d080ef7b2ddff7058c..d05c40c77c7d37eb8eabfd3a9df8860bed5a17e4 100644
index ca4c8e256047a4af45811c3e772b5a959e2ae941..1351423a12c19a01f602a202832372a399e6a867 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -544,4 +544,21 @@ public class WorldGenRegion implements WorldGenLevel {
@ -21517,10 +21517,10 @@ index 7dae8d91b74cc7df0745f0c121e3bea09b8d0b6d..1e2530c9e5212b6d2bdbc94817beddb4
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1baf861ba5a59d3413647331f19391968ac2e8db..78c9a729f188e0888d3df1f5d988391488bc9a43 100644
index 5bf4a91a061f7cfdb9fd25212cad49237a737571..cf3ec706b1737981258ce444934a93c6425c884e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1414,7 +1414,6 @@ public final class CraftServer implements Server {
@@ -1415,7 +1415,6 @@ public final class CraftServer implements Server {
// Paper end
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
@ -21528,7 +21528,7 @@ index 1baf861ba5a59d3413647331f19391968ac2e8db..78c9a729f188e0888d3df1f5d9883914
this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
return internal.getWorld();
@@ -1459,7 +1458,7 @@ public final class CraftServer implements Server {
@@ -1460,7 +1459,7 @@ public final class CraftServer implements Server {
}
handle.getChunkSource().close(save);
@ -21537,7 +21537,7 @@ index 1baf861ba5a59d3413647331f19391968ac2e8db..78c9a729f188e0888d3df1f5d9883914
handle.convertable.close();
} catch (Exception ex) {
this.getLogger().log(Level.SEVERE, null, ex);
@@ -2495,7 +2494,7 @@ public final class CraftServer implements Server {
@@ -2496,7 +2495,7 @@ public final class CraftServer implements Server {
@Override
public boolean isPrimaryThread() {

Datei anzeigen

@ -1573,10 +1573,10 @@ index 1e2530c9e5212b6d2bdbc94817beddb4247dac73..82b4bd669c57b18fb0b443bcd9449502
private static final byte[] EMPTY_LIGHT = new byte[2048];
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 78c9a729f188e0888d3df1f5d988391488bc9a43..f6b7ae6c00150d2bc33c42a1f8432478d979d38b 100644
index cf3ec706b1737981258ce444934a93c6425c884e..204e6368206d7c3c013538027fbb0842a9a49b45 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2666,7 +2666,7 @@ public final class CraftServer implements Server {
@@ -2667,7 +2667,7 @@ public final class CraftServer implements Server {
public ChunkGenerator.ChunkData createChunkData(World world) {
Preconditions.checkArgument(world != null, "World cannot be null");
ServerLevel handle = ((CraftWorld) world).getHandle();

Datei anzeigen

@ -355,10 +355,10 @@ index af50a02bafb7c1db4569604d1e69f95daab6d2a5..541b99dc1361a6ebd40873e45a1acd12
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f6b7ae6c00150d2bc33c42a1f8432478d979d38b..554096a467ed9e1c8ab393fdaa8b9c31e1f7bbd4 100644
index 204e6368206d7c3c013538027fbb0842a9a49b45..5309ae765e9855dc5f90bd195d78cdb68c72e5a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1365,9 +1365,7 @@ public final class CraftServer implements Server {
@@ -1366,9 +1366,7 @@ public final class CraftServer implements Server {
worlddata.checkName(name);
worlddata.setModdedInfo(this.console.getServerModName(), this.console.getModdedStatus().shouldReportAsModified());
@ -369,7 +369,7 @@ index f6b7ae6c00150d2bc33c42a1f8432478d979d38b..554096a467ed9e1c8ab393fdaa8b9c31
long j = BiomeManager.obfuscateSeed(worlddata.worldGenOptions().seed()); // Paper - use world seed
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
@@ -1378,6 +1376,13 @@ public final class CraftServer implements Server {
@@ -1379,6 +1377,13 @@ public final class CraftServer implements Server {
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
}