Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Removed redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
BelgianDev committed Dec 3, 2023
1 parent 70215f1 commit a3db816
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;

import java.util.concurrent.TimeUnit;

public class TestModule extends NetworkModule {
public static Logger LOGGER;
public static Module MODULE;
Expand All @@ -38,10 +36,6 @@ protected void onActivate(@NotNull ModuleActivationContext ctx) {
LOGGER.info("Registering services..");
ctx.getServer().getServiceManager().registerService(this, DatabaseService.class, new LocalDatabaseService());

ctx.getServer().createSequenceTask(this, () -> {
LOGGER.info("Hi!");
}, 10, TimeUnit.SECONDS);

FileManager fileManager = ctx.getServer().getFileManager();

ConfigurationReader<TestConfiguration> testConfReader =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import fr.atlasworld.network.api.module.Module;
import fr.atlasworld.network.core.AtlasNetwork;
import fr.atlasworld.network.core.boot.Bootstrap;
import fr.atlasworld.network.core.console.commands.InfoCommand;
import fr.atlasworld.network.core.console.commands.StopCommand;
import fr.atlasworld.network.core.logging.LogUtils;
import net.minecrell.terminalconsole.SimpleTerminalConsole;
Expand Down Expand Up @@ -57,7 +56,6 @@ public SystemConsole(CommandDispatcher<CommandSource> dispatcher) {

private void register() {
StopCommand.register(this.dispatcher);
InfoCommand.register(this.dispatcher);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package fr.atlasworld.network.core.console.arguments;

import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.List;

public class AddressCommandArgument implements ArgumentType<InetAddress> {
@Override
public InetAddress parse(StringReader reader) throws CommandSyntaxException {
String input = reader.readString();

try {
return InetAddress.getByName(input);
} catch (UnknownHostException e) {
throw CommandSyntaxException.BUILT_IN_EXCEPTIONS.literalIncorrect().createWithContext(reader, "127.0.0.1:1234 or 127.0.0.1");
}
}

@Override
public Collection<String> getExamples() {
return List.of("127.0.0.1", "127.0.0.1:1234");
}
}

This file was deleted.

0 comments on commit a3db816

Please sign in to comment.