mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
apply paper server patches
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||
@@ -143,6 +_,11 @@
|
||||
@@ -144,6 +_,11 @@
|
||||
private static final Map<String, String> NESTED_CLASS_NAMES = Util.make(new HashMap<>(), map -> {
|
||||
map.put("AbstractSkeleton$1", "AbstractSkeletonMelee");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -340,6 +_,12 @@
|
||||
@@ -337,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
@@ -13,7 +13,7 @@
|
||||
CompoundTag data = this.getData();
|
||||
if (data == null) {
|
||||
return null;
|
||||
@@ -577,4 +_,183 @@
|
||||
@@ -574,4 +_,183 @@
|
||||
manager.save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -429,6 +_,20 @@
|
||||
@@ -417,6 +_,20 @@
|
||||
this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager);
|
||||
this.pluginManager.paperPluginManager = this.paperPluginManager;
|
||||
// Paper end
|
||||
@@ -21,15 +21,15 @@
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
||||
|
||||
@@ -1048,6 +_,7 @@
|
||||
@@ -1029,6 +_,7 @@
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
+ org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1063,6 +_,7 @@
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && world.getGameRules().getBoolean(GameRules.RULE_SPAWN_MONSTERS)); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1044,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1080,6 +_,7 @@
|
||||
@@ -1061,6 +_,7 @@
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
this.spark.registerCommandBeforePlugins(this); // Paper - spark
|
||||
@@ -45,7 +45,7 @@
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -1579,6 +_,60 @@
|
||||
@@ -1526,6 +_,60 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
@Override
|
||||
public List<Recipe> getRecipesFor(ItemStack result) {
|
||||
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
|
||||
@@ -2947,6 +_,18 @@
|
||||
@@ -2827,6 +_,18 @@
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
@Override
|
||||
public void restart() {
|
||||
CraftServer.this.restart();
|
||||
@@ -2979,6 +_,7 @@
|
||||
@@ -2859,6 +_,7 @@
|
||||
@Override
|
||||
public double[] getTPS() {
|
||||
return new double[] {
|
||||
@@ -133,7 +133,7 @@
|
||||
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
||||
@@ -3186,4 +_,18 @@
|
||||
@@ -3066,4 +_,18 @@
|
||||
public void allowPausing(final Plugin plugin, final boolean value) {
|
||||
this.console.addPluginAllowingSleep(plugin.getName(), value);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2376,6 +_,50 @@
|
||||
@@ -2379,6 +_,50 @@
|
||||
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -301,6 +_,7 @@
|
||||
@@ -294,6 +_,7 @@
|
||||
@Override
|
||||
public void recalculatePermissions() {
|
||||
this.perm.recalculatePermissions();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -514,7 +_,7 @@
|
||||
@@ -516,7 +_,7 @@
|
||||
net.minecraft.server.level.ServerPlayer nmsKiller = killer == null ? null : ((CraftPlayer) killer).getHandle();
|
||||
this.getHandle().setLastHurtByMob(nmsKiller);
|
||||
if (nmsKiller != null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -565,10 +_,15 @@
|
||||
@@ -572,10 +_,15 @@
|
||||
|
||||
@Override
|
||||
public void setPlayerListName(String name) {
|
||||
@@ -17,7 +17,7 @@
|
||||
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
|
||||
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
|
||||
if (player.getBukkitEntity().canSee(this)) {
|
||||
@@ -1009,6 +_,78 @@
|
||||
@@ -1025,6 +_,78 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
@Override
|
||||
public void sendBlockDamage(Location loc, float progress) {
|
||||
this.sendBlockDamage(loc, progress, this.getEntityId());
|
||||
@@ -2671,6 +_,28 @@
|
||||
@@ -2695,6 +_,28 @@
|
||||
public float getWalkSpeed() {
|
||||
return this.getHandle().getAbilities().walkingSpeed * 2f;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/MaterialRerouting.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/MaterialRerouting.java
|
||||
@@ -708,4 +_,32 @@
|
||||
@@ -703,4 +_,32 @@
|
||||
meta.setCanPlaceOn(materials);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
Reference in New Issue
Block a user