Skip to content

Commit

Permalink
Merge pull request #106 from AlpsBTE/v3.0
Browse files Browse the repository at this point in the history
Ready for release
  • Loading branch information
LordTuxn authored Sep 25, 2022
2 parents 18620ec + 1b3faa5 commit 79e76ea
Show file tree
Hide file tree
Showing 89 changed files with 5,014 additions and 1,518 deletions.
66 changes: 38 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@


<!-- ABOUT THE PROJECT -->
## About The Project
The Plot System is an essential part of any BuildTheEarth server system, meant to run alongside the classic Terra servers to make participating a lot easier and appeal to both the casual and power users. The plot system gives every player the opportunity to participate in the project with ease using Minecraft versions 1.12-1.17 (Vanilla).
# About The Project
The Plot System is an essential part of any BuildTheEarth server system, meant to run alongside the classic Terra servers to make participating a lot easier and appeal to both the casual and power users. The plot system gives every player the opportunity to participate in the project with ease using Minecraft version 1.12 or higher, if ViaVersion is supported.

After clicking on the Companion item in the hotbar, a selection window appears where you can choose a city from the list. If you now click on one of these cities, you will get to a random plot of this city and you can immediately start building. Links to Google Maps, Google Earth Web & OpenStreetMap appear when you enter the plot and allow you to quickly find your way around.

Expand All @@ -40,45 +40,64 @@ The system is designed to make it easier for unexperienced people, casual player
The plugin was programmed by the Alps BTE Team and is meant for everyone to use and help contribute. For any questions regarding setup or contribution feel free to contact us.

All used Libraries and APIs are listed below.

<img src="https://user-images.githubusercontent.com/64250550/113524662-7c78b400-95b0-11eb-98dd-753600fb6f17.gif" width=100%/>


