mirror of
https://github.com/SimplexDevelopment/SimplexCore.git
synced 2024-12-22 08:37:37 +00:00
Some edits
This commit is contained in:
parent
d8b8bedc98
commit
2f5e2acfeb
@ -17,7 +17,7 @@ import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.MissingResourceException;
|
||||
|
||||
public class CommandLoader {
|
||||
public final class CommandLoader {
|
||||
private Reflections reflections;
|
||||
|
||||
public synchronized CommandLoader classpath(Class<?> clazz) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@CommandInfo(name = "defaultcommand", usage = "/<command>", description = "Default plugin command.")
|
||||
public class DefaultCommand extends SimplexCommand {
|
||||
public final class DefaultCommand extends SimplexCommand {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
sender.sendMessage("If you are seeing this when running your command, your command didn't register properly.");
|
||||
|
@ -5,7 +5,7 @@ import io.github.paldiu.simplexcore.utils.Constants;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
|
||||
public class ServerPluginListener extends SimplexListener {
|
||||
public final class ServerPluginListener extends SimplexListener {
|
||||
@EventHandler
|
||||
public void pluginRegister(PluginEnableEvent event) {
|
||||
if (SimplexAddon.class.isAssignableFrom(event.getPlugin().getClass())) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Cuboid {
|
||||
public final class Cuboid {
|
||||
private final int x, y, z;
|
||||
|
||||
public Cuboid() {
|
||||
|
@ -2,7 +2,7 @@ package io.github.paldiu.simplexcore.plugin;
|
||||
|
||||
import io.github.paldiu.simplexcore.utils.Constants;
|
||||
|
||||
public class AddonManager {
|
||||
public final class AddonManager {
|
||||
public AddonManager() { }
|
||||
|
||||
public void disable(SimplexAddon<?> simplexAddon) {
|
||||
|
@ -3,7 +3,7 @@ package io.github.paldiu.simplexcore.plugin;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class AddonRegistry {
|
||||
public final class AddonRegistry {
|
||||
private final Set<SimplexAddon<?>> components = new HashSet<>();
|
||||
private static final AddonRegistry instance = new AddonRegistry();
|
||||
|
||||
|
@ -1,17 +1,43 @@
|
||||
package io.github.paldiu.simplexcore.utils;
|
||||
|
||||
public class Bean<T> {
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
public final class Bean<T> {
|
||||
protected T bean;
|
||||
|
||||
public Bean(T bean) {
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public void setBean(T bean) {
|
||||
public void set(T bean) {
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public T getBean() {
|
||||
public T get() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder().append(get()).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Bean<?>)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return new EqualsBuilder().append(((Bean<?>) obj).get(), get()).isEquals();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return get().toString();
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package io.github.paldiu.simplexcore.utils;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
public class Trio<A, B, C> {
|
||||
public final class Trio<A, B, C> {
|
||||
private final A primary;
|
||||
private final B secondary;
|
||||
private final C tertiary;
|
||||
|
@ -12,7 +12,7 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Utilities {
|
||||
public final class Utilities {
|
||||
private static <T> Stream<T> feStr(T[] array) {
|
||||
return Arrays.stream(array);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user