1
1
package cat .nyaa .ukit .signedit ;
2
2
3
3
import cat .nyaa .ukit .SpigotLoader ;
4
+ import cat .nyaa .ukit .api .UKitAPI ;
4
5
import cat .nyaa .ukit .utils .LockettePluginUtils ;
5
6
import cat .nyaa .ukit .utils .SubCommandExecutor ;
6
7
import cat .nyaa .ukit .utils .SubTabCompleter ;
@@ -52,6 +53,10 @@ public boolean invokeCommand(CommandSender commandSender, Command command, Strin
52
53
commandSender .sendMessage (pluginInstance .language .signEditLang .cantModifyLockSign .produce ());
53
54
return true ;
54
55
}
56
+ if (taggedAsUnchangeable (sign )) {
57
+ commandSender .sendMessage (pluginInstance .language .signEditLang .signTaggedAsUnchangeable .produce ());
58
+ return true ;
59
+ }
55
60
int line ;
56
61
try {
57
62
line = Integer .parseInt (args [0 ]);
@@ -104,6 +109,10 @@ private boolean inInSpawnProtection(Location location) {
104
109
return location .toVector ().subtract (location .getWorld ().getSpawnLocation ().toVector ()).length () <= pluginInstance .getServer ().getSpawnRadius ();
105
110
}
106
111
112
+ private boolean taggedAsUnchangeable (Sign sign ) {
113
+ return sign .getPersistentDataContainer ().has (UKitAPI .signEditLockTagKey );
114
+ }
115
+
107
116
@ Override
108
117
public String getHelp () {
109
118
return pluginInstance .language .signEditLang .help .produce (
@@ -130,6 +139,9 @@ public List<String> tabComplete(CommandSender sender, Command command, String al
130
139
if (LockettePluginUtils .isLockSign (targetBlock )) {
131
140
return List .of ();
132
141
}
142
+ if (taggedAsUnchangeable (sign )) {
143
+ return List .of ();
144
+ }
133
145
var lookingSide = Utils .getSignSideLookingAt (player , sign );
134
146
var signSide = sign .getSide (lookingSide );
135
147
var suggestion = signSide .getLine (line - 1 ).replaceAll ("&" , "§§" ).replaceAll ("§" , "&" );
0 commit comments