Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinLMayes committed Jul 14, 2020
1 parent 990f4ca commit 99683b1
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 40 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/net/avicus/atlas/core/Atlas.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
import net.avicus.atlas.core.util.AtlasTask;
import net.avicus.atlas.core.util.Events;
import net.avicus.atlas.core.util.Messages;
import net.avicus.compendium.locale.TranslationProvider;
import net.avicus.atlas.core.util.Translations;
import net.avicus.atlas.core.util.properties.BlockPropStore;
import net.avicus.compendium.AvicusBukkitCommandManager;
import net.avicus.compendium.AvicusCommandsManager;
import net.avicus.compendium.commands.AvicusCommandsRegistration;
import net.avicus.compendium.commands.exception.AbstractTranslatableCommandException;
import net.avicus.compendium.config.Config;
import net.avicus.compendium.locale.TranslationProvider;
import net.avicus.compendium.locale.text.UnlocalizedText;
import net.avicus.compendium.settings.PlayerSettings;
import org.bukkit.Bukkit;
Expand All @@ -89,8 +89,8 @@

public class Atlas extends JavaPlugin {

private AtomicBoolean ready = new AtomicBoolean(false);
private static Atlas instance;
private AtomicBoolean ready = new AtomicBoolean(false);
private AvicusCommandsManager commandManager;
@Getter
@Setter
Expand Down
7 changes: 3 additions & 4 deletions core/src/main/java/net/avicus/atlas/core/AtlasConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public class AtlasConfig {
@ConfigPath("github")
@ConfigKey(key = "token")
private static String githubToken;
@Getter
@ConfigKey(key = "send-deprecation-warnings")
private static boolean sendDeprecationWarnings;

@ConfigPath("website")
public static class Website {
Expand All @@ -80,10 +83,6 @@ public static String resolvePath(String slug) {
}
}

@Getter
@ConfigKey(key = "send-deprecation-warnings")
private static boolean sendDeprecationWarnings;

@ConfigPath("chat")
public static class Chat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public static void critical(CommandContext cmd, CommandSender sender) throws Com
sender.sendMessage("Message sent!");
}

public enum AnnounceType {
NO_PREFIX, MESSAGE, CRITICAL
}

private static void send(String message, AnnounceType type) {
TextComponent prefix;
if (type == AnnounceType.NO_PREFIX) {
Expand All @@ -59,6 +55,10 @@ private static void send(String message, AnnounceType type) {
Bukkit.broadcast(send);
}

public enum AnnounceType {
NO_PREFIX, MESSAGE, CRITICAL
}

public static class Parent {

@CommandPermissions("hook.announce")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.regex.Pattern;
import javax.annotation.Nullable;
import net.avicus.atlas.core.component.Component;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package net.avicus.atlas.core.channel.premium;

import net.avicus.atlas.core.channel.PrefixedChannel;
import net.avicus.atlas.core.text.Components;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public final class PremiumChannel extends PrefixedChannel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import net.avicus.atlas.core.AtlasConfig;
import net.avicus.atlas.core.channel.PrefixedChannel;
import net.avicus.atlas.core.util.Translations;
import net.avicus.atlas.core.text.Components;
import net.avicus.atlas.core.util.Translations;
import net.avicus.compendium.commands.exception.TranslatableCommandErrorException;
import net.avicus.compendium.locale.text.LocalizedNumber;
import net.avicus.compendium.settings.PlayerSettings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package net.avicus.atlas.core.channel.staff;

import net.avicus.atlas.core.channel.PrefixedChannel;
import net.avicus.atlas.core.text.Components;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public final class StaffChannel extends PrefixedChannel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ public class MessageCommands implements CommandComponent {
Messages.PRIVATE_MESSAGES,
Messages.PRIVATE_MESSAGES_SUMMARY
);

public enum PrivateMessageScope {
ALL,
FRIENDS,
OFF
}

private final static Map<UUID, UUID> lastMessages = new HashMap<>();

private static boolean shouldDeliver(Player from, Player to) {
Expand Down Expand Up @@ -140,4 +133,10 @@ public void enable() {
public void registerCommands(CommandsManagerRegistration registrar) {
registrar.register(MessageCommands.class);
}

public enum PrivateMessageScope {
ALL,
FRIENDS,
OFF
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.sk89q.minecraft.util.commands.CommandPermissionsException;
import java.util.Iterator;
import java.util.List;
import net.avicus.atlas.core.util.Translations;
import net.avicus.atlas.core.text.Components;
import net.avicus.atlas.core.util.Translations;
import net.avicus.compendium.commands.exception.TranslatableCommandErrorException;
import net.avicus.compendium.locale.text.LocalizedNumber;
import net.avicus.compendium.locale.text.UnlocalizedText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.bukkit.event.player.PlayerEvent;

/**
* An event that is fired when a player spawns into a {@link Match}. Event is
* called before they are teleported or given a loadout.
* An event that is fired when a player spawns into a {@link Match}. Event is called before they are
* teleported or given a loadout.
*/
public class PlayerSpawnBeginEvent extends PlayerEvent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.bukkit.event.player.PlayerEvent;

/**
* An event that is fired when a player spawns into a {@link Match}. Event is
* called after they are teleported and/or given a loadout.
* An event that is fired when a player spawns into a {@link Match}. Event is called after they are
* teleported and/or given a loadout.
*/
public class PlayerSpawnCompleteEvent extends PlayerEvent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public abstract class ShopItem {
* @param name The name of the item.
* @param description List of description lines for the item. This will never be null, but can be
* empty.
* @param icon The icon which should be used for the corresponding {@link
* ShopMenuItem}.
* @param icon The icon which should be used for the corresponding {@link ShopMenuItem}.
* @param purchaseCheck The check that should be ran before this item can be purchased.
*/
public ShopItem(int price,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import net.avicus.atlas.core.GameType;
import net.avicus.atlas.core.map.AtlasMap;
import net.avicus.atlas.core.match.Match;
import net.avicus.atlas.core.profile.Skins;
import net.avicus.atlas.core.util.Inventories;
import net.avicus.atlas.core.util.Messages;
import net.avicus.atlas.core.util.Translations;
import net.avicus.atlas.core.profile.Skins;
import net.avicus.compendium.locale.text.LocalizedNumber;
import net.avicus.compendium.locale.text.UnlocalizedFormat;
import net.avicus.compendium.menu.inventory.ClickableInventoryMenuItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static net.avicus.compendium.locale.TranslationProvider.$NULL$;

import net.avicus.atlas.core.Atlas;
import net.avicus.atlas.core.AtlasConfig;
import net.avicus.compendium.locale.LocaleBundle;
import net.avicus.compendium.locale.TranslationProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ else if (blockId == Material.VINE.getId() && toolProps.toolType == Props.ToolTyp
// More Workarounds:
// TODO: Consider checking a generic workaround (based on duration, assuming some dig packets lost, proportional to duration etc.).
if (toolProps.materialBase == Props.MaterialBase.WOOD) {
if (toolProps.toolType == Props.ToolType.PICKAXE && (blockProps == BlockPropStore.ironDoorType
|| blockProps == BlockPropStore.dispenserType)) {
if (toolProps.toolType == Props.ToolType.PICKAXE && (
blockProps == BlockPropStore.ironDoorType
|| blockProps == BlockPropStore.dispenserType)) {
// Special correction.
// TODO: Uncomfortable: hide this in the blocks by some flags / other type of workarounds !
if (blockProps == BlockPropStore.dispenserType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.util.logging.Logger;
import lombok.Getter;
import lombok.Setter;
import net.avicus.atlas.core.Atlas;
import net.avicus.atlas.core.component.ComponentManager;
import net.avicus.atlas.core.component.visual.SidebarComponent;
import net.avicus.atlas.core.Atlas;
import net.avicus.atlas.core.countdown.CyclingCountdown;
import net.avicus.atlas.core.countdown.StartingCountdown;
import net.avicus.atlas.core.external.ModuleSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import com.google.common.collect.Lists;
import java.util.logging.Logger;
import lombok.Setter;
import net.avicus.atlas.core.Atlas;
import net.avicus.atlas.core.component.ComponentManager;
import net.avicus.atlas.core.component.visual.SidebarComponent;
import net.avicus.atlas.core.component.visual.SoundComponent;
import net.avicus.atlas.core.Atlas;
import net.avicus.atlas.core.external.ModuleSet;
import net.avicus.atlas.core.map.AtlasMapFactory;
import net.avicus.atlas.core.match.MatchFactory;
Expand Down

0 comments on commit 99683b1

Please sign in to comment.