Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb21b4f18d | ||
|
|
27799c6c25 | ||
|
|
da019d06ce | ||
|
|
d0466ffbcc | ||
|
|
706565f1d1 | ||
|
|
aec635cdbf | ||
|
|
c46dbce254 | ||
|
|
8868dca38c | ||
|
|
da897f9522 | ||
|
|
7f2307cc5f | ||
|
|
b6152ed60d | ||
|
|
9040f46126 | ||
|
|
43c1dcb932 | ||
|
|
da7ff326fe | ||
|
|
4c2ae38401 | ||
|
|
3a247683f1 | ||
|
|
e0e228c99c | ||
|
|
d166d24ce4 | ||
|
|
31a0acb859 | ||
|
|
b7cfec3d53 | ||
|
|
794a665f20 | ||
|
|
046ba3260e | ||
|
|
711c006e16 | ||
|
|
358a8af2cd |
4
.github/workflows/pr-build.yml
vendored
4
.github/workflows/pr-build.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [17]
|
java: [21]
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -42,4 +42,4 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Parchment-PR${{ github.event.pull_request.number }}-JDK${{ matrix.java }}
|
name: Parchment-PR${{ github.event.pull_request.number }}-JDK${{ matrix.java }}
|
||||||
path: build/libs/parchment-paperclip-*-reobf.jar
|
path: build/libs/parchment-paperclip-*.jar
|
||||||
|
|||||||
6
.github/workflows/push-build.yml
vendored
6
.github/workflows/push-build.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [17]
|
java: [21]
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -40,11 +40,11 @@ jobs:
|
|||||||
git config --global user.email "no-reply@github.com"
|
git config --global user.email "no-reply@github.com"
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
./gradlew applyPatches
|
./gradlew applyPatches
|
||||||
./gradlew createReobfPaperclipJar
|
./gradlew createMojmapBundlerJar
|
||||||
./gradlew :parchment-api:publishMavenPublicationToEdenSnapshotsRepository
|
./gradlew :parchment-api:publishMavenPublicationToEdenSnapshotsRepository
|
||||||
./gradlew publishDevBundlePublicationToEdenSnapshotsRepository -PpublishDevBundle
|
./gradlew publishDevBundlePublicationToEdenSnapshotsRepository -PpublishDevBundle
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Parchment-JDK${{ matrix.java }}
|
name: Parchment-JDK${{ matrix.java }}
|
||||||
path: build/libs/parchment-paperclip-*-reobf.jar
|
path: build/libs/parchment-paperclip-*.jar
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -49,6 +49,7 @@ run/
|
|||||||
/parchment-server/
|
/parchment-server/
|
||||||
/Parchment-API/
|
/Parchment-API/
|
||||||
/parchment-api/
|
/parchment-api/
|
||||||
|
/paper-api-generator/
|
||||||
|
|
||||||
# Compiled class file
|
# Compiled class file
|
||||||
*.class
|
*.class
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ plugins {
|
|||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("io.papermc.paperweight.patcher") version "1.5.11"
|
id("io.papermc.paperweight.patcher") version "1.7.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||||
content { onlyForConfigurations(PAPERCLIP_CONFIG) }
|
content { onlyForConfigurations(PAPERCLIP_CONFIG) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
|
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
decompiler("org.vineflower:vineflower:1.10.1")
|
||||||
paperclip("io.papermc:paperclip:3.0.3")
|
paperclip("io.papermc:paperclip:3.0.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ allprojects {
|
|||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion.set(JavaLanguageVersion.of(17))
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ allprojects {
|
|||||||
subprojects {
|
subprojects {
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(17)
|
options.release.set(21)
|
||||||
}
|
}
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
@@ -45,7 +45,7 @@ subprojects {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://papermc.io/repo/repository/maven-public/")
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
maven("https://sonatype.projecteden.gg/repository/maven-public/")
|
maven("https://sonatype.projecteden.gg/repository/maven-public/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,6 +64,15 @@ paperweight {
|
|||||||
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
|
||||||
serverOutputDir.set(layout.projectDirectory.dir("parchment-server"))
|
serverOutputDir.set(layout.projectDirectory.dir("parchment-server"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
patchTasks {
|
||||||
|
register("generatedApi") {
|
||||||
|
isBareDirectory.set(true)
|
||||||
|
upstreamDirPath.set("paper-api-generator/generated")
|
||||||
|
patchDir.set(layout.projectDirectory.dir("patches/generatedApi"))
|
||||||
|
outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,12 +82,11 @@ paperweight {
|
|||||||
|
|
||||||
tasks.generateDevelopmentBundle {
|
tasks.generateDevelopmentBundle {
|
||||||
apiCoordinates.set("gg.projecteden.parchment:parchment-api")
|
apiCoordinates.set("gg.projecteden.parchment:parchment-api")
|
||||||
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
|
|
||||||
libraryRepositories.set(
|
libraryRepositories.set(
|
||||||
listOf(
|
listOf(
|
||||||
"https://repo.maven.apache.org/maven2/",
|
"https://repo.maven.apache.org/maven2/",
|
||||||
"https://libraries.minecraft.net/",
|
"https://libraries.minecraft.net/",
|
||||||
"https://papermc.io/repo/repository/maven-public/",
|
"https://repo.papermc.io/repository/maven-public/",
|
||||||
"https://maven.quiltmc.org/repository/release/",
|
"https://maven.quiltmc.org/repository/release/",
|
||||||
"https://sonatype.projecteden.gg/repository/maven-public/"
|
"https://sonatype.projecteden.gg/repository/maven-public/"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
group = gg.projecteden.parchment
|
group = gg.projecteden.parchment
|
||||||
version = 1.20.4-R0.1-SNAPSHOT
|
version = 1.21.3-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion = 1.20.4
|
mcVersion = 1.21.3
|
||||||
paperRef = f1820dc80a02009980e6466ea5847933861b911a
|
paperRef = 9bc147178d62a722fb74b9157e9545a4aea72d4b
|
||||||
edenVersion = 2.2.8-SNAPSHOT
|
edenVersion = 2.3.0-SNAPSHOT
|
||||||
|
|
||||||
updatingMinecraft=true
|
updatingMinecraft=true
|
||||||
|
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Build changes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 9d817bf3f26ffd484945a00a6538970eca22ee20..fa4928487cca082a770a25f6f6490286ae397037 100644
|
index e29e5024fa693baae469d47fe77b57118f14627c..7dab3328c111b9d4e06a37f25f03708870f4bab9 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -14,6 +14,9 @@ val bungeeCordChatVersion = "1.20-R0.1"
|
@@ -14,6 +14,9 @@ val bungeeCordChatVersion = "1.20-R0.2"
|
||||||
val adventureVersion = "4.14.0"
|
val adventureVersion = "4.17.0"
|
||||||
val slf4jVersion = "2.0.9"
|
val slf4jVersion = "2.0.9"
|
||||||
val log4jVersion = "2.17.1"
|
val log4jVersion = "2.17.1"
|
||||||
+
|
+
|
||||||
@@ -18,11 +18,11 @@ index 9d817bf3f26ffd484945a00a6538970eca22ee20..fa4928487cca082a770a25f6f6490286
|
|||||||
val apiAndDocs: Configuration by configurations.creating {
|
val apiAndDocs: Configuration by configurations.creating {
|
||||||
attributes {
|
attributes {
|
||||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||||
@@ -27,6 +30,7 @@ configurations.api {
|
@@ -39,6 +42,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||||
}
|
// Paper end - configure mockito agent that is needed in newer java versions
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
+ api("gg.projecteden:eden-interfaces:$edenVersion") // Parchment
|
+ api("gg.projecteden:eden-interfaces:$edenVersion") // Parchment
|
||||||
|
api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api
|
||||||
// api dependencies are listed transitively to API consumers
|
// api dependencies are listed transitively to API consumers
|
||||||
api("com.google.guava:guava:32.1.2-jre")
|
api("com.google.guava:guava:32.1.2-jre")
|
||||||
api("com.google.code.gson:gson:2.10.1")
|
|
||||||
|
|||||||
@@ -8,122 +8,83 @@ Creates new interfaces for objects that have a reference to a player, offlinepla
|
|||||||
Also creates interfaces for objects that are like players in that they use all other interfaces and can receive Adventure messages.
|
Also creates interfaces for objects that are like players in that they use all other interfaces and can receive Adventure messages.
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
||||||
index 978813b94a5eae0afccbd3b38b463091a46b56ac..617a4b17982e3dac47480cb16046233232f288b7 100644
|
index 741d0e73bc635a545c94c4b1254cee8f41ba8925..24dfa7fb8d9f86626f48fdc40775f5bb7f05f3f0 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
||||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -13,7 +13,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
/**
|
|
||||||
* Called when a beacon effect is being applied to a player.
|
* Called when a beacon effect is being applied to a player.
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class BeaconEffectEvent extends BlockEvent implements Cancellable {
|
-public class BeaconEffectEvent extends BlockEvent implements Cancellable {
|
||||||
+public class BeaconEffectEvent extends BlockEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
+public class BeaconEffectEvent extends BlockEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
private boolean cancelled;
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
private PotionEffect effect;
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
||||||
index f530a3d9314e17d1da896cac633f6a422258d9a9..08897d13a8af33ed1cd40c46b0f168e0c4ebfd4a 100644
|
index 34adc77de2d1f06b2b10cc26b60240c6a3ef259c..2e3dd13143e7af0b3aaa8307909fe14cee402eb3 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
||||||
@@ -38,7 +38,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -38,7 +38,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
* at the Enderman, according to Vanilla rules.
|
* at the Enderman, according to Vanilla rules.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable {
|
-public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable {
|
||||||
+public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
+public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
||||||
@NotNull private final Player player;
|
|
||||||
|
|
||||||
public EndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player) {
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
||||||
index bcc8dba50e3a3df0206c4827bb468bf884837b8b..83b23884d67e7600a3a3cc33050606e397106020 100644
|
index 1492d168aa1dc538b732b0ff262074cc7c9900e6..4ec22bb3dd6674a9d56173d9abb5762a4fcfe584 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
||||||
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -12,7 +12,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
/**
|
|
||||||
* Fired when a Turtle lays eggs
|
* Fired when a Turtle lays eggs
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
|
-public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
|
||||||
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
private boolean cancelled = false;
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
@NotNull
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
||||||
index abeb24fccda2acfdb0dfdadacb8fe688bd97cf78..890069604ca78a9a3f3b4c5f40969a451a1b2067 100644
|
index a84101fb1b478f3018f283bc47d3e73a7ae5bbc8..ea24db70e9b83b8fb626840a2c1387407ffdc256 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
||||||
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -12,7 +12,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
/**
|
|
||||||
* Fired when a Turtle starts digging to lay eggs
|
* Fired when a Turtle starts digging to lay eggs
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
|
-public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
|
||||||
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
private boolean cancelled = false;
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
@NotNull private final Location location;
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
||||||
index 59ae7bc3a0a2079fe4b3a92d777aca682a58e4e3..738007be082287a1f1662f2f3b7772e818042647 100644
|
index aea04fb357f5728195fd9c9bdcd6304a0b953c45..18c6e8b1865a958a10fc2ae4234979f1adfaedc3 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
||||||
@@ -20,7 +20,7 @@ import java.util.UUID;
|
@@ -21,7 +21,7 @@ import org.jspecify.annotations.Nullable;
|
||||||
*
|
|
||||||
* <p>WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS</p>
|
* <p>WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS</p>
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class PlayerHandshakeEvent extends Event implements Cancellable {
|
-public class PlayerHandshakeEvent extends Event implements Cancellable {
|
||||||
+public class PlayerHandshakeEvent extends Event implements Cancellable, gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment {
|
+public class PlayerHandshakeEvent extends Event implements Cancellable, gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
|
||||||
|
|
||||||
private static final HandlerList HANDLERS = new HandlerList();
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
@NotNull private final String originalHandshake;
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
|
||||||
index 4dcf6242c9acc62d030a94f67b78729ed29f8c85..700fa58c70612ef18b26e8160e8ad1275ad56b5a 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
|
||||||
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
|
||||||
* No guarantees are made about thread execution context for this event. If you need to know, check
|
|
||||||
* event.isAsync()
|
|
||||||
*/
|
|
||||||
-public class PreLookupProfileEvent extends Event {
|
|
||||||
+public class PreLookupProfileEvent extends Event implements gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
|
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
|
||||||
@NotNull private final String name;
|
|
||||||
@@ -51,10 +51,25 @@ public class PreLookupProfileEvent extends Event {
|
|
||||||
* @return The UUID of the profile if it has already been provided by a plugin
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
+ // Parchment start
|
|
||||||
+ @Deprecated
|
|
||||||
public UUID getUUID() {
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /**
|
|
||||||
+ * If this value is left null by the completion of the event call, then the server will
|
|
||||||
+ * trigger a call to the Mojang API to look up the UUID (Network Request), and subsequently, fire a
|
|
||||||
+ * {@link LookupProfileEvent}
|
|
||||||
+ *
|
|
||||||
+ * @return The UUID of the profile if it has already been provided by a plugin
|
|
||||||
+ */
|
|
||||||
+ @Override
|
|
||||||
+ public @Nullable UUID getUniqueId() {
|
|
||||||
+ return uuid;
|
|
||||||
+ }
|
|
||||||
+ // Parchment end
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* Sets the UUID for this player name. This will skip the initial API call to find the players UUID.
|
|
||||||
*
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
||||||
index 9be64a95c2345433b6142d611077dedadcef9f5d..e3cea810881868fb5869de72f331733e6893fcee 100644
|
index 0482ecf5b84ba8e0260679049f384f3449bbe7b5..b8ef784ec3b61d78ddb0f1aa6bb9712b4df9892d 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
--- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
||||||
@@ -47,7 +47,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -53,7 +53,7 @@ import org.jspecify.annotations.Nullable;
|
||||||
*
|
|
||||||
* Only 1 process will be allowed to provide completions, the Async Event, or the standard process.
|
* Only 1 process will be allowed to provide completions, the Async Event, or the standard process.
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class AsyncTabCompleteEvent extends Event implements Cancellable {
|
-public class AsyncTabCompleteEvent extends Event implements Cancellable {
|
||||||
+public class AsyncTabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
|
+public class AsyncTabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
|
||||||
@NotNull private final CommandSender sender;
|
|
||||||
@NotNull private final String buffer;
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
private final boolean isCommand;
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||||
index 2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a..640a01478be687b089aeddad422e4bba2bea19b6 100644
|
index 2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a..640a01478be687b089aeddad422e4bba2bea19b6 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||||
@@ -397,33 +358,33 @@ index 0000000000000000000000000000000000000000..c70ddc6f92d62d2d5baa001c9009ddd3
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
||||||
index 2c1cda1126e577a88f19071e958eddb5a38785af..39e746f0c8536642346abbb6909fd2053031d695 100644
|
index 2815c5802eb38e5a48f9db42b9247e24c27db134..df0a4c29e7fdb019907d47da09f0e1e2db4c9613 100644
|
||||||
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
||||||
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
||||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -16,7 +16,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
* Should only be used for packet/clientside related stuff.
|
|
||||||
* Not intended for modifying server side state.
|
* Not intended for modifying server side state.
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class PlayerChunkLoadEvent extends ChunkEvent {
|
-public class PlayerChunkLoadEvent extends ChunkEvent {
|
||||||
+public class PlayerChunkLoadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
+public class PlayerChunkLoadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
private final Player player;
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
diff --git a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
||||||
index 12163a7b0591a7d022dc7eb9ee6608a1b6c39d9b..d81c7307127b135417e06a3b244416bee34b0abe 100644
|
index 3ebb35b680193109cc751398675e935eed746750..6f162e907e31496ac8a1470d3fa3b844a7f4615a 100644
|
||||||
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
||||||
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
||||||
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -14,7 +14,7 @@ import org.jspecify.annotations.NullMarked;
|
||||||
* Should only be used for packet/clientside related stuff.
|
|
||||||
* Not intended for modifying server side.
|
* Not intended for modifying server side.
|
||||||
*/
|
*/
|
||||||
|
@NullMarked
|
||||||
-public class PlayerChunkUnloadEvent extends ChunkEvent {
|
-public class PlayerChunkUnloadEvent extends ChunkEvent {
|
||||||
+public class PlayerChunkUnloadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
+public class PlayerChunkUnloadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
private final Player player;
|
|
||||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||||
index 9bbd928f7d513ca317cd27beffa61e5111f5ffb0..7cc62b34800d7fe3d26e78945b1e4f24d09f7c85 100644
|
index bdc065a486306236c7f0960718bea53bc0b0a9b6..c99fde4d0c8dc12a89015f4cccdccfe8e3dfb8f6 100644
|
||||||
--- a/src/main/java/org/bukkit/Location.java
|
--- a/src/main/java/org/bukkit/Location.java
|
||||||
+++ b/src/main/java/org/bukkit/Location.java
|
+++ b/src/main/java/org/bukkit/Location.java
|
||||||
@@ -30,7 +30,7 @@ import org.bukkit.entity.Player;
|
@@ -30,7 +30,7 @@ import org.bukkit.entity.Player;
|
||||||
@@ -450,15 +411,15 @@ index 9bbd928f7d513ca317cd27beffa61e5111f5ffb0..7cc62b34800d7fe3d26e78945b1e4f24
|
|||||||
* Constructs a new Location with the given coordinates
|
* Constructs a new Location with the given coordinates
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||||
index bce07d84cafca677bb6fad78c21b82097f06430c..c148832d2df44faa41d239d0be5b9df284a9b7c0 100644
|
index a028f2fe541491729856051780b33dba07832fb6..5a6aa86fda316b8591fb1653a09d9e2ff729b33f 100644
|
||||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||||
@@ -19,7 +19,14 @@ import org.jetbrains.annotations.Nullable;
|
@@ -19,7 +19,14 @@ import org.jetbrains.annotations.Nullable;
|
||||||
* player that is stored on the disk and can, thus, be retrieved without the
|
* player that is stored on the disk and can, thus, be retrieved without the
|
||||||
* player needing to be online.
|
* player needing to be online.
|
||||||
*/
|
*/
|
||||||
-public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable {
|
-public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder { // Paper - Add Offline PDC API
|
||||||
+public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment
|
+public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment
|
||||||
+
|
+
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ @Override
|
+ @Override
|
||||||
@@ -470,46 +431,47 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..c148832d2df44faa41d239d0be5b9df2
|
|||||||
/**
|
/**
|
||||||
* Checks if this player is currently online
|
* Checks if this player is currently online
|
||||||
diff --git a/src/main/java/org/bukkit/Raid.java b/src/main/java/org/bukkit/Raid.java
|
diff --git a/src/main/java/org/bukkit/Raid.java b/src/main/java/org/bukkit/Raid.java
|
||||||
index 983a8c20a06d2b509602b27f49c090598b8ecc42..46dd8496f5a2c792ee7811e33c424e88edf8b5b3 100644
|
index fa98599e3eee37bf68f0e9813497c718f457485c..7af5afbef7b1559221ab6c28131ae698aa8cec76 100644
|
||||||
--- a/src/main/java/org/bukkit/Raid.java
|
--- a/src/main/java/org/bukkit/Raid.java
|
||||||
+++ b/src/main/java/org/bukkit/Raid.java
|
+++ b/src/main/java/org/bukkit/Raid.java
|
||||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
/**
|
/**
|
||||||
* Represents a raid event.
|
* Represents a raid event.
|
||||||
*/
|
*/
|
||||||
-public interface Raid {
|
-public interface Raid extends org.bukkit.persistence.PersistentDataHolder { // Paper
|
||||||
+public interface Raid extends gg.projecteden.parchment.HasLocation { // Parchment
|
+public interface Raid extends org.bukkit.persistence.PersistentDataHolder, gg.projecteden.parchment.HasLocation { // Paper // Parchment
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get whether this raid started.
|
* Get whether this raid started.
|
||||||
diff --git a/src/main/java/org/bukkit/Vibration.java b/src/main/java/org/bukkit/Vibration.java
|
diff --git a/src/main/java/org/bukkit/Vibration.java b/src/main/java/org/bukkit/Vibration.java
|
||||||
index bbc01e7c192ae6689c301670047ff114306c57cb..2a83ba61686caffb247f17a67af474299dae6be4 100644
|
index bbc01e7c192ae6689c301670047ff114306c57cb..0b2a6ed4407817df4421ae8edf46d7876864a618 100644
|
||||||
--- a/src/main/java/org/bukkit/Vibration.java
|
--- a/src/main/java/org/bukkit/Vibration.java
|
||||||
+++ b/src/main/java/org/bukkit/Vibration.java
|
+++ b/src/main/java/org/bukkit/Vibration.java
|
||||||
@@ -74,7 +74,7 @@ public class Vibration {
|
@@ -74,7 +74,8 @@ public class Vibration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- public static class BlockDestination implements Destination {
|
- public static class BlockDestination implements Destination {
|
||||||
+ public static class BlockDestination implements Destination, gg.projecteden.parchment.HasLocation { // Parchment
|
+ public static class BlockDestination implements Destination, gg.projecteden.parchment.HasLocation { // Parchment
|
||||||
|
+
|
||||||
|
|
||||||
private final Location block;
|
private final Location block;
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||||
index d124768378d6f0c5573f28ee815ea3886fe74868..11a00998b1cb5ee582e225553f15b1b7c1a65b2a 100644
|
index 027a7d3b6feb52f6c3424edc0820d29fdaf6ebae..fe33bdfd98c3a96af766cbbe5a267f4710cbff52 100644
|
||||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
/**
|
/**
|
||||||
* Concrete implementation of an attribute modifier.
|
* Concrete implementation of an attribute modifier.
|
||||||
*/
|
*/
|
||||||
-public class AttributeModifier implements ConfigurationSerializable {
|
-public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||||
+public class AttributeModifier implements ConfigurationSerializable, gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
+public class AttributeModifier implements ConfigurationSerializable, Keyed, gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||||
|
|
||||||
private final UUID uuid;
|
private static final Pattern UUID_PATTERN = Pattern.compile("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
|
||||||
private final String name;
|
private final NamespacedKey key;
|
||||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||||
index 49974558799830d827f9ccd65a8bafee3fb0376b..0015bb89899e52d3c8f1ca68807ad7092e690305 100644
|
index 0efd8bb70ebdb86372022c9e12ec89f229ab3b52..ec7bb05c4fc2f0f1eb42c77dbe5e3eb6c340bdef 100644
|
||||||
--- a/src/main/java/org/bukkit/block/Block.java
|
--- a/src/main/java/org/bukkit/block/Block.java
|
||||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||||
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -522,7 +484,7 @@ index 49974558799830d827f9ccd65a8bafee3fb0376b..0015bb89899e52d3c8f1ca68807ad709
|
|||||||
/**
|
/**
|
||||||
* Gets the metadata for this block
|
* Gets the metadata for this block
|
||||||
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
|
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
|
||||||
index ef35316fa66ac8d9c7836b9c8af56dcefbf6ff2e..01e2c95bf52cfcffc51d354770fbda5f76540a28 100644
|
index 8c7c8c0e54682dc4276109d19d92394cdd4bc189..cbaf558b98f64922c5e15b1cb1f31068e8fdd501 100644
|
||||||
--- a/src/main/java/org/bukkit/block/BlockState.java
|
--- a/src/main/java/org/bukkit/block/BlockState.java
|
||||||
+++ b/src/main/java/org/bukkit/block/BlockState.java
|
+++ b/src/main/java/org/bukkit/block/BlockState.java
|
||||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -548,20 +510,21 @@ index a39d2f1acbbd84ae0e2cf29f85594e09e55e9355..4348b8961afe7a57350856622aff8c98
|
|||||||
|
|
||||||
public DoubleChest(@NotNull DoubleChestInventory chest) {
|
public DoubleChest(@NotNull DoubleChestInventory chest) {
|
||||||
diff --git a/src/main/java/org/bukkit/entity/AnimalTamer.java b/src/main/java/org/bukkit/entity/AnimalTamer.java
|
diff --git a/src/main/java/org/bukkit/entity/AnimalTamer.java b/src/main/java/org/bukkit/entity/AnimalTamer.java
|
||||||
index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..8f4a293c131cb8b63c31b410ffa211bdb42b3338 100644
|
index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..0cd8961afbe2e04132ec5d40dc9bbc6cab7a0f0f 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/AnimalTamer.java
|
--- a/src/main/java/org/bukkit/entity/AnimalTamer.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/AnimalTamer.java
|
+++ b/src/main/java/org/bukkit/entity/AnimalTamer.java
|
||||||
@@ -4,7 +4,7 @@ import java.util.UUID;
|
@@ -4,7 +4,8 @@ import java.util.UUID;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
-public interface AnimalTamer {
|
-public interface AnimalTamer {
|
||||||
+public interface AnimalTamer extends gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
+public interface AnimalTamer extends gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||||
|
+
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the name of the specified AnimalTamer.
|
* This is the name of the specified AnimalTamer.
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||||
index 1d0fd7ff8449f815a7d980af0b378181ea8bf8d8..65d2b0e87feec296b9f20a6de2d2266493cd1e7b 100644
|
index d0ae8a94db20281d3664d74718c65234eb2e5f83..87cea10a668d3040906a4dd1fd135c2162d9617f 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||||
@@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -574,7 +537,7 @@ index 1d0fd7ff8449f815a7d980af0b378181ea8bf8d8..65d2b0e87feec296b9f20a6de2d22664
|
|||||||
/**
|
/**
|
||||||
* Gets the entity's current position
|
* Gets the entity's current position
|
||||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
index 8b0d04d5b39ee817555a36adddc39b18fc6f0d02..1c87047de615a85ee20297295478770e669d87e6 100644
|
index 488604ba1a516b477693877c74712e4a45624a8b..7f9f8d8f95e58ca702ae7e5007c53c226890d662 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||||
@@ -20,7 +20,15 @@ import org.jetbrains.annotations.Nullable;
|
@@ -20,7 +20,15 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -595,10 +558,10 @@ index 8b0d04d5b39ee817555a36adddc39b18fc6f0d02..1c87047de615a85ee20297295478770e
|
|||||||
// Paper start
|
// Paper start
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index a8d3451ccfcd21a9e80adc2feab8fc9c2926c753..c445cff54095a5389c8d186a9a191beef082c118 100644
|
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..aa21cd957cb0a4756cf0f27cef69fbd80e71c54e 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -52,7 +52,17 @@ import org.jetbrains.annotations.Nullable;
|
@@ -58,7 +58,17 @@ import org.jetbrains.annotations.Nullable;
|
||||||
/**
|
/**
|
||||||
* Represents a player, connected or not
|
* Represents a player, connected or not
|
||||||
*/
|
*/
|
||||||
@@ -631,7 +594,7 @@ index 691733a642b3295bbe6d484be728c77cd32803bd..a2eae7a9bad13d1ba2bd954888a03738
|
|||||||
private boolean dropItems;
|
private boolean dropItems;
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
diff --git a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
diff --git a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
||||||
index 08d09c2a92d8aa6adf6610cc05905d58a76fce1f..5105d8be50d3ebc75eb776f27679ece82317fe06 100644
|
index c74ac0cb004aa219ce2f761969a4bb46cb7c9160..0ef554454608f0129b764dc3d6e3d7780ddf2a11 100644
|
||||||
--- a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
--- a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
+++ b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java
|
||||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -657,10 +620,10 @@ index 392cde07d578d684423e1bf369af28696eb7e484..e1dacc04c73e0cabcd04d50540f3a571
|
|||||||
private final Player player;
|
private final Player player;
|
||||||
private boolean instaBreak;
|
private boolean instaBreak;
|
||||||
diff --git a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
diff --git a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
||||||
index 3dd4bd38e72c04e74e5787fb38ca9abd10bad06b..3783fb96cc7086bc78dc06c573a1343c3a18c3cb 100644
|
index 4c5ee91de162b202c2db8bf68259ad41a430125d..0d7087301c05bd801b32621e279ff69335b92660 100644
|
||||||
--- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
--- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
+++ b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
||||||
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* AIR in most cases. Use #getBlockState() for more Information about the broken
|
* AIR in most cases. Use #getBlockState() for more Information about the broken
|
||||||
* block.
|
* block.
|
||||||
*/
|
*/
|
||||||
@@ -761,10 +724,10 @@ index 59aab10c2d27247eb77bd71d75b5f9126aa0fb12..57f89f569725289d56f1c75db258ac19
|
|||||||
/**
|
/**
|
||||||
* Gets the amount of ticks that the animal will fall in love for.
|
* Gets the amount of ticks that the animal will fall in love for.
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||||
index 099efafa14c10910e4ed04abb1823f0c1a96b6a6..382602ca4a9a33cf238f982f77865053d38bd285 100644
|
index e468e55d426b8f81f87c0a08451d02b3866c226f..74f0f439aa145d9c8d1c049aee387521f34a39e9 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
|
* event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
|
||||||
* is disabled as no block interaction will occur.
|
* is disabled as no block interaction will occur.
|
||||||
*/
|
*/
|
||||||
@@ -787,15 +750,15 @@ index 71d664dd89995f088c47d17b38547d530319470c..d931ece8f35c8f01748c59d01617fd59
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
||||||
index 6818e9f0ba32ca1a1e612703f7526b29f5a6438f..c9c4a6673fd3995bb9638b0d25fa212412cda807 100644
|
index 8b2caf665b9e829ceefc89bf41b192f53f3d5773..dbf52ab6f97245d1d4b2325a3e05b5047a3e7e6f 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
|
||||||
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
/**
|
* Cancelling this event prevents any further processing of the portal for that tick.
|
||||||
* Called when an entity comes into contact with a portal
|
* @see io.papermc.paper.event.entity.EntityInsideBlockEvent
|
||||||
*/
|
*/
|
||||||
-public class EntityPortalEnterEvent extends EntityEvent {
|
-public class EntityPortalEnterEvent extends EntityEvent implements org.bukkit.event.Cancellable { // Paper
|
||||||
+public class EntityPortalEnterEvent extends EntityEvent implements gg.projecteden.parchment.HasLocation { // Parchment
|
+public class EntityPortalEnterEvent extends EntityEvent implements org.bukkit.event.Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final Location location;
|
private final Location location;
|
||||||
|
|
||||||
@@ -813,7 +776,7 @@ index 961ee511342cd3a12ff2ff74d7b4683c6753123d..892732ab5ae58ec980c4fd05a5a3dfdc
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean canceled;
|
private boolean canceled;
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
||||||
index 6fc66197eb2c5d59c70d8d028b7963748371edbe..dc45ec5b6ae8e2958d83a113d23ab0b1a911de3f 100644
|
index 2bb29fa449cd6c90b52d2786ed15b6154d591607..ce4caa5d3b0801bc7e2fd2c917a4ae6e3f054052 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java
|
||||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
@@ -852,10 +815,10 @@ index cc5781f276ec0a503b1bfef19d630c85db897c2a..89b38f2ce9a355f39abc657eff49c3a5
|
|||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private final Player player;
|
private final Player player;
|
||||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||||
index a965b6a78073c5da86ad671752eff4a270029420..84cc90c085ae5ab788bcbc83bf1a0081be3b8186 100644
|
index 5ffd28fd24b4477a07fc9f6a3f669a6f4da9fa26..7611905895d414eeb45a92ed0e3b6124f3dd85cd 100644
|
||||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
--- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
|
* {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
|
||||||
* {@link org.bukkit.block.BlastFurnace}.
|
* {@link org.bukkit.block.BlastFurnace}.
|
||||||
*/
|
*/
|
||||||
@@ -891,12 +854,12 @@ index 8e2afeab4c62724148e8bb0c83fb7eec569c7a0c..2843fd117151dc75c87db06915a67322
|
|||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private net.kyori.adventure.text.Component titleOverride; // Paper
|
private net.kyori.adventure.text.Component titleOverride; // Paper
|
||||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||||
index fc2d9e85b65347b90bde3b0b13ccae759e33d466..6b2e64fa9c0f3c0af88797d63557c333edf69a5d 100644
|
index ae02788536d0c6736aba4ccf812844df4f9789f1..327558fcf2aacf0df5a62399fc510c25fcf7cb38 100644
|
||||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* <p>
|
* Consider rendering any translatable yourself with {@link net.kyori.adventure.translation.GlobalTranslator#render}
|
||||||
* This event is asynchronous, and not run using main thread.
|
* if the client's language is known.
|
||||||
*/
|
*/
|
||||||
-public class AsyncPlayerPreLoginEvent extends Event {
|
-public class AsyncPlayerPreLoginEvent extends Event {
|
||||||
+public class AsyncPlayerPreLoginEvent extends Event implements gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
+public class AsyncPlayerPreLoginEvent extends Event implements gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||||
@@ -917,10 +880,10 @@ index f6d3b817de3001f04ea4554c7c39a1290af3fd6d..44efb5cc62149b34b994eadac488a902
|
|||||||
|
|
||||||
public PlayerEvent(@NotNull final Player who) {
|
public PlayerEvent(@NotNull final Player who) {
|
||||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||||
index 6800132c6288b4588fd02b08d26f016c38f27129..8e333a361cdee30a83e9472285dfb0b30b2e72ca 100644
|
index 175ed12dd1698f4d153c9acdac8340c15a427ea5..5e14dc6968de1b146b31abef19fbba1af8c68b6f 100644
|
||||||
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
||||||
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Warning(reason = "This event causes a login thread to synchronize with the main thread")
|
@Warning(reason = "This event causes a login thread to synchronize with the main thread")
|
||||||
@@ -956,12 +919,12 @@ index 128e43cf12205f82f2b119a773208502cdccfdd4..ca1fed3081e2b0a3271a2dfa0f49cce7
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
//
|
//
|
||||||
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
||||||
index 4a3451af454295ac3e1b688e6665cad9fc594c82..b88cebb219577d59cc338be89c6f391d10702095 100644
|
index c71c122ccc4775d030688f7b8df0b4feb49136f4..107c38d38f47771111606c8788d637c565925b40 100644
|
||||||
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
|
||||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* advised to ensure the client does not have permission for the relevant
|
* @apiNote Only called for bukkit API commands {@link org.bukkit.command.Command} and
|
||||||
* commands, or use {@link PlayerCommandSendEvent}.
|
* {@link org.bukkit.command.CommandExecutor} and not for brigadier commands ({@link io.papermc.paper.command.brigadier.Commands}).
|
||||||
*/
|
*/
|
||||||
-public class TabCompleteEvent extends Event implements Cancellable {
|
-public class TabCompleteEvent extends Event implements Cancellable {
|
||||||
+public class TabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
|
+public class TabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
|
||||||
@@ -969,7 +932,7 @@ index 4a3451af454295ac3e1b688e6665cad9fc594c82..b88cebb219577d59cc338be89c6f391d
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
//
|
//
|
||||||
diff --git a/src/main/java/org/bukkit/event/world/GenericGameEvent.java b/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
diff --git a/src/main/java/org/bukkit/event/world/GenericGameEvent.java b/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
||||||
index 2a2a329877d8da45c2d6afecf78ce88d52635cad..22cdf3662b02fb5751ac6d913d781084cd7eee5b 100644
|
index fb975fefc74d8c9746cab4c02860f55654cf92f7..172699ba31d1ee0697607125d75549930288dd5b 100644
|
||||||
--- a/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
--- a/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
+++ b/src/main/java/org/bukkit/event/world/GenericGameEvent.java
|
||||||
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -982,7 +945,7 @@ index 2a2a329877d8da45c2d6afecf78ce88d52635cad..22cdf3662b02fb5751ac6d913d781084
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private final GameEvent event;
|
private final GameEvent event;
|
||||||
diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
||||||
index 7af8d6e51c824cf0592b722b834f1d4986e3cc08..c28d62fc3dc359f9ebcf926094198ee3c92467aa 100644
|
index 783e74bc382f0f6d24203fde7b811f588a674731..c0f863b35cc7f508a33ddcb1af9ed6c52115efdc 100644
|
||||||
--- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
--- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
+++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java
|
||||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -1008,20 +971,20 @@ index 0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3..469b9cc0c4b77844ba0317af51bd9ad8
|
|||||||
/**
|
/**
|
||||||
* Returns the size of the inventory
|
* Returns the size of the inventory
|
||||||
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
|
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||||
index ac6c5c7a58c2c88b6cb0f6632fb53e8d67f8a059..464c69fd652db3384b1a4a5f4151933c3cd7df7b 100644
|
index 5c258b6077277575daa5d96349837bdf06f42500..f8fd3590df19d4930f54c0456f9cb7bab636f227 100644
|
||||||
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||||
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
* contracts of certain methods, there's no guarantee that the game will work
|
* Represents a view linking two inventories and a single player (whose
|
||||||
* as it should.
|
* inventory may or may not be one of the two).
|
||||||
*/
|
*/
|
||||||
-public abstract class InventoryView {
|
-public interface InventoryView {
|
||||||
+public abstract class InventoryView implements gg.projecteden.parchment.HasHumanEntity { // Parchment
|
+public interface InventoryView extends gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||||
public static final int OUTSIDE = -999;
|
public static final int OUTSIDE = -999;
|
||||||
/**
|
/**
|
||||||
* Represents various extra properties of certain inventory windows.
|
* Represents various extra properties of certain inventory windows.
|
||||||
diff --git a/src/main/java/org/bukkit/loot/LootContext.java b/src/main/java/org/bukkit/loot/LootContext.java
|
diff --git a/src/main/java/org/bukkit/loot/LootContext.java b/src/main/java/org/bukkit/loot/LootContext.java
|
||||||
index 71b7aa9d675e1714e286e6fd4015ead036d912e0..95e120068a7c5c96b1b8553df9cf8654ba63a325 100644
|
index 9c1ccaed727ec5e5dad93146bbfda798e3f536e7..b4dc13b03d8a33ac13e8af6677e1a8418edc8e20 100644
|
||||||
--- a/src/main/java/org/bukkit/loot/LootContext.java
|
--- a/src/main/java/org/bukkit/loot/LootContext.java
|
||||||
+++ b/src/main/java/org/bukkit/loot/LootContext.java
|
+++ b/src/main/java/org/bukkit/loot/LootContext.java
|
||||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
@@ -1033,3 +996,27 @@ index 71b7aa9d675e1714e286e6fd4015ead036d912e0..95e120068a7c5c96b1b8553df9cf8654
|
|||||||
|
|
||||||
public static final int DEFAULT_LOOT_MODIFIER = -1;
|
public static final int DEFAULT_LOOT_MODIFIER = -1;
|
||||||
|
|
||||||
|
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||||
|
index 07416cc9e2b8156be2cc92d6d974b881b427fd99..4f96ecb2f03b7ad84592d874462acb54a86303c9 100644
|
||||||
|
--- a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||||
|
+++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||||
|
@@ -22,7 +22,7 @@ import org.jspecify.annotations.Nullable;
|
||||||
|
* {@link Event#isAsynchronous()}
|
||||||
|
*/
|
||||||
|
@NullMarked
|
||||||
|
-public class PreLookupProfileEvent extends Event {
|
||||||
|
+public class PreLookupProfileEvent extends Event implements gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
|
||||||
|
|
||||||
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
|
|
||||||
|
@@ -55,6 +55,10 @@ public class PreLookupProfileEvent extends Event {
|
||||||
|
return this.uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public UUID getUniqueId() {
|
||||||
|
+ return this.uuid;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* Sets the UUID for this player name. This will skip the initial API call to find the players UUID.
|
||||||
|
* <p>
|
||||||
|
|||||||
@@ -5,37 +5,35 @@ Subject: [PATCH] Add origin location to EntityDamageByBlockEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
||||||
index ab18f35b686ec79551c307dde9e43c7dfad1b182..47c522e31d704d6c36fbfe128c97cba234932bc7 100644
|
index 148c4aad384ae8e3b8b22d264a84bddfbcafdf1e..61fcdd178fa5a8f13c889a78f431d2a5529c8c43 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
|
||||||
@@ -17,6 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
public class EntityDamageByBlockEvent extends EntityDamageEvent {
|
public class EntityDamageByBlockEvent extends EntityDamageEvent {
|
||||||
private final Block damager;
|
private final Block damager;
|
||||||
private final org.bukkit.block.BlockState damagerBlockState; // Paper
|
private final BlockState damagerState;
|
||||||
+ private final org.bukkit.Location location; // Parchment
|
+ private final org.bukkit.Location location; // Parchment
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
|
public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
|
||||||
// Paper start
|
@@ -30,19 +31,40 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent {
|
||||||
@@ -28,21 +29,41 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent {
|
super(damagee, cause, damageSource, damage);
|
||||||
super(damagee, cause, damage);
|
|
||||||
this.damager = damager;
|
this.damager = damager;
|
||||||
this.damagerBlockState = damagerBlockState; // Paper
|
this.damagerState = damagerState;
|
||||||
+ this.location = damager != null ? damager.getLocation() : null; // Parchment
|
+ this.location = damager != null ? damager.getLocation() : null; // Parchment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
|
public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
|
||||||
// Paper start
|
- this(damager, (damager != null) ? damager.getState() : null, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), modifiers, modifierFunctions);
|
||||||
- this(damager, damagee, cause, modifiers, modifierFunctions, null);
|
+ this(damager, (damager != null) ? damager.getState() : null, damagee, cause, (damager != null) ? DamageSource.builder(DamageType.GENERIC).withDamageLocation(damager.getLocation()).build() : DamageSource.builder(DamageType.GENERIC).build(), modifiers, modifierFunctions, null);
|
||||||
+ this(damager, damagee, cause, modifiers, modifierFunctions, null, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.ApiStatus.Internal
|
- public EntityDamageByBlockEvent(@Nullable final Block damager, @Nullable final BlockState damagerState, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
|
||||||
- public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, final @Nullable org.bukkit.block.BlockState damagerBlockState) {
|
+ public EntityDamageByBlockEvent(@Nullable final Block damager, @Nullable final BlockState damagerState, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final DamageSource damageSource, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, @Nullable final org.bukkit.Location damageLocation) { // Parchment
|
||||||
+ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, final @Nullable org.bukkit.block.BlockState damagerBlockState, @Nullable final org.bukkit.Location damageLocation) { // Parchment
|
super(damagee, cause, damageSource, modifiers, modifierFunctions);
|
||||||
// Paper end
|
|
||||||
super(damagee, cause, modifiers, modifierFunctions);
|
|
||||||
this.damager = damager;
|
this.damager = damager;
|
||||||
this.damagerBlockState = damagerBlockState; // Paper
|
this.damagerState = damagerState;
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ if (damageLocation != null)
|
+ if (damageLocation != null)
|
||||||
+ this.location = damageLocation;
|
+ this.location = damageLocation;
|
||||||
@@ -56,6 +54,7 @@ index ab18f35b686ec79551c307dde9e43c7dfad1b182..47c522e31d704d6c36fbfe128c97cba2
|
|||||||
+ return location;
|
+ return location;
|
||||||
+ }
|
+ }
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
|
+
|
||||||
+
|
+
|
||||||
/**
|
/**
|
||||||
* Returns the block that damaged the player.
|
* Returns the block that damaged the player.
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..3f912d3fbf5fdef3b95f81585d2fcf76
|
|||||||
* Gets the char value associated with this color
|
* Gets the char value associated with this color
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java
|
diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java
|
||||||
index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909beaf941e8fa 100644
|
index f8edb964c4af597b03a2de06c464cc06a96b791c..3957d290c606a50b59c7c421ea7c163f4625449c 100644
|
||||||
--- a/src/main/java/org/bukkit/Color.java
|
--- a/src/main/java/org/bukkit/Color.java
|
||||||
+++ b/src/main/java/org/bukkit/Color.java
|
+++ b/src/main/java/org/bukkit/Color.java
|
||||||
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
* but subject to change.
|
* but subject to change.
|
||||||
*/
|
*/
|
||||||
@SerializableAs("Color")
|
@SerializableAs("Color")
|
||||||
@@ -93,7 +93,7 @@ index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909bea
|
|||||||
private static final int BIT_MASK = 0xff;
|
private static final int BIT_MASK = 0xff;
|
||||||
private static final int DEFAULT_ALPHA = 255;
|
private static final int DEFAULT_ALPHA = 255;
|
||||||
|
|
||||||
@@ -309,6 +309,13 @@ public final class Color implements ConfigurationSerializable {
|
@@ -310,6 +310,13 @@ public final class Color implements ConfigurationSerializable {
|
||||||
return getAlpha() << 24 | getRed() << 16 | getGreen() << 8 | getBlue();
|
return getAlpha() << 24 | getRed() << 16 | getGreen() << 8 | getBlue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909bea
|
|||||||
* Gets the color as an BGR integer.
|
* Gets the color as an BGR integer.
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java
|
diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java
|
||||||
index bd213cabddd8752e609544f24cfba95405726155..7e89cadecde96f9c2394446669dc4d98df391940 100644
|
index 47df858e095c4423c20e49e029d72f0f50d2c924..c7504e017bc57df6903a2d76ce98e9fd4c35a7cc 100644
|
||||||
--- a/src/main/java/org/bukkit/DyeColor.java
|
--- a/src/main/java/org/bukkit/DyeColor.java
|
||||||
+++ b/src/main/java/org/bukkit/DyeColor.java
|
+++ b/src/main/java/org/bukkit/DyeColor.java
|
||||||
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||||
index a4b38f284d4fea7df7f9df9bf44e4f68fefaf20f..df153e397f69a6a2f2487998efd444f26d1ff701 100644
|
index a491dc40093e19b8d1900443ad613223fd7f3119..fa22e21eb7299f601649af515b9e554e050b1ae1 100644
|
||||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||||
@@ -260,4 +260,17 @@ public interface UnsafeValues {
|
@@ -312,4 +312,18 @@ public interface UnsafeValues {
|
||||||
|
@NotNull java.util.List<net.kyori.adventure.text.Component> computeTooltipLines(@NotNull ItemStack itemStack, @NotNull io.papermc.paper.inventory.tooltip.TooltipContext tooltipContext, @Nullable org.bukkit.entity.Player player); // Paper - expose itemstack tooltip lines
|
||||||
|
|
||||||
String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic);
|
ItemStack createEmptyStack(); // Paper - proxy ItemStack
|
||||||
// Paper end
|
|
||||||
+
|
+
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ /**
|
+ /**
|
||||||
@@ -25,4 +25,5 @@ index a4b38f284d4fea7df7f9df9bf44e4f68fefaf20f..df153e397f69a6a2f2487998efd444f2
|
|||||||
+ */
|
+ */
|
||||||
+ java.util.concurrent.CompletableFuture<Boolean> canPlaceItemOn(@org.jetbrains.annotations.NotNull ItemStack item, @org.jetbrains.annotations.Nullable gg.projecteden.parchment.OptionalHumanEntity player, @org.jetbrains.annotations.NotNull org.bukkit.block.Block block, @org.jetbrains.annotations.NotNull org.bukkit.block.BlockFace face);
|
+ java.util.concurrent.CompletableFuture<Boolean> canPlaceItemOn(@org.jetbrains.annotations.NotNull ItemStack item, @org.jetbrains.annotations.Nullable gg.projecteden.parchment.OptionalHumanEntity player, @org.jetbrains.annotations.NotNull org.bukkit.block.Block block, @org.jetbrains.annotations.NotNull org.bukkit.block.BlockFace face);
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
|
+
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose MCUtil Executors
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index d0c634629aa0b6bac0da93655dd86ad3aea0ce30..b3162d58938ea5cb38f735a5977ce5e60d81c2b0 100644
|
index f55638eb8b315864052f9fe17ab4846e5e9d8dbb..ac7bd2a77f387e72f8862e8ea5af52f39d90265a 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2162,6 +2162,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2255,6 +2255,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
@NotNull
|
@NotNull
|
||||||
UnsafeValues getUnsafe();
|
UnsafeValues getUnsafe();
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ index 0000000000000000000000000000000000000000..ea17d99c7a1d70d88e2c439399cdb376
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||||
index 5eb3521f5f91b0684b4beebf4f7ba2c795b41c42..c8a3e139fd462a184fac9ff472048451372229de 100644
|
index 7a439c99fc4c5ee17d674460c8e58a9fe0c64e02..3cddbea3553ea12b610ffb1c9ab13d6ab4c291ee 100644
|
||||||
--- a/src/main/java/org/bukkit/World.java
|
--- a/src/main/java/org/bukkit/World.java
|
||||||
+++ b/src/main/java/org/bukkit/World.java
|
+++ b/src/main/java/org/bukkit/World.java
|
||||||
@@ -50,6 +50,36 @@ import org.jetbrains.annotations.Nullable;
|
@@ -52,6 +52,36 @@ import org.jetbrains.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
|
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
|
||||||
|
|
||||||
@@ -101,6 +101,6 @@ index 5eb3521f5f91b0684b4beebf4f7ba2c795b41c42..c8a3e139fd462a184fac9ff472048451
|
|||||||
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType);
|
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType);
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
+
|
+
|
||||||
// Paper start
|
// Paper start - void damage configuration
|
||||||
/**
|
/**
|
||||||
* @return The amount of Entities in this world
|
* Checks if void damage is enabled on this world.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ index 2f07efac03f4d12fd2ae9a340d34cf92a90b6cfa..a16d681d5338fdb2a974a2c67dcc0155
|
|||||||
+ *
|
+ *
|
||||||
+ * @return True if the entity is allowed to tick.
|
+ * @return True if the entity is allowed to tick.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canTick();
|
+ default boolean canTick() { return true; }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Sets whether the hanging entity is allowed to tick.
|
+ * Sets whether the hanging entity is allowed to tick.
|
||||||
@@ -28,6 +28,6 @@ index 2f07efac03f4d12fd2ae9a340d34cf92a90b6cfa..a16d681d5338fdb2a974a2c67dcc0155
|
|||||||
+ *
|
+ *
|
||||||
+ * @param tick True if the entity is allowed to tick.
|
+ * @param tick True if the entity is allowed to tick.
|
||||||
+ */
|
+ */
|
||||||
+ public void setCanTick(boolean tick);
|
+ default void setCanTick(boolean tick) { throw new UnsupportedOperationException(); }
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index c445cff54095a5389c8d186a9a191beef082c118..e59cac883dc83186e0977a73b03636993696b37e 100644
|
index aa21cd957cb0a4756cf0f27cef69fbd80e71c54e..d8014eea4f4415602db7e1199a2d9ce059adefaa 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -1912,6 +1912,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@@ -2137,6 +2137,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
@ApiStatus.Experimental
|
*/
|
||||||
public boolean canSee(@NotNull Entity entity);
|
public boolean canSee(@NotNull Entity entity);
|
||||||
|
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
@@ -19,9 +19,9 @@ index c445cff54095a5389c8d186a9a191beef082c118..e59cac883dc83186e0977a73b0363699
|
|||||||
+ * @param plugin Plugin that has hidden entities
|
+ * @param plugin Plugin that has hidden entities
|
||||||
+ * @return a view of hidden entity UUIDs
|
+ * @return a view of hidden entity UUIDs
|
||||||
+ */
|
+ */
|
||||||
+ @ApiStatus.Experimental
|
|
||||||
+ public java.util.@NotNull Set<java.util.UUID> getHiddenEntities(@NotNull Plugin plugin);
|
+ public java.util.@NotNull Set<java.util.UUID> getHiddenEntities(@NotNull Plugin plugin);
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
|
+
|
||||||
+
|
+
|
||||||
// Paper start
|
// Paper start
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,251 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Mon, 18 Jul 2022 20:15:42 -0400
|
|
||||||
Subject: [PATCH] Add Timings Events
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..16198861748b29c537527151216e79c7c32e7204 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
|
||||||
@@ -145,8 +145,27 @@ public final class Timings {
|
|
||||||
* @param enabled Should timings be reported
|
|
||||||
*/
|
|
||||||
public static void setTimingsEnabled(boolean enabled) {
|
|
||||||
+ // Parchment start
|
|
||||||
+ setTimingsEnabled(enabled, null);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * <p>Sets whether or not the Spigot Timings system should be enabled</p>
|
|
||||||
+ *
|
|
||||||
+ * Calls a {@link co.aikar.timings.event.TimingsModifyEvent}, if cancelled the timings will not be reset
|
|
||||||
+ *
|
|
||||||
+ * @param enabled Should timings be reported
|
|
||||||
+ * @param sender The sender asking to reset
|
|
||||||
+ */
|
|
||||||
+ public static void setTimingsEnabled(boolean enabled, CommandSender sender) {
|
|
||||||
timingsEnabled = enabled;
|
|
||||||
warnAboutDeprecationOnEnable();
|
|
||||||
+ if (sender != null) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Parchment end
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
index e801e79fa57c44b2e5d359647c920f88064826f1..012d2281c386d2e5f5a655079c0cbfa4545d6476 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
|
||||||
@@ -63,10 +63,12 @@ public class TimingsCommand extends BukkitCommand {
|
|
||||||
}
|
|
||||||
final String arg = args[0];
|
|
||||||
if ("on".equalsIgnoreCase(arg)) {
|
|
||||||
- Timings.setTimingsEnabled(true);
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.ENABLE).callEvent()) return true; // Parchment
|
|
||||||
+ Timings.setTimingsEnabled(true, sender);
|
|
||||||
sender.sendMessage(text("Enabled Timings & Reset"));
|
|
||||||
return true;
|
|
||||||
} else if ("off".equalsIgnoreCase(arg)) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.DISABLE).callEvent()) return true; // Parchment
|
|
||||||
Timings.setTimingsEnabled(false);
|
|
||||||
sender.sendMessage(text("Disabled Timings"));
|
|
||||||
return true;
|
|
||||||
@@ -79,15 +81,18 @@ public class TimingsCommand extends BukkitCommand {
|
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
if ("verbon".equalsIgnoreCase(arg)) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_ON).callEvent()) return true; // Parchment
|
|
||||||
Timings.setVerboseTimingsEnabled(true);
|
|
||||||
sender.sendMessage(text("Enabled Verbose Timings"));
|
|
||||||
return true;
|
|
||||||
} else if ("verboff".equalsIgnoreCase(arg)) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_OFF).callEvent()) return true; // Parchment
|
|
||||||
Timings.setVerboseTimingsEnabled(false);
|
|
||||||
sender.sendMessage(text("Disabled Verbose Timings"));
|
|
||||||
return true;
|
|
||||||
} else if ("reset".equalsIgnoreCase(arg)) {
|
|
||||||
if (now - lastResetAttempt < 30000) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) return true; // Parchment
|
|
||||||
TimingsManager.reset();
|
|
||||||
sender.sendMessage(text("Timings reset. Please wait 5-10 minutes before using /timings report.", NamedTextColor.RED));
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
index 3af5b8ea795311582044c712de50d29412024b77..806a1e528aae9a26413b483855130bef78ca72fb 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
|
||||||
@@ -59,6 +59,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsMessageEvent(this.senders, message).callEvent()) return; // Parchment
|
|
||||||
net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -70,6 +71,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendMessage(@NotNull String message) {
|
|
||||||
+ if (!new co.aikar.timings.event.TimingsMessageEvent(this.senders, net.kyori.adventure.text.Component.text(message)).callEvent()) return; // Parchment
|
|
||||||
senders.forEach((sender) -> sender.sendMessage(message));
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/event/TimingsEvent.java b/src/main/java/co/aikar/timings/event/TimingsEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..9ad67d72e6173d1629f862ca9fd13475950709f0
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/co/aikar/timings/event/TimingsEvent.java
|
|
||||||
@@ -0,0 +1,36 @@
|
|
||||||
+package co.aikar.timings.event;
|
|
||||||
+
|
|
||||||
+import org.bukkit.Bukkit;
|
|
||||||
+import org.bukkit.command.CommandSender;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+import java.util.Collection;
|
|
||||||
+import java.util.HashSet;
|
|
||||||
+import java.util.Set;
|
|
||||||
+
|
|
||||||
+public abstract class TimingsEvent extends Event {
|
|
||||||
+
|
|
||||||
+ private final @NotNull Set<CommandSender> audience;
|
|
||||||
+ private static final HandlerList handlers = new HandlerList();
|
|
||||||
+
|
|
||||||
+ public TimingsEvent(@NotNull Collection<CommandSender> audience) {
|
|
||||||
+ super(!Bukkit.isPrimaryThread());
|
|
||||||
+ this.audience = new HashSet<>(audience);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public @NotNull Set<CommandSender> getAudience() {
|
|
||||||
+ return this.audience;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return handlers;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static @NotNull HandlerList getHandlerList() {
|
|
||||||
+ return handlers;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java b/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..33152129508c526031eee68f2ae797563d97be0c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+package co.aikar.timings.event;
|
|
||||||
+
|
|
||||||
+import org.bukkit.command.CommandSender;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+import java.util.Collections;
|
|
||||||
+
|
|
||||||
+public class TimingsGenerateReportEvent extends TimingsEvent {
|
|
||||||
+
|
|
||||||
+ private final @NotNull String paste;
|
|
||||||
+
|
|
||||||
+ public TimingsGenerateReportEvent(@NotNull CommandSender sender, @NotNull String paste) {
|
|
||||||
+ super(Collections.singleton(sender));
|
|
||||||
+ this.paste = paste;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public @NotNull String getPaste() {
|
|
||||||
+ return this.paste;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java b/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..626f25e164c6b23481c5a976a6e184e739104305
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java
|
|
||||||
@@ -0,0 +1,35 @@
|
|
||||||
+package co.aikar.timings.event;
|
|
||||||
+
|
|
||||||
+import net.kyori.adventure.text.Component;
|
|
||||||
+import org.bukkit.command.CommandSender;
|
|
||||||
+import org.bukkit.event.Cancellable;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+import java.util.Collection;
|
|
||||||
+import java.util.HashSet;
|
|
||||||
+import java.util.List;
|
|
||||||
+
|
|
||||||
+public class TimingsMessageEvent extends TimingsEvent implements Cancellable {
|
|
||||||
+
|
|
||||||
+ public @NotNull Component message;
|
|
||||||
+ private boolean cancelled;
|
|
||||||
+
|
|
||||||
+ public TimingsMessageEvent(@NotNull Collection<CommandSender> senders, @NotNull Component message) {
|
|
||||||
+ super(new HashSet<>(senders));
|
|
||||||
+ this.message = message;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public @NotNull Component getMessage() {
|
|
||||||
+ return this.message;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isCancelled() {
|
|
||||||
+ return cancelled;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setCancelled(boolean cancel) {
|
|
||||||
+ this.cancelled = cancel;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java b/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..3faf845716d5d3adf360949f28a5e12aa7e20aa6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java
|
|
||||||
@@ -0,0 +1,41 @@
|
|
||||||
+package co.aikar.timings.event;
|
|
||||||
+
|
|
||||||
+import org.bukkit.command.CommandSender;
|
|
||||||
+import org.bukkit.event.Cancellable;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+import java.util.Collections;
|
|
||||||
+
|
|
||||||
+public class TimingsModifyEvent extends TimingsEvent implements Cancellable {
|
|
||||||
+
|
|
||||||
+ private final @NotNull Action action;
|
|
||||||
+ private boolean cancelled = false;
|
|
||||||
+
|
|
||||||
+ public TimingsModifyEvent(@NotNull CommandSender sender, @NotNull Action action) {
|
|
||||||
+ super(Collections.singleton(sender));
|
|
||||||
+ this.action = action;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public @NotNull Action getAction() {
|
|
||||||
+ return this.action;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isCancelled() {
|
|
||||||
+ return this.cancelled;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setCancelled(boolean cancel) {
|
|
||||||
+ this.cancelled = cancel;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public enum Action {
|
|
||||||
+ ENABLE,
|
|
||||||
+ DISABLE,
|
|
||||||
+ RESET,
|
|
||||||
+ VERBOSE_ON,
|
|
||||||
+ VERBOSE_OFF
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API methods
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index e59cac883dc83186e0977a73b03636993696b37e..e4df334e6ceba43144114c1ad84cb5710b71030e 100644
|
index d8014eea4f4415602db7e1199a2d9ce059adefaa..b68feadfb631672b4b99b464fb1b6aae6e82507f 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -62,6 +62,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@@ -68,6 +68,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@NotNull Player getPlayer();
|
@NotNull Player getPlayer();
|
||||||
@@ -5,14 +5,14 @@ Subject: [PATCH] Add NPC to EntityType
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
|
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
|
||||||
index 4aaf268f58038cd5d4101ec3fbfdc20b544d6678..29aa9227a57b4ea458379402ccfce3334d9325d8 100644
|
index c1aa59bab82aee8fd42f7149c520b45660b29082..6e1b2721b1ff69239ce6cf726c50974e76c78f1f 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||||
@@ -303,6 +303,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
@@ -352,6 +352,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||||
*/
|
|
||||||
LIGHTNING("lightning_bolt", LightningStrike.class, -1, false),
|
|
||||||
PLAYER("player", Player.class, -1, false),
|
|
||||||
+ NPC("npc", NPC.class, -1, true),
|
|
||||||
/**
|
/**
|
||||||
* An unknown entity without an Entity Class
|
* An unknown entity without an Entity Class
|
||||||
*/
|
*/
|
||||||
|
+ NPC("npc", NPC.class, -1, true),
|
||||||
|
UNKNOWN(null, null, -1, false);
|
||||||
|
|
||||||
|
private final String name;
|
||||||
@@ -5,24 +5,24 @@ Subject: [PATCH] Revert BungeeChat Deprecation
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index fa4928487cca082a770a25f6f6490286ae397037..9901114fba1469c138bba1821cafd057fbafd4b1 100644
|
index 7dab3328c111b9d4e06a37f25f03708870f4bab9..eefb9b19fb76689a5e7ba86a17ef7117ad67789b 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -35,7 +35,7 @@ dependencies {
|
@@ -48,7 +48,7 @@ dependencies {
|
||||||
api("com.google.guava:guava:32.1.2-jre")
|
api("com.google.guava:guava:32.1.2-jre")
|
||||||
api("com.google.code.gson:gson:2.10.1")
|
api("com.google.code.gson:gson:2.10.1")
|
||||||
// Paper start - adventure
|
// Paper start - adventure
|
||||||
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") {
|
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
|
||||||
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") { // Parchment - revert
|
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") { // Parchment - revert
|
||||||
exclude("com.google.guava", "guava")
|
exclude("com.google.guava", "guava")
|
||||||
}
|
}
|
||||||
// Paper - adventure
|
// Paper - adventure
|
||||||
@@ -133,7 +133,7 @@ tasks.withType<Javadoc> {
|
@@ -172,7 +172,7 @@ tasks.withType<Javadoc> {
|
||||||
"https://guava.dev/releases/32.1.2-jre/api/docs/",
|
"https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
||||||
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
|
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
|
||||||
- // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
|
- // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
|
||||||
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat // Parchment - revert
|
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
|
||||||
// Paper start - add missing javadoc links
|
// Paper start - add missing javadoc links
|
||||||
"https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
|
"https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
|
||||||
"https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
"https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Block BreakNaturally Overload
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||||
index 0015bb89899e52d3c8f1ca68807ad7092e690305..2c384d6c1719a3b2b1335a3f2b7e826c1892bd69 100644
|
index ec7bb05c4fc2f0f1eb42c77dbe5e3eb6c340bdef..3d07006fbab3f075aa72114773ad8e76686b0ad2 100644
|
||||||
--- a/src/main/java/org/bukkit/block/Block.java
|
--- a/src/main/java/org/bukkit/block/Block.java
|
||||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||||
@@ -590,6 +590,20 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
@@ -594,6 +594,20 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||||
*/
|
*/
|
||||||
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience);
|
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience);
|
||||||
|
|
||||||
@@ -6,15 +6,16 @@ Subject: [PATCH] Add CustomBlockUpdateEvent
|
|||||||
|
|
||||||
diff --git a/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java b/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java
|
diff --git a/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java b/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..620e091669dca44001f834ee66cf3b9681e998ce
|
index 0000000000000000000000000000000000000000..f99a67efe3582038fc5500c017a1c1371022985b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java
|
+++ b/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java
|
||||||
@@ -0,0 +1,58 @@
|
@@ -0,0 +1,70 @@
|
||||||
+package gg.projecteden.parchment.event.block;
|
+package gg.projecteden.parchment.event.block;
|
||||||
+
|
+
|
||||||
+import org.bukkit.block.data.BlockData;
|
+import org.bukkit.block.data.BlockData;
|
||||||
+import org.bukkit.event.Cancellable;
|
+import org.bukkit.event.Cancellable;
|
||||||
+import org.bukkit.event.Event;
|
+import org.bukkit.event.Event;
|
||||||
|
+import org.bukkit.Location;
|
||||||
+import org.bukkit.event.HandlerList;
|
+import org.bukkit.event.HandlerList;
|
||||||
+import org.jetbrains.annotations.NotNull;
|
+import org.jetbrains.annotations.NotNull;
|
||||||
+
|
+
|
||||||
@@ -25,6 +26,13 @@ index 0000000000000000000000000000000000000000..620e091669dca44001f834ee66cf3b96
|
|||||||
+
|
+
|
||||||
+ private BlockData block;
|
+ private BlockData block;
|
||||||
+ private UpdateType updateType;
|
+ private UpdateType updateType;
|
||||||
|
+ private Location location;
|
||||||
|
+
|
||||||
|
+ public CustomBlockUpdateEvent(BlockData block, UpdateType updateType, Location location) {
|
||||||
|
+ this.block = block;
|
||||||
|
+ this.updateType = updateType;
|
||||||
|
+ this.location = location;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ public CustomBlockUpdateEvent(BlockData block, UpdateType updateType) {
|
+ public CustomBlockUpdateEvent(BlockData block, UpdateType updateType) {
|
||||||
+ this.block = block;
|
+ this.block = block;
|
||||||
@@ -49,6 +57,10 @@ index 0000000000000000000000000000000000000000..620e091669dca44001f834ee66cf3b96
|
|||||||
+ return updateType;
|
+ return updateType;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ public Location getLocation() {
|
||||||
|
+ return location;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ @NotNull
|
+ @NotNull
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public HandlerList getHandlers() {
|
+ public HandlerList getHandlers() {
|
||||||
@@ -223,18 +223,6 @@ index 0000000000000000000000000000000000000000..c52c8371b2edf4f62533ffcbc7f8d7b1
|
|||||||
+ return this.idx;
|
+ return this.idx;
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
|
||||||
index 65d2b0e87feec296b9f20a6de2d2266493cd1e7b..283fa192456de9e643ed6b87ace05135e9cb7713 100644
|
|
||||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
|
||||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
|
||||||
@@ -1107,4 +1107,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
|
||||||
*/
|
|
||||||
@NotNull String getScoreboardEntryName();
|
|
||||||
// Paper end - entity scoreboard name
|
|
||||||
+
|
|
||||||
+ gg.projecteden.parchment.entity.EntityData getStoredEntityData();
|
|
||||||
+
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/gg/projecteden/parchment/entity/EntityDataServiceKey.java b/src/main/java/gg/projecteden/parchment/entity/EntityDataServiceKey.java
|
diff --git a/src/main/java/gg/projecteden/parchment/entity/EntityDataServiceKey.java b/src/main/java/gg/projecteden/parchment/entity/EntityDataServiceKey.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..c9f9c0d235f33925ee247ba4af56bf9f31bf7056
|
index 0000000000000000000000000000000000000000..c9f9c0d235f33925ee247ba4af56bf9f31bf7056
|
||||||
@@ -271,3 +259,15 @@ index 0000000000000000000000000000000000000000..c9f9c0d235f33925ee247ba4af56bf9f
|
|||||||
+ this.service = service;
|
+ this.service = service;
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||||
|
index 87cea10a668d3040906a4dd1fd135c2162d9617f..b8bdac918e8a49bef2bf09312eb6d71d373eb517 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||||
|
@@ -1172,4 +1172,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||||
|
*/
|
||||||
|
void broadcastHurtAnimation(@NotNull java.util.Collection<Player> players);
|
||||||
|
// Paper end - broadcast hurt animation
|
||||||
|
+
|
||||||
|
+ gg.projecteden.parchment.entity.EntityData getStoredEntityData();
|
||||||
|
+
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Fri, 15 Dec 2023 23:46:17 -0500
|
|
||||||
Subject: [PATCH] Temporarily remove Javadoc jar
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 9901114fba1469c138bba1821cafd057fbafd4b1..7b2266d0033a43a195e344f816c2a65bd2877db4 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -6,7 +6,6 @@ plugins {
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar()
|
|
||||||
- withJavadocJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
val annotationsVersion = "24.0.1"
|
|
||||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Add Sidebar Utility
|
|||||||
|
|
||||||
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java b/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java
|
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java b/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..f3f7a138d8d0a0e5f863f50fa39ffd861a8a1db9
|
index 0000000000000000000000000000000000000000..b0c704387e566d76d097595c35d06d8e5cbe204f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java
|
+++ b/src/main/java/gg/projecteden/parchment/sidebar/Sidebar.java
|
||||||
@@ -0,0 +1,123 @@
|
@@ -0,0 +1,123 @@
|
||||||
@@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..f3f7a138d8d0a0e5f863f50fa39ffd86
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java
|
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..c4a58a2b4e8bf5d3130b7da71616f06b6ed98e8f
|
index 0000000000000000000000000000000000000000..ec13738dc625464d7fa41484ee44583ef82248fd
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java
|
+++ b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBuffer.java
|
||||||
@@ -0,0 +1,100 @@
|
@@ -0,0 +1,100 @@
|
||||||
@@ -5,46 +5,55 @@ Subject: [PATCH] Build changes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
index 170a915098f09ace226648da342a04c5c7583d11..ff010d3680e8c6fea0f0ad7f455a2df757b495ba 100644
|
index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..256c09e98005cc64e2bc739ce6e880954664d693 100644
|
||||||
--- a/build.gradle.kts
|
--- a/build.gradle.kts
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -1,4 +1,5 @@
|
@@ -1,6 +1,8 @@
|
||||||
import io.papermc.paperweight.util.*
|
import io.papermc.paperweight.util.*
|
||||||
+val edenVersion: String by project // Parchment
|
import java.time.Instant
|
||||||
|
|
||||||
|
+val edenVersion: String by project // Parchment
|
||||||
|
+
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
@@ -27,8 +28,12 @@ repositories {
|
`maven-publish`
|
||||||
|
@@ -25,7 +27,9 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||||
|
// Paper end - configure mockito agent that is needed in newer java versions
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
extraRuntime(platform("net.kyori:adventure-bom:4.15.0-SNAPSHOT"))
|
|
||||||
- implementation(project(":paper-api"))
|
- implementation(project(":paper-api"))
|
||||||
- implementation(project(":paper-mojangapi"))
|
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ implementation(project(":parchment-api"))
|
+ implementation(project(":parchment-api"))
|
||||||
+ implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
|
||||||
+ exclude("io.papermc.paper", "paper-api")
|
|
||||||
+ }
|
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
// Paper start
|
// Paper start
|
||||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||||
@@ -84,7 +89,7 @@ tasks.jar {
|
@@ -99,14 +103,14 @@ tasks.jar {
|
||||||
|
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
"Implementation-Title" to "CraftBukkit",
|
- "Implementation-Title" to "Paper",
|
||||||
- "Implementation-Version" to "git-Paper-$implementationVersion",
|
+ "Implementation-Title" to "Parchment",
|
||||||
+ "Implementation-Version" to "git-Parchment-$implementationVersion", // Parchment
|
"Implementation-Version" to implementationVersion,
|
||||||
"Implementation-Vendor" to date, // Paper
|
"Implementation-Vendor" to date, // Paper
|
||||||
"Specification-Title" to "Bukkit",
|
- "Specification-Title" to "Paper",
|
||||||
|
+ "Specification-Title" to "Parchment",
|
||||||
"Specification-Version" to project.version,
|
"Specification-Version" to project.version,
|
||||||
@@ -112,7 +117,27 @@ tasks.compileTestJava {
|
- "Specification-Vendor" to "Paper Team",
|
||||||
|
- "Brand-Id" to "papermc:paper",
|
||||||
|
- "Brand-Name" to "Paper",
|
||||||
|
+ "Specification-Vendor" to "Project Eden",
|
||||||
|
+ "Brand-Id" to "projectedengg:parchment",
|
||||||
|
+ "Brand-Name" to "Parchment",
|
||||||
|
"Build-Number" to (build ?: ""),
|
||||||
|
"Build-Time" to Instant.now().toString(),
|
||||||
|
"Git-Branch" to gitBranch, // Paper
|
||||||
|
@@ -127,6 +131,27 @@ tasks.compileTestJava {
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications.create<MavenPublication>("maven") {
|
publications.create<MavenPublication>("maven") {
|
||||||
- artifact(tasks.shadowJar)
|
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ artifact(tasks.reobfJar)
|
+ artifact(tasks.jar)
|
||||||
+ groupId = project.group as String?
|
+ groupId = project.group as String?
|
||||||
+ artifactId = "parchment"
|
+ artifactId = "parchment"
|
||||||
+ version = project.version as String?
|
+ version = project.version as String?
|
||||||
@@ -67,7 +76,7 @@ index 170a915098f09ace226648da342a04c5c7583d11..ff010d3680e8c6fea0f0ad7f455a2df7
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +193,7 @@ fun TaskContainer.registerRunTask(
|
@@ -172,7 +197,7 @@ fun TaskContainer.registerRunTask(
|
||||||
name: String,
|
name: String,
|
||||||
block: JavaExec.() -> Unit
|
block: JavaExec.() -> Unit
|
||||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
@@ -90,53 +99,23 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..4dca3956a76a9d57b3167f73696cf5d5
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..9b248dde91651b40b6b3e3dda8985c73543b4922 100644
|
index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..87db580c74d20714e2ebe01df23811c79d1f8331 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
@@ -31,8 +31,10 @@ public class PaperVersionFetcher implements VersionFetcher {
|
@@ -49,7 +49,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||||
@Nonnull
|
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
|
||||||
@Override
|
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
|
||||||
public Component getVersionMessage(@Nonnull String serverVersion) {
|
} else {
|
||||||
- String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]");
|
- updateMessage = getUpdateStatusMessage("PaperMC/Paper", build);
|
||||||
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
|
+ updateMessage = getUpdateStatusMessage("ProjectEdenGG/Parchment", build);
|
||||||
+ // Parchment start
|
}
|
||||||
+ String[] parts = serverVersion.substring("git-Parchment-".length()).split("[-\\s]");
|
final @Nullable Component history = this.getHistory();
|
||||||
+ final Component updateMessage = getUpdateStatusMessage("ProjectEdenGG/Parchment", GITHUB_BRANCH_NAME, parts[0]);
|
|
||||||
+ // Parchment end
|
|
||||||
final Component history = getHistory();
|
|
||||||
|
|
||||||
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..cb786826e228b88db7836c2641d32d025bea5a10 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
|
|
||||||
@DontObfuscate
|
|
||||||
public String getServerModName() {
|
|
||||||
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
|
||||||
+ return "Parchment"; // Parchment - Parchment > //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
|
||||||
}
|
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport details) {
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
index 782bb8ca67517dde5dba8f0a133eb8699353dd01..f8925b5f581fac113de89b9fca24d35e39a6fa3d 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
@@ -270,7 +270,7 @@ import javax.annotation.Nullable; // Paper
|
|
||||||
import javax.annotation.Nonnull; // Paper
|
|
||||||
|
|
||||||
public final class CraftServer implements Server {
|
|
||||||
- private final String serverName = "Paper"; // Paper
|
|
||||||
+ private final String serverName = "Parchment"; // Paper // Parchment
|
|
||||||
private final String serverVersion;
|
|
||||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
|
||||||
private final Logger logger = Logger.getLogger("Minecraft");
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index 4b457cbfc56e55e0ae0fee5b69e2e75349702aab..d7f75d1a7107ce95dbba2842db0ced08ed4306e2 100644
|
index be0d38544395a9b3befb898bb961f34e32fe9509..693a7a0104e8da6c775a1fc718ac0b577a5ce89e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -301,7 +301,7 @@ public class Main {
|
@@ -267,7 +267,7 @@ public class Main {
|
||||||
if (buildDate.before(deadline.getTime())) {
|
if (buildDate.before(deadline.getTime())) {
|
||||||
// Paper start - This is some stupid bullshit
|
// Paper start - This is some stupid bullshit
|
||||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||||
@@ -144,7 +123,7 @@ index 4b457cbfc56e55e0ae0fee5b69e2e75349702aab..d7f75d1a7107ce95dbba2842db0ced08
|
|||||||
+ System.err.println("*** Please download a new build as per instructions from https://github.com/ProjectEdenGG/Parchment ***"); // Paper
|
+ System.err.println("*** Please download a new build as per instructions from https://github.com/ProjectEdenGG/Parchment ***"); // Paper
|
||||||
//System.err.println("*** Server will start in 20 seconds ***");
|
//System.err.println("*** Server will start in 20 seconds ***");
|
||||||
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
|
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
|
||||||
// Paper End
|
// Paper end
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
index 774556a62eb240da42e84db4502e2ed43495be17..6f1b3fa6ebeabc7596034663ed06686fd3892267 100644
|
index 774556a62eb240da42e84db4502e2ed43495be17..6f1b3fa6ebeabc7596034663ed06686fd3892267 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||||
@@ -159,15 +138,15 @@ index 774556a62eb240da42e84db4502e2ed43495be17..6f1b3fa6ebeabc7596034663ed06686f
|
|||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..be856b112dca06eac172a5c2b056b619ef47f6e6 100644
|
index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..ec8552ed502b6628ea723f5667097f01fddbc5e5 100644
|
||||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||||
@@ -162,7 +162,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
@@ -162,7 +162,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||||
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
|
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
|
||||||
log.log( Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
|
log.log( Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
|
||||||
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
||||||
- log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
|
- log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
|
||||||
+ log.log( Level.SEVERE, "Parchment version: " + Bukkit.getServer().getVersion() ); // Parchment
|
+ log.log( Level.SEVERE, "Parchment version: " + Bukkit.getServer().getVersion() );
|
||||||
//
|
//
|
||||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Temporary Access Transformers
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/core/Holder.java b/src/main/java/net/minecraft/core/Holder.java
|
diff --git a/src/main/java/net/minecraft/core/Holder.java b/src/main/java/net/minecraft/core/Holder.java
|
||||||
index 245f09b771fb1e8fab3bc4c03b1afe34ef505f1b..8dbef407de5c48543ca7f97d8c22301aa54da7d8 100644
|
index e91c4e26c25980645941ca8fbdcc3a9d02e31063..a73a9d04dfff9d12d3e5425c867f32331a6b5996 100644
|
||||||
--- a/src/main/java/net/minecraft/core/Holder.java
|
--- a/src/main/java/net/minecraft/core/Holder.java
|
||||||
+++ b/src/main/java/net/minecraft/core/Holder.java
|
+++ b/src/main/java/net/minecraft/core/Holder.java
|
||||||
@@ -126,6 +126,12 @@ public interface Holder<T> {
|
@@ -138,6 +138,12 @@ public interface Holder<T> {
|
||||||
return new Holder.Reference<>(Holder.Reference.Type.INTRUSIVE, owner, (ResourceKey<T>)null, value);
|
return new Holder.Reference<>(Holder.Reference.Type.INTRUSIVE, owner, null, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
@@ -22,15 +22,15 @@ index 245f09b771fb1e8fab3bc4c03b1afe34ef505f1b..8dbef407de5c48543ca7f97d8c22301a
|
|||||||
if (this.key == null) {
|
if (this.key == null) {
|
||||||
throw new IllegalStateException("Trying to access unbound value '" + this.value + "' from registry " + this.owner);
|
throw new IllegalStateException("Trying to access unbound value '" + this.value + "' from registry " + this.owner);
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
index efdf56044396b4ce486948d2c993971f99174a5e..4238b65cc86b0c49a34b50c4dac00cd89e3900e1 100644
|
index c816c935ecc74a811ffdffbe6ded73c06e92324a..ac457cd1479c219e1975d475a3e6bce17ae6e567 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||||
@@ -206,7 +206,7 @@ public class BlockItem extends Item {
|
@@ -177,7 +177,7 @@ public class BlockItem extends Item {
|
||||||
}).orElse(state);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- protected boolean canPlace(BlockPlaceContext context, BlockState state) {
|
- protected boolean canPlace(BlockPlaceContext context, BlockState state) {
|
||||||
+ public boolean canPlace(BlockPlaceContext context, BlockState state) { // Parchment
|
+ public boolean canPlace(BlockPlaceContext context, BlockState state) { // Parchment: protected -> public
|
||||||
Player entityhuman = context.getPlayer();
|
Player entityhuman = context.getPlayer();
|
||||||
CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman);
|
CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman);
|
||||||
// CraftBukkit start - store default return
|
// CraftBukkit start - store default return
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ Date: Sat, 19 Jun 2021 16:30:39 -0400
|
|||||||
Subject: [PATCH] Add SoundEvent
|
Subject: [PATCH] Add SoundEvent
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/gg/projecteden/gg/parchment/event/sound/ParchmentSoundEvent.java b/src/main/java/gg/projecteden/gg/parchment/event/sound/ParchmentSoundEvent.java
|
diff --git a/src/main/java/gg/projecteden/parchment/event/sound/ParchmentSoundEvent.java b/src/main/java/gg/projecteden/parchment/event/sound/ParchmentSoundEvent.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a583bfcfe
|
index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a583bfcfe
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/projecteden/gg/parchment/event/sound/ParchmentSoundEvent.java
|
+++ b/src/main/java/gg/projecteden/parchment/event/sound/ParchmentSoundEvent.java
|
||||||
@@ -0,0 +1,28 @@
|
@@ -0,0 +1,28 @@
|
||||||
+package gg.projecteden.parchment.event.sound;
|
+package gg.projecteden.parchment.event.sound;
|
||||||
+
|
+
|
||||||
@@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||||
index 99871023c54e387c6ef72a4307d945047aee87fe..4ce043faf03caf8858a86876b9125e274eb75c43 100644
|
index f466bfdf5557c94ebee3ad609d9b6f18f86aefef..687907f2ad51dceb523994adabcf8025960aa336 100644
|
||||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||||
@@ -344,6 +344,41 @@ public final class PaperAdventure {
|
@@ -390,6 +390,36 @@ public final class PaperAdventure {
|
||||||
return asVanilla(source);
|
return asVanilla(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,28 +67,23 @@ index 99871023c54e387c6ef72a4307d945047aee87fe..4ce043faf03caf8858a86876b9125e27
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static Optional<Holder.Reference<SoundEvent>> asSoundHolder(final net.minecraft.resources.ResourceKey<SoundEvent> key) {
|
+ public static Optional<Holder.Reference<SoundEvent>> asSoundHolder(final net.minecraft.resources.ResourceKey<SoundEvent> key) {
|
||||||
+ return BuiltInRegistries.SOUND_EVENT.getHolder(key);
|
+ return BuiltInRegistries.SOUND_EVENT.get(key);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static Optional<Holder.Reference<net.minecraft.sounds.SoundEvent>> asVanillaSoundHolder(final Key key) {
|
+ public static Optional<Holder.Reference<net.minecraft.sounds.SoundEvent>> asVanillaSoundHolder(final Key key) {
|
||||||
+ return asSoundHolder(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, asVanilla(key)));
|
+ return asSoundHolder(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, asVanilla(key)));
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @SuppressWarnings("PatternValidation")
|
|
||||||
+ public static Key asAdventure(final ResourceLocation key) {
|
|
||||||
+ return Key.key(key.getNamespace(), key.getPath());
|
|
||||||
+ }
|
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
+
|
|
||||||
+
|
+
|
||||||
public static Packet<?> asSoundPacket(final Sound sound, final double x, final double y, final double z, final long seed, @Nullable BiConsumer<Packet<?>, Float> packetConsumer) {
|
public static Packet<?> asSoundPacket(final Sound sound, final double x, final double y, final double z, final long seed, @Nullable BiConsumer<Packet<?>, Float> packetConsumer) {
|
||||||
final ResourceLocation name = asVanilla(sound.name());
|
final ResourceLocation name = asVanilla(sound.name());
|
||||||
final Optional<SoundEvent> soundEvent = BuiltInRegistries.SOUND_EVENT.getOptional(name);
|
final Optional<SoundEvent> soundEvent = BuiltInRegistries.SOUND_EVENT.getOptional(name);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index b78a9628a88f2a495ef6de74446a02a14d41a1f6..abd5300282563a804290eb2e9333e59a0e8ac708 100644
|
index 957cae6ddeba9efe3b55588567ae51e8b86b6a42..f6753ed14350b1c2dd7c69e2aed8657295863547 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1811,12 +1811,46 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1693,12 +1693,46 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playSeededSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) {
|
public void playSeededSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) {
|
||||||
@@ -99,7 +94,7 @@ index b78a9628a88f2a495ef6de74446a02a14d41a1f6..abd5300282563a804290eb2e9333e59a
|
|||||||
+ net.kyori.adventure.sound.Sound.sound()
|
+ net.kyori.adventure.sound.Sound.sound()
|
||||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||||
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
||||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation())
|
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
|
||||||
+ ))
|
+ ))
|
||||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||||
+ .volume(volume)
|
+ .volume(volume)
|
||||||
@@ -122,7 +117,7 @@ index b78a9628a88f2a495ef6de74446a02a14d41a1f6..abd5300282563a804290eb2e9333e59a
|
|||||||
+ net.kyori.adventure.sound.Sound.sound()
|
+ net.kyori.adventure.sound.Sound.sound()
|
||||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||||
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
||||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation())
|
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
|
||||||
+ ))
|
+ ))
|
||||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||||
+ .volume(volume)
|
+ .volume(volume)
|
||||||
@@ -138,58 +133,63 @@ index b78a9628a88f2a495ef6de74446a02a14d41a1f6..abd5300282563a804290eb2e9333e59a
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 8efbbd379244e3ed54d4aba199037cc20ccd096a..823bc659f7421c3752e4cf1333e1568e1308464d 100644
|
index 2e8ecf3bbb9f9ceba6f896738fa1ab8e2bd0fed6..94de83a35998c82b807c6e5836d957f317dd2ceb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -2435,7 +2435,20 @@ public class ServerPlayer extends Player {
|
@@ -2805,7 +2805,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playNotifySound(SoundEvent event, SoundSource category, float volume, float pitch) {
|
public void playNotifySound(SoundEvent sound, SoundSource category, float volume, float pitch) {
|
||||||
- this.connection.send(new ClientboundSoundPacket(BuiltInRegistries.SOUND_EVENT.wrapAsHolder(event), category, this.getX(), this.getY(), this.getZ(), volume, pitch, this.random.nextLong()));
|
- this.connection.send(new ClientboundSoundPacket(BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, this.getX(), this.getY(), this.getZ(), volume, pitch, this.random.nextLong()));
|
||||||
+ // Parchment start - sound event
|
+ // Parchment start - sound event
|
||||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||||
+ null,
|
+ null,
|
||||||
+ net.kyori.adventure.sound.Sound.sound()
|
+ net.kyori.adventure.sound.Sound.sound()
|
||||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(event.getLocation()))
|
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.location()))
|
||||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||||
+ .volume(volume)
|
+ .volume(volume)
|
||||||
+ .pitch(pitch)
|
+ .pitch(pitch)
|
||||||
+ .seed(this.random.nextLong())
|
+ .seed(this.random.nextLong())
|
||||||
+ .build(),
|
+ .build(),
|
||||||
+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(level(), getX(), getY(), getZ()),
|
+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(level(), getX(), getY(), getZ()),
|
||||||
+ sound -> 0d, soundEvent -> java.util.Collections.singletonList(getBukkitEntity())
|
+ _sound -> 0d, soundEvent -> java.util.Collections.singletonList(getBukkitEntity())
|
||||||
+ ));
|
+ ));
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index a35638a92479b90afa89cf201fc45b49c9e767f3..70aa55d04875338b92d29faba18aee08a926e518 100644
|
index 30de3d1a7792c38ae946f19cb0e14637919b5001..ef10ed017ad5d06c3f34f1287a8721a33fc61ce1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -968,7 +968,7 @@ public abstract class PlayerList {
|
@@ -876,6 +876,9 @@ public abstract class PlayerList {
|
||||||
BlockState data = worldserver1.getBlockState(blockposition);
|
isBedSpawn = true;
|
||||||
worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3);
|
|
||||||
}
|
}
|
||||||
- entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong()));
|
// Paper end - Add PlayerPostRespawnEvent
|
||||||
+ entityplayer1.playNotifySound(SoundEvents.RESPAWN_ANCHOR_DEPLETE.value(), SoundSource.BLOCKS, 1.0F, 1.0F); // Parchment - use existing play sound method
|
+ entityplayer1.playNotifySound(SoundEvents.RESPAWN_ANCHOR_DEPLETE.value(), SoundSource.BLOCKS, 1.0F, 1.0F); // Parchment - use existing play sound method
|
||||||
// Paper end
|
+ // Paper end - Fix SPIGOT-5989
|
||||||
|
+
|
||||||
}
|
}
|
||||||
// Added from changeDimension
|
// Added from changeDimension
|
||||||
|
this.sendAllPlayerInfo(entityplayer); // Update health, etc...
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
index 7f3466340891b4409d1399ebeb2ca865d77841cd..f459202c3a79128df936be4a1a2cd51bbc9143b8 100644
|
index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..6b73ca4ca59e3080926155613ce10af82cd43615 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -1839,7 +1839,21 @@ public abstract class Player extends LivingEntity {
|
@@ -1840,9 +1840,23 @@ public abstract class Player extends LivingEntity {
|
||||||
|
}
|
||||||
|
// Paper start - send while respecting visibility
|
||||||
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
|
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
|
||||||
fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself
|
- fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity itself
|
||||||
if (fromEntity instanceof ServerPlayer) {
|
- if (fromEntity instanceof ServerPlayer serverPlayer) {
|
||||||
- ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
|
- serverPlayer.connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
|
||||||
|
+ fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself
|
||||||
|
+ if (fromEntity instanceof ServerPlayer) {
|
||||||
+ // Parchment start - sound event
|
+ // Parchment start - sound event
|
||||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||||
+ null,
|
+ null,
|
||||||
+ net.kyori.adventure.sound.Sound.sound()
|
+ net.kyori.adventure.sound.Sound.sound()
|
||||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.getLocation()))
|
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.location()))
|
||||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundCategory))
|
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundCategory))
|
||||||
+ .volume(volume)
|
+ .volume(volume)
|
||||||
+ .pitch(pitch)
|
+ .pitch(pitch)
|
||||||
@@ -202,12 +202,12 @@ index 7f3466340891b4409d1399ebeb2ca865d77841cd..f459202c3a79128df936be4a1a2cd51b
|
|||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end - send while respecting visibility
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
index eaa2943b667967f93f28d9d794d702fdaeb670ec..df03f4867742cd194db260dfb81398b14286397e 100644
|
index 11cf2d9def087b0898c828eaa21eb5f7b8811d5f..7c1332f6c2fbe615e2831911b6548310532b022e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||||
@@ -542,7 +542,7 @@ public class Raid {
|
@@ -552,7 +552,7 @@ public class Raid {
|
||||||
double d2 = vec3d.z + 13.0D / d0 * (vec3d1.z - vec3d.z);
|
double d2 = vec3d.z + 13.0D / d0 * (vec3d1.z - vec3d.z);
|
||||||
|
|
||||||
if (d0 <= 64.0D || collection.contains(entityplayer)) {
|
if (d0 <= 64.0D || collection.contains(entityplayer)) {
|
||||||
@@ -217,10 +217,10 @@ index eaa2943b667967f93f28d9d794d702fdaeb670ec..df03f4867742cd194db260dfb81398b1
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..dfd54e3f9016635c986afdb613c94be9bec91237 100644
|
index e37aaf77f94b97b736cc20ef070cefdff0400188..c01ea04bc72ea7342722a463a384b1cc664c7afb 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -2177,4 +2177,42 @@ public class CraftEventFactory {
|
@@ -2271,4 +2271,42 @@ public class CraftEventFactory {
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
// Paper end - add EntityFertilizeEggEvent
|
// Paper end - add EntityFertilizeEggEvent
|
||||||
@@ -236,7 +236,7 @@ index f5a5ae30dfba21d5cf3990c046cfe41547e8a87a..dfd54e3f9016635c986afdb613c94be9
|
|||||||
+ long seed = sound.seed().orElse(0L); // TODO: random source?
|
+ long seed = sound.seed().orElse(0L); // TODO: random source?
|
||||||
+ net.minecraft.resources.ResourceKey<net.minecraft.sounds.SoundEvent> soundKey = net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, name);
|
+ net.minecraft.resources.ResourceKey<net.minecraft.sounds.SoundEvent> soundKey = net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, name);
|
||||||
+ net.minecraft.core.Holder.Reference<net.minecraft.sounds.SoundEvent> soundEvent = io.papermc.paper.adventure.PaperAdventure.asVanillaSoundHolder(sound.name()) // TODO: calculate event distance?
|
+ net.minecraft.core.Holder.Reference<net.minecraft.sounds.SoundEvent> soundEvent = io.papermc.paper.adventure.PaperAdventure.asVanillaSoundHolder(sound.name()) // TODO: calculate event distance?
|
||||||
+ .orElseGet(() -> net.minecraft.core.Holder.Reference.create(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.holderOwner(), soundKey, net.minecraft.sounds.SoundEvent.createFixedRangeEvent(name, (float) event.calculateDistance())));
|
+ .orElseGet(() -> net.minecraft.core.Holder.Reference.create(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT, soundKey, net.minecraft.sounds.SoundEvent.createFixedRangeEvent(name, (float) event.calculateDistance())));
|
||||||
+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter)
|
+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter)
|
||||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(soundEvent, source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed);
|
+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(soundEvent, source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed);
|
||||||
+ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) {
|
+ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) {
|
||||||
|
|||||||
@@ -5,21 +5,20 @@ Subject: [PATCH] Add PlayerUseRespawnAnchorEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
index 797ece59c10bdb60a86f71ca3b7bb95dbe0f1078..e560312bacc25ef3c2f26122fa68228bdf9e42a5 100644
|
index 9117c035d5a6ff114b028fad3380ceb1fc2b9691..c490b30531bf722b31db88aa4937d3fd777c2844 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
@@ -65,23 +65,45 @@ public class RespawnAnchorBlock extends Block {
|
@@ -64,7 +64,33 @@ public class RespawnAnchorBlock extends Block {
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
|
||||||
ItemStack itemstack = player.getItemInHand(hand);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||||
+ org.bukkit.entity.Player bukkitPlayer = player.getBukkitEntity() instanceof org.bukkit.entity.Player ? (org.bukkit.entity.Player) player.getBukkitEntity() : null;
|
+ org.bukkit.entity.Player bukkitPlayer = player.getBukkitEntity() instanceof org.bukkit.entity.Player ? (org.bukkit.entity.Player) player.getBukkitEntity() : null;
|
||||||
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
|
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
|
||||||
+ gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult result;
|
+ gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult result;
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
if (hand == InteractionHand.MAIN_HAND && !RespawnAnchorBlock.isRespawnFuel(itemstack) && RespawnAnchorBlock.isRespawnFuel(player.getItemInHand(InteractionHand.OFF_HAND))) {
|
+
|
||||||
return InteractionResult.PASS;
|
if (RespawnAnchorBlock.isRespawnFuel(stack) && RespawnAnchorBlock.canBeCharged(state)) {
|
||||||
} else if (RespawnAnchorBlock.isRespawnFuel(itemstack) && RespawnAnchorBlock.canBeCharged(state)) {
|
|
||||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||||
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE;
|
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE;
|
||||||
+ } else if (state.getValue(CHARGE) == 0) {
|
+ } else if (state.getValue(CHARGE) == 0) {
|
||||||
@@ -41,24 +40,5 @@ index 797ece59c10bdb60a86f71ca3b7bb95dbe0f1078..e560312bacc25ef3c2f26122fa68228b
|
|||||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) {
|
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) {
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
RespawnAnchorBlock.charge(player, world, pos, state);
|
RespawnAnchorBlock.charge(player, world, pos, state);
|
||||||
if (!player.getAbilities().instabuild) {
|
stack.consume(1, player);
|
||||||
itemstack.shrink(1);
|
return InteractionResult.SUCCESS;
|
||||||
}
|
|
||||||
|
|
||||||
return InteractionResult.sidedSuccess(world.isClientSide);
|
|
||||||
- } else if ((Integer) state.getValue(RespawnAnchorBlock.CHARGE) == 0) {
|
|
||||||
- return InteractionResult.PASS;
|
|
||||||
- } else if (!RespawnAnchorBlock.canSetSpawn(world)) {
|
|
||||||
- if (!world.isClientSide) {
|
|
||||||
- this.explode(state, world, pos);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return InteractionResult.sidedSuccess(world.isClientSide);
|
|
||||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
|
||||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.EXPLODE) {
|
|
||||||
+ this.explode(state, world, pos);
|
|
||||||
+ return InteractionResult.CONSUME;
|
|
||||||
+ // Parchment end
|
|
||||||
} else {
|
|
||||||
if (!world.isClientSide) {
|
|
||||||
ServerPlayer entityplayer = (ServerPlayer) player;
|
|
||||||
|
|||||||
@@ -5,33 +5,15 @@ Subject: [PATCH] Add origin location to EntityDamageByBlockEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index dfd54e3f9016635c986afdb613c94be9bec91237..c7056a714cecb4c2190bc5e85bf4ac3812640f6c 100644
|
index 33daeb74cdf11c5b920e02b191eb62d5d0937f8e..8f438df5d9112460e5b1664a56688bb1c6ddc6fa 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -1063,7 +1063,7 @@ public class CraftEventFactory {
|
@@ -1198,7 +1198,7 @@ public class CraftEventFactory {
|
||||||
CraftEventFactory.entityDamage = null;
|
}
|
||||||
EntityDamageEvent event;
|
|
||||||
if (damager == null) {
|
|
||||||
- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage
|
|
||||||
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState, source.getEntity().getBukkitEntity().getLocation()); // Paper - handle block state in damage
|
|
||||||
} else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) {
|
|
||||||
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
|
||||||
} else {
|
|
||||||
@@ -1111,7 +1111,7 @@ public class CraftEventFactory {
|
|
||||||
|
|
||||||
return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
private static EntityDamageEvent callEntityDamageEvent(Block damager, BlockState damagerState, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) {
|
||||||
} else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {
|
- EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagerState, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions);
|
||||||
- EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
+ EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagerState, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, bukkitDamageSource.getDamageLocation());
|
||||||
+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions, null, entity.getBukkitEntity().getLocation());
|
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
|
||||||
event.setCancelled(cancelled);
|
}
|
||||||
CraftEventFactory.callEvent(event);
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
@@ -1121,7 +1121,7 @@ public class CraftEventFactory {
|
|
||||||
}
|
|
||||||
return event;
|
|
||||||
} else if (source.is(DamageTypes.LAVA)) {
|
|
||||||
- EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions));
|
|
||||||
+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions, null, blockDamage.getLocation()));
|
|
||||||
event.setCancelled(cancelled);
|
|
||||||
|
|
||||||
Block damager = CraftEventFactory.blockDamage;
|
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index ec2396f0e5d62b10450eaa7239a8c5479638b3c3..ad1cc677ed7f04c9b6629050e1900e85299bac67 100644
|
index 507f908916cbeb592496f963b46e4c2121a7b5e3..356999f8359838f248ad0e673fef23a82a0560c8 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@@ -642,6 +642,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -702,6 +702,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end - proxy ItemStack
|
||||||
|
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#setGameProfile
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
index f459202c3a79128df936be4a1a2cd51bbc9143b8..31f533ae280f147cbc183430a6209beedf4e96b3 100644
|
index 6b73ca4ca59e3080926155613ce10af82cd43615..09ed0bd5f012ae2e34d5ed58828475577b6ab6f8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -1511,6 +1511,12 @@ public abstract class Player extends LivingEntity {
|
@@ -1523,6 +1523,12 @@ public abstract class Player extends LivingEntity {
|
||||||
return this.gameProfile;
|
return this.gameProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ Subject: [PATCH] Expose MCUtil Executors
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index f8925b5f581fac113de89b9fca24d35e39a6fa3d..7aa1ee8ec0ddcbac85102c67394c757a438f95e9 100644
|
index cac8592e3a2f438fe9ca167a4fdcd65152bbb2de..b85d19598c09a14e68fced841de2148bf6f469e0 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -3228,4 +3228,16 @@ public final class CraftServer implements Server {
|
@@ -3258,4 +3258,18 @@ public final class CraftServer implements Server {
|
||||||
|
this.console.addPluginAllowingSleep(plugin.getName(), value);
|
||||||
}
|
}
|
||||||
|
// Paper end - API to check if the server is sleeping
|
||||||
// Paper end
|
+
|
||||||
+
|
+
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ @Override
|
+ @Override
|
||||||
@@ -24,4 +25,5 @@ index f8925b5f581fac113de89b9fca24d35e39a6fa3d..7aa1ee8ec0ddcbac85102c67394c757a
|
|||||||
+ return io.papermc.paper.util.MCUtil.MAIN_EXECUTOR;
|
+ return io.papermc.paper.util.MCUtil.MAIN_EXECUTOR;
|
||||||
+ }
|
+ }
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
|
+
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ to easily get the items being dropped by any
|
|||||||
block instead of only blocks broken by players.
|
block instead of only blocks broken by players.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
index 4d50dd92a7f3187ee1d8edb926e7c273c8156549..c4c27fb5b92833eca243e1ba718c8dcaa676a310 100644
|
index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..43c288a4e226060a5e0cecddd941846d29ae8025 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
@@ -309,7 +309,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -292,7 +292,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
|
|
||||||
public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
||||||
if (world instanceof ServerLevel) {
|
if (world instanceof ServerLevel) {
|
||||||
@@ -20,7 +20,7 @@ index 4d50dd92a7f3187ee1d8edb926e7c273c8156549..c4c27fb5b92833eca243e1ba718c8dca
|
|||||||
Block.popResource(world, pos, itemstack);
|
Block.popResource(world, pos, itemstack);
|
||||||
});
|
});
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||||
@@ -319,7 +319,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -302,7 +302,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
|
|
||||||
public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
||||||
if (world instanceof ServerLevel) {
|
if (world instanceof ServerLevel) {
|
||||||
@@ -29,20 +29,20 @@ index 4d50dd92a7f3187ee1d8edb926e7c273c8156549..c4c27fb5b92833eca243e1ba718c8dca
|
|||||||
Block.popResource((ServerLevel) world, pos, itemstack);
|
Block.popResource((ServerLevel) world, pos, itemstack);
|
||||||
});
|
});
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||||
@@ -346,7 +346,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -338,7 +338,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
|
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool, boolean dropExperience) {
|
||||||
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) {
|
// Paper end - Properly handle xp dropping
|
||||||
if (world instanceof ServerLevel) {
|
if (world instanceof ServerLevel) {
|
||||||
- Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> {
|
- Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> {
|
||||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
|
||||||
Block.popResource(world, pos, itemstack1);
|
Block.popResource(world, pos, itemstack1);
|
||||||
});
|
});
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, tool, true);
|
state.spawnAfterBreak((ServerLevel) world, pos, tool, dropExperience); // Paper - Properly handle xp dropping
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index c7056a714cecb4c2190bc5e85bf4ac3812640f6c..6c1f74e3dbbf421e6ff496aee58297e6a9d36308 100644
|
index 0af82fae494762fec22afbb2363d24370dbdb71b..f29ddf243147a866b2b17f41556ff3d817aedf2e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -2214,5 +2214,19 @@ public class CraftEventFactory {
|
@@ -2308,5 +2308,19 @@ public class CraftEventFactory {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,10 +215,10 @@ index 0000000000000000000000000000000000000000..e7114e456f818d7bdd4081620f4b9b93
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
index e1fad381b861471a17529c246bb8a4a9c7646420..3a0fa7f7085607f44a52095c29647f6fbe641764 100644
|
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..77c914fb58403f4b6c2d145664740d1fb59bb261 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
@@ -2505,4 +2505,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@@ -2510,4 +2510,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
return this.adventure$pointers;
|
return this.adventure$pointers;
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -226,7 +226,11 @@ index e1fad381b861471a17529c246bb8a4a9c7646420..3a0fa7f7085607f44a52095c29647f6f
|
|||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ItemStack smeltItem(ItemStack toSmelt, gg.projecteden.parchment.inventory.RecipeType recipeType) {
|
+ public ItemStack smeltItem(ItemStack toSmelt, gg.projecteden.parchment.inventory.RecipeType recipeType) {
|
||||||
+ return world.getRecipeManager().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new gg.projecteden.parchment.inventory.SingletonContainer(toSmelt), world).map(recipe -> recipe.value().getResultItem(world.registryAccess()).getBukkitStack()).orElse(null);
|
+ var optional = world.recipeAccess().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(toSmelt)), world).map(recipe -> recipe.value()).orElse(null);
|
||||||
|
+ if (optional == null) {
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+ return optional.assemble(new net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(toSmelt)), world.registryAccess()).asBukkitCopy();
|
||||||
+ }
|
+ }
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable sleep status announcements
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index abd5300282563a804290eb2e9333e59a0e8ac708..bb6fcfe8c4fd42db3018b79853c11d598fac4b7b 100644
|
index f6753ed14350b1c2dd7c69e2aed8657295863547..1d614e2e4274ac24abd74dfb10c52d6624e0a9de 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1173,7 +1173,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -1068,7 +1068,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void announceSleepStatus() {
|
private void announceSleepStatus() {
|
||||||
|
|||||||
@@ -5,22 +5,22 @@ Subject: [PATCH] Add config for ticking TIME_SINCE_REST
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..aa47cd0274db73cefb5feb062be53f1cd66d48cf 100644
|
index b1c917d65076a3805e5b78cb946753f0c101e214..7034391701ce34119c6cfc22a8dd2dec6293f63d 100644
|
||||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||||
@@ -287,6 +287,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
@@ -317,6 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean disablePlayerCrits = false;
|
public boolean disablePlayerCrits = false;
|
||||||
+ public boolean tickTimeSinceSleep = true; // Parchment
|
+ public boolean tickTimeSinceSleep = true; // Parchment
|
||||||
public boolean nerfPigmenFromNetherPortals = false;
|
public boolean nerfPigmenFromNetherPortals = false;
|
||||||
public PillagerPatrols pillagerPatrols;
|
@Comment("Prevents merging items that are not on the same y level, preventing potential visual artifacts.")
|
||||||
|
public boolean onlyMergeItemsHorizontally = false;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
index 31f533ae280f147cbc183430a6209beedf4e96b3..1016f8a15756756fa7e85878aa22dbab5ae74a55 100644
|
index 09ed0bd5f012ae2e34d5ed58828475577b6ab6f8..e280cd56a4dc446edab97e6c48397e03edb2ca1e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -288,7 +288,7 @@ public abstract class Player extends LivingEntity {
|
@@ -304,7 +304,7 @@ public abstract class Player extends LivingEntity {
|
||||||
this.awardStat(Stats.CROUCH_TIME);
|
this.awardStat(Stats.CROUCH_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,31 +5,65 @@ Subject: [PATCH] Add HangingFrame Tick API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
index 66cf0a6cd1525ecf2615809210a26d55f445d07d..360ca6458083fa4018f11fcdade3ce930835db72 100644
|
index 799b1fc67bd16029ea26c480e21f5f51877343ab..da1ec6e15fe9525e50f2389eeea6719eb8d8882f 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||||
@@ -41,6 +41,7 @@ public abstract class HangingEntity extends Entity {
|
@@ -21,7 +21,11 @@ import org.apache.commons.lang3.Validate;
|
||||||
private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper
|
|
||||||
public BlockPos pos;
|
public abstract class HangingEntity extends BlockAttachedEntity {
|
||||||
protected Direction direction;
|
protected static final Predicate<Entity> HANGING_ENTITY = entity -> entity instanceof HangingEntity;
|
||||||
|
+
|
||||||
|
+ private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper - Perf: offset item frame ticking
|
||||||
|
+ //public BlockPos pos;
|
||||||
|
protected Direction direction = Direction.SOUTH;
|
||||||
+ public boolean tick = true; // Parchment
|
+ public boolean tick = true; // Parchment
|
||||||
|
|
||||||
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
@@ -116,7 +117,7 @@ public abstract class HangingEntity extends Entity {
|
@@ -54,6 +58,38 @@ public abstract class HangingEntity extends BlockAttachedEntity {
|
||||||
|
protected abstract AABB calculateBoundingBox(BlockPos pos, Direction side);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
+ public void tick() {
|
||||||
- if (!this.level().isClientSide) {
|
|
||||||
+ if (tick && !this.level().isClientSide) { // Parchment
|
+ if (tick && !this.level().isClientSide) { // Parchment
|
||||||
this.checkBelowWorld();
|
+ this.checkBelowWorld();
|
||||||
if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
|
+ if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
|
||||||
this.checkInterval = 0;
|
+ this.checkInterval = 0;
|
||||||
|
+ if (!this.isRemoved() && !this.survives()) {
|
||||||
|
+ // CraftBukkit start - fire break events
|
||||||
|
+ BlockState material = this.level().getBlockState(this.blockPosition());
|
||||||
|
+ org.bukkit.event.hanging.HangingBreakEvent.RemoveCause cause;
|
||||||
|
+
|
||||||
|
+ if (!material.isAir()) {
|
||||||
|
+ // TODO: This feels insufficient to catch 100% of suffocation cases
|
||||||
|
+ cause = org.bukkit.event.hanging.HangingBreakEvent.RemoveCause.OBSTRUCTION;
|
||||||
|
+ } else {
|
||||||
|
+ cause = org.bukkit.event.hanging.HangingBreakEvent.RemoveCause.PHYSICS;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ org.bukkit.event.hanging.HangingBreakEvent event = new org.bukkit.event.hanging.HangingBreakEvent((org.bukkit.entity.Hanging) this.getBukkitEntity(), cause);
|
||||||
|
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
+
|
||||||
|
+ if (this.isRemoved() || event.isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
|
||||||
|
+ this.dropItem((ServerLevel) this.level(), (Entity) null);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public boolean survives() {
|
||||||
|
if (!this.level().noCollision(this)) {
|
||||||
|
return false;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
||||||
index cbdcf767c01e2c173913f56747d2dacbda2f0094..a74f783df0225223a2b2ae3dc632541ccf078893 100644
|
index f1e3f2b89bcd969f3c80548e165881a9b290eb53..f2d46e908ca0030da514a686763e65a57f02cf35 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java
|
||||||
@@ -66,4 +66,16 @@ public class CraftHanging extends CraftEntity implements Hanging {
|
@@ -66,4 +66,16 @@ public class CraftHanging extends CraftBlockAttachedEntity implements Hanging {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftHanging";
|
return "CraftHanging";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index fd84786f3e72875e79df46416f47f3403876cef3..c3d6e20a29ab392ce9c1be027fbf6c6e06720efe 100644
|
index d0010dfd22463986bf3be9b3ee015ce92735753e..17b353b44fb15726203ecf643961a8242f2a9372 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -2009,6 +2009,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2179,6 +2179,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||||
}
|
}
|
||||||
// Paper start
|
// Paper start
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Big Barrels
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
index 416aa989ebb18a8741cc9d605a1180ab830f6643..c48466a4d2115f4fa6121b6bcba87b838743af34 100644
|
index 6186e55014bbb9d5bedaa0e9d196879c55339d42..4f02184ec9aa7067f0ee20f041799d25494cb358 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
@@ -67,7 +67,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -68,7 +68,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
|
|
||||||
public BarrelBlockEntity(BlockPos pos, BlockState state) {
|
public BarrelBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(BlockEntityType.BARREL, pos, state);
|
super(BlockEntityType.BARREL, pos, state);
|
||||||
@@ -17,7 +17,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..c48466a4d2115f4fa6121b6bcba87b83
|
|||||||
this.openersCounter = new ContainerOpenersCounter() {
|
this.openersCounter = new ContainerOpenersCounter() {
|
||||||
@Override
|
@Override
|
||||||
protected void onOpen(Level world, BlockPos pos, BlockState state) {
|
protected void onOpen(Level world, BlockPos pos, BlockState state) {
|
||||||
@@ -118,7 +118,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -119,7 +119,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getContainerSize() {
|
public int getContainerSize() {
|
||||||
@@ -26,7 +26,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..c48466a4d2115f4fa6121b6bcba87b83
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -138,7 +138,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -139,7 +139,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) {
|
protected AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) {
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Wed, 20 Jul 2022 05:26:25 -0400
|
|
||||||
Subject: [PATCH] Add Timings Events
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..88244a89ccf7ed33073e3795ef26a5ee4645e323 100644
|
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
||||||
@@ -350,6 +350,8 @@ public class TimingsExport extends Thread {
|
|
||||||
timingsURL = con.getHeaderField("Location");
|
|
||||||
listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL))));
|
|
||||||
|
|
||||||
+ new co.aikar.timings.event.TimingsGenerateReportEvent(this.listeners, timingsURL).callEvent();
|
|
||||||
+
|
|
||||||
if (response != null && !response.isEmpty()) {
|
|
||||||
Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response);
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index c3d6e20a29ab392ce9c1be027fbf6c6e06720efe..0070b39c9b4e6414c83d1863095af7ed93b55fc7 100644
|
index 17b353b44fb15726203ecf643961a8242f2a9372..b137889665a2e678951c631053d0f8cecd2adc95 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -197,6 +197,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -218,6 +218,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
|
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
|
||||||
private long lastSaveTime; // Paper - getLastPlayed replacement API
|
private long lastSaveTime; // Paper - getLastPlayed replacement API
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@ index c3d6e20a29ab392ce9c1be027fbf6c6e06720efe..0070b39c9b4e6414c83d1863095af7ed
|
|||||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||||
super(server, entity);
|
super(server, entity);
|
||||||
|
|
||||||
@@ -3304,4 +3306,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -3589,4 +3591,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
return this.spigot;
|
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData()));
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Paper end - entity effect API
|
||||||
+
|
+
|
||||||
+ // Parchment start
|
+ // Parchment start
|
||||||
+ @Override
|
+ @Override
|
||||||
@@ -48,6 +48,4 @@ index c3d6e20a29ab392ce9c1be027fbf6c6e06720efe..0070b39c9b4e6414c83d1863095af7ed
|
|||||||
+ return net.minecraft.util.Mth.clamp(this.getHandle().getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
|
+ return net.minecraft.util.Mth.clamp(this.getHandle().getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
|
||||||
+ }
|
+ }
|
||||||
+ // Parchment end
|
+ // Parchment end
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
}
|
||||||
48
patches/server/0017-Add-spam-bypass-permission.patch
Normal file
48
patches/server/0017-Add-spam-bypass-permission.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Blast-MC <cjblanton2@gmail.com>
|
||||||
|
Date: Mon, 25 Jul 2022 09:11:13 -0400
|
||||||
|
Subject: [PATCH] Add spam bypass permission
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..ef65deee8c878a3a6b7349b2421473ac550e4e1c 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -802,9 +802,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
||||||
|
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
|
||||||
|
// CraftBukkit start
|
||||||
|
- if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||||
|
- this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
||||||
|
- return;
|
||||||
|
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||||
|
+ if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||||
|
+ this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
// Paper start - Don't suggest if tab-complete is disabled
|
||||||
|
@@ -2559,6 +2561,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
|
// Spigot start - spam exclusions
|
||||||
|
private void detectRateSpam(String s) {
|
||||||
|
+ if (this.getCraftPlayer().hasPermission("spam.bypass")) return; // Parchment - spam bypass
|
||||||
|
// CraftBukkit start - replaced with thread safe throttle
|
||||||
|
for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
||||||
|
{
|
||||||
|
@@ -3339,9 +3342,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||||
|
// Paper start - auto recipe limit
|
||||||
|
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||||
|
- if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
|
||||||
|
- this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
|
||||||
|
- return;
|
||||||
|
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||||
|
+ if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
|
||||||
|
+ this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Paper end - auto recipe limit
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Mon, 25 Jul 2022 09:11:13 -0400
|
|
||||||
Subject: [PATCH] Add spam bypass permission
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
index 30ccbab1586a656e0ae41d7406525fb02d9e025b..4a5c5a0f4e4bf1f256bcf518955403995e2368a7 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
@@ -773,6 +773,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
|
||||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
|
|
||||||
// CraftBukkit start
|
|
||||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
|
||||||
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
|
|
||||||
server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
|
||||||
return;
|
|
||||||
@@ -783,6 +784,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
+ } // Parchment - spam bypass
|
|
||||||
// Paper end
|
|
||||||
// CraftBukkit end
|
|
||||||
// Paper start - Don't suggest if tab-complete is disabled
|
|
||||||
@@ -2450,6 +2452,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
|
|
||||||
// Spigot start - spam exclusions
|
|
||||||
private void detectRateSpam(String s) {
|
|
||||||
+ if (this.getCraftPlayer().hasPermission("spam.bypass")) return; // Parchment - spam bypass
|
|
||||||
// CraftBukkit start - replaced with thread safe throttle
|
|
||||||
boolean counted = true;
|
|
||||||
for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
|
||||||
@@ -3199,10 +3202,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
|
||||||
// Paper start
|
|
||||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
|
||||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
|
||||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
|
||||||
this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
+ } // Parchment - spam bypass
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
|
||||||
@@ -5,18 +5,20 @@ Subject: [PATCH] Disable set respawn message
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 823bc659f7421c3752e4cf1333e1568e1308464d..b7cdefdbbdba46fdd9f39275474be356c2af8b40 100644
|
index 94de83a35998c82b807c6e5836d957f317dd2ceb..64752d1c129b85f7a700c91e43741ac4d9bedd22 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -2399,9 +2399,11 @@ public class ServerPlayer extends Player {
|
@@ -2769,9 +2769,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||||
forced = event.isForced();
|
forced = event.isForced();
|
||||||
// Paper end
|
// Paper end - Add PlayerSetSpawnEvent
|
||||||
|
|
||||||
|
- if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper - Add PlayerSetSpawnEvent
|
||||||
|
- this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper - Add PlayerSetSpawnEvent
|
||||||
|
- }
|
||||||
+ /* Parchment start
|
+ /* Parchment start
|
||||||
if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper
|
+ if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper
|
||||||
this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper
|
+ this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper
|
||||||
}
|
+ } Parchment end */
|
||||||
+ Parchment end */
|
|
||||||
|
|
||||||
this.respawnPosition = pos;
|
this.respawnPosition = pos;
|
||||||
this.respawnDimension = dimension;
|
this.respawnDimension = dimension;
|
||||||
@@ -5,40 +5,34 @@ Subject: [PATCH] Make FixLight use action bar
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
diff --git a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||||
index 463c6d8d5b114816ed9065558285945817c30385..d77fb29ea767fce5b8e00b76625188f19ecdbd24 100644
|
index 85950a1aa732ab8c01ad28bec9e0de140e1a172e..e8186e9569c57bc68ac20f6fac0c90001986b5e6 100644
|
||||||
--- a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
--- a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
+++ b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||||
@@ -24,6 +24,7 @@ import static net.kyori.adventure.text.format.NamedTextColor.BLUE;
|
@@ -95,16 +95,22 @@ public final class FixLightCommand implements PaperSubcommand {
|
||||||
import static net.kyori.adventure.text.format.NamedTextColor.DARK_AQUA;
|
((StarLightLightingProvider)lightengine).starlight$serverRelightChunks(chunks,
|
||||||
import static net.kyori.adventure.text.format.NamedTextColor.GREEN;
|
|
||||||
import static net.kyori.adventure.text.format.NamedTextColor.RED;
|
|
||||||
+import static net.kyori.adventure.text.format.NamedTextColor.YELLOW;
|
|
||||||
|
|
||||||
@DefaultQualifier(NonNull.class)
|
|
||||||
public final class FixLightCommand implements PaperSubcommand {
|
|
||||||
@@ -93,17 +94,20 @@ public final class FixLightCommand implements PaperSubcommand {
|
|
||||||
lightengine.relight(chunks,
|
|
||||||
(final ChunkPos chunkPos) -> {
|
(final ChunkPos chunkPos) -> {
|
||||||
++relitChunks[0];
|
++relitChunks[0];
|
||||||
- sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
- sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
||||||
- text("Relit chunk ", BLUE), text(chunkPos.toString()),
|
- text("Relit chunk ", BLUE), text(chunkPos.toString()),
|
||||||
- text(", progress: ", BLUE), text((int) (Math.round(100.0 * (double) (relitChunks[0]) / (double) pending[0])) + "%")
|
- text(", progress: ", BLUE), text(ONE_DECIMAL_PLACES.get().format(100.0 * (double) (relitChunks[0]) / (double) pending[0]) + "%")
|
||||||
|
+
|
||||||
+ sender.getBukkitEntity().sendActionBar(text().color(DARK_AQUA).append(
|
+ sender.getBukkitEntity().sendActionBar(text().color(DARK_AQUA).append(
|
||||||
+ text("Relighting Chunks: ", DARK_AQUA), text(chunkPos.toString()),
|
+ text("Relighting Chunks: ", DARK_AQUA), text(chunkPos.toString()),
|
||||||
+ text(" " + relitChunks[0], YELLOW),
|
+ text(" " + relitChunks[0], net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
||||||
+ text("/", DARK_AQUA),
|
+ text("/", DARK_AQUA),
|
||||||
+ text(pending[0] + " ", YELLOW),
|
+ text(pending[0] + " ", net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
||||||
+ text("(" + (int) (Math.round(100.0 * (double) (relitChunks[0]) / (double) pending[0])) + "%)", YELLOW)
|
+ text("(" + (int) (Math.round(100.0 * (double) (relitChunks[0]) / (double) pending[0])) + "%)", net.kyori.adventure.text.format.NamedTextColor.YELLOW)
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
(final int totalRelit) -> {
|
(final int totalRelit) -> {
|
||||||
final long end = System.nanoTime();
|
final long end = System.nanoTime();
|
||||||
final long diff = Math.round(1.0e-6 * (end - start));
|
+ final long diff = Math.round(1.0e-6 * (end - start));
|
||||||
sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
||||||
- text("Relit ", BLUE), text(totalRelit),
|
- text("Relit ", BLUE), text(totalRelit),
|
||||||
- text(" chunks. Took ", BLUE), text(diff + "ms")
|
- text(" chunks. Took ", BLUE), text(ONE_DECIMAL_PLACES.get().format(1.0e-6 * (end - start)) + "ms")
|
||||||
+ text("Relit ", DARK_AQUA), text(totalRelit, YELLOW),
|
+
|
||||||
+ text(" chunks. Took ", DARK_AQUA), text(diff + "ms", YELLOW)
|
+ text("Relit ", DARK_AQUA), text(totalRelit, net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
||||||
|
+ text(" chunks. Took ", DARK_AQUA), text(diff + "ms", net.kyori.adventure.text.format.NamedTextColor.YELLOW)
|
||||||
));
|
));
|
||||||
if (done != null) {
|
if (done != null) {
|
||||||
done.run();
|
done.run();
|
||||||
249
patches/server/0020-Add-PreEntityShootBowEvent.patch
Normal file
249
patches/server/0020-Add-PreEntityShootBowEvent.patch
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Blast-MC <cjblanton2@gmail.com>
|
||||||
|
Date: Thu, 16 Mar 2023 23:11:05 -0400
|
||||||
|
Subject: [PATCH] Add PreEntityShootBowEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
|
index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..ec0f692bfc19669797b9b355fe4028578be7a133 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||||
|
@@ -206,6 +206,11 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||||
|
ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
||||||
|
ItemStack itemstack1 = this.getProjectile(itemstack);
|
||||||
|
AbstractArrow entityarrow = this.getArrow(itemstack1, pullProgress, itemstack);
|
||||||
|
+
|
||||||
|
+ // Parchment start
|
||||||
|
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack1.asBukkitCopy());
|
||||||
|
+ if (!preEvent.callEvent()) return;
|
||||||
|
+ // Parchment end
|
||||||
|
double d0 = target.getX() - this.getX();
|
||||||
|
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||||
|
double d2 = target.getZ() - this.getZ();
|
||||||
|
@@ -221,7 +226,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||||
|
- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
||||||
|
+ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
|
index db3aac9ba711dcd18ffc35c4a745ecaec89d0166..052125cdb7ae6aef5b247ca5509e61dd21b567a2 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
|
@@ -177,6 +177,10 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||||
|
ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
||||||
|
ItemStack itemstack1 = this.getProjectile(itemstack);
|
||||||
|
AbstractArrow entityarrow = ProjectileUtil.getMobArrow(this, itemstack1, pullProgress, itemstack);
|
||||||
|
+
|
||||||
|
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack1.asBukkitCopy());
|
||||||
|
+ if (!preEvent.callEvent()) return;
|
||||||
|
+ // Parchment end
|
||||||
|
double d0 = target.getX() - this.getX();
|
||||||
|
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||||
|
double d2 = target.getZ() - this.getZ();
|
||||||
|
@@ -192,7 +196,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||||
|
- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
||||||
|
+ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||||
|
}
|
||||||
|
// Paper end - EntityShootBowEvent
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
|
index 571f0699772eecbe02d71845da82a142321f2142..937da68b6d9aac6ad0c37de7f9db888eb29e017b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||||
|
@@ -164,8 +164,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- public void shoot(double x, double y, double z, float power, float uncertainty) {
|
||||||
|
- super.shoot(x, y, z, power, uncertainty);
|
||||||
|
+ // Parchment start
|
||||||
|
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
||||||
|
+ super.shoot(x, y, z, speed, divergence, relative);
|
||||||
|
+ // Parchment end
|
||||||
|
this.life = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
|
index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..ed9ca8381bd23336bd1859f4bdc1f18d4867ee1e 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
|
@@ -192,9 +192,17 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void shoot(double x, double y, double z, float power, float uncertainty) {
|
||||||
|
- Vec3 vec3d = this.getMovementToShoot(x, y, z, power, uncertainty);
|
||||||
|
+ // Parchment start
|
||||||
|
+ shoot(x, y, z, power, uncertainty, true);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
||||||
|
+ // Parchment end
|
||||||
|
+ Vec3 vec3d = this.getMovementToShoot(x, y, z, speed, divergence);
|
||||||
|
|
||||||
|
- this.setDeltaMovement(vec3d);
|
||||||
|
+ if (relative) { // Parchment
|
||||||
|
+ this.setDeltaMovement(vec3d);
|
||||||
|
+ } // Parchment
|
||||||
|
this.hasImpulse = true;
|
||||||
|
double d3 = vec3d.horizontalDistance();
|
||||||
|
|
||||||
|
@@ -205,6 +213,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) {
|
||||||
|
+ // Parchment start
|
||||||
|
+ shootFromRotation(shooter, pitch, yaw, roll, speed, divergence, true);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence, boolean relative) {
|
||||||
|
+ // Parchment end
|
||||||
|
float f5 = -Mth.sin(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||||
|
float f6 = -Mth.sin((pitch + roll) * 0.017453292F);
|
||||||
|
float f7 = Mth.cos(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||||
|
@@ -212,7 +226,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||||
|
Vec3 vec3d = shooter.getKnownMovement();
|
||||||
|
// Paper start - allow disabling relative velocity
|
||||||
|
- if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) {
|
||||||
|
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) {
|
||||||
|
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||||
|
}
|
||||||
|
// Paper end - allow disabling relative velocity
|
||||||
|
@@ -230,8 +244,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||||
|
+ return Projectile.spawnProjectileUsingShoot(creator, world, projectileStack, shooter, velocityX, velocityY, velocityZ, power, divergence, true);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||||
|
return Projectile.spawnProjectile(creator.create(world, shooter, projectileStack), world, projectileStack, (iprojectile) -> {
|
||||||
|
- iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||||
|
+ iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -239,12 +257,22 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
// Paper start - fixes and addition to spawn reason API
|
||||||
|
return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence).spawn();
|
||||||
|
}
|
||||||
|
+ public static <T extends Projectile> T spawnProjectileUsingShoot(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||||
|
+ // Paper start - fixes and addition to spawn reason API
|
||||||
|
+ return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence, relative).spawn();
|
||||||
|
+ }
|
||||||
|
public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||||
|
return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||||
|
// Paper end - fixes and addition to spawn reason API
|
||||||
|
projectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
+ public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||||
|
+ return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||||
|
+ // Paper end - fixes and addition to spawn reason API
|
||||||
|
+ projectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||||
|
+ });
|
||||||
|
+ }
|
||||||
|
|
||||||
|
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel world, ItemStack projectileStack) {
|
||||||
|
return Projectile.spawnProjectile(projectile, world, projectileStack, (iprojectile) -> {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
|
index bb593209c95c9cf1f9c5d52d52fab4a33ddbabcf..768964dbc785cb78d5ef517cf88f9f8b1f6af629 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||||
|
@@ -37,8 +37,13 @@ public class BowItem extends ProjectileWeaponItem {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
List<ItemStack> list = draw(stack, itemStack, player);
|
||||||
|
- if (world instanceof ServerLevel serverLevel && !list.isEmpty()) {
|
||||||
|
- this.shoot(serverLevel, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null);
|
||||||
|
+
|
||||||
|
+ if (!world.isClientSide() && !list.isEmpty()) {
|
||||||
|
+ // Parchment start
|
||||||
|
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(user.getBukkitEntity(), stack.asBukkitCopy(), itemStack.asBukkitCopy());
|
||||||
|
+ if (!preEvent.callEvent()) return false;
|
||||||
|
+ // Parchment end
|
||||||
|
+ this.shoot((ServerLevel) world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null, preEvent.isRelative());
|
||||||
|
}
|
||||||
|
|
||||||
|
world.playSound(
|
||||||
|
@@ -60,9 +65,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shootProjectile(
|
||||||
|
- LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target
|
||||||
|
+ LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target, boolean relative
|
||||||
|
) {
|
||||||
|
- projectile.shootFromRotation(shooter, shooter.getXRot(), shooter.getYRot() + yaw, 0.0F, speed, divergence);
|
||||||
|
+ projectile.shootFromRotation(shooter, shooter.getXRot(), shooter.getYRot() + yaw, 0.0F, speed, divergence, relative);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getPowerForTime(int useTicks) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||||
|
index 52c40eafc77e50a6fd21b9a7a250cea501f11690..2eca32e58e41f15cd9453e936d19c26a1a4b588c 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||||
|
@@ -140,7 +140,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shootProjectile(
|
||||||
|
- LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target
|
||||||
|
+ LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target, boolean relative
|
||||||
|
) {
|
||||||
|
Vector3f vector3f;
|
||||||
|
if (target != null) {
|
||||||
|
@@ -201,8 +201,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||||
|
) {
|
||||||
|
if (world instanceof ServerLevel serverLevel) {
|
||||||
|
ChargedProjectiles chargedProjectiles = stack.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.EMPTY);
|
||||||
|
+ // Parchment start
|
||||||
|
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(shooter.getBukkitEntity(), stack.asBukkitCopy(), chargedProjectiles.getItems().get(0).asBukkitCopy());
|
||||||
|
+ if (!preEvent.callEvent()) return;
|
||||||
|
+ // TODO: handle relative flag in CrossbowAttackMob#shootCrossbowProjectile
|
||||||
|
+ // Parchment end
|
||||||
|
+
|
||||||
|
if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) {
|
||||||
|
- this.shoot(serverLevel, shooter, hand, stack, chargedProjectiles.getItems(), speed, divergence, shooter instanceof Player, target);
|
||||||
|
+ this.shoot(serverLevel, shooter, hand, stack, chargedProjectiles.getItems(), speed, divergence, shooter instanceof Player, target, preEvent.isRelative());
|
||||||
|
if (shooter instanceof ServerPlayer serverPlayer) {
|
||||||
|
CriteriaTriggers.SHOT_CROSSBOW.trigger(serverPlayer, stack);
|
||||||
|
serverPlayer.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||||
|
index 78ba170a83f8c026bd110eae494c52577182ed61..5ece12e41233727fbd1106d067e607810341acab 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||||
|
@@ -41,7 +41,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||||
|
|
||||||
|
public abstract int getDefaultProjectileRange();
|
||||||
|
|
||||||
|
- protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target) {
|
||||||
|
+ protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target, boolean relative) {
|
||||||
|
float f2 = EnchantmentHelper.processProjectileSpread(world, stack, shooter, 0.0F);
|
||||||
|
float f3 = projectiles.size() == 1 ? 0.0F : 2.0F * f2 / (float) (projectiles.size() - 1);
|
||||||
|
float f4 = (float) ((projectiles.size() - 1) % 2) * f3 / 2.0F;
|
||||||
|
@@ -56,8 +56,9 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||||
|
f5 = -f5;
|
||||||
|
// CraftBukkit start
|
||||||
|
Projectile iprojectile = this.createProjectile(world, shooter, stack, itemstack1, critical);
|
||||||
|
- this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target);
|
||||||
|
|
||||||
|
+ this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target, relative);
|
||||||
|
+ // CraftBukkit start
|
||||||
|
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(shooter, stack, itemstack1, iprojectile, hand, speed, true);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
event.getProjectile().remove();
|
||||||
|
@@ -86,7 +87,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- protected abstract void shootProjectile(LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target);
|
||||||
|
+ protected abstract void shootProjectile(LivingEntity shooter, Projectile projectile, int index, float speed, float divergence, float yaw, @Nullable LivingEntity target, boolean relative);
|
||||||
|
|
||||||
|
protected Projectile createProjectile(Level world, LivingEntity shooter, ItemStack weaponStack, ItemStack projectileStack, boolean critical) {
|
||||||
|
Item item = projectileStack.getItem();
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Wed, 1 Mar 2023 22:02:23 -0500
|
|
||||||
Subject: [PATCH] Remove Hanging Entity Debug
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
||||||
index 374f73ac1dbfa27daef132373f7af4b9bb12daa0..015badafe28adc6ab121b24b7cb585a84bce12ff 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
||||||
@@ -281,7 +281,7 @@ public abstract class HangingEntity extends Entity {
|
|
||||||
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
|
||||||
|
|
||||||
if (!blockposition.closerThan(this.blockPosition(), 16.0D)) {
|
|
||||||
- HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
|
||||||
+ //HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
|
||||||
} else {
|
|
||||||
this.pos = blockposition;
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Return Displays in getTargetEntity
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 45b1a182acf6b2aef40b714d31ca125d8f74619a..90da5817fd0e5dc332193944b68fc343915d5b39 100644
|
index f36a075dbee2b96d01899e02460b1d8443e91749..6782f6184dedd38dfefefd48a6399cd141b00711 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -4107,7 +4107,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -4340,7 +4340,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
Vec3 direction = this.getLookAngle();
|
Vec3 direction = this.getLookAngle();
|
||||||
Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
||||||
|
|
||||||
@@ -16,4 +16,4 @@ index 45b1a182acf6b2aef40b714d31ca125d8f74619a..90da5817fd0e5dc332193944b68fc343
|
|||||||
+ List<Entity> entityList = this.level().getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display)); // Parchment - add displays
|
+ List<Entity> entityList = this.level().getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display)); // Parchment - add displays
|
||||||
|
|
||||||
double distance = 0.0D;
|
double distance = 0.0D;
|
||||||
EntityHitResult result = null;
|
net.minecraft.world.phys.EntityHitResult result = null;
|
||||||
@@ -5,57 +5,47 @@ Subject: [PATCH] Add CustomBlockUpdateEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||||
index ff16075fbfe664c73a46bc4b002450867974114e..32b56119850282ba8da5741e22dc21ffd6f6fb08 100644
|
index 6582db84c5307257f16c321453491cf24e40c9c7..eb54895ed35eb623bf93d375ff2d01a49fc2824c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||||
@@ -2,6 +2,8 @@ package net.minecraft.world.level.block;
|
@@ -68,12 +68,14 @@ public class NoteBlock extends Block {
|
||||||
|
|
||||||
import com.mojang.serialization.MapCodec;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
+
|
|
||||||
+import gg.projecteden.parchment.event.block.CustomBlockUpdateEvent;
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.core.Holder;
|
|
||||||
@@ -65,12 +67,14 @@ public class NoteBlock extends Block {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), CustomBlockUpdateEvent.UpdateType.INSTRUMENT).callEvent()) return this.defaultBlockState();
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.INSTRUMENT).callEvent()) return this.defaultBlockState();
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return this.defaultBlockState(); // Paper - place without considering instrument
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return this.defaultBlockState(); // Paper - place without considering instrument
|
||||||
return this.setInstrument(ctx.getLevel(), ctx.getClickedPos(), this.defaultBlockState());
|
return this.setInstrument(ctx.getLevel(), ctx.getClickedPos(), this.defaultBlockState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), CustomBlockUpdateEvent.UpdateType.INSTRUMENT).callEvent()) return state;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.INSTRUMENT, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, (Level) world)).callEvent()) return state;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
|
||||||
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
||||||
|
|
||||||
@@ -79,6 +83,7 @@ public class NoteBlock extends Block {
|
@@ -82,6 +84,7 @@ public class NoteBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), CustomBlockUpdateEvent.UpdateType.POWERED).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
|
||||||
boolean flag1 = world.hasNeighborSignal(pos);
|
boolean flag1 = world.hasNeighborSignal(pos);
|
||||||
|
|
||||||
@@ -117,7 +122,9 @@ public class NoteBlock extends Block {
|
@@ -119,7 +122,8 @@ public class NoteBlock extends Block {
|
||||||
} else if (world.isClientSide) {
|
@Override
|
||||||
return InteractionResult.SUCCESS;
|
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||||
} else {
|
if (!world.isClientSide) {
|
||||||
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
||||||
+
|
|
||||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates ||
|
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates ||
|
||||||
+ !new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), CustomBlockUpdateEvent.UpdateType.PITCH).callEvent()) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
+ !new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.PITCH, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
||||||
world.setBlock(pos, state, 3);
|
world.setBlock(pos, state, 3);
|
||||||
this.playNote(player, state, world, pos);
|
this.playNote(player, state, world, pos);
|
||||||
player.awardStat(Stats.TUNE_NOTEBLOCK);
|
player.awardStat(Stats.TUNE_NOTEBLOCK);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
index 2f947997ca746d18544940ef67ff550a95946edd..b1ecefd22a64bf7a134490cf7ac88d4d04e1f4e7 100644
|
index 74cce7874809dcbce2718ec3840bb6bb3127e871..d46503c9d31877412ba4ae5a3bb22c0a444662cf 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||||
@@ -66,21 +66,25 @@ public class TripWireBlock extends Block {
|
@@ -68,21 +68,25 @@ public class TripWireBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||||
@@ -70,55 +60,55 @@ index 2f947997ca746d18544940ef67ff550a95946edd..b1ecefd22a64bf7a134490cf7ac88d4d
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE).callEvent()) return state;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, (Level) world)).callEvent()) return state;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
|
||||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||||
if (!oldState.is(state.getBlock())) {
|
if (!oldState.is(state.getBlock())) {
|
||||||
this.updateSource(world, pos, state);
|
this.updateSource(world, pos, state);
|
||||||
@@ -89,6 +93,7 @@ public class TripWireBlock extends Block {
|
@@ -91,6 +95,7 @@ public class TripWireBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||||
if (!moved && !state.is(newState.getBlock())) {
|
if (!moved && !state.is(newState.getBlock())) {
|
||||||
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), true); // Paper - fix state inconsistency
|
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
|
||||||
@@ -97,6 +102,7 @@ public class TripWireBlock extends Block {
|
@@ -99,6 +104,7 @@ public class TripWireBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE).callEvent()) return state;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return state;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
||||||
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
||||||
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
||||||
@@ -107,6 +113,7 @@ public class TripWireBlock extends Block {
|
@@ -109,6 +115,7 @@ public class TripWireBlock extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||||
// Paper start - fix state inconsistency
|
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
|
||||||
this.updateSource(world, pos, state, false);
|
int i = aenumdirection.length;
|
||||||
@@ -146,6 +153,7 @@ public class TripWireBlock extends Block {
|
@@ -147,6 +154,7 @@ public class TripWireBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwires from detecting collision
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwires from detecting collision
|
||||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
@@ -157,6 +165,7 @@ public class TripWireBlock extends Block {
|
@@ -158,6 +166,7 @@ public class TripWireBlock extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED).callEvent()) return;
|
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwire pressed check
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwire pressed check
|
||||||
if ((Boolean) world.getBlockState(pos).getValue(TripWireBlock.POWERED)) {
|
if ((Boolean) world.getBlockState(pos).getValue(TripWireBlock.POWERED)) {
|
||||||
this.checkPressed(world, pos);
|
this.checkPressed(world, pos);
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Thu, 16 Mar 2023 23:11:05 -0400
|
|
||||||
Subject: [PATCH] Add PreEntityShootBowEvent
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
||||||
index b319021b22c5dceba6199ed27814b2dcf47b8d50..d12a49f9eb0110d4d889f15863ecb88c07a848b9 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
||||||
@@ -199,13 +199,17 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
|
||||||
@Override
|
|
||||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
|
||||||
ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW)));
|
|
||||||
+ // Parchment start
|
|
||||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy());
|
|
||||||
+ if (!preEvent.callEvent()) return;
|
|
||||||
+ // Parchment end
|
|
||||||
AbstractArrow entityarrow = this.getArrow(itemstack, pullProgress);
|
|
||||||
double d0 = target.getX() - this.getX();
|
|
||||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
|
||||||
double d2 = target.getZ() - this.getZ();
|
|
||||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
|
||||||
|
|
||||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
|
|
||||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment
|
|
||||||
// CraftBukkit start
|
|
||||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
|
||||||
index 63fce7e3d9f59f36e29bc827a46396d73143bb8b..9762a79c928d7235a7868b37858474e1b1e0cf56 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
|
||||||
@@ -189,13 +189,17 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
|
||||||
@Override
|
|
||||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
|
||||||
ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW)));
|
|
||||||
+ // Parchment start
|
|
||||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy());
|
|
||||||
+ if (!preEvent.callEvent()) return;
|
|
||||||
+ // Parchment end
|
|
||||||
AbstractArrow entityarrow = ProjectileUtil.getMobArrow(this, itemstack, pullProgress);
|
|
||||||
double d0 = target.getX() - this.getX();
|
|
||||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
|
||||||
double d2 = target.getZ() - this.getZ();
|
|
||||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
|
||||||
|
|
||||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
|
|
||||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment
|
|
||||||
// Paper start
|
|
||||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, target.getUsedItemHand(), 0.8F, true);
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
index 42ebd91196ae420eee57f4380abc558555457163..593c9e840956efe0fcd723744eef389b01a140c4 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
||||||
@@ -136,8 +136,10 @@ public abstract class AbstractArrow extends Projectile {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
- public void shoot(double x, double y, double z, float speed, float divergence) {
|
|
||||||
- super.shoot(x, y, z, speed, divergence);
|
|
||||||
+ // Parchment start
|
|
||||||
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
|
||||||
+ super.shoot(x, y, z, speed, divergence, relative);
|
|
||||||
+ // Parchment end
|
|
||||||
this.life = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
||||||
index 2f058cec80c6ef7a5a5ca065dc6c9fe353c521de..48f246351d75af18b72fe235b013de1c7290c8db 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
||||||
@@ -172,9 +172,17 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void shoot(double x, double y, double z, float speed, float divergence) {
|
|
||||||
+ // Parchment start
|
|
||||||
+ shoot(x, y, z, speed, divergence, true);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
|
||||||
+ // Parchment end
|
|
||||||
Vec3 vec3d = (new Vec3(x, y, z)).normalize().add(this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence)).scale((double) speed);
|
|
||||||
|
|
||||||
+ if (relative) { // Parchment
|
|
||||||
this.setDeltaMovement(vec3d);
|
|
||||||
+ } // Parchment
|
|
||||||
double d3 = vec3d.horizontalDistance();
|
|
||||||
|
|
||||||
this.setYRot((float) (Mth.atan2(vec3d.x, vec3d.z) * 57.2957763671875D));
|
|
||||||
@@ -184,6 +192,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) {
|
|
||||||
+ // Parchment start
|
|
||||||
+ shootFromRotation(shooter, pitch, yaw, roll, speed, divergence, true);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence, boolean relative) {
|
|
||||||
+ // Parchment end
|
|
||||||
float f5 = -Mth.sin(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
|
||||||
float f6 = -Mth.sin((pitch + roll) * 0.017453292F);
|
|
||||||
float f7 = Mth.cos(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
|
||||||
@@ -191,7 +205,9 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
||||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
|
||||||
Vec3 vec3d = shooter.getDeltaMovement();
|
|
||||||
|
|
||||||
+ if (relative) { // Parchment
|
|
||||||
if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity
|
|
||||||
+ } // Parchment
|
|
||||||
}
|
|
||||||
|
|
||||||
// CraftBukkit start - call projectile hit event
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
|
||||||
index 08d597db1a5345a343777a01427655e6bf2c926b..b923ea037a69628309167d16cc2a0ae780444523 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
|
||||||
@@ -42,9 +42,13 @@ public class BowItem extends ProjectileWeaponItem implements Vanishable {
|
|
||||||
|
|
||||||
if (!world.isClientSide) {
|
|
||||||
ArrowItem itemarrow = (ArrowItem) (itemstack1.getItem() instanceof ArrowItem ? itemstack1.getItem() : Items.ARROW);
|
|
||||||
+ // Parchment start
|
|
||||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(entityhuman.getBukkitEntity(), stack.asBukkitCopy(), itemstack1.asBukkitCopy());
|
|
||||||
+ if (!preEvent.callEvent()) return;
|
|
||||||
+ // Parchment end
|
|
||||||
AbstractArrow entityarrow = itemarrow.createArrow(world, itemstack1, entityhuman);
|
|
||||||
|
|
||||||
- entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F);
|
|
||||||
+ entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F, preEvent.isRelative()); // Parchment
|
|
||||||
if (f == 1.0F) {
|
|
||||||
entityarrow.setCritArrow(true);
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
|
||||||
index eede02c3f125d230af537bb67bebed9b88f7d1b4..343c634b97f3ff5e8eda008121a661423a1810aa 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
|
||||||
@@ -225,6 +225,11 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable {
|
|
||||||
|
|
||||||
private static void shootProjectile(Level world, LivingEntity shooter, InteractionHand hand, ItemStack crossbow, ItemStack projectile, float soundPitch, boolean creative, float speed, float divergence, float simulated) {
|
|
||||||
if (!world.isClientSide) {
|
|
||||||
+ // Parchment start
|
|
||||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(shooter.getBukkitEntity(), crossbow.asBukkitCopy(), projectile.asBukkitCopy());
|
|
||||||
+ if (!preEvent.callEvent()) return;
|
|
||||||
+ // TODO: handle relative flag in CrossbowAttackMob#shootCrossbowProjectile
|
|
||||||
+ // Parchment end
|
|
||||||
boolean flag1 = projectile.is(Items.FIREWORK_ROCKET);
|
|
||||||
Object object;
|
|
||||||
|
|
||||||
@@ -27,10 +27,10 @@ index 0000000000000000000000000000000000000000..30f8fd154136d05267e8737ff04a0be4
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 58536aabf607015939a1326f80207c0a06eed8ff..b27e958e8da8abbf0e36b432bf3a29da270ecb8e 100644
|
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..9309598317d361ecef658fe4de57c64ba73f36c1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -268,6 +268,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -284,6 +284,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,12 +40,12 @@ index 58536aabf607015939a1326f80207c0a06eed8ff..b27e958e8da8abbf0e36b432bf3a29da
|
|||||||
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
||||||
this.server.loadPlugins();
|
this.server.loadPlugins();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 9abe817ae202edaa2d88cd59ae5c7db0b1c634be..861dff20a09d94cb90e1ff95ea51f50efa7b501d 100644
|
index ed5b00620527c1776722d25b1b45f1544802a341..544882862b2248d426185dd67bd217f593caef2a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -158,6 +158,31 @@ import org.bukkit.plugin.PluginManager;
|
@@ -178,6 +178,31 @@ import org.bukkit.plugin.PluginManager;
|
||||||
|
|
||||||
public abstract class Entity implements Nameable, EntityAccess, CommandSource, ScoreHolder {
|
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||||
|
|
||||||
+ @javax.annotation.Nullable
|
+ @javax.annotation.Nullable
|
||||||
+ private gg.projecteden.parchment.entity.EntityData storedEntityData;
|
+ private gg.projecteden.parchment.entity.EntityData storedEntityData;
|
||||||
@@ -74,19 +74,18 @@ index 9abe817ae202edaa2d88cd59ae5c7db0b1c634be..861dff20a09d94cb90e1ff95ea51f50e
|
|||||||
+
|
+
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private static final int CURRENT_LEVEL = 2;
|
private static final int CURRENT_LEVEL = 2;
|
||||||
public boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation
|
public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first setPositionRotation
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index aa4dbf91cf6da329fdcacbde98bb870eb48e8f5c..392d5b896254e5dd57de33e16fa196950e6f7c61 100644
|
index ddabaed899c755925ad8618b78c33dacaf2126ac..134dba0bf6340772c7b3fa233dfabffd859422b2 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -222,6 +222,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@@ -1306,4 +1306,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
};
|
}
|
||||||
// Paper end - Folia schedulers
|
}
|
||||||
|
// Paper end - broadcast hurt animation
|
||||||
|
+
|
||||||
+ public gg.projecteden.parchment.entity.EntityData getStoredEntityData() {
|
+ public gg.projecteden.parchment.entity.EntityData getStoredEntityData() {
|
||||||
+ return this.entity.getStoredEntityData();
|
+ return this.entity.getStoredEntityData();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
public CraftEntity(final CraftServer server, final Entity entity) {
|
}
|
||||||
this.server = server;
|
|
||||||
this.entity = entity;
|
|
||||||
@@ -27,10 +27,10 @@ index 30f8fd154136d05267e8737ff04a0be45b23a35d..7091340870607605521239893b8ab763
|
|||||||
}
|
}
|
||||||
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java
|
diff --git a/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..5a1e28da1f3dcae1abeb016708dc6fdf883cd213
|
index 0000000000000000000000000000000000000000..3184478d24e6c984d4e5b5f67253f966315b298c
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java
|
+++ b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java
|
||||||
@@ -0,0 +1,181 @@
|
@@ -0,0 +1,182 @@
|
||||||
+package gg.projecteden.parchment.sidebar;
|
+package gg.projecteden.parchment.sidebar;
|
||||||
+
|
+
|
||||||
+import gg.projecteden.parchment.util.StringUtils;
|
+import gg.projecteden.parchment.util.StringUtils;
|
||||||
@@ -50,6 +50,7 @@ index 0000000000000000000000000000000000000000..5a1e28da1f3dcae1abeb016708dc6fdf
|
|||||||
+import org.bukkit.entity.Player;
|
+import org.bukkit.entity.Player;
|
||||||
+
|
+
|
||||||
+import java.util.Objects;
|
+import java.util.Objects;
|
||||||
|
+import java.util.Optional;
|
||||||
+
|
+
|
||||||
+public class SidebarBufferImpl extends SidebarBuffer {
|
+public class SidebarBufferImpl extends SidebarBuffer {
|
||||||
+
|
+
|
||||||
@@ -183,8 +184,8 @@ index 0000000000000000000000000000000000000000..5a1e28da1f3dcae1abeb016708dc6fdf
|
|||||||
+ this.connection.send(packet);
|
+ this.connection.send(packet);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ NumberFormat numberFormat = (display == null || display.isEmpty() || display.isBlank()) ? BlankFormat.INSTANCE : new FixedFormat(Component.literal(StringUtils.colorize(display)));
|
+ java.util.Optional<NumberFormat> numberFormat = java.util.Optional.of((display == null || display.isEmpty() || display.isBlank()) ? BlankFormat.INSTANCE : new FixedFormat(Component.literal(StringUtils.colorize(display))));
|
||||||
+ ClientboundSetScorePacket packet = new ClientboundSetScorePacket(id + value, this.name, line, null, numberFormat);
|
+ ClientboundSetScorePacket packet = new ClientboundSetScorePacket(id + value, this.name, line, Optional.empty(), numberFormat);
|
||||||
+
|
+
|
||||||
+ this.connection.send(packet);
|
+ this.connection.send(packet);
|
||||||
+ }
|
+ }
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
|
||||||
Date: Thu, 23 Mar 2023 18:18:43 -0400
|
|
||||||
Subject: [PATCH] Make SynchedEntityData#packAll Public
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
|
||||||
index a043c382c37058032548a5192e17f5f816abe5a6..24fb2e60bcf3722cbc95684ce81952ad4a4f840d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
|
||||||
+++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
|
||||||
@@ -289,7 +289,7 @@ public class SynchedEntityData {
|
|
||||||
// We need to pack all as we cannot rely on "non default values" or "dirty" ones.
|
|
||||||
// Because these values can possibly be desynced on the client.
|
|
||||||
@Nullable
|
|
||||||
- private List<SynchedEntityData.DataValue<?>> packAll() {
|
|
||||||
+ public List<SynchedEntityData.DataValue<?>> packAll() {
|
|
||||||
if (this.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
@@ -1,105 +1,57 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Blast-MC <cjblanton2@gmail.com>
|
From: Blast-MC <cjblanton2@gmail.com>
|
||||||
Date: Fri, 15 Dec 2023 21:59:19 -0500
|
Date: Thu, 25 Jan 2024 19:59:13 -0500
|
||||||
Subject: [PATCH] Add Block BreakNaturally Overload
|
Subject: [PATCH] Add Block BreakNaturally Overload
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
index c4c27fb5b92833eca243e1ba718c8dcaa676a310..74be1111c4ac7fc43ed92c83544b0e7d77764e9a 100644
|
index 43c288a4e226060a5e0cecddd941846d29ae8025..78726d52117105ffebd9d15b407f5e529a217900 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||||
@@ -7,6 +7,8 @@ import com.google.common.collect.ImmutableMap;
|
@@ -335,15 +339,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
import com.mojang.logging.LogUtils;
|
// Paper start - Properly handle xp dropping
|
||||||
import com.mojang.serialization.MapCodec;
|
dropResources(state, world, pos, blockEntity, entity, tool, true);
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap;
|
|
||||||
+
|
|
||||||
+import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Function;
|
|
||||||
@@ -307,24 +309,28 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
||||||
return state.getDrops(lootparams_a);
|
|
||||||
}
|
}
|
||||||
|
- public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool, boolean dropExperience) {
|
||||||
- public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
+ public static List<ItemEntity> dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool, boolean dropExperience) {
|
||||||
+ public static List<ItemEntity> dropResources(BlockState state, Level world, BlockPos pos) {
|
// Paper end - Properly handle xp dropping
|
||||||
if (world instanceof ServerLevel) {
|
if (world instanceof ServerLevel) {
|
||||||
+ List<ItemEntity> itemEntities = new ArrayList<>();
|
+ List<ItemEntity> itemEntities = new java.util.ArrayList<>();
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, (BlockEntity) null)).forEach((itemstack) -> { // Parchment
|
|
||||||
- Block.popResource(world, pos, itemstack);
|
|
||||||
+ itemEntities.add(Block.popResource(world, pos, itemstack));
|
|
||||||
});
|
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
|
||||||
+ return itemEntities;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
- public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
|
||||||
+ public static List<ItemEntity> dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
|
||||||
if (world instanceof ServerLevel) {
|
|
||||||
+ List<ItemEntity> itemEntities = new ArrayList<>();
|
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity)).forEach((itemstack) -> { // Parchment
|
|
||||||
- Block.popResource((ServerLevel) world, pos, itemstack);
|
|
||||||
+ itemEntities.add(Block.popResource((ServerLevel) world, pos, itemstack));
|
|
||||||
});
|
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
|
||||||
+ return itemEntities;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ return new ArrayList<>();
|
|
||||||
}
|
|
||||||
// Paper start
|
|
||||||
public static boolean dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity, BlockPos source) {
|
|
||||||
@@ -344,25 +350,29 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
- public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) {
|
|
||||||
+ public static List<ItemEntity> dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) {
|
|
||||||
if (world instanceof ServerLevel) {
|
|
||||||
+ List<ItemEntity> itemEntities = new ArrayList<>();
|
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
|
org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
|
||||||
- Block.popResource(world, pos, itemstack1);
|
- Block.popResource(world, pos, itemstack1);
|
||||||
+ itemEntities.add(Block.popResource(world, pos, itemstack1));
|
+ itemEntities.add(Block.popResourceWithReturn(world, pos, itemstack1));
|
||||||
});
|
});
|
||||||
state.spawnAfterBreak((ServerLevel) world, pos, tool, true);
|
state.spawnAfterBreak((ServerLevel) world, pos, tool, dropExperience); // Paper - Properly handle xp dropping
|
||||||
+ return itemEntities;
|
+ return itemEntities;
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
+ return new ArrayList<>();
|
+ return new java.util.ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
- public static void popResource(Level world, BlockPos pos, ItemStack stack) {
|
public static void popResource(Level world, BlockPos pos, ItemStack stack) {
|
||||||
+ public static ItemEntity popResource(Level world, BlockPos pos, ItemStack stack) {
|
@@ -357,6 +363,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
double d0 = (double) EntityType.ITEM.getHeight() / 2.0D;
|
|
||||||
double d1 = (double) pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D);
|
|
||||||
double d2 = (double) pos.getY() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D) - d0;
|
|
||||||
double d3 = (double) pos.getZ() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D);
|
|
||||||
|
|
||||||
+ ItemEntity itemEntity = new ItemEntity(world, d1, d2, d3, stack);
|
|
||||||
Block.popResource(world, () -> {
|
|
||||||
- return new ItemEntity(world, d1, d2, d3, stack);
|
|
||||||
+ return itemEntity;
|
|
||||||
}, stack);
|
}, stack);
|
||||||
+ return itemEntity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ public static ItemEntity popResourceWithReturn(Level world, BlockPos pos, ItemStack stack) {
|
||||||
|
+ double d0 = (double) EntityType.ITEM.getHeight() / 2.0D;
|
||||||
|
+ double d1 = (double) pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D);
|
||||||
|
+ double d2 = (double) pos.getY() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D) - d0;
|
||||||
|
+ double d3 = (double) pos.getZ() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D);
|
||||||
|
+
|
||||||
|
+ ItemEntity itemEntity = new ItemEntity(world, d1, d2, d3, stack);
|
||||||
|
+ Block.popResource(world, () -> itemEntity, stack);
|
||||||
|
+ return itemEntity;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
public static void popResourceFromFace(Level world, BlockPos pos, Direction direction, ItemStack stack) {
|
public static void popResourceFromFace(Level world, BlockPos pos, Direction direction, ItemStack stack) {
|
||||||
|
int i = direction.getStepX();
|
||||||
|
int j = direction.getStepY();
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||||
index e5506a7d074a9f89d41f4d5d7549a458779bef20..102b4238ca81b59248c83e9fa0529eb2340485d3 100644
|
index 5cb69d0b822e11a99a96aef4f59986d083b079f4..f151b805763ce5fa4b9bfacb74b0152ab3a6ae5e 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||||
@@ -43,6 +43,7 @@ import org.bukkit.craftbukkit.CraftFluidCollisionMode;
|
@@ -500,6 +500,11 @@ public class CraftBlock implements Block {
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
|
||||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
||||||
+import org.bukkit.craftbukkit.entity.CraftItem;
|
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.craftbukkit.util.CraftLocation;
|
|
||||||
@@ -494,16 +495,26 @@ public class CraftBlock implements Block {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience) {
|
public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience) {
|
||||||
@@ -107,23 +59,19 @@ index e5506a7d074a9f89d41f4d5d7549a458779bef20..102b4238ca81b59248c83e9fa0529eb2
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean breakNaturally(Player player, ItemStack tool, boolean triggerEffect, boolean dropExperience) {
|
+ public boolean breakNaturally(Player player, ItemStack item, boolean triggerEffect, boolean dropExperience) {
|
||||||
// Paper end
|
// Paper end
|
||||||
// Order matters here, need to drop before setting to air so skulls can get their data
|
// Order matters here, need to drop before setting to air so skulls can get their data
|
||||||
net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS();
|
net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS();
|
||||||
net.minecraft.world.level.block.Block block = iblockdata.getBlock();
|
@@ -509,7 +514,12 @@ public class CraftBlock implements Block {
|
||||||
- net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
|
||||||
+ net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(tool);
|
|
||||||
boolean result = false;
|
|
||||||
|
|
||||||
// Modelled off EntityHuman#hasBlock
|
// Modelled off EntityHuman#hasBlock
|
||||||
- if (block != Blocks.AIR && (item == null || !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata))) {
|
if (block != Blocks.AIR && (item == null || !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata))) {
|
||||||
- net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem);
|
- net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem, false); // Paper - Properly handle xp dropping
|
||||||
+ if (block != Blocks.AIR && (tool == null || !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata))) {
|
+ List<net.minecraft.world.entity.item.ItemEntity> itemEntities = net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem, false);
|
||||||
+ List<net.minecraft.world.entity.item.ItemEntity> itemEntities = net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem);
|
|
||||||
+
|
+
|
||||||
+ if (player != null) {
|
+ if (player != null) {
|
||||||
+ new org.bukkit.event.block.BlockDropItemEvent(this, this.getState(), player, itemEntities.stream().map(item -> (org.bukkit.entity.Item) CraftEntity.getEntity((org.bukkit.craftbukkit.CraftServer) Bukkit.getServer(), item)).toList()).callEvent();
|
+ new org.bukkit.event.block.BlockDropItemEvent(this, this.getState(), player, itemEntities.stream().map(i -> (org.bukkit.entity.Item) CraftEntity.getEntity((org.bukkit.craftbukkit.CraftServer) Bukkit.getServer(), i)).toList()).callEvent();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
// Paper start - improve Block#breanNaturally
|
// Paper start - improve Block#breanNaturally
|
||||||
|
|||||||
19
patches/server/0026-Nether-Portal-Kick-Fix.patch
Normal file
19
patches/server/0026-Nether-Portal-Kick-Fix.patch
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Blast-MC <cjblanton2@gmail.com>
|
||||||
|
Date: Sat, 4 Jan 2025 19:16:06 -0500
|
||||||
|
Subject: [PATCH] Nether Portal Kick Fix
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
index 544882862b2248d426185dd67bd217f593caef2a..0474a5d6a35955702ba76bdc24f5c6e77e358a90 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -1793,7 +1793,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
if (this.isAffectedByBlocks()) {
|
||||||
|
AABB axisalignedbb = this.getBoundingBox().deflate(9.999999747378752E-6D);
|
||||||
|
LongSet longset = this.visitedBlocks;
|
||||||
|
- Iterator iterator = queuedCollisionChecks.iterator();
|
||||||
|
+ Iterator iterator = new ArrayList<>(queuedCollisionChecks).iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Entity.Movement entity_b = (Entity.Movement) iterator.next();
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Blast-MC <cjblanton2@gmail.com>
|
||||||
|
Date: Thu, 9 Jan 2025 02:35:24 -0500
|
||||||
|
Subject: [PATCH] ItemStack Retain Internal Tag on Upgrade
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
|
index ab616f58e35458e52fb5a94e39875a188fd6a05b..4e4bc56f8ae1cd3f6ec142e505e5c9a51ff3a378 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
|
@@ -755,11 +755,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
|
this.setMaxDamage(maxDamage);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ CompoundTag internalTag = null;
|
||||||
|
String internal = SerializableMeta.getString(map, "internal", true);
|
||||||
|
if (internal != null) {
|
||||||
|
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal));
|
||||||
|
try {
|
||||||
|
- CompoundTag internalTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap());
|
||||||
|
+ internalTag = NbtIo.readCompressed(buf, NbtAccounter.unlimitedHeap());
|
||||||
|
this.deserializeInternal(internalTag, map);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
@@ -825,6 +826,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
|
Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (internalTag != null) {
|
||||||
|
+ if (this.customTag == null) {
|
||||||
|
+ this.customTag = new CompoundTag();
|
||||||
|
+ }
|
||||||
|
+ for (String key: internalTag.getAllKeys()) {
|
||||||
|
+ if (this.customTag.contains(key)) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ this.customTag.put(key, internalTag.get(key));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void deserializeInternal(CompoundTag tag, Object context) {
|
||||||
Reference in New Issue
Block a user