mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
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))
85 lines
2.6 KiB
Diff
85 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Mon, 27 Dec 2021 08:10:50 -0600
|
|
Subject: [PATCH] Grindstone API
|
|
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..eebb5d124456b8209d1b8e8cc4cb772dd3714f04
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
|
|
@@ -0,0 +1,72 @@
|
|
+package org.purpurmc.purpur.event.inventory;
|
|
+
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+import org.bukkit.entity.Player;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.inventory.InventoryEvent;
|
|
+import org.bukkit.inventory.GrindstoneInventory;
|
|
+import org.bukkit.inventory.InventoryView;
|
|
+import org.bukkit.inventory.ItemStack;
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+
|
|
+/**
|
|
+ * Called when a player takes the result item out of a Grindstone
|
|
+ */
|
|
+public class GrindstoneTakeResultEvent extends InventoryEvent {
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private final Player player;
|
|
+ private final ItemStack result;
|
|
+ private int experienceAmount;
|
|
+
|
|
+ public GrindstoneTakeResultEvent(@NotNull HumanEntity player, @NotNull InventoryView view, @NotNull ItemStack result, int experienceAmount) {
|
|
+ super(view);
|
|
+ this.player = (Player) player;
|
|
+ this.result = result;
|
|
+ this.experienceAmount = experienceAmount;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public Player getPlayer() {
|
|
+ return player;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public ItemStack getResult() {
|
|
+ return result;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ @Override
|
|
+ public GrindstoneInventory getInventory() {
|
|
+ return (GrindstoneInventory) super.getInventory();
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Get the amount of experience this transaction will give
|
|
+ *
|
|
+ * @return Amount of experience to give
|
|
+ */
|
|
+ public int getExperienceAmount() {
|
|
+ return this.experienceAmount;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Set the amount of experience this transaction will give
|
|
+ *
|
|
+ * @param experienceAmount Amount of experience to give
|
|
+ */
|
|
+ public void setExperienceAmount(int experienceAmount) {
|
|
+ this.experienceAmount = experienceAmount;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ @Override
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|