-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
DenizenImplementation.java
171 lines (119 loc) · 4.38 KB
/
DenizenImplementation.java
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package com.denizenscript.denizencore;
import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.denizencore.objects.core.ListTag;
import com.denizenscript.denizencore.scripts.ScriptEntry;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.scripts.containers.ScriptContainer;
import com.denizenscript.denizencore.scripts.queues.ScriptQueue;
import com.denizenscript.denizencore.tags.TagContext;
import com.denizenscript.denizencore.utilities.debugging.Debuggable;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import java.io.File;
import java.util.function.Consumer;
/**
* Interface representing all the information that an implementation must provide to the engine.
*/
public interface DenizenImplementation {
/**
* Return a list of all folders that the implementation has scripts within.
*/
File getScriptFolder();
/**
* Return the current version of the implementation.
* EG, "Gamey Game 1.0 Denizen 0.9"
*/
String getImplementationVersion();
/**
* Output a debug message to console.
*/
void debugMessage(String message);
/**
* Output an exception to console.
*/
void debugException(Throwable ex);
/**
* Output an error to console.
*/
void debugError(String error);
/**
* Output an error to console, specific to a script queue.
*/
void debugError(ScriptQueue queue, String error);
/**
* Output an error to console, specific to a script queue.
*/
void debugError(ScriptQueue queue, Throwable error);
/**
* Output a command information report.
*/
void debugReport(Debuggable caller, String name, String message);
/**
* Output an 'Okay!' message.
*/
void debugApproval(String message);
/**
* Outputs a message specific to a debuggable object.
*/
void debugEntry(Debuggable entry, String message);
/**
* Outputs a message specific to a debuggable object.
*/
void debugEntry(Debuggable entry, Debug.DebugElement element, String message);
/**
* Outputs a message specific to a debuggable object.
*/
void debugEntry(Debuggable entry, Debug.DebugElement element);
/**
* Return the name of the implementation.
* EG, "Gamey Game".
*/
String getImplementationName();
/**
* Run any code that fires before a script reload goes through,
* EG, clearing custom data.
*/
void preScriptReload();
/**
* Run any code that fires after a script reload goes through,
* EG, running a public Reload event.
*/
void onScriptReload();
/**
* Return an empty ScriptEntryData object of the implementation's variety.
* This is to avoid casting issues when ScriptEntry's use generic data objects.
*/
ScriptEntryData getEmptyScriptEntryData();
boolean handleCustomArgs(ScriptEntry entry, Argument arg, boolean if_ignore);
void refreshScriptContainers();
String scriptQueueSpeed();
ListTag valueOfFlagListTag(String input);
boolean matchesFlagListTag(String input);
boolean serverHasFlag(String flag);
TagContext getTagContext(ScriptContainer container);
TagContext getTagContext(ScriptEntry entry);
int getTagTimeout();
boolean allowConsoleRedirection();
String cleanseLogString(String str);
boolean matchesType(String comparable, String comparedTo);
boolean allowedToWebget();
void preTagExecute();
void postTagExecute();
boolean needsHandleArgPrefix(String prefix);
boolean shouldDebug(Debuggable debug);
void debugQueueExecute(ScriptEntry entry, String queue, String execute);
void debugTagFill(Debuggable entry, String tag, String result);
boolean tagTimeoutWhenSilent();
boolean getDefaultDebugMode();
boolean canWriteToFile(File f);
String getRandomColor();
int whileMaxLoops();
boolean allowLogging();
boolean canReadFile(File f);
boolean allowFileCopy();
File getDataFolder();
boolean allowStrangeYAMLSaves();
String queueHeaderInfo(ScriptEntry entry);
void startRecording();
void stopRecording();
void submitRecording(Consumer<String> processResult);
}