/
MCServer.java
123 lines (93 loc) · 3.87 KB
/
MCServer.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
package com.laytonsmith.abstraction;
import com.laytonsmith.abstraction.enums.MCBarColor;
import com.laytonsmith.abstraction.enums.MCBarStyle;
import com.laytonsmith.abstraction.enums.MCInventoryType;
import com.laytonsmith.abstraction.enums.MCVersion;
import com.laytonsmith.abstraction.pluginmessages.MCMessenger;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/**
*
*
*/
public interface MCServer extends AbstractionObject{
public String getName();
public Collection<MCPlayer> getOnlinePlayers();
public boolean dispatchCommand(MCCommandSender cs, String string) throws MCCommandException;
public MCPluginManager getPluginManager();
public MCPlayer getPlayer(String name);
public MCPlayer getPlayer(UUID uuid);
public MCWorld getWorld(String name);
public List<MCWorld> getWorlds();
public void broadcastMessage(String message);
public void broadcastMessage(String message, String permission);
public MCConsoleCommandSender getConsole();
public MCItemFactory getItemFactory();
public MCCommandMap getCommandMap();
public MCInventory createInventory(MCInventoryHolder owner, MCInventoryType type);
public MCInventory createInventory(MCInventoryHolder owner, int size, String title);
public MCInventory createInventory(MCInventoryHolder owner, int size);
/**
* Provides access to local user data associated with a name.
* Depending on the implementation, a web lookup with the official API may or may not be performed.
*
* @param player The name to lookup
* @return An object containing any info that can be accessed regardless of a connected player.
*/
public MCOfflinePlayer getOfflinePlayer(String player);
/**
* Provides access to local user data associated with a UUID.
* Depending on the implementation, a web lookup with the official API may or may not be performed.
*
* @param uuid The UUID to lookup
* @return An object containing any info that can be accessed regardless of a connected player.
*/
public MCOfflinePlayer getOfflinePlayer(UUID uuid);
public MCOfflinePlayer[] getOfflinePlayers();
/* Boring information get methods -.- */
public String getServerName();
public String getMotd();
public String getAPIVersion();
public String getServerVersion();
public MCVersion getMinecraftVersion();
public int getPort();
public String getIp();
boolean getAllowEnd();
boolean getAllowFlight();
boolean getAllowNether();
boolean getOnlineMode();
public int getViewDistance();
public String getWorldContainer();
public int getMaxPlayers();
public List<MCOfflinePlayer> getBannedPlayers();
public List<MCOfflinePlayer> getWhitelistedPlayers();
public List<MCOfflinePlayer> getOperators();
public void banName(String name);
public void unbanName(String name);
public void banIP(String address);
public Set<String> getIPBans();
public void unbanIP(String address);
public MCScoreboard getMainScoreboard();
public MCScoreboard getNewScoreboard();
public void runasConsole(String cmd);
public MCMessenger getMessenger();
public boolean unloadWorld(MCWorld world, boolean save);
public boolean addRecipe(MCRecipe recipe);
public List<MCRecipe> getRecipesFor(MCItemStack result);
public List<MCRecipe> allRecipes();
public void clearRecipes();
public void resetRecipes();
public void savePlayers();
public void shutdown();
/**
* Dispatches a command like {@link #dispatchCommand(com.laytonsmith.abstraction.MCCommandSender, java.lang.String) }, but
* attempts to capture the output of the command, and returns that.
* @param commandSender The command sender
* @param cmd The command
* @return The command's captured output, if possible, otherwise an empty string, never null.
*/
public String dispatchAndCaptureCommand(MCCommandSender commandSender, String cmd);
MCBossBar createBossBar(String title, MCBarColor color, MCBarStyle style);
}