9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-22 16:39:30 +00:00

Update Paper

This commit is contained in:
violetc
2023-12-23 17:17:01 +08:00
parent 1fcd6072e6
commit 9f8513bd78
32 changed files with 133 additions and 147 deletions

View File

@@ -334,10 +334,10 @@ index cd962621ee0d8bd17926a90ce960c46f1ae5a8dd..2a2262a9f0ead7a9b477cf7a75905b8d
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a36b234f884e2aae88a29fae872aeef662b27712..43e4c9fe0243f29d66b0255306b02e07f886d8c6 100644
index 9782a52dbbad0f1c4baaf3651790b19619def28f..824adc860bd01b30e1669bb1635a1da0ef8996a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -266,6 +266,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@@ -260,6 +260,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
import top.leavesmc.leaves.entity.CraftBotManager;
@@ -345,7 +345,7 @@ index a36b234f884e2aae88a29fae872aeef662b27712..43e4c9fe0243f29d66b0255306b02e07
import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
@@ -312,6 +313,7 @@ public final class CraftServer implements Server {
@@ -307,6 +308,7 @@ public final class CraftServer implements Server {
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
private final CraftPotionBrewer potionBrewer = new CraftPotionBrewer(); // Paper
private final CraftBotManager botManager = new CraftBotManager();
@@ -353,7 +353,7 @@ index a36b234f884e2aae88a29fae872aeef662b27712..43e4c9fe0243f29d66b0255306b02e07
// Paper start - Folia region threading API
private final io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler();
@@ -393,7 +395,7 @@ public final class CraftServer implements Server {
@@ -388,7 +390,7 @@ public final class CraftServer implements Server {
public CraftServer(DedicatedServer console, PlayerList playerList) {
this.console = console;
this.playerList = (DedicatedPlayerList) playerList;
@@ -362,7 +362,7 @@ index a36b234f884e2aae88a29fae872aeef662b27712..43e4c9fe0243f29d66b0255306b02e07
@Override
public CraftPlayer apply(ServerPlayer player) {
return player.getBukkitEntity();
@@ -3250,4 +3252,11 @@ public final class CraftServer implements Server {
@@ -3251,4 +3253,11 @@ public final class CraftServer implements Server {
return botManager;
}
// Leaves end - Bot API
@@ -375,10 +375,10 @@ index a36b234f884e2aae88a29fae872aeef662b27712..43e4c9fe0243f29d66b0255306b02e07
+ // Leaves end - replay mod api
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 801ee163a71ab2afd822c7f17bf45573c0fd83f5..8598a20fa2a2a81ccbf2099f52c15103f91d53d0 100644
index 418f16debd40e7588c8cfea2876a9688ceb11730..a7215be2bdafaa35c3553eb5a94f0f4fc3ea9047 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -203,6 +203,8 @@ import top.leavesmc.leaves.bot.ServerBot;
@@ -58,6 +58,8 @@ import top.leavesmc.leaves.bot.ServerBot;
import top.leavesmc.leaves.entity.CraftBot;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@@ -387,14 +387,14 @@ index 801ee163a71ab2afd822c7f17bf45573c0fd83f5..8598a20fa2a2a81ccbf2099f52c15103
public abstract class CraftEntity implements org.bukkit.entity.Entity {
private static PermissibleBase perm;
@@ -241,6 +243,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
// Leaves start - add CraftBot
if (entity instanceof ServerPlayer) {
if (entity instanceof ServerBot) { return new CraftBot(server, (ServerBot) entity); }
+ if (entity instanceof ServerPhotographer) { return new CraftPhotographer(server, (ServerPhotographer) entity); }
else { return new CraftPlayer(server, (ServerPlayer) entity); }
}
// Leaves end - add CraftBot
@@ -94,6 +96,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
if (entity instanceof ServerBot) { return new CraftBot(server, (ServerBot) entity); }
+ if (entity instanceof ServerPhotographer) { return new CraftPhotographer(server, (ServerPhotographer) entity); }
// Special case complex part, since there is no extra entity type for them
if (entity instanceof EnderDragonPart complexPart) {
diff --git a/src/main/java/top/leavesmc/leaves/entity/CraftPhotographer.java b/src/main/java/top/leavesmc/leaves/entity/CraftPhotographer.java
new file mode 100644
index 0000000000000000000000000000000000000000..65fd6fd9e6af4e43268f1f1507a37e1bd95d41b8