Skip to content

Commit

Permalink
Fix fakeplayer resident (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 16, 2024
1 parent 6856a2b commit ec5a806
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ index c396580a9cfd86ff261bed439bb4662ae88010b5..c2263ef7fb67db7c01bac7aecf218ee8
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d0190f633e99e2a5b5dc130def10c562ffc4e52e..31a55145bf2ed0e5a23fd07d1c14e93572d5ef5a 100644
index 6bc129a8a71e8936d596fa2e585a259282d11622..ba5fd079be52e8d179029925777dad3db3de2433 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -123,6 +123,8 @@ import org.bukkit.event.player.PlayerRespawnEvent.RespawnReason;
Expand Down Expand Up @@ -1638,10 +1638,10 @@ index 0000000000000000000000000000000000000000..4f5e6e5c1b9d8bd38c98e97fd31b3833
+}
diff --git a/src/main/java/org/leavesmc/leaves/bot/BotList.java b/src/main/java/org/leavesmc/leaves/bot/BotList.java
new file mode 100644
index 0000000000000000000000000000000000000000..33deb7eeda2c4cda396ac4ed7f05e6a851e89050
index 0000000000000000000000000000000000000000..bb33cad06036f188bd9228556fff6256391085c0
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bot/BotList.java
@@ -0,0 +1,339 @@
@@ -0,0 +1,340 @@
+package org.leavesmc.leaves.bot;
+
+import com.google.common.collect.Maps;
Expand Down Expand Up @@ -1924,8 +1924,9 @@ index 0000000000000000000000000000000000000000..33deb7eeda2c4cda396ac4ed7f05e6a8
+
+ public void loadResume() {
+ if (LeavesConfig.fakeplayerSupport && LeavesConfig.fakeplayerResident) {
+ for (String realName : this.getSavedBotList().getAllKeys()) {
+ CompoundTag nbt = this.getSavedBotList().getCompound(realName);
+ CompoundTag savedBotList = this.getSavedBotList().copy();
+ for (String realName : savedBotList.getAllKeys()) {
+ CompoundTag nbt = savedBotList.getCompound(realName);
+ if (nbt.getBoolean("resume")) {
+ this.loadNewBot(realName);
+ }
Expand Down

0 comments on commit ec5a806

Please sign in to comment.