2020-10-11 16:02:26 +02:00
|
|
|
package demo;
|
2020-02-17 17:33:53 +01:00
|
|
|
|
2020-10-11 16:02:26 +02:00
|
|
|
import demo.blocks.BurningTorchBlock;
|
|
|
|
import demo.blocks.StoneBlock;
|
|
|
|
import demo.blocks.UpdatableBlockDemo;
|
2020-11-09 23:48:34 +01:00
|
|
|
import demo.commands.GamemodeCommand;
|
2020-11-04 04:45:46 +01:00
|
|
|
import demo.commands.TestCommand;
|
2020-04-24 03:25:58 +02:00
|
|
|
import net.minestom.server.MinecraftServer;
|
|
|
|
import net.minestom.server.command.CommandManager;
|
|
|
|
import net.minestom.server.instance.block.BlockManager;
|
|
|
|
import net.minestom.server.instance.block.rule.vanilla.RedstonePlacementRule;
|
2020-05-04 18:15:29 +02:00
|
|
|
import net.minestom.server.storage.StorageManager;
|
|
|
|
import net.minestom.server.storage.systems.FileStorageSystem;
|
2020-04-24 03:25:58 +02:00
|
|
|
import net.minestom.server.utils.time.TimeUnit;
|
|
|
|
import net.minestom.server.utils.time.UpdateOption;
|
2020-04-01 13:16:18 +02:00
|
|
|
|
2020-02-17 17:33:53 +01:00
|
|
|
|
|
|
|
public class Main {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
MinecraftServer minecraftServer = MinecraftServer.init();
|
|
|
|
|
|
|
|
BlockManager blockManager = MinecraftServer.getBlockManager();
|
2020-04-01 13:16:18 +02:00
|
|
|
blockManager.registerCustomBlock(new StoneBlock());
|
|
|
|
blockManager.registerCustomBlock(new UpdatableBlockDemo());
|
2020-05-05 15:55:21 +02:00
|
|
|
blockManager.registerCustomBlock(new BurningTorchBlock());
|
2020-04-01 13:16:18 +02:00
|
|
|
|
2020-04-12 10:24:25 +02:00
|
|
|
blockManager.registerBlockPlacementRule(new RedstonePlacementRule());
|
|
|
|
|
2020-04-01 13:16:18 +02:00
|
|
|
CommandManager commandManager = MinecraftServer.getCommandManager();
|
2020-07-14 13:35:07 +02:00
|
|
|
commandManager.register(new TestCommand());
|
2020-11-09 23:48:34 +01:00
|
|
|
commandManager.register(new GamemodeCommand());
|
2020-11-04 04:45:46 +01:00
|
|
|
/*commandManager.register(new EntitySelectorCommand());
|
2020-11-02 02:53:12 +01:00
|
|
|
commandManager.register(new HealthCommand());
|
2020-07-24 01:03:24 +02:00
|
|
|
commandManager.register(new SimpleCommand());
|
|
|
|
commandManager.register(new GamemodeCommand());
|
|
|
|
commandManager.register(new DimensionCommand());
|
2020-07-29 05:03:07 +02:00
|
|
|
commandManager.register(new ShutdownCommand());
|
2020-11-04 04:45:46 +01:00
|
|
|
commandManager.register(new TeleportCommand());*/
|
2020-04-01 13:16:18 +02:00
|
|
|
|
2020-11-02 04:13:43 +01:00
|
|
|
commandManager.setUnknownCommandCallback((sender, command) -> sender.sendMessage("unknown command"));
|
|
|
|
|
2020-08-21 01:32:59 +02:00
|
|
|
|
2020-05-04 18:15:29 +02:00
|
|
|
StorageManager storageManager = MinecraftServer.getStorageManager();
|
2020-05-06 22:35:32 +02:00
|
|
|
storageManager.defineDefaultStorageSystem(FileStorageSystem::new);
|
2020-05-04 18:15:29 +02:00
|
|
|
|
2020-04-17 21:34:01 +02:00
|
|
|
MinecraftServer.getBenchmarkManager().enable(new UpdateOption(10 * 1000, TimeUnit.MILLISECOND));
|
2020-02-17 17:33:53 +01:00
|
|
|
|
2020-07-31 20:44:58 +02:00
|
|
|
MinecraftServer.getSchedulerManager().buildShutdownTask(() -> System.out.println("Good night")).schedule();
|
2020-04-28 19:22:54 +02:00
|
|
|
|
2020-03-20 19:50:22 +01:00
|
|
|
PlayerInit.init();
|
|
|
|
|
2020-11-09 23:48:34 +01:00
|
|
|
//VelocityProxy.enable("rBeJJ79W4MVU");
|
2020-11-10 23:16:35 +01:00
|
|
|
//BungeeCordProxy.enable();
|
2020-11-09 23:48:34 +01:00
|
|
|
|
2020-11-11 21:35:20 +01:00
|
|
|
// MojangAuth.init();
|
2020-06-22 00:57:53 +02:00
|
|
|
|
2020-08-11 01:41:14 +02:00
|
|
|
minecraftServer.start("0.0.0.0", 25565, PlayerInit.getResponseDataConsumer());
|
2020-02-17 17:33:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|