aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0374-SendSignEvent.patch
blob: c1d2dfcd6b1f7d179eec0dd357b5298c5d9e815f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 4 Dec 2016 22:06:10 -0500
Subject: [PATCH] SendSignEvent


diff --git a/src/main/java/io/papermc/paper/event/block/SendSignEvent.java b/src/main/java/io/papermc/paper/event/block/SendSignEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..fa188e8bf3965234b2634b01ab1078c2fa76e7be
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/SendSignEvent.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2016 Starlis LLC / Daniel Ennis (Aikar) - MIT License
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining
+ *  a copy of this software and associated documentation files (the
+ *  "Software"), to deal in the Software without restriction, including
+ *  without limitation the rights to use, copy, modify, merge, publish,
+ *  distribute, sublicense, and/or sell copies of the Software, and to
+ *  permit persons to whom the Software is furnished to do so, subject to
+ *  the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be
+ *  included in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package io.papermc.paper.event.block;
+
+import net.kyori.adventure.text.Component;
+
+import org.bukkit.block.Block;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+public abstract class SendSignEvent extends Event {
+
+    /**
+     * @return the Block which is being sent
+     */
+    @NotNull
+    public abstract Block getBlock();
+
+    /**
+     * This collection may be an immutable view
+     *
+     * @return the lines of the sign
+    **/
+    @NotNull
+    public abstract List<@NotNull Component> lines();
+
+    /**
+     * @param line the line in which to modify
+     * @param component the component in which to set
+     */
+    public abstract void line(int line, @Nullable net.kyori.adventure.text.Component component);
+
+    private static final HandlerList handlers = new HandlerList();
+
+    @NotNull
+    public HandlerList getHandlers() {
+        return handlers;
+    }
+
+    @NotNull
+    public static HandlerList getHandlerList() {
+        return handlers;
+    }
+}