mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
hardfork from paper 😊
This commit is contained in:
@@ -1,42 +1,18 @@
|
||||
--- a/paper-api/build.gradle.kts
|
||||
+++ b/paper-api/build.gradle.kts
|
||||
--- a/spigot-api/build.gradle.kts
|
||||
+++ b/spigot-api/build.gradle.kts
|
||||
@@ -93,7 +_,7 @@
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
|
||||
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath()
|
||||
idea {
|
||||
module {
|
||||
generatedSourceDirs.add(generatedDir.toFile())
|
||||
@@ -103,6 +_,18 @@
|
||||
main {
|
||||
java {
|
||||
srcDir(generatedDir)
|
||||
+ srcDir(file("../paper-api/src/main/java"))
|
||||
+ }
|
||||
+ resources {
|
||||
+ srcDir(file("../paper-api/src/main/resources"))
|
||||
+ }
|
||||
+ }
|
||||
+ test {
|
||||
+ java {
|
||||
+ srcDir(file("../paper-api/src/test/java"))
|
||||
+ }
|
||||
+ resources {
|
||||
+ srcDir(file("../paper-api/src/test/resources"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,8 +_,10 @@
|
||||
val services = objects.newInstance<Services>()
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
+ //(options as StandardJavadocDocletOptions).addStringOption("-add-modules", "jdk.incubator.vector") // Purpur - our javadocs need this for pufferfish's SIMD patch
|
||||
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Paper's bajillion javadoc warnings
|
||||
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Spigot's bajillion javadoc warnings
|
||||
val options = options as StandardJavadocDocletOptions
|
||||
- options.overview = "src/main/javadoc/overview.html"
|
||||
+ options.overview = "../paper-api/src/main/javadoc/overview.html"
|
||||
+ options.overview = "../spigot-api/src/main/javadoc/overview.html"
|
||||
options.use()
|
||||
options.isDocFilesSubDirs = true
|
||||
options.links(
|
||||
@@ -45,12 +21,12 @@
|
||||
|
||||
// workaround for https://github.com/gradle/gradle/issues/4046
|
||||
- inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
|
||||
+ inputs.dir("../paper-api/src/main/javadoc").withPropertyName("javadoc-sourceset")
|
||||
+ inputs.dir("../spigot-api/src/main/javadoc").withPropertyName("javadoc-sourceset")
|
||||
val fsOps = services.fileSystemOperations
|
||||
doLast {
|
||||
fsOps.copy {
|
||||
- from("src/main/javadoc") {
|
||||
+ from("../paper-api/src/main/javadoc") {
|
||||
+ from("../spigot-api/src/main/javadoc") {
|
||||
include("**/doc-files/**")
|
||||
}
|
||||
into("build/docs/javadoc")
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <granny@purpurmc.org>
|
||||
Date: Thu, 16 May 2024 19:11:29 -0700
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
index 652ff54e7c50412503725d628bfe72ed03059790..fb1fe2651e53a9bf46b3632c638e13eea9dcda93 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
|
||||
@@ -19,6 +19,12 @@ public interface ServerBuildInfo {
|
||||
*/
|
||||
Key BRAND_PAPER_ID = Key.key("papermc", "paper");
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * The brand id for Purpur.
|
||||
+ */
|
||||
+ Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
|
||||
+ // Purpur end
|
||||
/**
|
||||
* Gets the {@code ServerBuildInfo}.
|
||||
*
|
||||
@@ -1,29 +0,0 @@
|
||||
--- a/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -441,6 +_,26 @@
|
||||
|
||||
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
|
||||
|
||||
+ // Purpur start - Ridables
|
||||
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
|
||||
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
|
||||
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
+ // Purpur end - Ridables
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ // Purpur start - Add option to disable zombie aggressiveness towards villagers when lagging
|
||||
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
+ // Purpur end - Add option to disable zombie aggressiveness towards villagers when lagging
|
||||
+ // Purpur start - Configurable chance for wolves to spawn rabid
|
||||
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
|
||||
+ // Purpur end - Configurable chance for wolves to spawn rabid
|
||||
+ // Purpur start - Iron golem poppy calms anger
|
||||
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
|
||||
+ // Purpur end - Iron golem poppy calms anger
|
||||
+
|
||||
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {
|
||||
return GoalKey.of(type, NamespacedKey.minecraft(key));
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
@@ -28,6 +_,12 @@
|
||||
*/
|
||||
Component getVersionMessage(String serverVersion);
|
||||
|
||||
+ // Purpur start
|
||||
+ default int distance() {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@ApiStatus.Internal
|
||||
class DummyVersionFetcher implements VersionFetcher {
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -213,7 +_,7 @@
|
||||
String version = Bukkit.getVersion();
|
||||
// Paper start
|
||||
if (version.startsWith("null")) { // running from ide?
|
||||
- setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
|
||||
+ setVersionMessage(Component.text("* Unknown version, custom build?", NamedTextColor.RED)); // Purpur
|
||||
return;
|
||||
}
|
||||
setVersionMessage(getVersionFetcher().getVersionMessage(version));
|
||||
@@ -254,9 +_,11 @@
|
||||
// Paper start
|
||||
private void setVersionMessage(final @NotNull Component msg) {
|
||||
lastCheck = System.currentTimeMillis();
|
||||
- final Component message = Component.textOfChildren(
|
||||
- Component.text(Bukkit.getVersionMessage(), NamedTextColor.WHITE),
|
||||
- Component.newline(),
|
||||
+ // Purpur start
|
||||
+ int distance = getVersionFetcher().distance();
|
||||
+ final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
|
||||
+ ChatColor.parseMM("<grey>Current Purpur Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
|
||||
+ // Purpur end
|
||||
msg
|
||||
);
|
||||
this.versionMessage = Component.text()
|
||||
@@ -9,8 +9,8 @@ index 53ad1696d02afbebf27663dd753fa93e41cfeb4e..cec387842895d617b0dcf9158f080fe0
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2369,6 +2369,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
+ @NotNull
|
||||
@@ -4,7 +4,7 @@
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
Timing startTiming();
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
* Will automatically be called when this Timing is used with try-with-resources
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void stopTiming();
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
Timing startTimingIfSync();
|
||||
|
||||
/**
|
||||
@@ -28,14 +28,14 @@
|
||||
*
|
||||
* But only if we are on the primary thread.
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void stopTimingIfSync();
|
||||
|
||||
/**
|
||||
* @deprecated Doesn't do anything - Removed
|
||||
*/
|
||||
@Deprecated
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void abort();
|
||||
|
||||
/**
|
||||
@@ -43,6 +43,6 @@
|
||||
TimingHandler getTimingHandler();
|
||||
|
||||
@Override
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void close();
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -3616,4 +_,40 @@
|
||||
return this.asItemType().getDefaultDataTypes();
|
||||
}
|
||||
// Paper end - data component API
|
||||
+
|
||||
+ // Purpur start - ItemStack convenience methods
|
||||
+ public boolean isArmor() {
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -570,4 +_,104 @@
|
||||
@Override
|
||||
io.papermc.paper.persistence.PersistentDataContainerView getPersistentDataContainer();
|
||||
// Paper end - add pdc to offline player
|
||||
+
|
||||
+ // Purpur start - OfflinePlayer API
|
||||
+ /**
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2705,4 +_,111 @@
|
||||
*/
|
||||
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
||||
// Paper end - API to check if the server is sleeping
|
||||
+
|
||||
+ // Purpur start - Bring back server name
|
||||
+ /**
|
||||
@@ -17,20 +17,16 @@
|
||||
+ parsedArgs = event.getArgs();
|
||||
+ // Purpur end - ExecuteCommandEvent
|
||||
+
|
||||
// Paper start - Plugins do weird things to workaround normal registration
|
||||
if (target.timings == null) {
|
||||
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
||||
|
||||
@@ -160,10 +_,10 @@
|
||||
// Paper end
|
||||
|
||||
try {
|
||||
- try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
|
||||
+ //try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources // Purpur - Remove Timings
|
||||
- try (co.aikar.timings.Timing ignored = target.timings.startTiming()) {
|
||||
+ //try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Purpur - Remove Timings
|
||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||
- target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
|
||||
- } // target.timings.stopTiming(); // Spigot // Paper
|
||||
- } // target.timings.stopTiming(); // Spigot
|
||||
+ target.execute(sender, sentCommandLabel, parsedArgs); // Purpur - ExecuteCommandEvent
|
||||
+ //} // target.timings.stopTiming(); // Spigot // Paper // Purpur - Remove Timings
|
||||
+ //} // target.timings.stopTiming(); // Spigot // Purpur - Remove Timings
|
||||
} catch (CommandException ex) {
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
//target.timings.stopTiming(); // Spigot // Paper
|
||||
target.timings.stopTiming(); // Spigot
|
||||
@@ -28,5 +28,4 @@
|
||||
*/
|
||||
- @Deprecated(since = "1.17", forRemoval = true)
|
||||
void setPlayerSpawned(boolean playerSpawned);
|
||||
// Paper start
|
||||
/**
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1214,4 +_,59 @@
|
||||
*/
|
||||
void broadcastHurtAnimation(@NotNull java.util.Collection<Player> players);
|
||||
// Paper end - broadcast hurt animation
|
||||
+
|
||||
+ // Purpur start - Ridables
|
||||
+ /**
|
||||
@@ -2,8 +2,6 @@
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -153,4 +_,62 @@
|
||||
*/
|
||||
public void setHealth(int health);
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -2,8 +2,6 @@
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1452,4 +_,20 @@
|
||||
*/
|
||||
boolean canUseEquipmentSlot(org.bukkit.inventory.@NotNull EquipmentSlot slot);
|
||||
// Paper end - Expose canUseSlot
|
||||
+
|
||||
+ // Purpur start - API for any mob to burn daylight
|
||||
+ /**
|
||||
@@ -1,9 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/entity/Llama.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Llama.java
|
||||
@@ -119,4 +_,20 @@
|
||||
@org.jetbrains.annotations.Nullable
|
||||
Llama getCaravanTail();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -1,9 +1,7 @@
|
||||
--- a/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
@@ -138,4 +_,42 @@
|
||||
setItem(2, result);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
@@ -15,9 +15,6 @@
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -1371,4 +_,482 @@
|
||||
return this.craftDelegate.matchesWithoutData(item, excludeTypes, ignoreCount);
|
||||
}
|
||||
// Paper end - data component API
|
||||
+
|
||||
+ // Purpur start - ItemStack convenience methods
|
||||
+ /**
|
||||
@@ -1,9 +1,7 @@
|
||||
--- a/src/main/java/org/bukkit/inventory/view/AnvilView.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/view/AnvilView.java
|
||||
@@ -89,4 +_,34 @@
|
||||
*/
|
||||
void bypassEnchantmentLevelRestriction(boolean bypassEnchantmentLevelRestriction);
|
||||
// Paper end - bypass anvil level restrictions
|
||||
|
||||
+
|
||||
+ // Purpur start - Anvil API
|
||||
+ /**
|
||||
@@ -9,13 +9,11 @@
|
||||
}
|
||||
});
|
||||
@@ -88,6 +_,7 @@
|
||||
// Paper end - plugin loader api
|
||||
return null;
|
||||
}
|
||||
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur - Add log suppression for LibraryLoader
|
||||
logger.log(Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
|
||||
@@ -140,6 +_,7 @@
|
||||
}
|
||||
|
||||
@@ -23,4 +21,3 @@
|
||||
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur - Add log suppression for LibraryLoader
|
||||
logger.log(Level.INFO, "[{0}] Loaded library {1}", new Object[]
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|
||||
Reference in New Issue
Block a user