From 5ebf3f35a8633e142d4f17092c8a42c232723d83 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 21 Nov 2021 15:00:21 +0100 Subject: [PATCH] Initial commit --- .gitattributes | 2 + .gitignore | 113 ++++++++++++++++++ pom.xml | 102 ++++++++++++++++ src/main/java/rip/tilly/bedwars/BedWars.java | 32 +++++ src/main/java/rip/tilly/bedwars/utils/CC.java | 38 ++++++ src/main/resources/config.yml | 0 src/main/resources/plugin.yml | 6 + 7 files changed, 293 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/rip/tilly/bedwars/BedWars.java create mode 100644 src/main/java/rip/tilly/bedwars/utils/CC.java create mode 100644 src/main/resources/config.yml create mode 100644 src/main/resources/plugin.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4788b4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +target/ + +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next + +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# Common working directory +run/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4273aeb --- /dev/null +++ b/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + + rip.tilly + BedWars + 1.0 + jar + + BedWars + + + 1.8 + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + false + + + + + + + + src/main/resources + true + + + + + + + spigotmc-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + + + + + + org.papermc + PaperSpigot + 1.8.8-R0.1-SNAPSHOT + ${project.basedir}/libs/PaperSpigot-1.8.8-R0.1-SNAPSHOT.jar + system + + + + + com.google.code.gson + gson + 2.8.8 + compile + + + + + org.mongodb + mongo-java-driver + 3.12.10 + compile + + + + + org.projectlombok + lombok + 1.18.20 + provided + + + + diff --git a/src/main/java/rip/tilly/bedwars/BedWars.java b/src/main/java/rip/tilly/bedwars/BedWars.java new file mode 100644 index 0000000..58b50aa --- /dev/null +++ b/src/main/java/rip/tilly/bedwars/BedWars.java @@ -0,0 +1,32 @@ +package rip.tilly.bedwars; + +import lombok.Getter; +import org.bukkit.Bukkit; +import org.bukkit.plugin.java.JavaPlugin; +import rip.tilly.bedwars.utils.CC; + +/** + * Created by Lucanius & Trixkz + * Project: BedWars + */ +@Getter +public final class BedWars extends JavaPlugin { + + @Getter private static BedWars instance; + + @Override + public void onEnable() { + instance = this; + this.saveDefaultConfig(); + + Bukkit.getConsoleSender().sendMessage("------------------------------------------------"); + Bukkit.getConsoleSender().sendMessage(CC.translate("&dBedWars &8- &av" + getDescription().getVersion())); + Bukkit.getConsoleSender().sendMessage(CC.translate("&7Made on &dTilly RIP &7by &eTrixkz &7& &eLucanius")); + Bukkit.getConsoleSender().sendMessage("------------------------------------------------"); + } + + @Override + public void onDisable() { + instance = null; + } +} diff --git a/src/main/java/rip/tilly/bedwars/utils/CC.java b/src/main/java/rip/tilly/bedwars/utils/CC.java new file mode 100644 index 0000000..2863b8f --- /dev/null +++ b/src/main/java/rip/tilly/bedwars/utils/CC.java @@ -0,0 +1,38 @@ +package rip.tilly.bedwars.utils; + +import org.bukkit.ChatColor; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Lucanius + * Project: BedWars + */ +public class CC { + + public static final String scoreboardBar = ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "----------------------"; + public static final String chatBar = ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "--------------------------------------------"; + + public static String translate(String message) { + return ChatColor.translateAlternateColorCodes('&', message); + } + + public static List translate(List lines) { + List strings = new ArrayList<>(); + for (String line : lines) { + strings.add(ChatColor.translateAlternateColorCodes('&', line)); + } + return strings; + } + + public static List translate(String[] lines) { + List strings = new ArrayList<>(); + for (String line : lines) { + if (line != null) { + strings.add(ChatColor.translateAlternateColorCodes('&', line)); + } + } + return strings; + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..a1029ef --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,6 @@ +name: BedWars +version: ${project.version} +main: rip.tilly.bedwars.BedWars +authors: + - Lucanius + - Trixkz