1.21.3
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
group = gg.projecteden.parchment
|
||||
version = 1.21.1-R0.1-SNAPSHOT
|
||||
version = 1.21.3-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.21.1
|
||||
paperRef = f97aff74b6f7fd4940c0c0b6cca3f8ac6e1afdef
|
||||
mcVersion = 1.21.3
|
||||
paperRef = 9bc147178d62a722fb74b9157e9545a4aea72d4b
|
||||
edenVersion = 2.2.8-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 65618b6b3c950fb27707f243a766511d6cd3aab4..cccf6f315e2aae9d67afe726c7bad4f619e47860 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 65618b6b3c950fb27707f243a766511d6cd3aab4..cccf6f315e2aae9d67afe726c7bad4f6
|
||||
* 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 3993fecec5b4c2bbd77e175a168afcad571ce4d1..f2a98e4e25262c452d20e27a9617bf7cfbee9e77 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 bfa378fe3d074bafbc0af2c4d858e2a34d3126bd..f6b6a75dc9ae2b8c391025221f151e2169d62913 100644
|
||||
index 027a7d3b6feb52f6c3424edc0820d29fdaf6ebae..fe33bdfd98c3a96af766cbbe5a267f4710cbff52 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
@@ -18,7 +18,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, Keyed {
|
||||
+public class AttributeModifier implements ConfigurationSerializable, Keyed, gg.projecteden.api.interfaces.HasUniqueId { // Parchment
|
||||
|
||||
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;
|
||||
private final double amount;
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index a13c8ddd4a1222e7a16debb61769af3758502d7c..6672aaad187bb4ac23d9a3397fc0ef2ae3708bb2 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;
|
||||
@@ -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 725ef320f929d5e3d141c1ed3246d73a7d741f31..93506536af557bc9972c295ee3957fe0e3c22053 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 725ef320f929d5e3d141c1ed3246d73a7d741f31..93506536af557bc9972c295ee3957fe0
|
||||
/**
|
||||
* 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 294de2c073167e7186fbf1d6885fe5951351cc9c..0b23a17a02c7df498f67dad2b49568c5e8c9127b 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 294de2c073167e7186fbf1d6885fe5951351cc9c..0b23a17a02c7df498f67dad2b49568c5
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 7c56182acaf827f4b1a986a61cea8e9960604c98..9a6f2ed1eb9559789317e21226f67cb6f02c0761 100644
|
||||
index 95f0b3186e313c7fbd5c8531d52b82a69e525f94..aa21cd957cb0a4756cf0f27cef69fbd80e71c54e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -57,7 +57,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -58,7 +58,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
*/
|
||||
@@ -957,7 +919,7 @@ 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 ea26cb90d988d693f26e37229fbdee975c0b11f4..f19aa180b7d4f19f57b9968a4c35a76ad29029c3 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
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -1009,7 +971,7 @@ 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 72f93377b60a3b6a08b8c8264ee7313e89c15da0..019ba8c91c06da12efadc445ada6f634a78e488b 100644
|
||||
index 5c258b6077277575daa5d96349837bdf06f42500..f8fd3590df19d4930f54c0456f9cb7bab636f227 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -1034,3 +996,27 @@ index 9c1ccaed727ec5e5dad93146bbfda798e3f536e7..b4dc13b03d8a33ac13e8af6677e1a841
|
||||
|
||||
public static final int DEFAULT_LOOT_MODIFIER = -1;
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||
index 07416cc9e2b8156be2cc92d6d974b881b427fd99..4f96ecb2f03b7ad84592d874462acb54a86303c9 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
|
||||
@@ -22,7 +22,7 @@ import org.jspecify.annotations.Nullable;
|
||||
* {@link Event#isAsynchronous()}
|
||||
*/
|
||||
@NullMarked
|
||||
-public class PreLookupProfileEvent extends Event {
|
||||
+public class PreLookupProfileEvent extends Event implements gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
@@ -55,6 +55,10 @@ public class PreLookupProfileEvent extends Event {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
+ public UUID getUniqueId() {
|
||||
+ return this.uuid;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Sets the UUID for this player name. This will skip the initial API call to find the players UUID.
|
||||
* <p>
|
||||
|
||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 330e3013eda204aa9b33d5e1c3104e0b595abdbc..8093b81f00b84e292a1e6f76af9509ea178a7ab3 100644
|
||||
index a491dc40093e19b8d1900443ad613223fd7f3119..fa22e21eb7299f601649af515b9e554e050b1ae1 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -287,4 +287,18 @@ public interface UnsafeValues {
|
||||
<A extends Keyed, M> io.papermc.paper.registry.tag.@Nullable Tag<A> getTag(io.papermc.paper.registry.tag.@NotNull TagKey<A> tagKey); // Paper - hack to get tags for non-server backed registries
|
||||
@@ -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
|
||||
+
|
||||
|
||||
@@ -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 c043d239c449bf4bb13a24467f2f6c67b4d28d2d..08d834ed5dcb7b281f9f0ed02c396992f62c80c6 100644
|
||||
index f55638eb8b315864052f9fe17ab4846e5e9d8dbb..ac7bd2a77f387e72f8862e8ea5af52f39d90265a 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2226,6 +2226,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.
|
||||
|
||||
@@ -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 9a6f2ed1eb9559789317e21226f67cb6f02c0761..14aee20cdbe0cb9a118582b605257115098760ac 100644
|
||||
index aa21cd957cb0a4756cf0f27cef69fbd80e71c54e..d8014eea4f4415602db7e1199a2d9ce059adefaa 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2097,6 +2097,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 e81d0bc309de877ed2b5da6122f55c162e9b5f10..d4d65c301df8f6b9945d636b5f0e623a8289a8bc 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 95d87c9dbf2b237787294dfbe7fed87a36e6dedf..d8e0b7fba75c68495f30419258ddf88f1237df07 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
@@ -65,10 +65,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;
|
||||
@@ -81,15 +83,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 df066d6f8d55afbc0c1897c486d638657a5f8df9..e80b33ecf12815356356bea0e0ecd4da75a5a416 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
@@ -62,6 +62,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);
|
||||
}
|
||||
|
||||
@@ -73,6 +74,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 14aee20cdbe0cb9a118582b605257115098760ac..ddfe7859ad921343214d3d82ef01bcc57a35790d 100644
|
||||
index d8014eea4f4415602db7e1199a2d9ce059adefaa..b68feadfb631672b4b99b464fb1b6aae6e82507f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -67,6 +67,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 6905614c3d277a3a725554f02cc92d4b3430eecc..36023edd1db4185243ffc417fe59a09c104fbb47 100644
|
||||
index c1aa59bab82aee8fd42f7149c520b45660b29082..6e1b2721b1ff69239ce6cf726c50974e76c78f1f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -305,6 +305,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 93506536af557bc9972c295ee3957fe0e3c22053..072567951ceecddb4f2bf269e6695b322d3a0f0e 100644
|
||||
index 87cea10a668d3040906a4dd1fd135c2162d9617f..b8bdac918e8a49bef2bf09312eb6d71d373eb517 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1159,4 +1159,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 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad3d3faa87 100644
|
||||
index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..256c09e98005cc64e2bc739ce6e880954664d693 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,6 +1,8 @@
|
||||
@@ -17,8 +17,8 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
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 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
+ implementation(project(":parchment-api"))
|
||||
+ // Parchment end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -84,14 +88,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 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to Instant.now().toString(),
|
||||
"Git-Branch" to gitBranch, // Paper
|
||||
@@ -112,6 +116,27 @@ tasks.compileTestJava {
|
||||
@@ -127,6 +131,27 @@ tasks.compileTestJava {
|
||||
|
||||
publishing {
|
||||
publications.create<MavenPublication>("maven") {
|
||||
@@ -76,7 +76,7 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +173,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -172,7 +197,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
@@ -112,7 +112,7 @@ 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 c1e88c31910e96ef07cece05046c0b55e708b52d..0937440b0e793e62f26ccfde9b4441513724ae27 100644
|
||||
index be0d38544395a9b3befb898bb961f34e32fe9509..693a7a0104e8da6c775a1fc718ac0b577a5ce89e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -267,7 +267,7 @@ public class Main {
|
||||
|
||||
@@ -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 22fe529890f34f66534c01248f654dc911b44c3b..dfa777529d3eb3cc0a6713c58b91b74cff25bc0e 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
|
||||
@@ -364,6 +364,40 @@ public final class PaperAdventure {
|
||||
@@ -390,6 +390,36 @@ public final class PaperAdventure {
|
||||
return asVanilla(source);
|
||||
}
|
||||
|
||||
@@ -67,27 +67,23 @@ index 22fe529890f34f66534c01248f654dc911b44c3b..dfa777529d3eb3cc0a6713c58b91b74c
|
||||
+ }
|
||||
+
|
||||
+ 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 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6123e0d35 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
|
||||
@@ -1645,12 +1645,46 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -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 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
+ 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 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
+ 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 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c962abe64 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
|
||||
@@ -2560,7 +2560,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
@@ -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 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c
|
||||
+ 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,10 +159,10 @@ index 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5..e37555cf68b6c7108297d98cd84616bad9009bd7 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
|
||||
@@ -907,6 +907,9 @@ public abstract class PlayerList {
|
||||
@@ -876,6 +876,9 @@ public abstract class PlayerList {
|
||||
isBedSpawn = true;
|
||||
}
|
||||
// Paper end - Add PlayerPostRespawnEvent
|
||||
@@ -177,10 +173,10 @@ index 43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5..e37555cf68b6c7108297d98cd84616ba
|
||||
// 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 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff743d1b05fa 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
|
||||
@@ -1894,9 +1894,23 @@ 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) {
|
||||
@@ -193,7 +189,7 @@ index 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff74
|
||||
+ 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)
|
||||
@@ -208,10 +204,10 @@ index 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff74
|
||||
}
|
||||
// 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 dcbef04bbaab988096bf416163264833e84d1967..4117f12172d1d67283fab21851bf2d1c167da1cb 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
|
||||
@@ -561,7 +561,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)) {
|
||||
@@ -221,10 +217,10 @@ index dcbef04bbaab988096bf416163264833e84d1967..4117f12172d1d67283fab21851bf2d1c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..33daeb74cdf11c5b920e02b191eb62d5d0937f8e 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
|
||||
@@ -2251,4 +2251,42 @@ public class CraftEventFactory {
|
||||
@@ -2271,4 +2271,42 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
// Paper end - add EntityFertilizeEggEvent
|
||||
@@ -240,7 +236,7 @@ index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..33daeb74cdf11c5b920e02b191eb62d5
|
||||
+ 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 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 41c34ffdf9d95a04ed55a1e09ebc78e8cf946777..b43be3c60dc46cd11b652f315d641f16b44b13f2 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
|
||||
@@ -690,6 +690,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -702,6 +702,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
// Paper end - proxy ItemStack
|
||||
|
||||
|
||||
@@ -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 a4b7229f0de89c315fcf0ecdeeb0ff743d1b05fa..0acb4ef6d4ea60d7e4bc17534e84a7a9b477f04e 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
|
||||
@@ -1566,6 +1566,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 c8b82bc41f2042bb4b067f06265a3a22e51f7629..6ee706a17443cd53d6f3d768df07e6e5b51db670 100644
|
||||
index cac8592e3a2f438fe9ca167a4fdcd65152bbb2de..b85d19598c09a14e68fced841de2148bf6f469e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -3218,4 +3218,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 c8b82bc41f2042bb4b067f06265a3a22e51f7629..6ee706a17443cd53d6f3d768df07e6e5
|
||||
+ 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 a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4fc4ec54e 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 a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
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 a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
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 a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
});
|
||||
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 8f438df5d9112460e5b1664a56688bb1c6ddc6fa..d19b9c7773d7d416085dc5a4dbe8113ad5fe9c41 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
|
||||
@@ -2288,5 +2288,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 8045d6c9398d1c88595da6e41aa1ed27fb6fbad0..a5a98d23f1b339b320761446a3c4f1f6a3ec3b1f 100644
|
||||
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..77c914fb58403f4b6c2d145664740d1fb59bb261 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2475,4 +2475,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 8045d6c9398d1c88595da6e41aa1ed27fb6fbad0..a5a98d23f1b339b320761446a3c4f1f6
|
||||
+ // 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 net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(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 4d496c5fbf7f7431ac908f40b98578b6123e0d35..5619beb2cf3b5c31e392a2c4a1b7fc01330c7587 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
|
||||
@@ -1003,7 +1003,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1068,7 +1068,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
private void announceSleepStatus() {
|
||||
|
||||
@@ -5,10 +5,10 @@ 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 4bcf27f98765abf693e535cfc1756c27a10cb316..6a698656c90c368d5c64f4a0b2a16500c7dadc02 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
|
||||
@@ -290,6 +290,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -317,6 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public boolean disablePlayerCrits = false;
|
||||
@@ -17,7 +17,7 @@ index 4bcf27f98765abf693e535cfc1756c27a10cb316..6a698656c90c368d5c64f4a0b2a16500
|
||||
@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 0acb4ef6d4ea60d7e4bc17534e84a7a9b477f04e..dae72e66a976701c0cb1fc26e6c37657b79da423 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
|
||||
@@ -304,7 +304,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@@ -5,10 +5,10 @@ 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 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b003a7974 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
|
||||
@@ -20,7 +20,11 @@ import org.apache.commons.lang3.Validate;
|
||||
@@ -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;
|
||||
@@ -20,7 +20,7 @@ index 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b
|
||||
|
||||
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -53,6 +57,38 @@ public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
@@ -54,6 +58,38 @@ public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
protected abstract AABB calculateBoundingBox(BlockPos pos, Direction side);
|
||||
|
||||
@Override
|
||||
@@ -49,7 +49,7 @@ index 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
|
||||
+ this.dropItem((Entity) null);
|
||||
+ this.dropItem((ServerLevel) this.level(), (Entity) null);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -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 992437a6e838f653f32d33b5b3f702c484640a97..49d5cdd931de7c28faadd211a52109f28a9df6e5 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
|
||||
@@ -2165,6 +2165,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 49d5cdd931de7c28faadd211a52109f28a9df6e5..1dc933a1b8a5d731de0d1a1e9754eafb8460224d 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
|
||||
@@ -213,6 +213,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 49d5cdd931de7c28faadd211a52109f28a9df6e5..1dc933a1b8a5d731de0d1a1e9754eafb
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
|
||||
@@ -3565,4 +3567,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer)this.getHandle())
|
||||
.moonrise$getViewDistanceHolder().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 60ff21c8df4168f14da04a12073bde47cd4693c4..51c9f6239d0bbf2090b29cc3052a0925b1763649 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -756,9 +756,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
|
||||
@@ -2452,6 +2454,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 )
|
||||
@@ -3206,10 +3209,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.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 5174b23c6e04da7a3d833ea3fd191b5956a49809..323330172fde196c6e992484d22479d9f8b041db 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
|
||||
@@ -2524,9 +2524,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
@@ -2769,9 +2769,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
forced = event.isForced();
|
||||
// Paper end - Add PlayerSetSpawnEvent
|
||||
|
||||
@@ -5,14 +5,10 @@ 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 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..321499a52848101b6c36bef18a35f5367c62913c 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
|
||||
@@ -201,15 +201,21 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
|
||||
@Override
|
||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
||||
+
|
||||
@@ -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);
|
||||
@@ -24,18 +20,20 @@ index 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..321499a52848101b6c36bef18a35f536
|
||||
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 c858556ea457931aa14e338e20672cb50cb19f0e..b93db38d69ea6f12f4c1d2f73800753a04309772 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
|
||||
@@ -179,12 +179,16 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
@@ -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);
|
||||
@@ -46,18 +44,20 @@ index c858556ea457931aa14e338e20672cb50cb19f0e..b93db38d69ea6f12f4c1d2f73800753a
|
||||
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 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..3c314a9db7467c1066f9e5c8857438bb01317274 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
|
||||
@@ -167,8 +167,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -164,8 +164,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,10 +71,10 @@ index 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..3c314a9db7467c1066f9e5c8857438bb
|
||||
}
|
||||
|
||||
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 de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab3215e6ba3b 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
|
||||
@@ -181,9 +181,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) {
|
||||
@@ -94,7 +94,7 @@ index de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab32
|
||||
this.hasImpulse = true;
|
||||
double d3 = vec3d.horizontalDistance();
|
||||
|
||||
@@ -194,6 +202,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) {
|
||||
@@ -107,22 +107,59 @@ index de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab32
|
||||
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);
|
||||
@@ -204,7 +218,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
if (vec3d.lengthSqr() > 4D * 4D) {
|
||||
vec3d = vec3d.normalize().scale(2D);
|
||||
}
|
||||
@@ -212,7 +226,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||
Vec3 vec3d = shooter.getKnownMovement();
|
||||
// Paper start - allow disabling relative velocity
|
||||
- if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) {
|
||||
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) { // Parchment
|
||||
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||
}
|
||||
// Paper end - allow disabling relative velocity
|
||||
@@ -230,8 +244,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||
+ return Projectile.spawnProjectileUsingShoot(creator, world, projectileStack, shooter, velocityX, velocityY, velocityZ, power, divergence, true);
|
||||
+ }
|
||||
+
|
||||
+ public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
return Projectile.spawnProjectile(creator.create(world, shooter, projectileStack), world, projectileStack, (iprojectile) -> {
|
||||
- iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||
+ iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,12 +257,22 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
// Paper start - fixes and addition to spawn reason API
|
||||
return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence).spawn();
|
||||
}
|
||||
+ public static <T extends Projectile> T spawnProjectileUsingShoot(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
+ // Paper start - fixes and addition to spawn reason API
|
||||
+ return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence, relative).spawn();
|
||||
+ }
|
||||
public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||
return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||
// Paper end - fixes and addition to spawn reason API
|
||||
projectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||
});
|
||||
}
|
||||
+ public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
+ return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||
+ // Paper end - fixes and addition to spawn reason API
|
||||
+ projectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||
+ });
|
||||
+ }
|
||||
|
||||
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel world, ItemStack projectileStack) {
|
||||
return Projectile.spawnProjectile(projectile, world, projectileStack, (iprojectile) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a478107cb9 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,8 +31,13 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
float f = getPowerForTime(i);
|
||||
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 instanceof ServerLevel serverLevel && !list.isEmpty()) {
|
||||
- this.shoot(serverLevel, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null);
|
||||
@@ -130,13 +167,13 @@ index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a4
|
||||
+ 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((ServerLevel) world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null, preEvent.isRelative());
|
||||
}
|
||||
|
||||
world.playSound(
|
||||
@@ -53,9 +58,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
@@ -60,9 +65,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -149,10 +186,10 @@ index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a4
|
||||
|
||||
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 c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f26235f4e5f5b 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
|
||||
@@ -137,7 +137,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -140,7 +140,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -161,7 +198,7 @@ index c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f2623
|
||||
) {
|
||||
Vector3f vector3f;
|
||||
if (target != null) {
|
||||
@@ -198,8 +198,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -201,8 +201,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
) {
|
||||
if (world instanceof ServerLevel serverLevel) {
|
||||
ChargedProjectiles chargedProjectiles = stack.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.EMPTY);
|
||||
@@ -178,32 +215,30 @@ index c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f2623
|
||||
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 32dd0b13a0819f597d8a93c6bc3a155781067544..a74540e3a0aa61534fd84868bf8a29d97ccb6e6b 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,9 +46,10 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
@@ -41,7 +41,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
|
||||
public abstract int getDefaultProjectileRange();
|
||||
|
||||
- protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target) {
|
||||
+
|
||||
+ protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target, boolean relative) {
|
||||
float f2 = EnchantmentHelper.processProjectileSpread(world, stack, shooter, 0.0F);
|
||||
- float f3 = projectiles.size() == 1 ? 0.0F : 2.0F * f2 / (float) (projectiles.size() - 1);
|
||||
+ float f3 = projectiles.size() == 1 ? 0.0F : 20.0F / (float) (projectiles.size() - 1);
|
||||
float f3 = projectiles.size() == 1 ? 0.0F : 2.0F * f2 / (float) (projectiles.size() - 1);
|
||||
float f4 = (float) ((projectiles.size() - 1) % 2) * f3 / 2.0F;
|
||||
float f5 = 1.0F;
|
||||
|
||||
@@ -61,7 +62,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
@@ -56,8 +56,9 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
f5 = -f5;
|
||||
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
|
||||
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()) {
|
||||
@@ -91,7 +92,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
event.getProjectile().remove();
|
||||
@@ -86,7 +87,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -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 fe435d4a387bb28be6831cec0c8bb0a7c8b603a4..b5c5294a59aad34e21da88bb9d7a6fc70d1a959b 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
|
||||
@@ -4183,7 +4183,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 fe435d4a387bb28be6831cec0c8bb0a7c8b603a4..b5c5294a59aad34e21da88bb9d7a6fc7
|
||||
+ 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 dd56c8e041116ef3602a9f89c998c8208ab89b51..9197be4019ddbe16e09c781a74809d15f569e0f3 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
|
||||
@@ -287,6 +287,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 dd56c8e041116ef3602a9f89c998c8208ab89b51..9197be4019ddbe16e09c781a74809d15
|
||||
// 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 1f7594e22f0f08ae110ef9b42f15119358aa5723..577a6cc50cf41dc3e590edb955a372c4c2a83fe2 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
|
||||
@@ -169,6 +169,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, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
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 1f7594e22f0f08ae110ef9b42f15119358aa5723..577a6cc50cf41dc3e590edb955a372c4
|
||||
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 2cde808bfa797256409879505ba205a71f381981..1bde22a5ec330980ee697830cb2c6a7441394722 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
|
||||
@@ -80,6 +80,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;
|
||||
}
|
||||
@@ -5,10 +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 d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa049694270d3b5 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 {
|
||||
@@ -290,24 +290,28 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
return state.getDrops(lootparams_a);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
}
|
||||
|
||||
// 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 +64,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
}
|
||||
|
||||
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,7 +83,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
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 {
|
||||
Reference in New Issue
Block a user