aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0356-SendSignEvent.patch
blob: d61f8aedea4b2a4e6b20faf492015bcc3f615e3c (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..8cc0e1eb7a1a851b3c5ea3e002149b0d96bc5972
--- /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<Component> getLines();
+
+    /**
+     * @param line the line in which to modify
+     * @param component the component in which to set
+     */
+    public abstract void setLine(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;
+    }
+}