Updated Upstream (CraftBukkit) (#6504)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 5be41fb8 SPIGOT-6720: Fix bed explosion checks 09b99daf SPIGOT-6722: Close entity manager when unloading world 3a9561bf SPIGOT-6686: Changes in MaximumRepairCost for Anvil Rename cause inconsistency
This commit is contained in:
parent
08f746f5f0
commit
f44d237de9
|
@ -681,7 +681,7 @@ index ae26cf65169fd25520263a3edb93424383fa7bb0..5de52a4c33fd136b43b150b7ed0df770
|
|||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 289838b07b027dad54789c977db87fd7637577a0..127386a7d436d9e6a54ee66e7a40a20b73be6481 100644
|
||||
index 4bd0a7923845a402bc3a3dfea998be5f3cbc5518..dee1bf692a2c13d280b54a46137e24376f5b7772 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -820,6 +820,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -707,7 +707,7 @@ index 289838b07b027dad54789c977db87fd7637577a0..127386a7d436d9e6a54ee66e7a40a20b
|
|||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2247,4 +2250,35 @@ public final class CraftServer implements Server {
|
||||
@@ -2248,4 +2251,35 @@ public final class CraftServer implements Server {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
|
|
@ -1823,10 +1823,10 @@ index b645a2fc839dbf922ce73b23b7d53e9a5fe1a2ee..1b478ebfe6792a157772a5812d0daa1a
|
|||
|
||||
private static CompoundTag packStructureData(ServerLevel world, ChunkPos chunkcoordintpair, Map<StructureFeature<?>, StructureStart<?>> map, Map<StructureFeature<?>, LongSet> map1) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 127386a7d436d9e6a54ee66e7a40a20b73be6481..5749657a70191d52932a45d810bb07d8efd29531 100644
|
||||
index dee1bf692a2c13d280b54a46137e24376f5b7772..0c430583e4bdc4050e3a278ff500bea3b07c40ee 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2219,12 +2219,31 @@ public final class CraftServer implements Server {
|
||||
@@ -2220,12 +2220,31 @@ public final class CraftServer implements Server {
|
||||
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
|
||||
{
|
||||
|
||||
|
|
|
@ -1223,7 +1223,7 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490
|
|||
buf.writeComponent(this.footer);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index b3ce71df7ed67583925b21b59d8f1ccf9ed5beda..5358faada2d6cf806a468190ec568ffa322aa121 100644
|
||||
index 89c718e5b975a83b07a114b2b2c6fe31c75cb580..d1efa7b3fb2b22bd77fd01ffd137ddc975e5fe60 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -146,6 +146,7 @@ import net.minecraft.world.scores.Score;
|
||||
|
@ -1702,7 +1702,7 @@ index 7a0e7961df1e62b311ea2ecc76d7343a8646723b..6859fafa42527d45366018f737c19e6c
|
|||
}
|
||||
collection = icons;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea02d7c3ad9 100644
|
||||
index 0c430583e4bdc4050e3a278ff500bea3b07c40ee..ca36773a4a01d050a79bfabeb5aba854a86be168 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -579,8 +579,10 @@ public final class CraftServer implements Server {
|
||||
|
@ -1716,7 +1716,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1405,7 +1407,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1406,7 +1408,15 @@ public final class CraftServer implements Server {
|
||||
return this.configuration.getInt("settings.spawn-radius", -1);
|
||||
}
|
||||
|
||||
|
@ -1732,7 +1732,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
public String getShutdownMessage() {
|
||||
return this.configuration.getString("settings.shutdown-message");
|
||||
}
|
||||
@@ -1558,7 +1568,20 @@ public final class CraftServer implements Server {
|
||||
@@ -1559,7 +1569,20 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1753,7 +1753,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
Set<CommandSender> recipients = new HashSet<>();
|
||||
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
|
||||
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
|
||||
@@ -1566,14 +1589,14 @@ public final class CraftServer implements Server {
|
||||
@@ -1567,14 +1590,14 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1770,7 +1770,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
|
||||
for (CommandSender recipient : recipients) {
|
||||
recipient.sendMessage(message);
|
||||
@@ -1809,6 +1832,14 @@ public final class CraftServer implements Server {
|
||||
@@ -1810,6 +1833,14 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
|
||||
}
|
||||
|
||||
|
@ -1785,7 +1785,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
@Override
|
||||
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
|
||||
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
|
||||
@@ -1821,13 +1852,28 @@ public final class CraftServer implements Server {
|
||||
@@ -1822,13 +1853,28 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
|
||||
}
|
||||
|
||||
|
@ -1814,7 +1814,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
public Merchant createMerchant(String title) {
|
||||
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
|
||||
}
|
||||
@@ -1871,6 +1917,12 @@ public final class CraftServer implements Server {
|
||||
@@ -1872,6 +1918,12 @@ public final class CraftServer implements Server {
|
||||
return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
|
||||
}
|
||||
|
||||
|
@ -1827,7 +1827,7 @@ index 5749657a70191d52932a45d810bb07d8efd29531..70d1ac0c352f16ee2dc394e5df31eea0
|
|||
@Override
|
||||
public String getMotd() {
|
||||
return this.console.getMotd();
|
||||
@@ -2299,5 +2351,15 @@ public final class CraftServer implements Server {
|
||||
@@ -2300,5 +2352,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,10 +143,10 @@ index cb1caae296d8d27d65f6f63f0f86aee53d363664..5756f151de059f6b0de811498fe9e6e0
|
|||
this.startMetricsRecordingTick();
|
||||
this.profiler.push("tick");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2092bd94bc151264e1e5d0efd687ee92c3ac8c3c..167558990f82c9b463377bbc64e18baa956871db 100644
|
||||
index 7d197e075874c70207e1068e300eaf5f076745a8..66420a9b1e917856b94343b90859323a1d84341f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2267,6 +2267,17 @@ public final class CraftServer implements Server {
|
||||
@@ -2268,6 +2268,17 @@ public final class CraftServer implements Server {
|
||||
return CraftMagicNumbers.INSTANCE;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d8f5476067cb41d04ebccd690b83756b95396500..461251cc096e3e2efc52f7b5cc4de90dc5334a34 100644
|
||||
index 022326790d61d163a47b2fe888627f0625405755..45c6c2bc739c842d27cb9c4a87c2154f6e447d17 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1905,6 +1905,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1906,6 +1906,7 @@ public final class CraftServer implements Server {
|
||||
return this.helpMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
|
|||
https://github.com/PaperMC/Paper/issues/49
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f3e50cebfbac08d9cf997faf99e63f750fff8a5c..d9196e8268ffcdd5e696b98b4a384baa03d8bb21 100644
|
||||
index 451d911334dc1477c99f94705632c9fd5184ddb0..c2b16834ccddda703973dc7ad85f584e2625a57f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2397,5 +2397,23 @@ public final class CraftServer implements Server {
|
||||
@@ -2398,5 +2398,23 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
return this.adventure$audiences;
|
||||
}
|
||||
|
|
|
@ -67,10 +67,10 @@ index f6cb864c45f960811acc02829d1f7883b916de29..8703f97dc2f392b136c6851aa09b607c
|
|||
} else {
|
||||
String[] astring1 = astring;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d4c1b181ac1d1f4aaedf2c2ace8aff632439c8d7..1d3eebbd525cea270f74c651725ecb1704cd14d6 100644
|
||||
index 8020aa53077e3eb09a866257c5648bf10ecc9227..a461bfaeaa414ae3bfed96913140b22b81fe255d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1648,7 +1648,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1649,7 +1649,7 @@ public final class CraftServer implements Server {
|
||||
// Spigot Start
|
||||
GameProfile profile = null;
|
||||
// Only fetch an online UUID in online mode
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
|
|||
Reload the aliases stored in commands.yml
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 1d3eebbd525cea270f74c651725ecb1704cd14d6..36008512f847510c03e6165904dbe9a562c06d25 100644
|
||||
index a461bfaeaa414ae3bfed96913140b22b81fe255d..ba13ecb7148e1b7227b4eeaa36cedaed163200af 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2423,5 +2423,24 @@ public final class CraftServer implements Server {
|
||||
@@ -2424,5 +2424,24 @@ public final class CraftServer implements Server {
|
||||
DefaultPermissions.registerCorePermissions();
|
||||
CraftDefaultPermissions.registerCorePermissions();
|
||||
}
|
||||
|
|
|
@ -20,10 +20,10 @@ index 8af8e5f28b5205e3e4ef68ba870f610facc389bd..546daac72e4829a22ed3c3eb4093b0d8
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 36008512f847510c03e6165904dbe9a562c06d25..66be5160113dfa7833dd5015313e7e7dea0bc1ae 100644
|
||||
index ba13ecb7148e1b7227b4eeaa36cedaed163200af..2c0753ed9403de5c875a023baafa74b6db5ef80a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2442,5 +2442,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2443,5 +2443,10 @@ public final class CraftServer implements Server {
|
||||
commandMap.registerServerAliases();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ Other changes:
|
|||
configuration
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index bacfd25d2fa07d2b0441494a39fe3830b7e4d1f0..6557e1556c54df6581b61419a2b9e040dd6e0196 100644
|
||||
index d97e9ba4432fc87c84f9f128820ff741464e1e25..ee6257e1106794614b9d3ec4e9ee354f14f86e69 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -17,7 +17,17 @@ repositories {
|
||||
|
@ -244,7 +244,7 @@ index 24add1cd1f865012c5382548e415218d481ecefe..31dccb0b4ab60d6cedf236fc7d51a363
|
|||
|
||||
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 66be5160113dfa7833dd5015313e7e7dea0bc1ae..1fff5dfe44ec37c22df3fe257e02f4270564ad5c 100644
|
||||
index 2c0753ed9403de5c875a023baafa74b6db5ef80a..a573643b089e02b9d7be3b2aaa2afbbf352af705 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -47,7 +47,6 @@ import java.util.function.Consumer;
|
||||
|
@ -263,7 +263,7 @@ index 66be5160113dfa7833dd5015313e7e7dea0bc1ae..1fff5dfe44ec37c22df3fe257e02f427
|
|||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.bossevents.CustomBossEvent;
|
||||
import net.minecraft.server.commands.ReloadCommand;
|
||||
@@ -1232,9 +1232,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1233,9 +1233,13 @@ public final class CraftServer implements Server {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
|
|
|
@ -491,7 +491,7 @@ index 6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7..61405c2b53e03a4b83e2c70c6e4d3739
|
|||
String s1 = name.toLowerCase(Locale.ROOT);
|
||||
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6c5ebee1ebbc8fdb579f2f4f05ff8ae859206c2a..eb46de0cff9dbedf19a3826ca2a876f22284f210 100644
|
||||
index d76f2b4ff336819687f233a50b69ca1cafe5c0a5..fecf75505ecad65855306ed02065d417a479c022 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -241,6 +241,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
|
||||
|
@ -504,7 +504,7 @@ index 6c5ebee1ebbc8fdb579f2f4f05ff8ae859206c2a..eb46de0cff9dbedf19a3826ca2a876f2
|
|||
public final class CraftServer implements Server {
|
||||
private final String serverName = "Paper"; // Paper
|
||||
private final String serverVersion;
|
||||
@@ -2457,5 +2460,24 @@ public final class CraftServer implements Server {
|
||||
@@ -2458,5 +2461,24 @@ public final class CraftServer implements Server {
|
||||
public boolean suggestPlayerNamesWhenNullTabCompletions() {
|
||||
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
|
||||
}
|
||||
|
|
|
@ -72,10 +72,10 @@ index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index eb46de0cff9dbedf19a3826ca2a876f22284f210..ad2b2e17125408712a247457db167ef6bf3e354e 100644
|
||||
index fecf75505ecad65855306ed02065d417a479c022..454b87eb16b4c5819a199fa0c3412c9a10a72caa 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1992,7 +1992,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1993,7 +1993,7 @@ public final class CraftServer implements Server {
|
||||
offers = this.tabCompleteChat(player, message);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
|
|||
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ad2b2e17125408712a247457db167ef6bf3e354e..063c6f78c6813d5f49ea6f15e23cfb7aa4adbc2f 100644
|
||||
index 454b87eb16b4c5819a199fa0c3412c9a10a72caa..2585e1b58c911ac63e9820d7473a3099abba30b6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1650,6 +1650,25 @@ public final class CraftServer implements Server {
|
||||
@@ -1651,6 +1651,25 @@ public final class CraftServer implements Server {
|
||||
return recipients.size();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,10 +42,10 @@ index cdec195a7aab9195c07ebfbba4f25b27a319ca6e..26de4e9daf0826b97a5f12304d7691dc
|
|||
Object val = config.get("settings.save-player-data");
|
||||
if (val instanceof Boolean) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a2acf9c1969fd3d365276421d63aae6617a52dc4..5ce7eba5d2a66d545034526d022eb12e46962d30 100644
|
||||
index d64bcc0aafb918e82e881f6503ce8311e78a3f6f..0d2f6680af8a678b4b07a6a3ba809128c69563e7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2482,6 +2482,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2483,6 +2483,11 @@ public final class CraftServer implements Server {
|
||||
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ index 8415342e178ab61660321570454815eb418b5282..a2d93627dd241e05699ef5a4b52d0efa
|
|||
|
||||
public boolean isDebugging() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5ce7eba5d2a66d545034526d022eb12e46962d30..fbb4177c4ca094f93adb99c9a69258535053cbb7 100644
|
||||
index 0d2f6680af8a678b4b07a6a3ba809128c69563e7..46a1c05f3321ddf34efc4f5fb6b607188a8c4939 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1981,7 +1981,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1982,7 +1982,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean isPrimaryThread() {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index fbb4177c4ca094f93adb99c9a69258535053cbb7..de6ae7b2078c0ca5e64bcdfe3a6957c2c6436977 100644
|
||||
index 46a1c05f3321ddf34efc4f5fb6b607188a8c4939..34c8228de823c777209c6506451222d82ad80738 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2505,5 +2505,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2506,5 +2506,10 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ index 8190c30346c0fd2d86fb7cbcfc7ce17333e05146..9860f5a0ddff83f1393ee13a96b38c3b
|
|||
private void countAllMobsForSpawning() {
|
||||
countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index a2eecfaf54921423f803d759c06789e5e8a38d33..1273ef4f7f0dff15f8630c0ca3dd1fffcae6acdf 100644
|
||||
index f027ff9549c9b97f36c9339ec16f39fd4c6ce5d2..6fa6b3af43e17408c014a56ee116f533edcdbdf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -165,10 +165,10 @@ index a2eecfaf54921423f803d759c06789e5e8a38d33..1273ef4f7f0dff15f8630c0ca3dd1fff
|
|||
ChunkPos chunkcoordintpair = holder.getPos();
|
||||
CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkRangeFuture(chunkcoordintpair, 1, (i) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
index ba3509510bdada588100d481a9124e928cfe760e..a56cfcf5ac735147f3f2bd029a2b1a4e889d5b4f 100644
|
||||
index 96b070a1fd4a3948609ba47614c81cc231084f5c..d9b82aea11dda1d6b45a66f2b7ca1524b7a3c369 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -61,7 +61,21 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
@@ -64,7 +64,21 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
|
||||
private boolean addEntityUuid(T entity) {
|
||||
if (!this.knownUuids.add(entity.getUUID())) {
|
||||
|
@ -178,7 +178,7 @@ index ba3509510bdada588100d481a9124e928cfe760e..a56cfcf5ac735147f3f2bd029a2b1a4e
|
|||
+ return false;
|
||||
+ }
|
||||
+ // Paper end
|
||||
LOGGER.warn("UUID of added entity already exists: {}", (Object)entity);
|
||||
PersistentEntitySectionManager.LOGGER.warn("UUID of added entity already exists: {}", entity);
|
||||
+ // Paper start
|
||||
+ if (net.minecraft.world.level.Level.DEBUG_ENTITIES && ((Entity) entity).level.paperConfig.duplicateUUIDMode != com.destroystokyo.paper.PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
|
||||
+ if (((Entity) entity).addedToWorldStack != null) {
|
||||
|
@ -190,39 +190,3 @@ index ba3509510bdada588100d481a9124e928cfe760e..a56cfcf5ac735147f3f2bd029a2b1a4e
|
|||
return false;
|
||||
} else {
|
||||
return true;
|
||||
@@ -238,7 +252,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
}
|
||||
|
||||
private void processUnloads() {
|
||||
- this.chunksToUnload.removeIf((pos) -> {
|
||||
+ this.chunksToUnload.removeIf((java.util.function.LongPredicate) (pos) -> { // Paper - decompile fix
|
||||
return this.chunkVisibility.get(pos) != Visibility.HIDDEN ? true : this.processChunkUnload(pos);
|
||||
});
|
||||
}
|
||||
@@ -272,7 +286,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
}
|
||||
|
||||
public void autoSave() {
|
||||
- this.getAllChunksToSave().forEach((pos) -> {
|
||||
+ this.getAllChunksToSave().forEach((java.util.function.LongConsumer) (pos) -> { // Paper - decompile fix
|
||||
boolean bl = this.chunkVisibility.get(pos) == Visibility.HIDDEN;
|
||||
if (bl) {
|
||||
this.processChunkUnload(pos);
|
||||
@@ -290,7 +304,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
while(!longSet.isEmpty()) {
|
||||
this.permanentStorage.flush(false);
|
||||
this.processPendingLoads();
|
||||
- longSet.removeIf((pos) -> {
|
||||
+ longSet.removeIf((java.util.function.LongPredicate) (pos) -> { // Paper - decompile fix
|
||||
boolean bl = this.chunkVisibility.get(pos) == Visibility.HIDDEN;
|
||||
return bl ? this.processChunkUnload(pos) : this.storeChunkSections(pos, (entityAccess) -> {
|
||||
});
|
||||
@@ -328,7 +342,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
|
||||
public void dumpSections(Writer writer) throws IOException {
|
||||
CsvOutput csvOutput = CsvOutput.builder().addColumn("x").addColumn("y").addColumn("z").addColumn("visibility").addColumn("load_status").addColumn("entity_count").build(writer);
|
||||
- this.sectionStorage.getAllChunksWithExistingSections().forEach((chunkPos) -> {
|
||||
+ this.sectionStorage.getAllChunksWithExistingSections().forEach((java.util.function.LongConsumer) (chunkPos) -> { // Paper - decompile fix
|
||||
PersistentEntitySectionManager.ChunkLoadStatus chunkLoadStatus = this.chunkLoadStatuses.get(chunkPos);
|
||||
this.sectionStorage.getExistingSectionPositionsInChunk(chunkPos).forEach((sectionPos) -> {
|
||||
EntitySection<T> entitySection = this.sectionStorage.getSection(sectionPos);
|
||||
|
|
|
@ -1119,17 +1119,17 @@ index 3b8c04f6ffd7e6c197465aa1caf633ba92529472..1007bfc9c19641f42afd5526cfe7bdb6
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
index a56cfcf5ac735147f3f2bd029a2b1a4e889d5b4f..790594b970c03c340d0c4ca7b5ce315f5ffe571d 100644
|
||||
index d9b82aea11dda1d6b45a66f2b7ca1524b7a3c369..10bc96bb33c5f292adb6383fdda73f90d43b090b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -264,6 +264,12 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
this.addEntity(entity, true);
|
||||
@@ -281,6 +281,12 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
this.addEntity(entityaccess, true);
|
||||
});
|
||||
this.chunkLoadStatuses.put(chunkEntities.getPos().toLong(), PersistentEntitySectionManager.ChunkLoadStatus.LOADED);
|
||||
this.chunkLoadStatuses.put(chunkentities.getPos().toLong(), PersistentEntitySectionManager.ChunkLoadStatus.LOADED);
|
||||
+ // Paper start - rewrite ServerTickList
|
||||
+ final net.minecraft.server.level.ServerLevel level = ((net.minecraft.world.level.chunk.storage.EntityStorage) this.permanentStorage).level;
|
||||
+ if (level.chunkSource.isPositionTickingReady(chunkEntities.getPos().longKey)) {
|
||||
+ level.onChunkSetTicking(chunkEntities.getPos().x, chunkEntities.getPos().z);
|
||||
+ if (level.chunkSource.isPositionTickingReady(chunkentities.getPos().longKey)) {
|
||||
+ level.onChunkSetTicking(chunkentities.getPos().x, chunkentities.getPos().z);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
|
|
@ -146,10 +146,10 @@ index 3c299bae9095ddc3732f1817c2d52f8d8a6987db..43e0c5d29981ccc6a20933afdb33e8b8
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index de6ae7b2078c0ca5e64bcdfe3a6957c2c6436977..b6afe0425464e50c5422c53ce43fb4f8ab94993d 100644
|
||||
index 34c8228de823c777209c6506451222d82ad80738..04a88d0f82733eae21c4b4727911f4a9b0f146f1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2343,6 +2343,16 @@ public final class CraftServer implements Server {
|
||||
@@ -2344,6 +2344,16 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
|
|||
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b6afe0425464e50c5422c53ce43fb4f8ab94993d..349a5114cdd29b1844d8ccc5b5eff6cdd46e1d6b 100644
|
||||
index 04a88d0f82733eae21c4b4727911f4a9b0f146f1..79bfa802220d94008c3b19020e0633ba7eba1d89 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2520,5 +2520,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2521,5 +2521,10 @@ public final class CraftServer implements Server {
|
||||
public int getCurrentTick() {
|
||||
return net.minecraft.server.MinecraftServer.currentTick;
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ index b6ccc8cacb615a35a60c73f145b7bd1cf0b891ee..a335d48467d1730bfed25eb5fd9046e1
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 962028a58ee54b99be20905c1fd16cfe15c82175..6d810cdb538d078dbf7ccd2ef84a4be27eb1f3e7 100644
|
||||
index 5e828201871086994f7037a50a0d12aecb0c0ece..b5459099b368ff6c8e62d254196350c2189e52a9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -613,6 +613,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -323,10 +323,10 @@ index 016c2302d8bcf121eafd1be7eb4f3b206dbdbeec..1de1566b76c73ddfaf7e022296068db0
|
|||
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
||||
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 349a5114cdd29b1844d8ccc5b5eff6cdd46e1d6b..d1661f7f527765a847a057902acad31954896557 100644
|
||||
index 79bfa802220d94008c3b19020e0633ba7eba1d89..bb1eaf69b9b32e81f5fd32add9cb37a2e92181d2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1981,7 +1981,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1982,7 +1982,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean isPrimaryThread() {
|
||||
|
|
|
@ -899,10 +899,10 @@ index 8c2ec30a35e86f2b30863045b586a67e485c624b..848cac4426346b6d2ed575f33bf01c0e
|
|||
LOOK,
|
||||
JUMP,
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b499675f6d94203924cdaebcb2b06db20fe0ed14..1279e1d3bafac03cbc31807d0934e80e47d4f759 100644
|
||||
index 72640c2dd945a22e8e562ee6901c9f70ae786816..f4c055e7e2d10756262386c8fb34996c4a38ee3f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2532,5 +2532,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2533,5 +2533,11 @@ public final class CraftServer implements Server {
|
||||
public boolean isStopping() {
|
||||
return net.minecraft.server.MinecraftServer.getServer().hasStopped();
|
||||
}
|
||||
|
|
|
@ -47,10 +47,10 @@ index 439f82a48e6f6ce7b4773505ced32324cacb302d..2a99aa989ac5c19d99bb3cbc0934425e
|
|||
|
||||
public static int getX(long pos) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
index 790594b970c03c340d0c4ca7b5ce315f5ffe571d..d1428fe87ec3be070d9a125a1774ea758d4cd74b 100644
|
||||
index 8b21080f5fd85ba6c1c3c8ac30e4a9d143c71e11..a98ef525ff57867edbc86ebebe626895c7a9bf25 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -333,6 +333,11 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
@@ -362,6 +362,11 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
public LevelEntityGetter<T> getEntityGetter() {
|
||||
return this.entityGetter;
|
||||
}
|
||||
|
@ -60,5 +60,5 @@ index 790594b970c03c340d0c4ca7b5ce315f5ffe571d..d1428fe87ec3be070d9a125a1774ea75
|
|||
+ }
|
||||
+ // Paper end
|
||||
|
||||
public boolean isPositionTicking(BlockPos blockPos) {
|
||||
return this.chunkVisibility.get(ChunkPos.asLong(blockPos)).isTicking();
|
||||
public boolean isPositionTicking(BlockPos blockposition) {
|
||||
return ((Visibility) this.chunkVisibility.get(ChunkPos.asLong(blockposition))).isTicking();
|
||||
|
|
|
@ -8,10 +8,10 @@ Adds a new event for all crafting stations that generate a result slot item
|
|||
Anvil, Grindstone and Smithing now extend this event
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
index 0d1e828debc87c6ddc569dfa8f85be9918365dc1..3070ad3a4bbe83485c6b4a68aa634045c70cafdd 100644
|
||||
index 2ed4930648411ccd52fc970b069e57eba9bceef8..593e23c10f2b1616db7256158dfe564b2d289df1 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
@@ -316,6 +316,7 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
@@ -317,6 +317,7 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
}
|
||||
|
||||
this.createResult();
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 65fcf1300022b66c87b00637775dbed02b2c734e..50f85ab4f3ba97728f873cb2facb92a60e5ea765 100644
|
||||
index c5fdc37664b748d3daa8d29c57121fe5a2bf7e07..bfdfbc550306484290989329878e33adbf3f37cd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2174,6 +2174,32 @@ public final class CraftServer implements Server {
|
||||
@@ -2175,6 +2175,32 @@ public final class CraftServer implements Server {
|
||||
return new OldCraftChunkData(world);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 509f662fcaa02a83b8dd508acce3b8276052d213..2ef9dda0c89db50828282bba4af8edff31b3b3a3 100644
|
||||
index c1ea62a2c65fb2cbb79c967cfb8fd2bb9cbba7a2..af988f828e9f1ec3f6f317d907611e950665c17f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1744,6 +1744,28 @@ public final class CraftServer implements Server {
|
||||
@@ -1745,6 +1745,28 @@ public final class CraftServer implements Server {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..6271586368c65250c887739d04c5fccf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2ef9dda0c89db50828282bba4af8edff31b3b3a3..ca297bb7f77223cc18e20178e141a6309df80ca1 100644
|
||||
index af988f828e9f1ec3f6f317d907611e950665c17f..5cda9f21219decf6e4b9e5cc6e83b4749066f20f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2363,6 +2363,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2364,6 +2364,11 @@ public final class CraftServer implements Server {
|
||||
Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type");
|
||||
|
||||
return (org.bukkit.Tag<T>) new CraftFluidTag(FluidTags.getAllTags(), key);
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement Keyed on World
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 3cd1877e1e61ca00851098e99e4f1bf375bc79e4..eae363f7ea979782d2c3c787706dd8894c992c55 100644
|
||||
index 5b95bb1d1361740f5605873fb707980bb911e6a3..69e03f48af3f08701e124cb4576233aff1faa323 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1182,7 +1182,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -17,7 +17,7 @@ index 3cd1877e1e61ca00851098e99e4f1bf375bc79e4..eae363f7ea979782d2c3c787706dd889
|
|||
}
|
||||
|
||||
ServerLevel internal = (ServerLevel) new ServerLevel(this.console, console.executor, worldSession, worlddata, worldKey, dimensionmanager, this.getServer().progressListenerFactory.create(11),
|
||||
@@ -1273,6 +1273,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1274,6 +1274,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Added PlayerBedFailEnterEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index dd3a4a8527b9adc5daba7540661fb88f9fbf33b2..163a7861f987c3832aac51cc6df950c768546731 100644
|
||||
index 0adca590a7118769919e7d923f41148851de4bfd..e3ff04fe21761db65fb03c5e58ecd5823f0507c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
@@ -111,14 +111,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
|
@ -14,13 +14,13 @@ index dd3a4a8527b9adc5daba7540661fb88f9fbf33b2..163a7861f987c3832aac51cc6df950c7
|
|||
player.startSleepInBed(pos).ifLeft((entityhuman_enumbedresult) -> {
|
||||
+ // Paper start - PlayerBedFailEnterEvent
|
||||
+ if (entityhuman_enumbedresult != null) {
|
||||
+ io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.VALUES[entityhuman_enumbedresult.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(world, finalblockposition), entityhuman_enumbedresult == Player.BedSleepingProblem.NOT_POSSIBLE_HERE, io.papermc.paper.adventure.PaperAdventure.asAdventure(entityhuman_enumbedresult.getMessage()));
|
||||
+ io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.VALUES[entityhuman_enumbedresult.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(world, finalblockposition), !world.dimensionType().bedWorks(), io.papermc.paper.adventure.PaperAdventure.asAdventure(entityhuman_enumbedresult.getMessage()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
// CraftBukkit start - handling bed explosion from below here
|
||||
- if (entityhuman_enumbedresult == Player.BedSleepingProblem.NOT_POSSIBLE_HERE) {
|
||||
- if (!world.dimensionType().bedWorks()) {
|
||||
+ if (event.getWillExplode()) { // Paper
|
||||
this.explodeBed(finaliblockdata, world, finalblockposition);
|
||||
} else
|
||||
|
|
|
@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index eae363f7ea979782d2c3c787706dd8894c992c55..ae5cd5b5964fc66ded0de892e1d8b7074c0af7e6 100644
|
||||
index 69e03f48af3f08701e124cb4576233aff1faa323..25cf42f67f4b413933cd73960737f6ad43750c7b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -281,6 +281,7 @@ public final class CraftServer implements Server {
|
||||
|
@ -111,7 +111,7 @@ index eae363f7ea979782d2c3c787706dd8894c992c55..ae5cd5b5964fc66ded0de892e1d8b707
|
|||
}
|
||||
|
||||
public boolean getCommandBlockOverride(String command) {
|
||||
@@ -2637,5 +2639,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2638,5 +2640,11 @@ public final class CraftServer implements Server {
|
||||
public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
|
||||
return mobGoals;
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Doc <nachito94@msn.com>
|
||||
Date: Fri, 6 Aug 2021 11:23:13 -0400
|
||||
Subject: [PATCH] Fix bed handling for custom dimensions
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 8e1478593fcf79ee7a25d666503736cbe707a52c..8565aa3698a4febe21cb3aae0af51ae3479ec743 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1255,7 +1255,7 @@ public class ServerPlayer extends Player {
|
||||
// CraftBukkit start - moved bed result checks from below into separate method
|
||||
private Either<Player.BedSleepingProblem, Unit> getBedResult(BlockPos blockposition, Direction enumdirection) {
|
||||
if (!this.isSleeping() && this.isAlive()) {
|
||||
- if (!this.level.dimensionType().natural()) {
|
||||
+ if (!this.level.dimensionType().natural() || !this.level.dimensionType().bedWorks()) { // Paper - check if dimension allows beds (moved from BedBlock#canSetSpawn)
|
||||
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_HERE);
|
||||
} else if (!this.bedInRange(blockposition, enumdirection)) {
|
||||
return Either.left(Player.BedSleepingProblem.TOO_FAR_AWAY);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index 163a7861f987c3832aac51cc6df950c768546731..110415afe81ed239599ba85e2dcdc5992cead1f5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
@@ -113,7 +113,8 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
player.startSleepInBed(pos).ifLeft((entityhuman_enumbedresult) -> {
|
||||
// Paper start - PlayerBedFailEnterEvent
|
||||
if (entityhuman_enumbedresult != null) {
|
||||
- io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.VALUES[entityhuman_enumbedresult.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(world, finalblockposition), entityhuman_enumbedresult == Player.BedSleepingProblem.NOT_POSSIBLE_HERE, io.papermc.paper.adventure.PaperAdventure.asAdventure(entityhuman_enumbedresult.getMessage()));
|
||||
+ boolean bedWillExplode = !world.dimensionType().bedWorks(); // Paper - Handle explode flag
|
||||
+ io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.VALUES[entityhuman_enumbedresult.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(world, finalblockposition), bedWillExplode, io.papermc.paper.adventure.PaperAdventure.asAdventure(entityhuman_enumbedresult.getMessage())); // Paper
|
||||
if (!event.callEvent()) {
|
||||
return;
|
||||
}
|
|
@ -30,7 +30,7 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..f875507241ac6769545e91cd3285232b
|
|||
private RedirectModifier<S> modifier = null;
|
||||
private boolean forks;
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index a6f10d47bc4e2cadcc3e06cffa011ed7fb97c68d..cc0aff09e03586f97d79c8db6e1e52d9f192b4b1 100644
|
||||
index 816ea85a5880123c970d227d61426a0ae2b9539f..6fec6a47538da4c0c5a4505e9bedf492bb3376dd 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -204,6 +204,13 @@ public class Commands {
|
|
@ -28,7 +28,7 @@ index f1b9affe2e971203f9a72d3abbf902559e0b04e5..34497bf24046225108c47f1faf52bb18
|
|||
}
|
||||
// Spigot End
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 8565aa3698a4febe21cb3aae0af51ae3479ec743..718649f1ffa20e618063a17e62d4b00c01c7c8eb 100644
|
||||
index 3e0c5379e40607554324e8fdc72a0f2a71ec7aaa..44b2429d9cc20bdebe58203f973382a4f7ea4c6c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1564,6 +1564,18 @@ public class ServerPlayer extends Player {
|
|
@ -1 +1 @@
|
|||
Subproject commit a0a37f416ca6c9be007f65e1b8ef5efea9b50cb5
|
||||
Subproject commit 5be41fb80fa84c15359d271c38b52a1e815ea9f9
|
Loading…
Reference in New Issue