feat: 1.20.1
This commit is contained in:
@@ -128,7 +128,7 @@ index 9be64a95c2345433b6142d611077dedadcef9f5d..e3cea810881868fb5869de72f331733e
|
||||
@NotNull private final String buffer;
|
||||
private final boolean isCommand;
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
index 89e132525cfae0ce979e37b3e2793df781e47227..f14635ae3112862c1337398bf5f5f56a7f87d90f 100644
|
||||
index 2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a..640a01478be687b089aeddad422e4bba2bea19b6 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
@@ -8,7 +8,7 @@ import static com.google.common.base.Preconditions.*;
|
||||
@@ -427,7 +427,7 @@ index 12163a7b0591a7d022dc7eb9ee6608a1b6c39d9b..d81c7307127b135417e06a3b244416be
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final Player player;
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 6bbf8468bc47e82b0aeb164e49cdb73d93bae87b..1d7077f3a1be8068747aaf0665a1dee797bb4088 100644
|
||||
index 1a60a18e15780128a1914826daa952ffacb92e9e..1c7e4ff20536e9a57a8f596032282967d5e6445a 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;
|
||||
@@ -435,38 +435,36 @@ index 6bbf8468bc47e82b0aeb164e49cdb73d93bae87b..1d7077f3a1be8068747aaf0665a1dee7
|
||||
* representation by the implementation.
|
||||
*/
|
||||
-public class Location implements Cloneable, ConfigurationSerializable, io.papermc.paper.math.FinePosition { // Paper
|
||||
+public class Location implements Cloneable, ConfigurationSerializable , io.papermc.paper.math.FinePosition, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
+public class Location implements Cloneable, ConfigurationSerializable, io.papermc.paper.math.FinePosition, gg.projecteden.parchment.HasLocation { // Paper // Parchment
|
||||
private Reference<World> world;
|
||||
private double x;
|
||||
private double y;
|
||||
@@ -72,6 +72,13 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
this.yaw = yaw;
|
||||
@@ -1199,4 +1199,11 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
return new Location(world, this.x(), this.y(), this.z(), this.getYaw(), this.getPitch());
|
||||
}
|
||||
|
||||
// Paper end
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public @NotNull Location getLocation() {
|
||||
+ return this;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
/**
|
||||
* Sets the world that this location resides in
|
||||
*
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index 69b50eee42e8c52063033705bd23a5ef5231ed83..f61ddf47ce33a4a1708e7000bb43b303e3b1a503 100644
|
||||
index 72175dcae49f75b494ab70958053ed994a8828f4..eb86c81c95fe7f76487c5dc37c1b9e1cda233fdc 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -10,7 +10,7 @@ import org.bukkit.profile.PlayerProfile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -15,7 +15,7 @@ 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
|
||||
|
||||
/**
|
||||
* Checks if this player is currently online
|
||||
@@ -139,6 +139,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -144,6 +144,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@Nullable
|
||||
public Player getPlayer();
|
||||
|
||||
@@ -520,7 +518,7 @@ index d124768378d6f0c5573f28ee815ea3886fe74868..11a00998b1cb5ee582e225553f15b1b7
|
||||
private final UUID uuid;
|
||||
private final String name;
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 390a2a2611df35a9ea6f1eb996b47e2aa4597ff0..e7dcaf75283dd222891e4f20971716934291a672 100644
|
||||
index 1c3f54382d66549dc881d4577c7104be6673a274..da7ac29bf25c38d8bdcccdf15122983b6f9b07eb 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;
|
||||
@@ -528,7 +526,7 @@ index 390a2a2611df35a9ea6f1eb996b47e2aa4597ff0..e7dcaf75283dd222891e4f2097171693
|
||||
* generation when used in cases like BlockPhysicsEvent!!!!
|
||||
*/
|
||||
-public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
+public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable
|
||||
+public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable // Parchment
|
||||
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
@@ -572,10 +570,10 @@ index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..8f4a293c131cb8b63c31b410ffa211bd
|
||||
/**
|
||||
* 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 8c58018b155c52a7b2a139f784abceb6aa00a268..dfa0366e3f46ef974f9d3397f057a6abc5c0e08c 100644
|
||||
index 6b842453589cf148ab32c1507cf374056826316e..0bd098a93d6fd3b41d736861c9c0f65f23f4fc62 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a base entity in the world
|
||||
*/
|
||||
@@ -585,7 +583,7 @@ index 8c58018b155c52a7b2a139f784abceb6aa00a268..dfa0366e3f46ef974f9d3397f057a6ab
|
||||
/**
|
||||
* 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 f17ef44bc02e97ff084e5abfde8d6c6822f00d62..aae9eaa7a0e42cd9bc0a4ccf56bf056441d47c90 100644
|
||||
index 8b0d04d5b39ee817555a36adddc39b18fc6f0d02..1c87047de615a85ee20297295478770e669d87e6 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;
|
||||
@@ -593,28 +591,28 @@ index f17ef44bc02e97ff084e5abfde8d6c6822f00d62..aae9eaa7a0e42cd9bc0a4ccf56bf0564
|
||||
* Represents a human entity, such as an NPC or a player
|
||||
*/
|
||||
-public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder {
|
||||
+// Parchment start
|
||||
+public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity {
|
||||
+public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ default HumanEntity getPlayer() {
|
||||
+ return this;
|
||||
+ }
|
||||
+// Parchment end
|
||||
+ // Parchment end
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 5f11b2e9c1bca121ae72dd0ec94ae4a86f80a324..f2f32e578fb7748d41d26ae980d4132fdd28f2cd 100644
|
||||
index 0b4f9dee48f8d49977dc9a5f104ee062ca2cbfae..2c84eb129191f057ab96000dd2e2446ad44972c7 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -39,7 +39,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -43,7 +43,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
*/
|
||||
-public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, com.destroystokyo.paper.network.NetworkClient { // Paper
|
||||
+public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, com.destroystokyo.paper.network.NetworkClient, gg.projecteden.parchment.HasPlayer { // Paper // Parchment
|
||||
-public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient { // Paper
|
||||
+public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient, gg.projecteden.parchment.HasPlayer { // Paper // Parchment
|
||||
+
|
||||
+ // Parchment start - fix defaults
|
||||
+ /**
|
||||
@@ -707,7 +705,7 @@ index 6dcd9f828c6c40e48593b0bad5a44a656eb01645..0651bdd983e90e0e1e8a3565dcb5d97c
|
||||
private final IgniteCause cause;
|
||||
private final Entity ignitingEntity;
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93ea9c51ec 100644
|
||||
index 4e3c406ba883aae553e8d69b6b719b872cd6096c..d0a92dc9eba0f61b596e9a388f3aa4076ef2bc65 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -720,10 +718,10 @@ index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93
|
||||
protected boolean cancel;
|
||||
protected boolean canBuild;
|
||||
diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
index c40536f781393cb39e6a1a4ba6e780713d5dc126..e4455679b37ac38bd505982ef12d323c9ff466c3 100644
|
||||
index d944d67f544494355f03c5bc9afd8ea7726e6412..800db8e63bdb8c05ffdc88c3a3b0f1f268a1357e 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* <p>
|
||||
* If a Sign Change event is cancelled, the sign will not be changed.
|
||||
*/
|
||||
@@ -788,7 +786,7 @@ index 099efafa14c10910e4ed04abb1823f0c1a96b6a6..382602ca4a9a33cf238f982f77865053
|
||||
private boolean cancel;
|
||||
private final Location location;
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
index 327876e0ad7dcfeb71d9d22afe1c04bcd71c3bf9..466a54c4e30a7886e7383f43f9b6c389a5bdba7c 100644
|
||||
index 71d664dd89995f088c47d17b38547d530319470c..d931ece8f35c8f01748c59d01617fd59b287030e 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
@@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -892,12 +890,12 @@ index 21ad8888c0e403bfc63518502577d651c02dda05..1c59335a8f0a40162190f6fb73ffbfef
|
||||
// Paper start
|
||||
private final Reason reason;
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f748278a7 100644
|
||||
index ceae092eb782698803c6c3df41267dde20ba62b2..23e35e7e65bdf2e758dc8dc980b9427b7e4163a9 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Represents a player related inventory event
|
||||
* Called when a player opens an inventory
|
||||
*/
|
||||
-public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
|
||||
+public class InventoryOpenEvent extends InventoryEvent implements Cancellable, gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||
@@ -905,7 +903,7 @@ index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f
|
||||
private boolean cancelled;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index 635b8787fc235b61c0d5677def034656e4ec4cef..6f15f4adfa552e2f5960464663ee126282086bb1 100644
|
||||
index fc2d9e85b65347b90bde3b0b13ccae759e33d466..6b2e64fa9c0f3c0af88797d63557c333edf69a5d 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -1010,7 +1008,7 @@ index 7af8d6e51c824cf0592b722b834f1d4986e3cc08..c28d62fc3dc359f9ebcf926094198ee3
|
||||
private boolean cancelled = false;
|
||||
private final Location location;
|
||||
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bceac9cfaa4 100644
|
||||
index 0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3..469b9cc0c4b77844ba0317af51bd9ad873915967 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -1023,7 +1021,7 @@ index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bce
|
||||
/**
|
||||
* 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 daca40b63e95ea33178bcb54ad45911da591ca54..e9b5206851db890d7638ce94d793fb909be20307 100644
|
||||
index 77a0cd901038405ed0e267f0432f13deccae3ab5..abe9b0d97d24e9e2ef1a61e34249895eb35b800f 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -6,12 +6,13 @@ Subject: [PATCH] Add SoundEvent
|
||||
|
||||
diff --git a/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java b/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c0409febb9d
|
||||
index 0000000000000000000000000000000000000000..0bb783a6a86681fa54a738a3851e9079d4befa87
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java
|
||||
@@ -0,0 +1,382 @@
|
||||
@@ -0,0 +1,359 @@
|
||||
+package gg.projecteden.parchment.event.sound;
|
||||
+
|
||||
+import gg.projecteden.parchment.HasLocation;
|
||||
+import gg.projecteden.parchment.OptionalHumanEntity;
|
||||
+import net.kyori.adventure.sound.Sound;
|
||||
+import org.bukkit.Location;
|
||||
@@ -34,7 +35,7 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ * Called when a sound is sent to a player.
|
||||
+ * Cancelling this event will prevent the packet from sending.
|
||||
+ */
|
||||
+public final class SoundEvent extends Event implements Cancellable, OptionalHumanEntity {
|
||||
+public final class SoundEvent extends Event implements Cancellable {
|
||||
+ private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(SoundEvent.class);
|
||||
+
|
||||
+ private static final org.bukkit.event.HandlerList handlers = new org.bukkit.event.HandlerList();
|
||||
@@ -59,16 +60,14 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ private @NotNull Sound sound;
|
||||
+ private @NotNull Emitter emitter;
|
||||
+ private boolean cancelled;
|
||||
+ private long seed;
|
||||
+ private @Nullable BiFunction<@NotNull SoundEvent, @NotNull Player, @Nullable Sound> soundOverrideFunction;
|
||||
+ private @Nullable BiFunction<@NotNull SoundEvent, @NotNull Player, @Nullable Emitter> emitterOverrideFunction;
|
||||
+
|
||||
+ public SoundEvent(@Nullable HumanEntity except, @NotNull Sound sound, @NotNull Emitter emitter, long seed, @Nullable Function<Sound, Double> distanceFunction, @Nullable Function<SoundEvent, List<Player>> recipientsFunction) {
|
||||
+ public SoundEvent(@Nullable HumanEntity except, @NotNull Sound sound, @NotNull Emitter emitter, @Nullable Function<Sound, Double> distanceFunction, @Nullable Function<SoundEvent, List<Player>> recipientsFunction) {
|
||||
+ super(true);
|
||||
+ this.except = except;
|
||||
+ this.sound = Objects.requireNonNull(sound, "sound cannot be null");
|
||||
+ this.emitter = Objects.requireNonNull(emitter, "emitter cannot be null");
|
||||
+ this.seed = seed;
|
||||
+ this.distanceFunction = Objects.requireNonNullElse(distanceFunction, DEFAULT_DISTANCE_FUNCTION);
|
||||
+ this.recipientsFunction = wrapRecipientsFunction(Objects.requireNonNullElse(recipientsFunction, DEFAULT_RECIPIENTS_FUNCTION));
|
||||
+ }
|
||||
@@ -77,18 +76,6 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ * Gets the player that <b>won't</b> be receiving this sound.
|
||||
+ *
|
||||
+ * @return player excluded from receiving this sound
|
||||
+ * @deprecated use {@link #getException()} for more clarity
|
||||
+ */
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
+ public @Nullable HumanEntity getPlayer() {
|
||||
+ return getException();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the player that <b>won't</b> be receiving this sound.
|
||||
+ *
|
||||
+ * @return player excluded from receiving this sound
|
||||
+ */
|
||||
+ public @Nullable HumanEntity getException() {
|
||||
+ return except;
|
||||
@@ -140,24 +127,6 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the seed used to generate the sound.
|
||||
+ *
|
||||
+ * @return seed used to generate the sound
|
||||
+ */
|
||||
+ public long getSeed() {
|
||||
+ return seed;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the seed used to generate the sound.
|
||||
+ *
|
||||
+ * @param seed seed used to generate the sound
|
||||
+ */
|
||||
+ public void setSeed(long seed) {
|
||||
+ this.seed = seed;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Calculates the distance of the sound.
|
||||
+ * <p>
|
||||
+ * The distance value is dynamically calculated using a
|
||||
@@ -362,14 +331,18 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ /**
|
||||
+ * The class which determines where a sound will emit from.
|
||||
+ */
|
||||
+ public sealed interface Emitter permits EntityEmitter, LocationEmitter {
|
||||
+ public sealed interface Emitter extends HasLocation permits EntityEmitter, LocationEmitter {
|
||||
+ /**
|
||||
+ * Gets the location at which the sound will be played.
|
||||
+ *
|
||||
+ * @return sound's location
|
||||
+ * @deprecated use {@link #getLocation()} instead
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ Location location();
|
||||
+ @Deprecated
|
||||
+ default Location location() {
|
||||
+ return getLocation();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -379,7 +352,7 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ */
|
||||
+ public record EntityEmitter(@NotNull Entity entity) implements Emitter {
|
||||
+ @Override
|
||||
+ public @NotNull Location location() {
|
||||
+ public @NotNull Location getLocation() {
|
||||
+ return entity.getLocation();
|
||||
+ }
|
||||
+ }
|
||||
@@ -390,5 +363,9 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04
|
||||
+ * @param location the location from which the sound will be played
|
||||
+ */
|
||||
+ public record LocationEmitter(@NotNull Location location) implements Emitter {
|
||||
+ @Override
|
||||
+ public @NotNull Location getLocation() {
|
||||
+ return location;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
||||
@@ -6,19 +6,19 @@ Subject: [PATCH] Expanded Adventure support
|
||||
Adds support for Adventure in a few places where it was previously missing.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
||||
index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489642245c2 100644
|
||||
index 918a045165cdcde264bc24082b7afebb407271de..3f912d3fbf5fdef3b95f81585d2fcf76719d2d04 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* All supported color values for chat
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* @deprecated ChatColor has been deprecated in favor of <a href="https://docs.advntr.dev/text.html">Adventure</a> API. See {@link net.kyori.adventure.text.format.NamedTextColor} for the adventure equivalent of pre-defined text colors
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
-public enum ChatColor {
|
||||
+public enum ChatColor implements net.kyori.adventure.text.format.StyleBuilderApplicable, net.kyori.adventure.text.format.TextFormat { // Parchment
|
||||
/**
|
||||
* Represents black
|
||||
*/
|
||||
@@ -181,6 +181,13 @@ public enum ChatColor {
|
||||
@@ -183,6 +183,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.MAGIC;
|
||||
}
|
||||
@@ -26,41 +26,13 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.OBFUSCATED);
|
||||
+ style.apply(net.kyori.adventure.text.format.TextDecoration.OBFUSCATED);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
},
|
||||
/**
|
||||
* Makes the text bold.
|
||||
@@ -191,6 +198,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.BOLD;
|
||||
}
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.BOLD);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
},
|
||||
/**
|
||||
* Makes a line appear through the text.
|
||||
@@ -201,6 +215,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.STRIKETHROUGH;
|
||||
}
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.STRIKETHROUGH);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
},
|
||||
/**
|
||||
* Makes the text appear underlined.
|
||||
@@ -211,6 +232,13 @@ public enum ChatColor {
|
||||
@@ -213,6 +220,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.UNDERLINE;
|
||||
}
|
||||
@@ -68,27 +40,13 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.UNDERLINED);
|
||||
+ style.apply(net.kyori.adventure.text.format.TextDecoration.UNDERLINED);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
},
|
||||
/**
|
||||
* Makes the text italic.
|
||||
@@ -221,6 +249,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.ITALIC;
|
||||
}
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.ITALIC);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
},
|
||||
/**
|
||||
* Resets all previous chat colors or formats.
|
||||
@@ -231,6 +266,16 @@ public enum ChatColor {
|
||||
@@ -233,6 +247,16 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.RESET;
|
||||
}
|
||||
@@ -105,14 +63,17 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -263,6 +308,13 @@ public enum ChatColor {
|
||||
@@ -265,6 +289,16 @@ public enum ChatColor {
|
||||
return net.md_5.bungee.api.ChatColor.RESET;
|
||||
};
|
||||
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
|
||||
+ style.color(net.kyori.adventure.text.format.TextColor.color(asBungee().getColor().getRGB()));
|
||||
+ if (isColor())
|
||||
+ style.color(net.kyori.adventure.text.format.TextColor.color(asBungee().getColor().getRGB()));
|
||||
+ else
|
||||
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.valueOf(name()));
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index b92255a9c87620f46adb140689b1cd328a476d61..3ed52d016314c01293530fa760fa5faaf59586ed 100644
|
||||
index c661eab343ae76488de701630424e2d589f44fc0..b0ba8331fa43f4584eac1b1d9f4c3cad9d47b872 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -245,4 +245,17 @@ public interface UnsafeValues {
|
||||
@@ -250,4 +250,17 @@ public interface UnsafeValues {
|
||||
*/
|
||||
void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);
|
||||
// Paper end
|
||||
|
||||
@@ -5,14 +5,13 @@ Subject: [PATCH] Expose MCUtil Executors
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 2204336d8800311b65e894739ab1b27273e7c6f2..2c35578c85be5f47c2b2a11f1df16db51e31cc41 100644
|
||||
index 96a267a676b41dc10f7b18ead826e45c5f6db425..4c8b2fa8ee92a4576d8aeea99f488ce88ee6cbc6 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2139,4 +2139,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull org.bukkit.potion.PotionBrewer getPotionBrewer();
|
||||
// Paper end
|
||||
+
|
||||
@@ -1979,6 +1979,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
UnsafeValues getUnsafe();
|
||||
|
||||
+ // Parchment start
|
||||
+ /**
|
||||
+ * Gets the executor which runs tasks on an asynchronous thread pool.
|
||||
@@ -28,4 +27,7 @@ index 2204336d8800311b65e894739ab1b27273e7c6f2..2c35578c85be5f47c2b2a11f1df16db5
|
||||
+ @NotNull
|
||||
+ java.util.concurrent.Executor getMainExecutor();
|
||||
+ // Parchment end
|
||||
}
|
||||
+
|
||||
// Spigot start
|
||||
public class Spigot {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Will eventually (hopefully) be replaced by a more extensive Paper PR with suppor
|
||||
|
||||
diff --git a/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b40459a89d17
|
||||
index 0000000000000000000000000000000000000000..ea17d99c7a1d70d88e2c439399cdb376b9dedf47
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java
|
||||
@@ -0,0 +1,50 @@
|
||||
@@ -24,15 +24,15 @@ index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b404
|
||||
+ */
|
||||
+ CRAFTING(false),
|
||||
+ /**
|
||||
+ * Recipes for smelting an item inside of a furnace.
|
||||
+ * Recipes for smelting an item inside a furnace.
|
||||
+ */
|
||||
+ SMELTING(true),
|
||||
+ /**
|
||||
+ * Recipes for smelting an item inside of a blasting furnace.
|
||||
+ * Recipes for smelting an item inside a blasting furnace.
|
||||
+ */
|
||||
+ BLASTING(true),
|
||||
+ /**
|
||||
+ * Recipes for smelting an item inside of a smoker.
|
||||
+ * Recipes for smelting an item inside a smoker.
|
||||
+ */
|
||||
+ SMOKING(true),
|
||||
+ /**
|
||||
@@ -64,12 +64,12 @@ index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b404
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index aa04d7df70d99402c91e920fd693d7d4fb655786..6bb7341460eab62e83918d3b47fe89302027e9fe 100644
|
||||
index 6917931966377c51db88a3364997a110dd987970..9be68828aaecba89444e745e2d4126557c02868d 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4010,6 +4010,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
@@ -49,6 +49,36 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
|
||||
|
||||
+ // Parchment start
|
||||
+ /**
|
||||
@@ -101,6 +101,6 @@ index aa04d7df70d99402c91e920fd693d7d4fb655786..6bb7341460eab62e83918d3b47fe8930
|
||||
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType);
|
||||
+ // Parchment end
|
||||
+
|
||||
// Paper start
|
||||
/**
|
||||
* Represents various map environment types that a world may be
|
||||
*/
|
||||
* @return The amount of Entities in this world
|
||||
|
||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 64734c0ca89859294bde01da3dcaee6dc1840894..205cd1d53bef3a8d18315561543f815ede791570 100644
|
||||
index 2c84eb129191f057ab96000dd2e2446ad44972c7..55ebfbda0a308edecbd4e7a71e36fb7ccb2f7ad5 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1597,6 +1597,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@org.jetbrains.annotations.ApiStatus.Experimental // Paper
|
||||
@@ -1725,6 +1725,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@ApiStatus.Experimental
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
+ // Parchment start
|
||||
@@ -19,7 +19,7 @@ index 64734c0ca89859294bde01da3dcaee6dc1840894..205cd1d53bef3a8d18315561543f815e
|
||||
+ * @param plugin Plugin that has hidden entities
|
||||
+ * @return a view of hidden entity UUIDs
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ @ApiStatus.Experimental
|
||||
+ public java.util.@NotNull Set<java.util.UUID> getHiddenEntities(@NotNull Plugin plugin);
|
||||
+ // Parchment end
|
||||
+
|
||||
|
||||
@@ -5,122 +5,94 @@ 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 852f5673fb3f9c7d7ad44b01d04b3dcdf7352e50..52dc9dd0e45c6b20b2414bd74726ade049959e72 100644
|
||||
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..16198861748b29c537527151216e79c7c32e7204 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
package co.aikar.timings;
|
||||
|
||||
+import co.aikar.timings.event.TimingsModifyEvent;
|
||||
+import co.aikar.timings.event.TimingsModifyEvent.Action;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.EvictingQueue;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -139,7 +141,24 @@ public final class Timings {
|
||||
@@ -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 TimingsModifyEvent}, if cancelled the timings will not be reset
|
||||
+ * 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, Action.RESET).callEvent()) {
|
||||
+ 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 61cfad5cd53980836e1fd6ecf08a760166fff2b9..b668b91f2159cd693e95a1652ca0c65012aa7a88 100644
|
||||
index e801e79fa57c44b2e5d359647c920f88064826f1..012d2281c386d2e5f5a655079c0cbfa4545d6476 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
@@ -60,12 +60,14 @@ public class TimingsCommand extends BukkitCommand {
|
||||
@@ -63,10 +63,12 @@ public class TimingsCommand extends BukkitCommand {
|
||||
}
|
||||
final String arg = args[0];
|
||||
if ("on".equalsIgnoreCase(arg)) {
|
||||
- Timings.setTimingsEnabled(true);
|
||||
- sender.sendMessage(text("Enabled Timings & Reset"));
|
||||
+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.ENABLE).callEvent()) {
|
||||
+ Timings.setTimingsEnabled(true, sender);
|
||||
+ }
|
||||
+ 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)) {
|
||||
- Timings.setTimingsEnabled(false);
|
||||
- sender.sendMessage(text("Disabled Timings"));
|
||||
+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.DISABLE).callEvent()) {
|
||||
+ Timings.setTimingsEnabled(false, sender);
|
||||
+ }
|
||||
+ 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;
|
||||
}
|
||||
|
||||
@@ -76,20 +78,22 @@ public class TimingsCommand extends BukkitCommand {
|
||||
@@ -79,15 +81,18 @@ public class TimingsCommand extends BukkitCommand {
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if ("verbon".equalsIgnoreCase(arg)) {
|
||||
- Timings.setVerboseTimingsEnabled(true);
|
||||
- sender.sendMessage(text("Enabled Verbose Timings"));
|
||||
+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_ON).callEvent()) {
|
||||
+ Timings.setVerboseTimingsEnabled(true);
|
||||
+ }
|
||||
+ 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)) {
|
||||
- Timings.setVerboseTimingsEnabled(false);
|
||||
- sender.sendMessage(text("Disabled Verbose Timings"));
|
||||
+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_OFF).callEvent()) {
|
||||
+ Timings.setVerboseTimingsEnabled(false);
|
||||
+ }
|
||||
+ 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) {
|
||||
- TimingsManager.reset();
|
||||
- sender.sendMessage(text("Timings reset. Please wait 5-10 minutes before using /timings report.", NamedTextColor.RED));
|
||||
+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) {
|
||||
+ TimingsManager.reset();
|
||||
+ }
|
||||
+ 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 {
|
||||
lastResetAttempt = now;
|
||||
- sender.sendMessage(text("WARNING: Timings v2 should not be reset. If you are experiencing lag, please wait 3 minutes and then issue a report. The best timings will include 10+ minutes, with data before and after your lag period. If you really want to reset, run this command again within 30 seconds.", NamedTextColor.RED));
|
||||
}
|
||||
} else if (
|
||||
"paste".equalsIgnoreCase(arg) ||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
index 3af5b8ea795311582044c712de50d29412024b77..b509aa8d2b05e913277713308e2eea46e631a5df 100644
|
||||
index 3af5b8ea795311582044c712de50d29412024b77..806a1e528aae9a26413b483855130bef78ca72fb 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
@@ -59,7 +59,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
@@ -59,6 +59,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
|
||||
@Override
|
||||
public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
||||
- net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
|
||||
+ if (new co.aikar.timings.event.TimingsMessageEvent(this.senders, message).callEvent()) {
|
||||
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
|
||||
+ }
|
||||
+ if (!new co.aikar.timings.event.TimingsMessageEvent(this.senders, message).callEvent()) return; // Parchment
|
||||
net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -70,7 +72,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
@@ -70,6 +71,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
|
||||
@Override
|
||||
public void sendMessage(@NotNull String message) {
|
||||
- senders.forEach((sender) -> sender.sendMessage(message));
|
||||
+ if (new co.aikar.timings.event.TimingsMessageEvent(this.senders, net.kyori.adventure.text.Component.text(message)).callEvent()) {
|
||||
+ senders.forEach((sender) -> sender.sendMessage(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));
|
||||
}
|
||||
|
||||
public void addConsoleIfNeeded() {
|
||||
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..df78c90859999ec18c7b8758e0f1c71281e1abe4
|
||||
|
||||
@@ -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 205cd1d53bef3a8d18315561543f815ede791570..bb67075d04e31865b48e8436876ecf6f342d4d8b 100644
|
||||
index 55ebfbda0a308edecbd4e7a71e36fb7ccb2f7ad5..8d371db712879cfce4804e176ef55676aa87e515 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -49,6 +49,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -53,6 +53,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 ee3a3bda9a5b9cf3bcabf80ee3c653a2959fab0c..3e9bf06682373686d0c6f40defc56f23e785cd4b 100644
|
||||
index 6cf14afd2c1b8018c67c6cac302ae28bb12ab5a5..9ab641d268cd10a2c9bd888732d4754d520c56c7 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -297,6 +297,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
@@ -295,6 +295,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
*/
|
||||
LIGHTNING("lightning_bolt", LightningStrike.class, -1, false),
|
||||
PLAYER("player", Player.class, -1, false),
|
||||
|
||||
@@ -5,21 +5,21 @@ Subject: [PATCH] Revert BungeeChat Deprecation
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index cad12a2632b9ebb569280441c42869685db1f31a..50014fbac3aa4f8c7c930405ca89f9cdb83b771c 100644
|
||||
index 149f9088fe806467656e8b1c4157df60fda69ba7..ec34a20389fcf09904830f9778b2f429030dc197 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,7 +25,7 @@ dependencies {
|
||||
@@ -29,7 +29,7 @@ dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
api("com.google.guava:guava:31.1-jre")
|
||||
api("com.google.code.gson:gson:2.10")
|
||||
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
|
||||
+ api("net.md-5:bungeecord-chat:1.16-R0.4") // Parchment - revert
|
||||
api("org.yaml:snakeyaml:1.33")
|
||||
+ api("net.md-5:bungeecord-chat:1.16-R0.4") // Paper // Parchment - revert
|
||||
api("org.yaml:snakeyaml:2.0")
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
@@ -106,7 +106,7 @@ tasks.withType<Javadoc> {
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/1.33/",
|
||||
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
|
||||
@@ -110,7 +110,7 @@ tasks.withType<Javadoc> {
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.0/",
|
||||
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
|
||||
// Paper start
|
||||
- //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat
|
||||
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat // Parchment - revert
|
||||
|
||||
Reference in New Issue
Block a user