## Features
✔️ Support for **multiple cities** and **countries/states**<br/>
# Features
## Plot Types
![FocusMode_PlotSystemBanner](https://user-images.githubusercontent.com/64250550/184678178-f8b5c3e5-ec35-4b6b-9b1b-ac3170148d34.png)
<font size="3">
The focus mode is the old well-known mode that was also used by default before the release of v3.0. Build your plot on a floating island in an empty void world. Simple and straightforward, like in the good old days.
<br/><br/>➖ No Environment
<br/>➖ No Neighboring Plots
</font><br/><br/>

![InspirationMode_PlotSystemBanner](https://user-images.githubusercontent.com/64250550/184681201-2f7e2103-df8d-42a3-93b0-ce42770e4fa8.png)
<font size="3">
The inspiration mode feels like building in a normal world. By adding the surrounding area of your plot, you will see neighboring buildings, streets and vegetation. In comparison to the focus mode, you will have a better orientation which helps you when building. This mode is selected as default, when using the Plot System for the first time.
<br/><br/>➕ Environment
<br/>➖ No Neighboring Plots
</font><br/><br/>

![CityInspirationMode_PlotSystemBanner](https://user-images.githubusercontent.com/64250550/184683030-27f1760b-09ad-43f7-b5ed-bdd46c972246.png)
<font size="3">
The city inspiration mode will give you the full building experience by combining the inspiration mode with other players. Build with your friends and others in one world next to each other and see continuous progress.
<br/><br/>⚠️ This mode is not fully stable and still in BETA
<br/><br/>➕ Environment
<br/>➕ Neighboring Plots
</font>

## Other Features
✔️ Support for **multiple cities** as well as for **continents** and **countries/states**<br/>
✔️ **User-friendly menus** and **commands**<br/>
✔️ **Multi-Language** Support<br/>
✔️ **Multi-Language** Support (currently up to 7 languages)<br/>
✔️ Plot **Group System** (Build together with up to 5 people on one plot)<br/>
✔️ **SFTP/FTP** Support<br/>
✔️ Detailed **review system** with feedback<br/>
✔️ Three plot **difficulty levels**<br/>
✔️ Detailed **review system** with individual feedback<br/>
✔️ Three plot **difficulty levels** (easy, medium and hard)<br/>
✔️ Building **Quality of Life tools**<br/>
✔️ **/tpll support** on plots<br/>
✔️ Full **/tpll support** on plots<br/>
✔️ **Leaderboards** when using the Holograms extension<br/>
✔️ Automatic **abandoning of inactive plots**<br/>
✔️ Automatic **placement of completed plots** on the terra server<br/>
✔️ **Easy configuration** and **setup**<br/>


<!-- INSTALLATION -->
## Installation
# Installation
💻 To use this system, you currently need at least two servers.</br>
One is running Terra++ with the **[Plot-System-Terra Plugin](https://github.com/AlpsBTE/Plot-System-Terra)** and the other one is a Spigot Vanilla server for the Plot-System itself.</br>

**For more information check out the [Wiki](https://github.com/AlpsBTE/Plot-System/wiki/Installation)**!


<!-- ROADMAP -->
## Roadmap
# Roadmap
📋 Plot Tutorial<br/>
📋 In-Game Guidebook<br/>
📋 Discord Integration<br/>
📋 More and Improved Leaderboards<br/>
📋 Statistics<br/>


<!-- CONTRIBUTING -->
## Contributing
# Contributing
🔨 Any contributions you make are greatly appreciated.

* Reporting a bug
Expand All @@ -88,23 +107,13 @@ One is running Terra++ with the **[Plot-System-Terra Plugin](https://github.com/


<!-- LICENSE -->
## License
# License

Distributed under the MIT License. See `LICENSE` for more information.


<!-- CONTACTS -->
## Contacts

- R3tuxn - [R3tuxn#7169](https://discord.com/invite/vgkspay)
- Cinnazeyy - [Cinnazeyy#2440](https://discord.com/invite/vgkspay)
- Coppertine - [Coppertine#1718](https://discord.com/invite/vgkspay)

Project Link: [https://github.com/AlpsBTE/PlotSystem](https://github.com/AlpsBTE/Plot-System)


<!-- LIBRARIES & APIS -->
## Libraries & APIs
# Libraries & APIs
* [Spigot & Bukkit API](https://hub.spigotmc.org/stash/projects/SPIGOT)
* [WorldEdit API](https://github.com/EngineHub/WorldEdit)
* [WorldGuard API](https://github.com/EngineHub/WorldGuard)
Expand All @@ -117,3 +126,4 @@ Project Link: [https://github.com/AlpsBTE/PlotSystem](https://github.com/AlpsBTE
* [Maria-DB Library](https://mariadb.com/kb/en/about-mariadb-connector-j/)
* [Hikari-CP](https://github.com/brettwooldridge/HikariCP)
* [Apache Common VFS API](https://commons.apache.org/proper/commons-vfs/commons-vfs2/apidocs/index.html)
* [ProtocolLIB](https://github.com/dmulloy2/ProtocolLib)
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alpsbte</groupId>
<artifactId>PlotSystem</artifactId>
<version>2.3</version>
<version>3.0</version>

<repositories>
<!-- Spigot & Bukkit -->
Expand Down Expand Up @@ -89,14 +89,14 @@
<dependency>
<groupId>com.fastasyncworldedit</groupId>
<artifactId>FAWE-Core</artifactId>
<version>1.17-93</version>
<version>1.12</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.fastasyncworldedit</groupId>
<artifactId>FAWE-Bukkit</artifactId>
<version>1.17-93</version>
<version>1.12</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand All @@ -122,6 +122,14 @@
<scope>compile</scope>
</dependency>

<!-- ParticleNativeAPI -->
<dependency>
<groupId>com.github.fierioziy.particlenativeapi</groupId>
<artifactId>ParticleNativeAPI-plugin</artifactId>
<version>3.2.0</version>
<scope>provided</scope>
</dependency>

<!-- Canvas Menu Builder -->
<dependency>
<groupId>com.github.IPVP-MC</groupId>
Expand Down
69 changes: 37 additions & 32 deletions src/main/java/com/alpsbte/plotsystem/PlotSystem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright © 2021, Alps BTE <[email protected]>
* Copyright © 2021-2022, Alps BTE <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,19 +25,18 @@
package com.alpsbte.plotsystem;

import com.alpsbte.plotsystem.commands.*;
import com.alpsbte.plotsystem.core.holograms.HologramManager;
import com.alpsbte.plotsystem.core.holograms.HolographicDisplay;
import com.alpsbte.plotsystem.core.system.Review;
import com.alpsbte.plotsystem.utils.PacketListener;
import com.alpsbte.plotsystem.utils.io.config.ConfigUtil;
import com.alpsbte.plotsystem.core.holograms.HolographicDisplay;
import com.alpsbte.plotsystem.core.holograms.PlotsLeaderboard;
import com.alpsbte.plotsystem.core.holograms.ScoreLeaderboard;
import com.alpsbte.plotsystem.core.system.plot.PlotManager;
import com.alpsbte.plotsystem.utils.io.language.LangUtil;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.alpsbte.plotsystem.utils.io.config.ConfigPaths;
import com.alpsbte.plotsystem.core.database.DatabaseConnection;
import com.alpsbte.plotsystem.core.EventListener;
import com.alpsbte.plotsystem.utils.io.config.ConfigNotImplementedException;
Expand All @@ -52,15 +51,13 @@
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;
import java.util.logging.Level;

public class PlotSystem extends JavaPlugin {

private static final String VERSION = "2.3";
private static final String VERSION = "3.0";

private static PlotSystem plugin;
private ConfigUtil configManager;
Expand All @@ -69,11 +66,6 @@ public class PlotSystem extends JavaPlugin {

private boolean pluginEnabled = false;

private static final List<HolographicDisplay> holograms = Arrays.asList(
new ScoreLeaderboard(),
new PlotsLeaderboard()
);

@Override
public void onEnable() {
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog"); // Disable Logging
Expand Down Expand Up @@ -165,7 +157,7 @@ public void onEnable() {
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + "Extensions:");

if (DependencyManager.isHolographicDisplaysEnabled()) {
reloadHolograms();
HologramManager.reloadHolograms();
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "- HolographicDisplays (Leaderboards)");
} else {
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "No extensions enabled.");
Expand All @@ -176,7 +168,7 @@ public void onEnable() {
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + "Update-Checker:");

UpdateChecker.getVersion(version -> {
if (version.equalsIgnoreCase(VERSION)) {
if (Double.parseDouble(VERSION) >= version) {
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "You are using the latest stable version.");
} else {
UpdateChecker.isUpdateAvailable = true;
Expand All @@ -188,6 +180,8 @@ public void onEnable() {

PlotManager.checkPlotsForLastActivity();
PlotManager.syncPlotSchematicFiles();
Review.checkReviewerFeedbackList();
PlotManager.startTimer();

try {
new PacketListener();
Expand All @@ -214,6 +208,8 @@ public void onDisable() {
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "> " + ChatColor.GRAY + "Made by " + ChatColor.RED + "Alps BTE (AT/CH/LI)");
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "> " + ChatColor.GRAY + "GitHub: " + ChatColor.WHITE + "https://github.com/AlpsBTE/Plot-System");
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + "------------------------------------------------------");

HologramManager.getHolograms().forEach(HolographicDisplay::onShutdown);
}
}

Expand All @@ -240,18 +236,6 @@ public void saveConfig() {
this.configManager.saveFiles();
}

public static void reloadHolograms() {
if (DependencyManager.isHolographicDisplaysEnabled()) {
for (HolographicDisplay hologram : holograms) {
if(plugin.getConfigManager().getConfig().getBoolean(hologram.getDefaultPath() + ConfigPaths.HOLOGRAMS_ENABLED)) {
hologram.show();
} else {
hologram.hide();
}
}
}
}

public static PlotSystem getPlugin() {
return plugin;
}
Expand All @@ -260,8 +244,6 @@ public CommandManager getCommandManager() {
return commandManager;
}

public static List<HolographicDisplay> getHolograms() { return holograms; }


public static class DependencyManager {

Expand Down Expand Up @@ -309,10 +291,25 @@ public static boolean isHolographicDisplaysEnabled() {
return plugin.getServer().getPluginManager().isPluginEnabled("HolographicDisplays");
}

/**
* @return True if ParticleNativeAPI is present
*/
public static boolean isParticleNativeAPIEnabled() {
return plugin.getServer().getPluginManager().isPluginEnabled("ParticleNativeAPI");
}

public static boolean isMultiverseInventoriesEnabled() {
return plugin.getServer().getPluginManager().isPluginEnabled("Multiverse-Inventories");
}

/**
* @param worldName Name of the world
* @return Config path for the world
*/
public static String getMultiverseInventoriesConfigPath(String worldName) {
return PlotSystem.DependencyManager.isMultiverseInventoriesEnabled() ? Bukkit.getPluginManager().getPlugin("Multiverse-Inventories").getDataFolder() + "/worlds/" + worldName : "";
}

/**
* @return Multiverse-Core instance
*/
Expand All @@ -334,6 +331,14 @@ public static WorldGuardPlugin getWorldGuard() {
return WorldGuardPlugin.inst();
}

/**
* @param worldName Name of the world
* @return Config path for the world
*/
public static String getWorldGuardConfigPath(String worldName) {
return Bukkit.getPluginManager().getPlugin("WorldGuard").getDataFolder() + "/worlds/" + worldName;
}

/**
* @return Protocol Lib Instance
*/
Expand All @@ -348,10 +353,10 @@ public static class UpdateChecker {
* Get latest plugin version from SpigotMC
* @param version Returns latest stable version
*/
public static void getVersion(final Consumer<String> version) {
public static void getVersion(final Consumer<Double> version) {
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + RESOURCE_ID).openStream(); Scanner scanner = new Scanner(inputStream)) {
if (scanner.hasNext()) {
version.accept(scanner.next());
version.accept(Double.parseDouble(scanner.next()));
}
} catch (IOException ex) {
Bukkit.getLogger().log(Level.WARNING, "Cannot look for new updates: " + ex.getMessage());
Expand All @@ -365,4 +370,4 @@ public static boolean updateAvailable() {
return isUpdateAvailable;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

package com.alpsbte.plotsystem.commands;

import com.alpsbte.plotsystem.core.menus.CompanionMenu;
import com.alpsbte.plotsystem.core.menus.companion.CompanionMenu;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.io.language.LangPaths;
import com.alpsbte.plotsystem.utils.io.language.LangUtil;
Expand All @@ -37,7 +37,7 @@ public class CMD_Companion extends BaseCommand {
public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
if (sender.hasPermission(getPermission())) {
if (getPlayer(sender) != null) {
new CompanionMenu((Player) sender);
CompanionMenu.open((Player) sender);
}
} else {
sender.sendMessage(Utils.getErrorMessageFormat(LangUtil.get(sender, LangPaths.Message.Error.PLAYER_HAS_NO_PERMISSIONS)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a
player.sendMessage(Utils.getErrorMessageFormat(LangUtil.get(sender, LangPaths.Message.Error.PLAYER_NOT_FOUND)));
}
} else {
new PlayerPlotsMenu(player, new Builder(player.getUniqueId()));
new PlayerPlotsMenu(player, Builder.byUUID(player.getUniqueId()));
}
} catch (SQLException ex) {
sender.sendMessage(Utils.getErrorMessageFormat(LangUtil.get(sender, LangPaths.Message.Error.ERROR_OCCURRED)));
Expand Down
Loading

0 comments on commit 79e76ea

Please sign in to comment.