Skip to content

Commit

Permalink
style(prettier): prettified code
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette authored and actions-user committed Jul 25, 2021
1 parent 72b07f1 commit 1b8ea6b
Show file tree
Hide file tree
Showing 64 changed files with 125 additions and 237 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.github.arthurfiorette.sinklibrary.command;

import com.github.arthurfiorette.sinklibrary.command.wrapper.CommandInfo.CommandInfoBuilder;
import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;
import java.util.Collection;
import java.util.List;

import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginIdentifiableCommand;

import com.github.arthurfiorette.sinklibrary.command.wrapper.CommandInfo.CommandInfoBuilder;
import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;

public interface BaseCommand extends BaseComponent, PluginIdentifiableCommand {
void handle(final CommandSender sender, final Collection<String> args);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.github.arthurfiorette.sinklibrary.command;

import org.bukkit.command.CommandMap;

import com.github.arthurfiorette.sinklibrary.command.reflection.CommandReflector;
import com.github.arthurfiorette.sinklibrary.command.reflection.SimpleCommandReflector;
import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseService;

import lombok.*;
import org.bukkit.command.CommandMap;

@RequiredArgsConstructor
public abstract class CommandStorage implements BaseService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.arthurfiorette.sinklibrary.command.wrapper.CommandInfo;
import com.github.arthurfiorette.sinklibrary.command.wrapper.CommandInfo.CommandInfoBuilder;
import com.github.arthurfiorette.sinklibrary.command.wrapper.CommandWrapper;

import lombok.experimental.UtilityClass;

@UtilityClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.arthurfiorette.sinklibrary.command.reflection;

import org.bukkit.command.CommandMap;
import org.bukkit.plugin.PluginManager;

import com.github.arthurfiorette.sinklibrary.exceptions.EnablingException;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;
import org.bukkit.command.CommandMap;
import org.bukkit.plugin.PluginManager;

public interface CommandReflector extends BaseComponent {
void enable() throws EnablingException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.github.arthurfiorette.sinklibrary.command.reflection;

import java.lang.reflect.Field;

import org.bukkit.command.CommandMap;
import org.bukkit.plugin.PluginManager;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.exceptions.EnablingException;

import java.lang.reflect.Field;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.command.CommandMap;
import org.bukkit.plugin.PluginManager;

public class SimpleCommandReflector implements CommandReflector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;

import lombok.*;
import org.bukkit.ChatColor;

@Builder
public class CommandInfo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package com.github.arthurfiorette.sinklibrary.command.wrapper;

import java.util.List;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

import com.github.arthurfiorette.sinklibrary.command.BaseCommand;
import com.github.arthurfiorette.sinklibrary.command.CommandUtils;
import com.github.arthurfiorette.sinklibrary.tuple.Pair;
import com.github.arthurfiorette.sinklibrary.tuple.ValidPair;
import com.google.common.collect.Lists;

import java.util.List;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

public class CommandWrapper extends Command {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.github.arthurfiorette.sinklibrary.components;

import java.util.LinkedHashMap;
import java.util.Map;

import com.github.arthurfiorette.sinklibrary.core.SinkPlugin;
import com.github.arthurfiorette.sinklibrary.exceptions.ComponentNotRegisteredException;
import com.github.arthurfiorette.sinklibrary.exceptions.IllegalComponentException;
import com.github.arthurfiorette.sinklibrary.interfaces.*;
import com.github.arthurfiorette.sinklibrary.logging.Level;

import java.util.LinkedHashMap;
import java.util.Map;
import lombok.Getter;
import lombok.NonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.arthurfiorette.sinklibrary.config;

import java.io.File;

import org.bukkit.configuration.file.FileConfiguration;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;
import java.io.File;
import org.bukkit.configuration.file.FileConfiguration;

public interface BaseConfig extends BaseComponent {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.github.arthurfiorette.sinklibrary.config;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import java.io.File;

import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;

import lombok.Getter;

public class CustomConfig implements BaseConfig {

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.github.arthurfiorette.sinklibrary.config;

import java.io.File;

import org.bukkit.configuration.file.FileConfiguration;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;

import java.io.File;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;

public class PluginConfig implements BaseConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package com.github.arthurfiorette.sinklibrary.config.addons;

import com.github.arthurfiorette.sinklibrary.config.BaseConfig;
import com.github.arthurfiorette.sinklibrary.replacer.Replacer;
import com.github.arthurfiorette.sinklibrary.replacer.ReplacerFunction;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.bukkit.Color;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.*;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;

import com.github.arthurfiorette.sinklibrary.config.BaseConfig;
import com.github.arthurfiorette.sinklibrary.replacer.Replacer;
import com.github.arthurfiorette.sinklibrary.replacer.ReplacerFunction;

public interface EnumConfig<P extends Enum<P> & PathResolver> extends BaseConfig {
/**
* Checks if this {@link ConfigurationSection} contains the given path.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.arthurfiorette.sinklibrary.config.management;

import java.util.EnumMap;

import com.github.arthurfiorette.sinklibrary.config.BaseConfig;
import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;

import java.util.EnumMap;
import lombok.Getter;

public class ConfigStorage<L extends Enum<L> & ConfigLoader> implements BaseComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.github.arthurfiorette.sinklibrary.core;

import java.util.concurrent.*;

import org.bukkit.plugin.Plugin;

import com.github.arthurfiorette.sinklibrary.components.ComponentManager;
import com.github.arthurfiorette.sinklibrary.executor.v2.TaskContext;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;
import com.github.arthurfiorette.sinklibrary.logging.BaseLogger;
import com.github.arthurfiorette.sinklibrary.logging.Level;
import java.util.concurrent.*;
import org.bukkit.plugin.Plugin;

public interface BasePlugin extends Plugin {
void treatThrowable(Object author, Throwable throwable, String message, Object... args);
Expand Down Expand Up @@ -38,13 +36,21 @@ default <T extends BaseComponent> T getComponent(final Class<T> clazz) {
return this.getManager().getComponent(clazz);
}

default void log(final Level level, final Object author, final String message,
final Object... args) {
default void log(
final Level level,
final Object author,
final String message,
final Object... args
) {
this.getBaseLogger().log(level, author, message, args);
}

default void log(final Level level, final Object author, final String message,
final Throwable throwable) {
default void log(
final Level level,
final Object author,
final String message,
final Throwable throwable
) {
this.getBaseLogger().log(level, author, message, throwable);
}

Expand All @@ -55,5 +61,4 @@ default void log(final Level level, final String message, final Object... args)
default void log(final Level level, final String message, final Throwable throwable) {
this.getBaseLogger().log(level, message, throwable);
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.github.arthurfiorette.sinklibrary.core;

import org.bukkit.plugin.java.JavaPlugin;

import com.github.arthurfiorette.sinklibrary.components.ComponentManager;
import com.github.arthurfiorette.sinklibrary.components.SimpleComponentManager;
import com.github.arthurfiorette.sinklibrary.executor.v2.TaskContext;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseService;
import com.github.arthurfiorette.sinklibrary.interfaces.ComponentLoader;
import com.github.arthurfiorette.sinklibrary.logging.*;

import lombok.*;
import org.bukkit.plugin.java.JavaPlugin;

@RequiredArgsConstructor
public abstract class SinkPlugin extends JavaPlugin implements BasePlugin {
Expand All @@ -24,9 +22,8 @@ public abstract class SinkPlugin extends JavaPlugin implements BasePlugin {

public SinkPlugin() {
this.manager = new SimpleComponentManager(this);
this.baseLogger =
new BukkitLogger(this, Level.ALL);
}
this.baseLogger = new BukkitLogger(this, Level.ALL);
}

/**
* @return the component array to register all of yours components and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.github.arthurfiorette.sinklibrary.data;

import java.util.function.Consumer;

import com.google.common.cache.CacheBuilder;
import java.util.function.Consumer;

@FunctionalInterface
public interface CacheOperator<K, V> extends Consumer<CacheBuilder<K, V>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.arthurfiorette.sinklibrary.data.database;

import com.github.arthurfiorette.sinklibrary.interfaces.BaseService;
import java.util.Collection;

import javax.annotation.Nullable;

import com.github.arthurfiorette.sinklibrary.interfaces.BaseService;

/**
* Represents a simple database model. <b>All of these methods are meant to be
* executed in a synchronous way</b>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.arthurfiorette.sinklibrary.data.database;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;

import lombok.*;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.github.arthurfiorette.sinklibrary.data.repository;

import java.util.Collection;
import java.util.Set;
import java.util.concurrent.CompletableFuture;

import com.github.arthurfiorette.sinklibrary.core.BasePlugin;
import com.github.arthurfiorette.sinklibrary.data.database.Database;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseComponent;

import java.util.Collection;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import lombok.*;

@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package com.github.arthurfiorette.sinklibrary.data.repository;

import java.util.Collection;
import java.util.Set;
import java.util.concurrent.*;

import com.github.arthurfiorette.sinklibrary.data.CacheOperator;
import com.github.arthurfiorette.sinklibrary.data.LoadingWrapper;
import com.github.arthurfiorette.sinklibrary.data.database.Database;
import com.github.arthurfiorette.sinklibrary.data.storage.LoadingStorage;
import com.github.arthurfiorette.sinklibrary.interfaces.BaseService;
import com.google.common.cache.*;
import com.google.common.collect.Lists;

import java.util.Collection;
import java.util.Set;
import java.util.concurrent.*;
import lombok.Getter;
import lombok.NonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.github.arthurfiorette.sinklibrary.data.repository;

import com.github.arthurfiorette.sinklibrary.data.database.Database;
import com.github.arthurfiorette.sinklibrary.data.storage.Storage;
import java.util.Collection;
import java.util.Set;
import java.util.concurrent.CompletableFuture;

import com.github.arthurfiorette.sinklibrary.data.database.Database;
import com.github.arthurfiorette.sinklibrary.data.storage.Storage;

/**
* It's something between a {@link Storage} and a {@link Database}, but it has
* its serialized and deserialized types the same.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.arthurfiorette.sinklibrary.data.repository.addons;

import java.util.UUID;
import java.util.concurrent.CompletableFuture;

import com.github.arthurfiorette.sinklibrary.data.repository.Repository;
import com.github.arthurfiorette.sinklibrary.interfaces.Identifiable;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;

public interface IdentifiableAdapter<V extends Identifiable, R> extends Repository<UUID, V> {
default CompletableFuture<Void> save(final V value) {
Expand Down
Loading

0 comments on commit 1b8ea6b

Please sign in to comment.