本文整理汇总了Java中net.minecraft.command.ServerCommandManager类的典型用法代码示例。如果您正苦于以下问题:Java ServerCommandManager类的具体用法?Java ServerCommandManager怎么用?Java ServerCommandManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerCommandManager类属于net.minecraft.command包,在下文中一共展示了ServerCommandManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serverStart
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent event) {
MinecraftServer server = event.getServer();
ICommandManager command = server.getCommandManager();
ServerCommandManager serverCommand = (ServerCommandManager) command;
serverCommand.registerCommand(new CommandAlly());
serverCommand.registerCommand(new CommandAllyAccept());
serverCommand.registerCommand(new CommandAllyList());
serverCommand.registerCommand(new CommandAllyReject());
serverCommand.registerCommand(new CommandAllyRemove());
serverCommand.registerCommand(new CommandEnemy());
serverCommand.registerCommand(new CommandEnemyList());
serverCommand.registerCommand(new CommandEnemyRemove());
}
示例2: serverStart
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandTModifiers());
if(!jsonFile.exists())
try {
jsonFile.createNewFile();
PrintStream out = new PrintStream(new FileOutputStream(jsonFile));
writeDefaultJSON(out);
out.close();
} catch (IOException e) {
Logger.getLogger(NAME).log(Level.WARNING, "Could not create json file - " + e);
}
reloadModifiers();
// for(ItemModifier mod : ModifyBuilder.instance.itemModifiers)
// System.out.println(mod.getClass());
new Thread(){
public void run(){
ItemUpdate.checkForUpdate();
}
}.start();
}
示例3: registerServerCommands
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
/**
* Registers all server commands
*
* @return Whether the server commands were registered successfully
*/
private void registerServerCommands(MinecraftServer server) throws Exception {
List<Class<? extends StandardCommand>> serverCommands = this.mod.getServerCommandClasses();
if (serverCommands == null) throw new RuntimeException("Server Command Classes not loaded");
ServerCommandManager commandManager = (ServerCommandManager) server.getCommandManager();
for (Class<? extends StandardCommand> cmdClass : serverCommands) {
try {
StandardCommand cmd = cmdClass.newInstance();
if (cmd instanceof MultipleCommands) {
Constructor<? extends StandardCommand> ctr = cmdClass.getConstructor(int.class);
for (int i = 0; i < ((MultipleCommands) cmd).getCommandNames().length; i++)
if (this.mod.isCommandEnabled(((MultipleCommands) cmd).getCommandNames()[i]))
commandManager.registerCommand(new ServerCommand(ServerCommand.upcast(ctr.newInstance(i))));
}
else if (this.mod.isCommandEnabled(cmd.getCommandName()))
commandManager.registerCommand(new ServerCommand(ServerCommand.upcast(cmd)));
}
catch (Exception ex) {
this.mod.getLogger().warn("Skipping Server Command " + cmdClass.getName() + " due to the following exception during loading", ex);
}
}
}
示例4: onServerStarting
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
ICommandManager manager = event.getServer().getCommandManager();
if (manager instanceof ServerCommandManager) {
((ServerCommandManager) manager).registerCommand(CommandManager.INSTANCE);
}
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
Progression.logger.log(Level.INFO, "How did a client get in the server start?");
return;
}
//Remap all relevant data, Loads in the server data
RemappingHandler.reloadServerData(JSONLoader.getServerTabData(RemappingHandler.getHostName()), false);
World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
data = (PlayerSavedData) world.loadItemData(PlayerSavedData.class, MODNAME);
if (data == null) {
createWorldData();
}
}
示例5: MinecraftServer
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
this.field_152366_X = new PlayerProfileCache(this, field_152367_a);
mcServer = this;
this.serverProxy = p_i45281_2_;
this.anvilFile = p_i45281_1_;
this.field_147144_o = new NetworkSystem(this);
this.commandManager = new ServerCommandManager();
this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
this.field_152364_T = new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString());
this.field_147143_S = this.field_152364_T.createMinecraftSessionService();
this.field_152365_W = this.field_152364_T.createProfileRepository();
this.primaryThread = new Thread(this, "Server thread"); // CraftBukkit
this.cauldronConfig = new CauldronConfig("cauldron.yml", "cauldron");
this.tileEntityConfig = new TileEntityConfig("tileentities.yml", "cauldron_te");
}
示例6: MinecraftServer
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
public MinecraftServer(File par1File)
{
this.serverProxy = Proxy.NO_PROXY;
this.field_143008_E = 0;
this.sentPacketCountArray = new long[100];
this.sentPacketSizeArray = new long[100];
this.receivedPacketCountArray = new long[100];
this.receivedPacketSizeArray = new long[100];
this.tickTimeArray = new long[100];
this.texturePack = "";
mcServer = this;
this.anvilFile = par1File;
this.commandManager = new ServerCommandManager();
this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File);
this.registerDispenseBehaviors();
}
示例7: onServerStarting
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void onServerStarting(FMLServerStartedEvent event){
ServerCommandManager mgr = (ServerCommandManager) MinecraftServer.getServer().getCommandManager();
mgr.registerCommand(new ClaimCommand());
mgr.registerCommand(new DeleteClaim());
mgr.registerCommand(new ModifyACL());
mgr.registerCommand(new ShowClaims());
mgr.registerCommand(new HideClaims());
mgr.registerCommand(new TransferClaim());
mgr.registerCommand(new Execute());
mgr.registerCommand(new AdminInvisibility());
mgr.registerCommand(new AdminMode());
mgr.registerCommand(new TempBan());
mgr.registerCommand(new PermaBan());
mgr.registerCommand(new UnBan());
mgr.registerCommand(new OpenInventory());
mgr.registerCommand(new Warp());
}
示例8: serverStarting
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
/**
* Save the instance of the command manager and initialize the commands.
*
* @param event The server starting event that was fired.
*/
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
MinecraftServer server = event.getServer();
HueManager hueManager = HueManager.getInstance();
hueManager.setMinecraftServer(server);
this.listener.setWorld(server.getEntityWorld());
this.commandManager = (ServerCommandManager) server.getCommandManager();
this.initCommands();
}
示例9: serverStarting
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
ICommandManager commandManager = MinecraftServer.getServer().getCommandManager();
ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
addCommands(serverCommandManager);
}
示例10: addCommands
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
public void addCommands(ServerCommandManager manager)
{
manager.registerCommand(new CommandResetGame());
manager.registerCommand(new CommandPassword());
manager.registerCommand(new CommandKillme());
manager.registerCommand(new CommandPlaySound());
manager.registerCommand(new CommandStopRounds());
manager.registerCommand(new CommandContinueRound());
manager.registerCommand(new CommandInspect());
manager.registerCommand(new CommandMotD());
manager.registerCommand(new CommandKillAll());
manager.registerCommand(new CommandRobot());
manager.registerCommand(new CommandConfig());
manager.registerCommand(new CommandHotPotato());
}
示例11: serverStart
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
MinecraftServer server = MinecraftServer.getServer();
// Get's the current server instance
ICommandManager command = server.getCommandManager();
ServerCommandManager manager = (ServerCommandManager) command;
//manager.registerCommand(new CommandModInfo());
manager.registerCommand(new CommandChangelog());
manager.registerCommand(new CommandAbilities());
}
示例12: serverStart
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent e)
{
MinecraftServer server = getServer();
ICommandManager iCommandManager = server.getCommandManager();
ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager;
serverCommandManager.registerCommand(new CommandHandler());
}
示例13: serverStart
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
//Thread.currentThread().setName("EpicProportionsMod");
MinecraftServer server = MinecraftServer.getServer();
// Get's the current server instance
ICommandManager command = server.getCommandManager();
ServerCommandManager manager = (ServerCommandManager) command;
manager.registerCommand(new CommandModInfo());
manager.registerCommand(new CommandChangelog());
}
示例14: registerCommands
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
private void registerCommands(FMLServerStartingEvent event) {
MinecraftServer server = event.getServer();
ICommandManager command = server.getCommandManager();
ServerCommandManager manager = (ServerCommandManager) command;
manager.registerCommand(new CommandWallet());
manager.registerCommand(new CommandBalance());
manager.registerCommand(new CommandPay());
}
示例15: serverStarting
import net.minecraft.command.ServerCommandManager; //导入依赖的package包/类
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event){
MinecraftServer server = event.getServer();
ICommandManager cmdmng = server.getCommandManager();
if (cmdmng instanceof ServerCommandManager && cmdmng instanceof CommandHandler) {
CommandHandler cmdhnd = (CommandHandler) cmdmng;
TaleCraftCommands.register(cmdhnd);
}
// By calling this method, we create the ServerMirror for the given server.
ServerHandler.getServerMirror(server);
}