mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Pufferfish) (#1575)
Upstream has released updates that appear to apply and compile correctly Pufferfish Changes: pufferfish-gg/Pufferfish@c9f4e20 Final 1.20.4 Update pufferfish-gg/Pufferfish@1f3ad02 Final 1.20.4 update, for realzies pufferfish-gg/Pufferfish@b1ab664 Enable SIMD on java 21 pufferfish-gg/Pufferfish@0674c2b 1.21 compiles pufferfish-gg/Pufferfish@98ea973 Fix 1.21 version checkers pufferfish-gg/Pufferfish@68f859c Fix lambda/tick guard patch pufferfish-gg/Pufferfish@eaa18d5 Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d72eea Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d3c743 Update pufferfish version detector stuff pufferfish-gg/Pufferfish@5e30963 Fix crash bug pufferfish-gg/Pufferfish@12571eb Use mojmapped paperclip jar instead (CI only) pufferfish-gg/Pufferfish@4d16ae0 Drop a patch - moonrise includes it pufferfish-gg/Pufferfish@52c2d05 Revert "Drop a patch - moonrise includes it" pufferfish-gg/Pufferfish@bdb56f1 Fix entity interactions with fluids pufferfish-gg/Pufferfish@469e5c1 Updated Upstream (Paper) pufferfish-gg/Pufferfish@d75961f 1.21.1 Update (Updated Upstream (Paper))
This commit is contained in:
@@ -1,198 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 00:57:16 -0500
|
||||
Subject: [PATCH] Ridables
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 725ef320f929d5e3d141c1ed3246d73a7d741f31..514611cf71cafc8e7e07ef901c2ccad03cd5f31b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1159,4 +1159,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull String getScoreboardEntryName();
|
||||
// Paper end - entity scoreboard name
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the riding player
|
||||
+ *
|
||||
+ * @return Riding player
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ Player getRider();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is being ridden
|
||||
+ *
|
||||
+ * @return True if being ridden
|
||||
+ */
|
||||
+ boolean hasRider();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is ridable
|
||||
+ *
|
||||
+ * @return True if ridable
|
||||
+ */
|
||||
+ boolean isRidable();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is ridable in water
|
||||
+ *
|
||||
+ * @return True if ridable in water
|
||||
+ */
|
||||
+ boolean isRidableInWater();
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a037df01b07af9ffb98b67aca412c1d34fade03b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java
|
||||
@@ -0,0 +1,103 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Mob;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Triggered when a ridable mob moves with a rider
|
||||
+ */
|
||||
+public class RidableMoveEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+ private final Player rider;
|
||||
+ private Location from;
|
||||
+ private Location to;
|
||||
+
|
||||
+ public RidableMoveEvent(@NotNull Mob entity, @NotNull Player rider, @NotNull Location from, @NotNull Location to) {
|
||||
+ super(entity);
|
||||
+ this.rider = rider;
|
||||
+ this.from = from;
|
||||
+ this.to = to;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Mob getEntity() {
|
||||
+ return (Mob) entity;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Player getRider() {
|
||||
+ return rider;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isCancelled() {
|
||||
+ return canceled;
|
||||
+ }
|
||||
+
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ canceled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the location this entity moved from
|
||||
+ *
|
||||
+ * @return Location the entity moved from
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getFrom() {
|
||||
+ return from;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the location to mark as where the entity moved from
|
||||
+ *
|
||||
+ * @param from New location to mark as the entity's previous location
|
||||
+ */
|
||||
+ public void setFrom(@NotNull Location from) {
|
||||
+ validateLocation(from);
|
||||
+ this.from = from;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the location this entity moved to
|
||||
+ *
|
||||
+ * @return Location the entity moved to
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getTo() {
|
||||
+ return to;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the location that this entity will move to
|
||||
+ *
|
||||
+ * @param to New Location this entity will move to
|
||||
+ */
|
||||
+ public void setTo(@NotNull Location to) {
|
||||
+ validateLocation(to);
|
||||
+ this.to = to;
|
||||
+ }
|
||||
+
|
||||
+ private void validateLocation(@NotNull Location loc) {
|
||||
+ Preconditions.checkArgument(loc != null, "Cannot use null location!");
|
||||
+ Preconditions.checkArgument(loc.getWorld() != null, "Cannot use null location with null world!");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3d3a7d898e3278ce998d713dafbb4b354dad7fc7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java
|
||||
@@ -0,0 +1,37 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+public class RidableSpacebarEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public RidableSpacebarEvent(@NotNull Entity entity) {
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user