Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
end_of_line = lf
insert_final_newline = false

[*.java]
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
11 changes: 0 additions & 11 deletions bukkit/src/main/java/io/github/gonalez/znpcs/ServersNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.github.gonalez.znpcs.ZNPConfigUtils.PluginConfigConfigurationFormat;
import io.github.gonalez.znpcs.commands.list.DefaultCommand;
import io.github.gonalez.znpcs.configuration.ConfigConfiguration;
import io.github.gonalez.znpcs.configuration.DataConfiguration;
import io.github.gonalez.znpcs.listeners.InventoryListener;
import io.github.gonalez.znpcs.listeners.PlayerListener;
Expand Down Expand Up @@ -55,8 +53,6 @@ public class ServersNPC extends JavaPlugin {

public static BungeeUtils BUNGEE_UTILS;

private ZNPConfigSaveTask configSaveTask;

@Override
public void onEnable() {
Path pluginPath = getDataFolder().toPath();
Expand All @@ -71,8 +67,6 @@ public void onEnable() {
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
new MetricsLite(this, 8054);

ZNPConfigUtils.setConfigurationManager(new PluginConfigConfigurationFormat(pluginPath, GSON));

SkinFetcher skinFetcher =
SkinFetcherImpl.builder()
.setSkinExecutor(Executors.newSingleThreadExecutor())
Expand All @@ -86,8 +80,6 @@ public void onEnable() {
Bukkit.getOnlinePlayers().forEach(ZUser::find);

new NPCManagerTask(this);
(configSaveTask = new ZNPConfigSaveTask()).runTaskTimerAsynchronously(this, 300,
ZNPConfigUtils.getConfig(ConfigConfiguration.class).saveNpcsDelaySeconds);
new NpcRefreshSkinTask(skinFetcher).runTaskTimerAsynchronously(this, 0L, 20L);

new PlayerListener(this);
Expand All @@ -97,9 +89,6 @@ public void onEnable() {
@Override
public void onDisable() {
Bukkit.getOnlinePlayers().forEach(ZUser::unregister);
if (configSaveTask != null) {
configSaveTask.run();
}
}

/**
Expand Down

This file was deleted.

87 changes: 0 additions & 87 deletions bukkit/src/main/java/io/github/gonalez/znpcs/ZNPConfigUtils.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.github.gonalez.znpcs.commands;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.collect.ImmutableList;
import io.github.gonalez.znpcs.command.CommandEnvironment;
import io.github.gonalez.znpcs.command.CommandResult;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

public final class BukkitCommand extends Command {
private final io.github.gonalez.znpcs.command.Command forward;
private final CommandEnvironment commandEnvironment;

public BukkitCommand(
String name,
io.github.gonalez.znpcs.command.Command forward,
CommandEnvironment commandEnvironment) {
super(name);
this.forward = checkNotNull(forward);
this.commandEnvironment = checkNotNull(commandEnvironment);
}

@Override
public boolean execute(CommandSender sender, String name, String[] args) {
CommandResult commandResult = commandEnvironment.executeCommand(forward, ImmutableList.copyOf(args));
return !commandResult.hasError();
}
}
76 changes: 0 additions & 76 deletions bukkit/src/main/java/io/github/gonalez/znpcs/commands/Command.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading