Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: masmc05 <masmc05@gmail.com>
This commit is contained in:
parent
3fc93581bb
commit
f17519338b
1360 changed files with 1817 additions and 1446 deletions
68
patches/api/0236-Add-BlockFailedDispenseEvent.patch
Normal file
68
patches/api/0236-Add-BlockFailedDispenseEvent.patch
Normal file
|
@ -0,0 +1,68 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TheViperShow <29604693+TheViperShow@users.noreply.github.com>
|
||||
Date: Wed, 22 Apr 2020 09:40:23 +0200
|
||||
Subject: [PATCH] Add BlockFailedDispenseEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/event/block/BlockFailedDispenseEvent.java b/src/main/java/io/papermc/paper/event/block/BlockFailedDispenseEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d531b034b49b163e5095e840a5c9c4fe5eb73319
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/event/block/BlockFailedDispenseEvent.java
|
||||
@@ -0,0 +1,56 @@
|
||||
+package io.papermc.paper.event.block;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a block tries to dispense an item, but its inventory is empty.
|
||||
+ */
|
||||
+public class BlockFailedDispenseEvent extends BlockEvent {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private boolean shouldPlayEffect = true;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public BlockFailedDispenseEvent(@NotNull Block theBlock) {
|
||||
+ super(theBlock);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return if the effect should be played
|
||||
+ */
|
||||
+ public boolean shouldPlayEffect() {
|
||||
+ return this.shouldPlayEffect;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets if the effect for empty dispensers should be played
|
||||
+ *
|
||||
+ * @param playEffect if the effect should be played
|
||||
+ */
|
||||
+ public void shouldPlayEffect(boolean playEffect) {
|
||||
+ this.shouldPlayEffect = playEffect;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return {@link #shouldPlayEffect()}
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean callEvent() {
|
||||
+ super.callEvent();
|
||||
+ return this.shouldPlayEffect();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ public static @NotNull HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+}
|
Loading…
Add table
Add a link
Reference in a new issue