Skip to content

Commit

Permalink
🌈[main/_] Clean up the workspace and import
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepymalc committed Aug 17, 2021
1 parent 8270f60 commit db96134
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=enabled
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
Expand Down
30 changes: 8 additions & 22 deletions src/main/java/com/linyuanlin/minecraft/App.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
package com.linyuanlin.minecraft;

import com.gmail.filoghost.holographicdisplays.api.Hologram;
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
import com.gmail.filoghost.holographicdisplays.api.*;
import com.linyuanlin.minecraft.manager.*;
import com.linyuanlin.minecraft.models.PlayerData;
import com.linyuanlin.minecraft.mongodb.MongodbClient;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.chat.*;
import net.md_5.bungee.api.chat.hover.content.Text;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.player.*;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.io.*;
import java.util.*;
import java.util.logging.*;

public class App extends JavaPlugin implements Listener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import com.tjplaysnow.discord.object.ThreadSpigot;
import net.dv8tion.jda.api.entities.TextChannel;

import java.util.HashMap;
import java.util.Map;
import java.util.*;

public class DiscordBotManager {

private App app;

// Key: Channel Tag, Value: Channel ID
Expand Down Expand Up @@ -41,22 +39,24 @@ public void shutDownAllBot() {
public void sendMessage(String botTag, String channelTag, String message) {
Bot bot = bots.get(botTag);
if (bot == null) {
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag + " because bot is not exist.");
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag
+ " because bot is not exist.");
return;
}
String cId = textChannels.get(channelTag);
if (cId == null) {
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag + " because channel is not exist.");
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag
+ " because channel is not exist.");
return;
}

TextChannel c = bot.getBot().getTextChannelById(cId);
if (c == null) {
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag + " because channel is not exist.");
this.app.getLogger().warning("Cannot let bot " + botTag + " send message to channel " + channelTag
+ " because channel is not exist.");
return;
}

c.sendMessage(message).queue();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import com.linyuanlin.minecraft.models.PlayerData;
import com.linyuanlin.minecraft.item.CustomItem;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.bukkit.inventory.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.linyuanlin.minecraft.App;
import com.mongodb.client.model.Filters;
import java.util.*;
import org.bson.Document;
import org.bukkit.*;
import org.bson.Document;

public class LocationManager {
private App app;
Expand Down
19 changes: 6 additions & 13 deletions src/main/java/com/linyuanlin/minecraft/Manager/TeamManager.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
package com.linyuanlin.minecraft.manager;

import com.linyuanlin.minecraft.App;
import com.linyuanlin.minecraft.models.PlayerData;
import com.linyuanlin.minecraft.models.Team;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import com.linyuanlin.minecraft.models.*;
import net.md_5.bungee.api.chat.*;
import net.md_5.bungee.api.chat.hover.content.Text;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.*;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Optional;
import java.io.*;
import java.util.*;

public class TeamManager implements CommandExecutor {
private App app;
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/linyuanlin/minecraft/Manager/TradeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

import com.linyuanlin.minecraft.App;
import com.linyuanlin.minecraft.models.PlayerData;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.*;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.*;

public class TradeManager implements CommandExecutor {
private App app;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.linyuanlin.minecraft.manager;

import com.linyuanlin.minecraft.models.WorldData;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.*;

import java.io.File;
import java.util.HashMap;
import java.util.Objects;
import java.io.*;
import java.util.*;

public class WorldManager {
/*
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/com/linyuanlin/minecraft/models/PlayerData.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
import com.linyuanlin.minecraft.manager.TeamManager;
import com.mongodb.client.model.Filters;
import org.bson.Document;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.util.Date;
import java.util.HashMap;
import java.util.Optional;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class PlayerData {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/linyuanlin/minecraft/models/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.TextComponent;

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

public class Team {
private final List<PlayerData> playerList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linyuanlin.minecraft.models;

import org.bukkit.World;
import org.bukkit.*;

public class WorldData {
private String worldId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

import com.linyuanlin.minecraft.App;
import com.mongodb.BasicDBObject;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.*;
import org.bson.Document;
import org.bson.conversions.Bson;

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

public class MongodbClient {
public FindIterable<Document> cursor;
Expand Down

0 comments on commit db96134

Please sign in to comment.