Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb21b4f18d | ||
|
|
27799c6c25 | ||
|
|
da019d06ce | ||
|
|
d0466ffbcc | ||
|
|
706565f1d1 | ||
|
|
aec635cdbf | ||
|
|
c46dbce254 | ||
|
|
8868dca38c | ||
|
|
da897f9522 | ||
|
|
7f2307cc5f | ||
|
|
b6152ed60d | ||
|
|
9040f46126 | ||
|
|
43c1dcb932 | ||
|
|
da7ff326fe |
2
.github/workflows/pr-build.yml
vendored
2
.github/workflows/pr-build.yml
vendored
@@ -42,4 +42,4 @@ jobs:
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Parchment-PR${{ github.event.pull_request.number }}-JDK${{ matrix.java }}
|
||||
path: build/libs/parchment-paperclip-*-reobf.jar
|
||||
path: build/libs/parchment-paperclip-*.jar
|
||||
|
||||
2
.github/workflows/push-build.yml
vendored
2
.github/workflows/push-build.yml
vendored
@@ -47,4 +47,4 @@ jobs:
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Parchment-JDK${{ matrix.java }}
|
||||
path: build/libs/parchment-paperclip-*-reobf.jar
|
||||
path: build/libs/parchment-paperclip-*.jar
|
||||
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.7.1"
|
||||
id("io.papermc.paperweight.patcher") version "1.7.5"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -15,7 +15,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
group = gg.projecteden.parchment
|
||||
version = 1.20.6-R0.1-SNAPSHOT
|
||||
version = 1.21.3-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.20.6
|
||||
paperRef = 0ad09de75bfb1db2a84bb760cdee09b06d609bb3
|
||||
edenVersion = 2.2.8-SNAPSHOT
|
||||
mcVersion = 1.21.3
|
||||
paperRef = 9bc147178d62a722fb74b9157e9545a4aea72d4b
|
||||
edenVersion = 2.3.0-SNAPSHOT
|
||||
|
||||
updatingMinecraft=true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index fd39ed209b20c927054b8482c400beeeeab460a3..f7786d4034afae1926bb249e282f3f204e09ba1a 100644
|
||||
index e29e5024fa693baae469d47fe77b57118f14627c..7dab3328c111b9d4e06a37f25f03708870f4bab9 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -14,6 +14,9 @@ val bungeeCordChatVersion = "1.20-R0.2"
|
||||
@@ -18,8 +18,8 @@ index fd39ed209b20c927054b8482c400beeeeab460a3..f7786d4034afae1926bb249e282f3f20
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
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 {
|
||||
+ api("gg.projecteden:eden-interfaces:$edenVersion") // Parchment
|
||||
|
||||
@@ -8,118 +8,78 @@ 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.
|
||||
|
||||
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 7270c1feece2dc15a4a0503c4bca93a1288f8f13..a941a1e1a9e0c5047ad9f7976e65338ac3f87f68 100644
|
||||
index 741d0e73bc635a545c94c4b1254cee8f41ba8925..24dfa7fb8d9f86626f48fdc40775f5bb7f05f3f0 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
||||
@@ -12,7 +12,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.
|
||||
*/
|
||||
@NullMarked
|
||||
-public class BeaconEffectEvent extends BlockEvent implements Cancellable {
|
||||
+public class BeaconEffectEvent extends BlockEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
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 ae34e679723a2ef436da04c116038272743a8f35..420842d6882c37c64e0f2e9fd41ba9b289fe7690 100644
|
||||
index 34adc77de2d1f06b2b10cc26b60240c6a3ef259c..2e3dd13143e7af0b3aaa8307909fe14cee402eb3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
|
||||
@@ -37,7 +37,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Starts off cancelled if the player is wearing a pumpkin head or is not looking
|
||||
@@ -38,7 +38,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
* at the Enderman, according to Vanilla rules.
|
||||
*/
|
||||
@NullMarked
|
||||
-public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable {
|
||||
+public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
|
||||
|
||||
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
|
||||
index 3029e406cd684efb5645e38711dff9c0bb7b01e4..7ce5cdb02c2b8dc46d01892f495bf06e59d11641 100644
|
||||
index 1492d168aa1dc538b732b0ff262074cc7c9900e6..4ec22bb3dd6674a9d56173d9abb5762a4fcfe584 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
* Fired when a Turtle lays eggs
|
||||
*/
|
||||
@NullMarked
|
||||
-public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
|
||||
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
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 7a2fa4a11b47e4982d1644830d7e28f12b4378ec..0cb8e6b174ab62899068ab2a0fcc9e63834e6efd 100644
|
||||
index a84101fb1b478f3018f283bc47d3e73a7ae5bbc8..ea24db70e9b83b8fb626840a2c1387407ffdc256 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
* Fired when a Turtle starts digging to lay eggs
|
||||
*/
|
||||
@NullMarked
|
||||
-public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
|
||||
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
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 7c049bad187b94331f42f96833d1cf4ce03ef477..72c36b9ebd668750598a5bf1146fea8043126e05 100644
|
||||
index aea04fb357f5728195fd9c9bdcd6304a0b953c45..18c6e8b1865a958a10fc2ae4234979f1adfaedc3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
|
||||
@@ -21,7 +21,7 @@ import java.util.UUID;
|
||||
*
|
||||
@@ -21,7 +21,7 @@ import org.jspecify.annotations.Nullable;
|
||||
* <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, gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
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 3f73ec52f9b581001bef3a19a5f1533dfa474356..92a38938ab76d5ae873a1d82b8d53250912ced06 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.jetbrains.annotations.Nullable;
|
||||
* No guarantees are made about thread execution context for this event. If you need to know, check
|
||||
* {@link Event#isAsynchronous()}
|
||||
*/
|
||||
-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();
|
||||
|
||||
@@ -52,11 +52,26 @@ public class PreLookupProfileEvent extends Event {
|
||||
*
|
||||
* @return The UUID of the profile if it has already been provided by a plugin
|
||||
*/
|
||||
+ // Parchment start
|
||||
+ @Deprecated
|
||||
@Nullable
|
||||
public UUID getUUID() {
|
||||
return this.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.
|
||||
* <p>
|
||||
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 8965974988ad20fbe1d45885f20a3a98d2e9595f..a19e23e55737bdb7ee9909e02ca6414aaf66830f 100644
|
||||
index 0482ecf5b84ba8e0260679049f384f3449bbe7b5..b8ef784ec3b61d78ddb0f1aa6bb9712b4df9892d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
|
||||
@@ -53,7 +53,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* <p>
|
||||
@@ -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.
|
||||
*/
|
||||
@NullMarked
|
||||
-public class AsyncTabCompleteEvent extends Event implements Cancellable {
|
||||
+public class AsyncTabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
|
||||
|
||||
@@ -398,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
|
||||
index 3ddbc099a13df939b3912f30b54e7635840ba5a4..cf34f788b732037713d9a0ab29636de1820afd0a 100644
|
||||
index 2815c5802eb38e5a48f9db42b9247e24c27db134..df0a4c29e7fdb019907d47da09f0e1e2db4c9613 100644
|
||||
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
||||
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Should only be used for packet/clientside related stuff.
|
||||
@@ -16,7 +16,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
* Not intended for modifying server side state.
|
||||
*/
|
||||
@NullMarked
|
||||
-public class PlayerChunkLoadEvent extends ChunkEvent {
|
||||
+public class PlayerChunkLoadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
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 2cac7e27991c04a9ced261f2dd8ad8657ccddf6b..2dc9666fac98e3ff8b569f9510fa0db3ba0eb681 100644
|
||||
index 3ebb35b680193109cc751398675e935eed746750..6f162e907e31496ac8a1470d3fa3b844a7f4615a 100644
|
||||
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
||||
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Should only be used for packet/clientside related stuff.
|
||||
@@ -14,7 +14,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
* Not intended for modifying server side.
|
||||
*/
|
||||
@NullMarked
|
||||
-public class PlayerChunkUnloadEvent extends ChunkEvent {
|
||||
+public class PlayerChunkUnloadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index c6049747fc286acb4e8053901fcc517e5170afa2..5ab9b3e73c9cc6ee9cc4471a1f40c9c60a75b99c 100644
|
||||
index bdc065a486306236c7f0960718bea53bc0b0a9b6..c99fde4d0c8dc12a89015f4cccdccfe8e3dfb8f6 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -30,7 +30,7 @@ import org.bukkit.entity.Player;
|
||||
@@ -451,15 +411,15 @@ index c6049747fc286acb4e8053901fcc517e5170afa2..5ab9b3e73c9cc6ee9cc4471a1f40c9c6
|
||||
* 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
|
||||
index 30298a629b39bd43ce14b414fc697b2dfcbea89c..5f50d10c79990a96ae3f954fbff41b5b39a4d7b8 100644
|
||||
index a028f2fe541491729856051780b33dba07832fb6..5a6aa86fda316b8591fb1653a09d9e2ff729b33f 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -19,7 +19,14 @@ import org.jetbrains.annotations.Nullable;
|
||||
* player that is stored on the disk and can, thus, be retrieved without the
|
||||
* player needing to be online.
|
||||
*/
|
||||
-public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable {
|
||||
+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 { // Paper - Add Offline PDC API
|
||||
+public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
@@ -484,33 +444,34 @@ index fa98599e3eee37bf68f0e9813497c718f457485c..7af5afbef7b1559221ab6c28131ae698
|
||||
/**
|
||||
* Get whether this raid started.
|
||||
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
|
||||
+++ 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, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
+
|
||||
|
||||
private final Location block;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
index 8ba00f743b61cd33dd41ae7f1c272ee2b0c8546d..6e2d3f7e8e2f96016d28bb941f16706d228b542d 100644
|
||||
index 027a7d3b6feb52f6c3424edc0820d29fdaf6ebae..fe33bdfd98c3a96af766cbbe5a267f4710cbff52 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Concrete implementation of an attribute modifier.
|
||||
*/
|
||||
-public class AttributeModifier implements ConfigurationSerializable {
|
||||
+public class AttributeModifier implements ConfigurationSerializable, gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||
-public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
+public class AttributeModifier implements ConfigurationSerializable, Keyed, gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||
|
||||
private final UUID uuid;
|
||||
private final String name;
|
||||
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 NamespacedKey key;
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 8a842840e1a2652a6356d4a56e4749a5ba36e902..c5b6ec1c6dfa8789afcde1bf22b2507d20c0545f 100644
|
||||
index 0efd8bb70ebdb86372022c9e12ec89f229ab3b52..ec7bb05c4fc2f0f1eb42c77dbe5e3eb6c340bdef 100644
|
||||
--- a/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;
|
||||
@@ -523,7 +484,7 @@ index 8a842840e1a2652a6356d4a56e4749a5ba36e902..c5b6ec1c6dfa8789afcde1bf22b2507d
|
||||
/**
|
||||
* 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
|
||||
index 80e5d39afe8a6cf882b29c0da78450b958812137..e747f89e5129e360f9827886fcbfb238cf7e19c1 100644
|
||||
index 8c7c8c0e54682dc4276109d19d92394cdd4bc189..cbaf558b98f64922c5e15b1cb1f31068e8fdd501 100644
|
||||
--- a/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;
|
||||
@@ -549,20 +510,21 @@ index a39d2f1acbbd84ae0e2cf29f85594e09e55e9355..4348b8961afe7a57350856622aff8c98
|
||||
|
||||
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
|
||||
index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..8f4a293c131cb8b63c31b410ffa211bdb42b3338 100644
|
||||
index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..0cd8961afbe2e04132ec5d40dc9bbc6cab7a0f0f 100644
|
||||
--- a/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.Nullable;
|
||||
|
||||
-public interface AnimalTamer {
|
||||
+public interface AnimalTamer extends gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||
+
|
||||
|
||||
/**
|
||||
* 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
|
||||
index 62e3793903905b94eb1a120345015149abb33713..8f35e0c9e778d98ca191d45eec76a7a74d51959a 100644
|
||||
index d0ae8a94db20281d3664d74718c65234eb2e5f83..87cea10a668d3040906a4dd1fd135c2162d9617f 100644
|
||||
--- a/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;
|
||||
@@ -575,7 +537,7 @@ index 62e3793903905b94eb1a120345015149abb33713..8f35e0c9e778d98ca191d45eec76a7a7
|
||||
/**
|
||||
* 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
|
||||
index ee866f3497ed56708d4062685f5585ca06a03955..4c8f373cb946f4db769be566c163f27a9f4af61e 100644
|
||||
index 488604ba1a516b477693877c74712e4a45624a8b..7f9f8d8f95e58ca702ae7e5007c53c226890d662 100644
|
||||
--- a/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;
|
||||
@@ -596,10 +558,10 @@ index ee866f3497ed56708d4062685f5585ca06a03955..4c8f373cb946f4db769be566c163f27a
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 6c327a07bf8a6aa11a2d7dad12b2830acc539484..42e186ffdb421ccea61c4325f4b9800d55f624a8 100644
|
||||
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..aa21cd957cb0a4756cf0f27cef69fbd80e71c54e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -56,7 +56,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -58,7 +58,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
*/
|
||||
@@ -762,10 +724,10 @@ index 59aab10c2d27247eb77bd71d75b5f9126aa0fb12..57f89f569725289d56f1c75db258ac19
|
||||
/**
|
||||
* 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
|
||||
index 8506fa03293c575c35b55b052224807470fdbd98..2b5e481929c956bdfff5522b2c7ec3e71aa750f5 100644
|
||||
index e468e55d426b8f81f87c0a08451d02b3866c226f..74f0f439aa145d9c8d1c049aee387521f34a39e9 100644
|
||||
--- a/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}
|
||||
* is disabled as no block interaction will occur.
|
||||
*/
|
||||
@@ -788,15 +750,15 @@ index 71d664dd89995f088c47d17b38547d530319470c..d931ece8f35c8f01748c59d01617fd59
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
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
|
||||
index e4e3d2e22c28ef251d76c48ade267b4eb3749e7d..5128c4b618b4e369a8f9700169b187926ddde09e 100644
|
||||
index 8b2caf665b9e829ceefc89bf41b192f53f3d5773..dbf52ab6f97245d1d4b2325a3e05b5047a3e7e6f 100644
|
||||
--- a/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;
|
||||
/**
|
||||
* Called when an entity comes into contact with a portal
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Cancelling this event prevents any further processing of the portal for that tick.
|
||||
* @see io.papermc.paper.event.entity.EntityInsideBlockEvent
|
||||
*/
|
||||
-public class EntityPortalEnterEvent extends EntityEvent {
|
||||
+public class EntityPortalEnterEvent extends EntityEvent implements gg.projecteden.parchment.HasLocation { // Parchment
|
||||
-public class EntityPortalEnterEvent extends EntityEvent implements org.bukkit.event.Cancellable { // Paper
|
||||
+public class EntityPortalEnterEvent extends EntityEvent implements org.bukkit.event.Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final Location location;
|
||||
|
||||
@@ -853,10 +815,10 @@ index cc5781f276ec0a503b1bfef19d630c85db897c2a..89b38f2ce9a355f39abc657eff49c3a5
|
||||
private boolean cancelled;
|
||||
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
|
||||
index a965b6a78073c5da86ad671752eff4a270029420..84cc90c085ae5ab788bcbc83bf1a0081be3b8186 100644
|
||||
index 5ffd28fd24b4477a07fc9f6a3f669a6f4da9fa26..7611905895d414eeb45a92ed0e3b6124f3dd85cd 100644
|
||||
--- a/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.BlastFurnace}.
|
||||
*/
|
||||
@@ -957,12 +919,12 @@ index 128e43cf12205f82f2b119a773208502cdccfdd4..ca1fed3081e2b0a3271a2dfa0f49cce7
|
||||
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
|
||||
index b43c3cb5c88eada186d6f81712c244aaa18fb53e..a37055d864038a0090fa0c71f7d8e22aea69b3fe 100644
|
||||
index c71c122ccc4775d030688f7b8df0b4feb49136f4..107c38d38f47771111606c8788d637c565925b40 100644
|
||||
--- a/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;
|
||||
* advised to ensure the client does not have permission for the relevant
|
||||
* commands, or use {@link PlayerCommandSendEvent}.
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @apiNote Only called for bukkit API commands {@link org.bukkit.command.Command} and
|
||||
* {@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, gg.projecteden.parchment.OptionalLocation { // Parchment
|
||||
@@ -1009,20 +971,20 @@ index 0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3..469b9cc0c4b77844ba0317af51bd9ad8
|
||||
/**
|
||||
* 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
|
||||
index ac6c5c7a58c2c88b6cb0f6632fb53e8d67f8a059..464c69fd652db3384b1a4a5f4151933c3cd7df7b 100644
|
||||
index 5c258b6077277575daa5d96349837bdf06f42500..f8fd3590df19d4930f54c0456f9cb7bab636f227 100644
|
||||
--- a/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;
|
||||
* contracts of certain methods, there's no guarantee that the game will work
|
||||
* as it should.
|
||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Represents a view linking two inventories and a single player (whose
|
||||
* inventory may or may not be one of the two).
|
||||
*/
|
||||
-public abstract class InventoryView {
|
||||
+public abstract class InventoryView implements gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||
-public interface InventoryView {
|
||||
+public interface InventoryView extends gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||
public static final int OUTSIDE = -999;
|
||||
/**
|
||||
* 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
|
||||
index b35dba42069f771db8727bf98f9d17aff9d6094e..0b4a90259952185c0897d4c6b68124dd3d42db26 100644
|
||||
index 9c1ccaed727ec5e5dad93146bbfda798e3f536e7..b4dc13b03d8a33ac13e8af6677e1a8418edc8e20 100644
|
||||
--- a/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;
|
||||
@@ -1034,3 +996,27 @@ index b35dba42069f771db8727bf98f9d17aff9d6094e..0b4a90259952185c0897d4c6b68124dd
|
||||
|
||||
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>
|
||||
|
||||
@@ -81,10 +81,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..3f912d3fbf5fdef3b95f81585d2fcf76
|
||||
* 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
|
||||
index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909beaf941e8fa 100644
|
||||
index f8edb964c4af597b03a2de06c464cc06a96b791c..3957d290c606a50b59c7c421ea7c163f4625449c 100644
|
||||
--- a/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.
|
||||
*/
|
||||
@SerializableAs("Color")
|
||||
@@ -93,7 +93,7 @@ index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909bea
|
||||
private static final int BIT_MASK = 0xff;
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909bea
|
||||
* 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
|
||||
index bd213cabddd8752e609544f24cfba95405726155..7e89cadecde96f9c2394446669dc4d98df391940 100644
|
||||
index 47df858e095c4423c20e49e029d72f0f50d2c924..c7504e017bc57df6903a2d76ce98e9fd4c35a7cc 100644
|
||||
--- a/src/main/java/org/bukkit/DyeColor.java
|
||||
+++ b/src/main/java/org/bukkit/DyeColor.java
|
||||
@@ -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
|
||||
index 0857a65ecbc36e0e4b8a7d0cda52be35f238f660..1a3151814ef669db1c8530c7afaa810be99ca267 100644
|
||||
index a491dc40093e19b8d1900443ad613223fd7f3119..fa22e21eb7299f601649af515b9e554e050b1ae1 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -282,4 +282,19 @@ public interface UnsafeValues {
|
||||
// Paper end - lifecycle event API
|
||||
|
||||
@@ -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
|
||||
|
||||
ItemStack createEmptyStack(); // Paper - proxy ItemStack
|
||||
+
|
||||
+ // Parchment start
|
||||
+ /**
|
||||
@@ -25,6 +25,5 @@ index 0857a65ecbc36e0e4b8a7d0cda52be35f238f660..1a3151814ef669db1c8530c7afaa810b
|
||||
+ */
|
||||
+ 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
|
||||
+
|
||||
+
|
||||
}
|
||||
|
||||
@@ -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
|
||||
index c8595ffcfcbdd79794d464415287d46acef72b72..e018920520c8d747fb10e8365d4dd0326b04c50c 100644
|
||||
index f55638eb8b315864052f9fe17ab4846e5e9d8dbb..ac7bd2a77f387e72f8862e8ea5af52f39d90265a 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2229,6 +2229,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2255,6 +2255,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
UnsafeValues getUnsafe();
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..ea17d99c7a1d70d88e2c439399cdb376
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 97f97ea5c6aa513c439f86a9c82821e0f7d9cd1e..64c1287b7a668680e19f8c4c1a678abb0eb5d88e 100644
|
||||
index 7a439c99fc4c5ee17d674460c8e58a9fe0c64e02..3cddbea3553ea12b610ffb1c9ab13d6ab4c291ee 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -52,6 +52,36 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -101,6 +101,6 @@ index 97f97ea5c6aa513c439f86a9c82821e0f7d9cd1e..64c1287b7a668680e19f8c4c1a678abb
|
||||
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType);
|
||||
+ // 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.
|
||||
+ */
|
||||
+ public boolean canTick();
|
||||
+ default boolean canTick() { return true; }
|
||||
+
|
||||
+ /**
|
||||
+ * 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.
|
||||
+ */
|
||||
+ public void setCanTick(boolean tick);
|
||||
+ default void setCanTick(boolean tick) { throw new UnsupportedOperationException(); }
|
||||
+ // Parchment end
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index 42e186ffdb421ccea61c4325f4b9800d55f624a8..8b2380241dbf40bd03941250a66e0a7b4a2282ec 100644
|
||||
index aa21cd957cb0a4756cf0f27cef69fbd80e71c54e..d8014eea4f4415602db7e1199a2d9ce059adefaa 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2092,6 +2092,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2137,6 +2137,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
|
||||
@@ -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
|
||||
index 8b2380241dbf40bd03941250a66e0a7b4a2282ec..d86f8f80e0873dccd24b186d4860d1e5dbe2f450 100644
|
||||
index d8014eea4f4415602db7e1199a2d9ce059adefaa..b68feadfb631672b4b99b464fb1b6aae6e82507f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -66,6 +66,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -68,6 +68,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
@Override
|
||||
@NotNull Player getPlayer();
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index 1d1315262737d99bf9f5aabc0ae66eee4645cc65..825ad446bcee169c4735955d226dae18b512d7e3 100644
|
||||
index c1aa59bab82aee8fd42f7149c520b45660b29082..6e1b2721b1ff69239ce6cf726c50974e76c78f1f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -317,6 +317,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
|
||||
/**
|
||||
* An unknown entity without an Entity Class
|
||||
*/
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Revert BungeeChat Deprecation
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f7786d4034afae1926bb249e282f3f204e09ba1a..f689a22e535bb007089b981fe803f1a6af4911c2 100644
|
||||
index 7dab3328c111b9d4e06a37f25f03708870f4bab9..eefb9b19fb76689a5e7ba86a17ef7117ad67789b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -36,7 +36,7 @@ dependencies {
|
||||
@@ -48,7 +48,7 @@ dependencies {
|
||||
api("com.google.guava:guava:32.1.2-jre")
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
// Paper start - adventure
|
||||
@@ -17,7 +17,7 @@ index f7786d4034afae1926bb249e282f3f204e09ba1a..f689a22e535bb007089b981fe803f1a6
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
// Paper - adventure
|
||||
@@ -154,7 +154,7 @@ tasks.withType<Javadoc> {
|
||||
@@ -172,7 +172,7 @@ tasks.withType<Javadoc> {
|
||||
"https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||
"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
|
||||
@@ -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
|
||||
index 0015bb89899e52d3c8f1ca68807ad7092e690305..2c384d6c1719a3b2b1335a3f2b7e826c1892bd69 100644
|
||||
index ec7bb05c4fc2f0f1eb42c77dbe5e3eb6c340bdef..3d07006fbab3f075aa72114773ad8e76686b0ad2 100644
|
||||
--- a/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);
|
||||
|
||||
@@ -6,7 +6,7 @@ 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
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ae798a18bb07d83bfd3acefc222a48e29f9a3ec3
|
||||
index 0000000000000000000000000000000000000000..f99a67efe3582038fc5500c017a1c1371022985b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/projecteden/parchment/event/block/CustomBlockUpdateEvent.java
|
||||
@@ -0,0 +1,70 @@
|
||||
@@ -260,13 +260,13 @@ index 0000000000000000000000000000000000000000..c9f9c0d235f33925ee247ba4af56bf9f
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 8f35e0c9e778d98ca191d45eec76a7a74d51959a..f865c4dbdf29e3cd718de7a325d478252895d940 100644
|
||||
index 87cea10a668d3040906a4dd1fd135c2162d9617f..b8bdac918e8a49bef2bf09312eb6d71d373eb517 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1155,4 +1155,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -1172,4 +1172,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull String getScoreboardEntryName();
|
||||
// Paper end - entity scoreboard name
|
||||
void broadcastHurtAnimation(@NotNull java.util.Collection<Player> players);
|
||||
// Paper end - broadcast hurt animation
|
||||
+
|
||||
+ gg.projecteden.parchment.entity.EntityData getStoredEntityData();
|
||||
+
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..34f1acc44c17b53d93b750a35817131145db454f 100644
|
||||
index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..256c09e98005cc64e2bc739ce6e880954664d693 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,6 +1,8 @@
|
||||
@@ -17,8 +17,8 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..34f1acc44c17b53d93b750a358171311
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
@@ -13,7 +15,9 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
@@ -25,7 +27,9 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":paper-api"))
|
||||
@@ -26,9 +26,9 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..34f1acc44c17b53d93b750a358171311
|
||||
+ implementation(project(":parchment-api"))
|
||||
+ // Parchment end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -80,14 +84,14 @@ tasks.jar {
|
||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||
@@ -99,14 +103,14 @@ tasks.jar {
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
@@ -48,7 +48,7 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..34f1acc44c17b53d93b750a358171311
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to Instant.now().toString(),
|
||||
"Git-Branch" to gitBranch, // Paper
|
||||
@@ -108,6 +112,27 @@ tasks.compileTestJava {
|
||||
@@ -127,6 +131,27 @@ tasks.compileTestJava {
|
||||
|
||||
publishing {
|
||||
publications.create<MavenPublication>("maven") {
|
||||
@@ -76,7 +76,7 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..34f1acc44c17b53d93b750a358171311
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +169,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -172,7 +197,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
@@ -112,10 +112,10 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..87db580c74d20714e2ebe01df23811c7
|
||||
final @Nullable Component history = this.getHistory();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index e02102280ed1dc300191d19bbca8f00e17701753..9b5d9729288ac11d21365c900a3b2af454c765dc 100644
|
||||
index be0d38544395a9b3befb898bb961f34e32fe9509..693a7a0104e8da6c775a1fc718ac0b577a5ce89e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -303,7 +303,7 @@ public class Main {
|
||||
@@ -267,7 +267,7 @@ public class Main {
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
// Paper start - This is some stupid bullshit
|
||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||
@@ -138,10 +138,10 @@ index 774556a62eb240da42e84db4502e2ed43495be17..6f1b3fa6ebeabc7596034663ed06686f
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 6db566e3111ec08a99aa429624979cb83a85e272..d3a5867e9202d1f34e66c4e6d3842211c40a6255 100644
|
||||
index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..ec8552ed502b6628ea723f5667097f01fddbc5e5 100644
|
||||
--- a/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, "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" );
|
||||
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index d7bbf60ba94ecd85f991a0c5c70c34fdb00ec9d5..724adc4c35aece988af815e7886fcbd727f0e27e 100644
|
||||
index e91c4e26c25980645941ca8fbdcc3a9d02e31063..a73a9d04dfff9d12d3e5425c867f32331a6b5996 100644
|
||||
--- a/src/main/java/net/minecraft/core/Holder.java
|
||||
+++ b/src/main/java/net/minecraft/core/Holder.java
|
||||
@@ -137,6 +137,12 @@ public interface Holder<T> {
|
||||
@@ -138,6 +138,12 @@ public interface Holder<T> {
|
||||
return new Holder.Reference<>(Holder.Reference.Type.INTRUSIVE, owner, null, value);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ index d7bbf60ba94ecd85f991a0c5c70c34fdb00ec9d5..724adc4c35aece988af815e7886fcbd7
|
||||
if (this.key == null) {
|
||||
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
|
||||
index 96fb69ec6db2e7c8c728435f0c537b076259b2fb..45a5f63268ebd67d6601e86e33f9fa5fd458ad0c 100644
|
||||
index c816c935ecc74a811ffdffbe6ded73c06e92324a..ac457cd1479c219e1975d475a3e6bce17ae6e567 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -183,7 +183,7 @@ public class BlockItem extends Item {
|
||||
@@ -177,7 +177,7 @@ public class BlockItem extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
index badd85a92f38caae257181f67a322fc79599d1ce..4fc829f26512159f430ea26af462bbad0d602149 100644
|
||||
index f466bfdf5557c94ebee3ad609d9b6f18f86aefef..687907f2ad51dceb523994adabcf8025960aa336 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -363,6 +363,40 @@ public final class PaperAdventure {
|
||||
@@ -390,6 +390,36 @@ public final class PaperAdventure {
|
||||
return asVanilla(source);
|
||||
}
|
||||
|
||||
@@ -67,27 +67,23 @@ index badd85a92f38caae257181f67a322fc79599d1ce..4fc829f26512159f430ea26af462bbad
|
||||
+ }
|
||||
+
|
||||
+ 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) {
|
||||
+ 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
|
||||
+
|
||||
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 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
|
||||
index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..c3891adadf9b49c8b17ec387bb63713285621b76 100644
|
||||
index 957cae6ddeba9efe3b55588567ae51e8b86b6a42..f6753ed14350b1c2dd7c69e2aed8657295863547 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1813,12 +1813,46 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1693,12 +1693,46 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
@Override
|
||||
public void playSeededSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
@@ -98,7 +94,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..c3891adadf9b49c8b17ec387bb637132
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||
+ 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))
|
||||
+ .volume(volume)
|
||||
@@ -121,7 +117,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..c3891adadf9b49c8b17ec387bb637132
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||
+ 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))
|
||||
+ .volume(volume)
|
||||
@@ -137,10 +133,10 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..c3891adadf9b49c8b17ec387bb637132
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index a645ad66af061966c5e47cae677026b35a55c486..b1e1717b3b63b9c554c7925ed63ed217bff7e792 100644
|
||||
index 2e8ecf3bbb9f9ceba6f896738fa1ab8e2bd0fed6..94de83a35998c82b807c6e5836d957f317dd2ceb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2528,7 +2528,20 @@ public class ServerPlayer extends Player {
|
||||
@@ -2805,7 +2805,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
|
||||
@Override
|
||||
public void playNotifySound(SoundEvent sound, SoundSource category, float volume, float pitch) {
|
||||
@@ -149,7 +145,7 @@ index a645ad66af061966c5e47cae677026b35a55c486..b1e1717b3b63b9c554c7925ed63ed217
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.getLocation()))
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.location()))
|
||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||
+ .volume(volume)
|
||||
+ .pitch(pitch)
|
||||
@@ -163,32 +159,37 @@ index a645ad66af061966c5e47cae677026b35a55c486..b1e1717b3b63b9c554c7925ed63ed217
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a2142930b4d4b05987c90496fb9d733d99040aa0..ca96202a50f36dfc870e418c7816bc871f098eab 100644
|
||||
index 30de3d1a7792c38ae946f19cb0e14637919b5001..ef10ed017ad5d06c3f34f1287a8721a33fc61ce1 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -967,7 +967,7 @@ public abstract class PlayerList {
|
||||
BlockState data = worldserver1.getBlockState(blockposition);
|
||||
worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3);
|
||||
@@ -876,6 +876,9 @@ public abstract class PlayerList {
|
||||
isBedSpawn = true;
|
||||
}
|
||||
- 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
|
||||
// Paper end - Fix SPIGOT-5989
|
||||
+ // Paper end - Fix SPIGOT-5989
|
||||
+
|
||||
}
|
||||
// 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
|
||||
index 686374e89e41b0917791264f3281f7384835bca8..75995354090771370ba6b4aa8f4ded28186583e8 100644
|
||||
index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..6b73ca4ca59e3080926155613ce10af82cd43615 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1882,7 +1882,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) {
|
||||
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) {
|
||||
- ((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()));
|
||||
- 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 serverPlayer) {
|
||||
- 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
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
+ 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))
|
||||
+ .volume(volume)
|
||||
+ .pitch(pitch)
|
||||
@@ -203,10 +204,10 @@ index 686374e89e41b0917791264f3281f7384835bca8..75995354090771370ba6b4aa8f4ded28
|
||||
}
|
||||
// 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
|
||||
index fdff9788eaf663be79214b2ca491f0f0444f6136..4b26f4a4620bacd40efe22b685f48fdda1012e8a 100644
|
||||
index 11cf2d9def087b0898c828eaa21eb5f7b8811d5f..7c1332f6c2fbe615e2831911b6548310532b022e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -564,7 +564,7 @@ public class Raid {
|
||||
@@ -552,7 +552,7 @@ public class Raid {
|
||||
double d2 = vec3d.z + 13.0D / d0 * (vec3d1.z - vec3d.z);
|
||||
|
||||
if (d0 <= 64.0D || collection.contains(entityplayer)) {
|
||||
@@ -216,10 +217,10 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..4b26f4a4620bacd40efe22b685f48fdd
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 34b91eff3190848bae38b20e1d956ece497b1473..75a3d42d0ac458e1f7161e88cf27ec6087828926 100644
|
||||
index e37aaf77f94b97b736cc20ef070cefdff0400188..c01ea04bc72ea7342722a463a384b1cc664c7afb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2182,4 +2182,42 @@ public class CraftEventFactory {
|
||||
@@ -2271,4 +2271,42 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
// Paper end - add EntityFertilizeEggEvent
|
||||
@@ -235,7 +236,7 @@ index 34b91eff3190848bae38b20e1d956ece497b1473..75a3d42d0ac458e1f7161e88cf27ec60
|
||||
+ 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.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)
|
||||
+ 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) {
|
||||
|
||||
@@ -5,13 +5,13 @@ 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
|
||||
index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601c227fbe8 100644
|
||||
index 9117c035d5a6ff114b028fad3380ceb1fc2b9691..c490b30531bf722b31db88aa4937d3fd777c2844 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -65,7 +65,33 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -64,7 +64,33 @@ public class RespawnAnchorBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||
+ 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);
|
||||
@@ -28,7 +28,7 @@ index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601
|
||||
+ } else if (!world.isClientSide) {
|
||||
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.SET_SPAWN;
|
||||
+ } else {
|
||||
+ return ItemInteractionResult.SUCCESS;
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ if (bukkitPlayer != null) {
|
||||
+ gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent event = new gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent(bukkitPlayer, block, result);
|
||||
@@ -36,9 +36,9 @@ index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601
|
||||
+ result = event.getResult();
|
||||
+ }
|
||||
+ if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.NOTHING) {
|
||||
+ return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
|
||||
+ return InteractionResult.PASS;
|
||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) {
|
||||
+ // Parchment end
|
||||
RespawnAnchorBlock.charge(player, world, pos, state);
|
||||
stack.consume(1, player);
|
||||
return ItemInteractionResult.sidedSuccess(world.isClientSide);
|
||||
return InteractionResult.SUCCESS;
|
||||
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index 75a3d42d0ac458e1f7161e88cf27ec6087828926..ca52d30944a067bb156cae6290663ab20cb160e9 100644
|
||||
index 33daeb74cdf11c5b920e02b191eb62d5d0937f8e..8f438df5d9112460e5b1664a56688bb1c6ddc6fa 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1188,7 +1188,7 @@ public class CraftEventFactory {
|
||||
@@ -1198,7 +1198,7 @@ public class CraftEventFactory {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -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
|
||||
index 5a382907285a288f2a223189e690d3dbdf45594c..fab345b24eebeac1935bff9f0ece4334748d1b17 100644
|
||||
index 507f908916cbeb592496f963b46e4c2121a7b5e3..356999f8359838f248ad0e673fef23a82a0560c8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -693,6 +693,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -702,6 +702,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
// Paper end - lifecycle event API
|
||||
// Paper end - proxy ItemStack
|
||||
|
||||
+ // Parchment start
|
||||
+ @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
|
||||
index 75995354090771370ba6b4aa8f4ded28186583e8..38388feb2a578d71568fbe17799c4f9a0d5f2c2c 100644
|
||||
index 6b73ca4ca59e3080926155613ce10af82cd43615..09ed0bd5f012ae2e34d5ed58828475577b6ab6f8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1541,6 +1541,12 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1523,6 +1523,12 @@ public abstract class Player extends LivingEntity {
|
||||
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
|
||||
index 2fa5507aa2153a05208077f9547c165a1099b5bb..50f91ac8303dd33f3b493c85cb713dba1b89d294 100644
|
||||
index cac8592e3a2f438fe9ca167a4fdcd65152bbb2de..b85d19598c09a14e68fced841de2148bf6f469e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -3264,4 +3264,16 @@ public final class CraftServer implements Server {
|
||||
return this.potionBrewer;
|
||||
@@ -3258,4 +3258,18 @@ public final class CraftServer implements Server {
|
||||
this.console.addPluginAllowingSleep(plugin.getName(), value);
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - API to check if the server is sleeping
|
||||
+
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
@@ -24,4 +25,5 @@ index 2fa5507aa2153a05208077f9547c165a1099b5bb..50f91ac8303dd33f3b493c85cb713dba
|
||||
+ return io.papermc.paper.util.MCUtil.MAIN_EXECUTOR;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ to easily get the items being dropped by any
|
||||
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
|
||||
index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..46330f02d04f9e8a921ddf14bb34e94392c17431 100644
|
||||
index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..43c288a4e226060a5e0cecddd941846d29ae8025 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -301,7 +301,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) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -20,7 +20,7 @@ index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..46330f02d04f9e8a921ddf14bb34e943
|
||||
Block.popResource(world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -311,7 +311,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) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -29,7 +29,7 @@ index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..46330f02d04f9e8a921ddf14bb34e943
|
||||
Block.popResource((ServerLevel) world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -347,7 +347,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) {
|
||||
// Paper end - Properly handle xp dropping
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -39,10 +39,10 @@ index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..46330f02d04f9e8a921ddf14bb34e943
|
||||
});
|
||||
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
|
||||
index ca52d30944a067bb156cae6290663ab20cb160e9..bbd231e085b3d14693a56c4b2abf393f86ff0683 100644
|
||||
index 0af82fae494762fec22afbb2363d24370dbdb71b..f29ddf243147a866b2b17f41556ff3d817aedf2e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2219,5 +2219,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
|
||||
index f2b20ed5063a293f0b464548f590d652170cd1d8..b6c14eaeb9e1c0f186e0ec15b76e6ba8814287d3 100644
|
||||
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..77c914fb58403f4b6c2d145664740d1fb59bb261 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2561,4 +2561,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2510,4 +2510,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return this.adventure$pointers;
|
||||
}
|
||||
// Paper end
|
||||
@@ -226,7 +226,11 @@ index f2b20ed5063a293f0b464548f590d652170cd1d8..b6c14eaeb9e1c0f186e0ec15b76e6ba8
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ 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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
index c3891adadf9b49c8b17ec387bb63713285621b76..05ffad3a3bf6eeb720db239238b2d3189585cce9 100644
|
||||
index f6753ed14350b1c2dd7c69e2aed8657295863547..1d614e2e4274ac24abd74dfb10c52d6624e0a9de 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1178,7 +1178,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1068,7 +1068,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
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
|
||||
index efc91ff91827872c62b8bd060282549ccdcf67dd..2555be33b41c7011c9acceb5ac777e7ab6752c10 100644
|
||||
index b1c917d65076a3805e5b78cb946753f0c101e214..7034391701ce34119c6cfc22a8dd2dec6293f63d 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -288,6 +288,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -317,6 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public boolean disablePlayerCrits = false;
|
||||
+ public boolean tickTimeSinceSleep = true; // Parchment
|
||||
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
|
||||
index 38388feb2a578d71568fbe17799c4f9a0d5f2c2c..a11c18605c0fbaead1163466a38089265a5ac5a8 100644
|
||||
index 09ed0bd5f012ae2e34d5ed58828475577b6ab6f8..e280cd56a4dc446edab97e6c48397e03edb2ca1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -302,7 +302,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -304,7 +304,7 @@ public abstract class Player extends LivingEntity {
|
||||
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
|
||||
index bf2d91bbb4bf401696f5f5d14a67e3920a179084..47a38704eba3ce3da1bf0d5dc18856f2c02c3ea8 100644
|
||||
index 799b1fc67bd16029ea26c480e21f5f51877343ab..da1ec6e15fe9525e50f2389eeea6719eb8d8882f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -43,6 +43,7 @@ public abstract class HangingEntity extends Entity {
|
||||
private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper - Perf: offset item frame ticking
|
||||
public BlockPos pos;
|
||||
protected Direction direction;
|
||||
@@ -21,7 +21,11 @@ import org.apache.commons.lang3.Validate;
|
||||
|
||||
public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
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
|
||||
|
||||
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -118,7 +119,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
|
||||
public void tick() {
|
||||
- if (!this.level().isClientSide) {
|
||||
+ public void tick() {
|
||||
+ if (tick && !this.level().isClientSide) { // Parchment
|
||||
this.checkBelowWorld();
|
||||
if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
|
||||
this.checkInterval = 0;
|
||||
+ this.checkBelowWorld();
|
||||
+ if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot
|
||||
+ 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
|
||||
index cbdcf767c01e2c173913f56747d2dacbda2f0094..a74f783df0225223a2b2ae3dc632541ccf078893 100644
|
||||
index f1e3f2b89bcd969f3c80548e165881a9b290eb53..f2d46e908ca0030da514a686763e65a57f02cf35 100644
|
||||
--- a/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() {
|
||||
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
|
||||
index 7e6116963d835d4606ef3d93b69d3e44b61288e1..1da9415f141aabe8df5b82392c142c1f3fd960fb 100644
|
||||
index d0010dfd22463986bf3be9b3ee015ce92735753e..17b353b44fb15726203ecf643961a8242f2a9372 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2145,6 +2145,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));
|
||||
}
|
||||
// Paper start
|
||||
|
||||
@@ -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 7620c72a4c243cbeea245203ce03a97cbfa7d922..37da50840a55e9df555aaf3aceb21661e472bcff 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -348,6 +348,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
|
||||
index 1da9415f141aabe8df5b82392c142c1f3fd960fb..f8aaccfebf81debf807eb74fb7accaa86d5f1a9e 100644
|
||||
index 17b353b44fb15726203ecf643961a8242f2a9372..b137889665a2e678951c631053d0f8cecd2adc95 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -211,6 +211,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 long lastSaveTime; // Paper - getLastPlayed replacement API
|
||||
|
||||
@@ -17,10 +17,10 @@ index 1da9415f141aabe8df5b82392c142c1f3fd960fb..f8aaccfebf81debf807eb74fb7accaa8
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
|
||||
@@ -3530,4 +3532,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setSendViewDistance(final int viewDistance) {
|
||||
this.getHandle().setSendViewDistance(viewDistance);
|
||||
@@ -3589,4 +3591,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData()));
|
||||
}
|
||||
// Paper end - entity effect API
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
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,50 +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 b9b3277c8ed94e0cd30b20b9c00a33eaad48e5ac..c68329a2668220b0884eafd88440f3aaffd9e0fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -787,9 +787,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.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 - configurable tab spam limits
|
||||
- this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause
|
||||
- return;
|
||||
+ 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 - configurable tab spam limits
|
||||
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - AsyncTabCompleteEvent & kick event cause
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
// CraftBukkit end
|
||||
// Paper start - Don't suggest if tab-complete is disabled
|
||||
@@ -2512,6 +2514,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 )
|
||||
@@ -3273,10 +3276,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||
// Paper start - auto recipe limit
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
- 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"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
- return;
|
||||
- }
|
||||
+ 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"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
+ return;
|
||||
+ }
|
||||
+ } // Parchment - spam bypass
|
||||
}
|
||||
// Paper end - auto recipe limit
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index b1e1717b3b63b9c554c7925ed63ed217bff7e792..606384fa11d6aab9384278e89481cd7e07cdb945 100644
|
||||
index 94de83a35998c82b807c6e5836d957f317dd2ceb..64752d1c129b85f7a700c91e43741ac4d9bedd22 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2492,9 +2492,10 @@ public class ServerPlayer extends Player {
|
||||
@@ -2769,9 +2769,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
forced = event.isForced();
|
||||
// Paper end - Add PlayerSetSpawnEvent
|
||||
|
||||
@@ -5,16 +5,17 @@ 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
|
||||
index 56524cbe4303901007e1e7fb3703a19efbf79ae7..e13e1da7fc814e83bed1f0f32cd5d115c1c3b710 100644
|
||||
index 85950a1aa732ab8c01ad28bec9e0de140e1a172e..e8186e9569c57bc68ac20f6fac0c90001986b5e6 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||
@@ -87,17 +87,20 @@ public final class FixLightCommand implements PaperSubcommand {
|
||||
lightengine.relight(chunks,
|
||||
@@ -95,16 +95,22 @@ public final class FixLightCommand implements PaperSubcommand {
|
||||
((StarLightLightingProvider)lightengine).starlight$serverRelightChunks(chunks,
|
||||
(final ChunkPos chunkPos) -> {
|
||||
++relitChunks[0];
|
||||
- sender.getBukkitEntity().sendMessage(text().color(DARK_AQUA).append(
|
||||
- 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(
|
||||
+ text("Relighting Chunks: ", DARK_AQUA), text(chunkPos.toString()),
|
||||
+ text(" " + relitChunks[0], net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
||||
@@ -25,10 +26,11 @@ index 56524cbe4303901007e1e7fb3703a19efbf79ae7..e13e1da7fc814e83bed1f0f32cd5d115
|
||||
},
|
||||
(final int totalRelit) -> {
|
||||
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(
|
||||
- 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, net.kyori.adventure.text.format.NamedTextColor.YELLOW),
|
||||
+ text(" chunks. Took ", DARK_AQUA), text(diff + "ms", net.kyori.adventure.text.format.NamedTextColor.YELLOW)
|
||||
));
|
||||
@@ -5,56 +5,59 @@ 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 0c5fe46d2da113beff3e220843593d616e37d4ca..7a57f18eeb052a451c54f232f012a8cffa4803f4 100644
|
||||
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
|
||||
@@ -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)));
|
||||
@@ -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(), itemstack.asBukkitCopy());
|
||||
+ 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
|
||||
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);
|
||||
@@ -221,7 +226,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
}
|
||||
|
||||
- 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()) {
|
||||
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 a7964208c952cb4e34916ae6523850fc3921b07e..776bfaf8bc5f3d7afe8c2e2cdafe734eb32aac82 100644
|
||||
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
|
||||
@@ -176,13 +176,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());
|
||||
@@ -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
|
||||
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);
|
||||
@@ -192,7 +196,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
}
|
||||
|
||||
- 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 - EntityShootBowEvent
|
||||
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()) {
|
||||
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 31b8a8bf78d52b5f11b68e780ec09bf78e7bda84..d296e1ce4798bd223a98bbc5693f29713a1fde7e 100644
|
||||
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
|
||||
@@ -143,8 +143,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -164,8 +164,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,10 +71,10 @@ index 31b8a8bf78d52b5f11b68e780ec09bf78e7bda84..d296e1ce4798bd223a98bbc5693f2971
|
||||
}
|
||||
|
||||
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 74c596264d4da551437bd2a23e1c70022cfc73fc..968bfd2004ec8bd2243f886ffee660f235e80241 100644
|
||||
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
|
||||
@@ -175,9 +175,17 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -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) {
|
||||
@@ -88,10 +91,10 @@ index 74c596264d4da551437bd2a23e1c70022cfc73fc..968bfd2004ec8bd2243f886ffee660f2
|
||||
+ if (relative) { // Parchment
|
||||
+ this.setDeltaMovement(vec3d);
|
||||
+ } // Parchment
|
||||
this.hasImpulse = true;
|
||||
double d3 = vec3d.horizontalDistance();
|
||||
|
||||
this.setYRot((float) (Mth.atan2(vec3d.x, vec3d.z) * 57.2957763671875D));
|
||||
@@ -187,6 +195,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -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) {
|
||||
@@ -104,35 +107,73 @@ index 74c596264d4da551437bd2a23e1c70022cfc73fc..968bfd2004ec8bd2243f886ffee660f2
|
||||
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);
|
||||
@@ -194,7 +208,9 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -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.getDeltaMovement();
|
||||
|
||||
- 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
|
||||
+ 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
|
||||
+ }
|
||||
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 {
|
||||
}
|
||||
|
||||
// CraftBukkit start - call projectile hit event
|
||||
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 5ca843df5b4caa668953e5e36a9b20fabeb35046..68012cc58dc794afae8b74b7d81eab0080929707 100644
|
||||
index bb593209c95c9cf1f9c5d52d52fab4a33ddbabcf..768964dbc785cb78d5ef517cf88f9f8b1f6af629 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
@@ -31,7 +31,11 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
if (!((double)f < 0.1)) {
|
||||
@@ -37,8 +37,13 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
return false;
|
||||
} else {
|
||||
List<ItemStack> list = draw(stack, itemStack, player);
|
||||
if (!world.isClientSide() && !list.isEmpty()) {
|
||||
- this.shoot(world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null);
|
||||
- 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;
|
||||
+ if (!preEvent.callEvent()) return false;
|
||||
+ // Parchment end
|
||||
+ this.shoot(world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null, preEvent.isRelative());
|
||||
+ this.shoot((ServerLevel) world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null, preEvent.isRelative());
|
||||
}
|
||||
|
||||
world.playSound(
|
||||
@@ -52,9 +56,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
@@ -60,9 +65,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -145,10 +186,10 @@ index 5ca843df5b4caa668953e5e36a9b20fabeb35046..68012cc58dc794afae8b74b7d81eab00
|
||||
|
||||
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 1f52feb5684ee1bab710e1557cf69b43b4d4dfd4..b4633be6d59f5b05d0b59e2aff2d8452ffd29736 100644
|
||||
index 52c40eafc77e50a6fd21b9a7a250cea501f11690..2eca32e58e41f15cd9453e936d19c26a1a4b588c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
@@ -124,7 +124,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -140,7 +140,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -157,9 +198,9 @@ index 1f52feb5684ee1bab710e1557cf69b43b4d4dfd4..b4633be6d59f5b05d0b59e2aff2d8452
|
||||
) {
|
||||
Vector3f vector3f;
|
||||
if (target != null) {
|
||||
@@ -186,8 +186,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -201,8 +201,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
) {
|
||||
if (!world.isClientSide()) {
|
||||
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());
|
||||
@@ -168,34 +209,36 @@ index 1f52feb5684ee1bab710e1557cf69b43b4d4dfd4..b4633be6d59f5b05d0b59e2aff2d8452
|
||||
+ // Parchment end
|
||||
+
|
||||
if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) {
|
||||
- this.shoot(world, shooter, hand, stack, chargedProjectiles.getItems(), speed, divergence, shooter instanceof Player, livingEntity);
|
||||
+ this.shoot(world, shooter, hand, stack, chargedProjectiles.getItems(), speed, divergence, shooter instanceof Player, livingEntity, preEvent.isRelative());
|
||||
- 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 d27e83c08c45b8514207f26e48ceb1a91ded94be..9d4460201093fa34a37c118c9a38dcd596448265 100644
|
||||
index 78ba170a83f8c026bd110eae494c52577182ed61..5ece12e41233727fbd1106d067e607810341acab 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
@@ -46,7 +46,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
@@ -41,7 +41,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
|
||||
public abstract int getDefaultProjectileRange();
|
||||
|
||||
- protected void shoot(Level world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target) {
|
||||
+ protected void shoot(Level world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target, boolean relative) {
|
||||
float f2 = 10.0F;
|
||||
float f3 = projectiles.size() == 1 ? 0.0F : 20.0F / (float) (projectiles.size() - 1);
|
||||
- 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;
|
||||
@@ -62,7 +62,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
// itemstack.hurtAndBreak(this.getDurabilityUse(itemstack1), entityliving, EntityLiving.getSlotForHand(enumhand)); // CraftBukkit - moved down
|
||||
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);
|
||||
@@ -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()) {
|
||||
@@ -90,7 +90,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
event.getProjectile().remove();
|
||||
@@ -86,7 +87,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
index ef0f118aecf0893e45cb9423a677d7e42496324b..ac75ec5d0d0e9ec36030859d78082e0fa48a9b70 100644
|
||||
index f36a075dbee2b96d01899e02460b1d8443e91749..6782f6184dedd38dfefefd48a6399cd141b00711 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -4117,7 +4117,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 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
||||
|
||||
@@ -16,4 +16,4 @@ index ef0f118aecf0893e45cb9423a677d7e42496324b..ac75ec5d0d0e9ec36030859d78082e0f
|
||||
+ 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;
|
||||
EntityHitResult result = null;
|
||||
net.minecraft.world.phys.EntityHitResult result = null;
|
||||
@@ -5,10 +5,10 @@ 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
|
||||
index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c175eca74 100644
|
||||
index 6582db84c5307257f16c321453491cf24e40c9c7..eb54895ed35eb623bf93d375ff2d01a49fc2824c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -66,12 +66,14 @@ public class NoteBlock extends Block {
|
||||
@@ -68,12 +68,14 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@@ -18,23 +18,23 @@ index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ 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, world.getMinecraftWorld())).callEvent()) return state;
|
||||
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.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
|
||||
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
||||
|
||||
@@ -80,6 +82,7 @@ public class NoteBlock extends Block {
|
||||
@@ -82,6 +84,7 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected 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()), 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
|
||||
boolean flag1 = world.hasNeighborSignal(pos);
|
||||
|
||||
@@ -119,7 +122,8 @@ public class NoteBlock extends Block {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
@Override
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
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 ||
|
||||
+ !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
|
||||
@@ -42,10 +42,10 @@ index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c
|
||||
this.playNote(player, state, world, pos);
|
||||
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
|
||||
index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce282bba75b0 100644
|
||||
index 74cce7874809dcbce2718ec3840bb6bb3127e871..d46503c9d31877412ba4ae5a3bb22c0a444662cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
@@ -67,21 +67,25 @@ public class TripWireBlock extends Block {
|
||||
@@ -68,21 +68,25 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@@ -60,10 +60,10 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ 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.getMinecraftWorld())).callEvent()) return state;
|
||||
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, 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
|
||||
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
|
||||
@@ -72,7 +72,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!oldState.is(state.getBlock())) {
|
||||
this.updateSource(world, pos, state);
|
||||
@@ -90,6 +94,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -91,6 +95,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
@@ -80,7 +80,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!moved && !state.is(newState.getBlock())) {
|
||||
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
|
||||
@@ -98,6 +103,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -99,6 +104,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
@@ -88,7 +88,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
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)) {
|
||||
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
||||
@@ -108,6 +114,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -109,6 +115,7 @@ public class TripWireBlock extends Block {
|
||||
}
|
||||
|
||||
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
||||
@@ -96,7 +96,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
|
||||
int i = aenumdirection.length;
|
||||
@@ -141,6 +148,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -147,6 +154,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
@@ -104,7 +104,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
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 - Add EntityInsideBlockEvent
|
||||
if (!world.isClientSide) {
|
||||
@@ -152,6 +160,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -158,6 +166,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
@@ -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
|
||||
index 2eb9c584cc77237f1c82d880a51a3f8b51008d73..dd0fa065e97f0ae0bc6a2f66392d6393e4c04b06 100644
|
||||
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..9309598317d361ecef658fe4de57c64ba73f36c1 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -281,6 +281,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -284,6 +284,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ index 2eb9c584cc77237f1c82d880a51a3f8b51008d73..dd0fa065e97f0ae0bc6a2f66392d6393
|
||||
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
||||
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
|
||||
index 25ea45a528612d1a2a2d77293b3802f473a52f38..169fdd2e21a192bfc834785a2e9eae2adde442c3 100644
|
||||
index ed5b00620527c1776722d25b1b45f1544802a341..544882862b2248d426185dd67bd217f593caef2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -164,6 +164,31 @@ import org.bukkit.plugin.PluginManager;
|
||||
@@ -178,6 +178,31 @@ import org.bukkit.plugin.PluginManager;
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, 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
|
||||
+ private gg.projecteden.parchment.entity.EntityData storedEntityData;
|
||||
@@ -76,17 +76,16 @@ index 25ea45a528612d1a2a2d77293b3802f473a52f38..169fdd2e21a192bfc834785a2e9eae2a
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
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
|
||||
index a2d336ceb52b63db5c03432ee7bc94dc6a742b82..a7a95547fc3f1614c7e6efdd0dcd24ba6af27fd8 100644
|
||||
index ddabaed899c755925ad8618b78c33dacaf2126ac..134dba0bf6340772c7b3fa233dfabffd859422b2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -78,6 +78,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
};
|
||||
// Paper end - Folia schedulers
|
||||
|
||||
@@ -1306,4 +1306,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
}
|
||||
// Paper end - broadcast hurt animation
|
||||
+
|
||||
+ public gg.projecteden.parchment.entity.EntityData 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
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..79900376e8d91792a23dde07fd9f516c3694318f
|
||||
index 0000000000000000000000000000000000000000..3184478d24e6c984d4e5b5f67253f966315b298c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/projecteden/parchment/sidebar/SidebarBufferImpl.java
|
||||
@@ -0,0 +1,181 @@
|
||||
@@ -0,0 +1,182 @@
|
||||
+package gg.projecteden.parchment.sidebar;
|
||||
+
|
||||
+import gg.projecteden.parchment.util.StringUtils;
|
||||
@@ -50,6 +50,7 @@ index 0000000000000000000000000000000000000000..79900376e8d91792a23dde07fd9f516c
|
||||
+import org.bukkit.entity.Player;
|
||||
+
|
||||
+import java.util.Objects;
|
||||
+import java.util.Optional;
|
||||
+
|
||||
+public class SidebarBufferImpl extends SidebarBuffer {
|
||||
+
|
||||
@@ -184,7 +185,7 @@ index 0000000000000000000000000000000000000000..79900376e8d91792a23dde07fd9f516c
|
||||
+ }
|
||||
+
|
||||
+ 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);
|
||||
+ }
|
||||
@@ -5,45 +5,10 @@ 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
|
||||
index 46330f02d04f9e8a921ddf14bb34e94392c17431..e7695d630e17260708951090da89db7dbb3db09e 100644
|
||||
index 43c288a4e226060a5e0cecddd941846d29ae8025..78726d52117105ffebd9d15b407f5e529a217900 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -299,24 +299,28 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
return state.getDrops(lootparams_a);
|
||||
}
|
||||
|
||||
- public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
||||
+ public static List<ItemEntity> dropResources(BlockState state, Level world, BlockPos pos) {
|
||||
if (world instanceof ServerLevel) {
|
||||
+ 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.popResourceWithReturn(world, pos, itemstack));
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
+ return itemEntities;
|
||||
}
|
||||
-
|
||||
+ return new java.util.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 java.util.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.popResourceWithReturn((ServerLevel) world, pos, itemstack));
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
+ return itemEntities;
|
||||
}
|
||||
-
|
||||
+ return new java.util.ArrayList<>();
|
||||
}
|
||||
|
||||
// Paper start - Add BlockBreakBlockEvent
|
||||
@@ -344,15 +348,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -335,15 +339,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
// Paper start - Properly handle xp dropping
|
||||
dropResources(state, world, pos, blockEntity, entity, tool, true);
|
||||
}
|
||||
@@ -64,7 +29,7 @@ index 46330f02d04f9e8a921ddf14bb34e94392c17431..e7695d630e17260708951090da89db7d
|
||||
}
|
||||
|
||||
public static void popResource(Level world, BlockPos pos, ItemStack stack) {
|
||||
@@ -366,6 +372,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -357,6 +363,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}, stack);
|
||||
}
|
||||
|
||||
@@ -83,11 +48,11 @@ index 46330f02d04f9e8a921ddf14bb34e94392c17431..e7695d630e17260708951090da89db7d
|
||||
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
|
||||
index ac11f18690434922179b61ffcc3036dea025b0cb..f9aae49eed516bce00cb968de36ca8b3de038311 100644
|
||||
index 5cb69d0b822e11a99a96aef4f59986d083b079f4..f151b805763ce5fa4b9bfacb74b0152ab3a6ae5e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -500,6 +500,11 @@ public class CraftBlock implements Block {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dropExperience) {
|
||||
+ return this.breakNaturally(null, item, triggerEffect, dropExperience);
|
||||
@@ -99,7 +64,7 @@ index ac11f18690434922179b61ffcc3036dea025b0cb..f9aae49eed516bce00cb968de36ca8b3
|
||||
// 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();
|
||||
@@ -509,7 +514,12 @@ public class CraftBlock implements Block {
|
||||
|
||||
|
||||
// Modelled off EntityHuman#hasBlock
|
||||
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, false); // Paper - Properly handle xp dropping
|
||||
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