Initialize fork of Template-OG to Scoreboard-OG
This commit is contained in:
1 parent
8ebc156b5b
commit
2a41cfb56b
10 files changed
+15
-139
No files matched your search
Binary file not shown.
@@ -1,9 +1,6 @@
|
||||
[submodule "libs/Utilities-OG"]
|
||||
path = libs/Utilities-OG
|
||||
url = https://github.com/true-og/Utilities-OG
|
||||
[submodule "libs/GxUI-OG"]
|
||||
path = libs/GxUI-OG
|
||||
url = https://github.com/true-og/GxUI-OG
|
||||
[submodule "libs/DiamondBank-OG"]
|
||||
path = libs/DiamondBank-OG
|
||||
url = https://github.com/true-og/DiamondBank-OG
|
||||
|
||||
+3
-5
@@ -29,7 +29,7 @@ java {
|
||||
kotlin { jvmToolchain(17) }
|
||||
|
||||
/* ----------------------------- Metadata ------------------------------ */
|
||||
group = "net.trueog.template-og" // Declare bundle identifier.
|
||||
group = "net.trueog.scoreboard-og" // Declare bundle identifier.
|
||||
|
||||
version = "1.0" // Declare plugin version (will be in .jar).
|
||||
|
||||
@@ -48,6 +48,7 @@ repositories {
|
||||
mavenCentral() // Import the Maven Central Maven Repository.
|
||||
gradlePluginPortal() // Import the Gradle Plugin Portal Maven Repository.
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") } // Import the PurpurMC Maven Repository.
|
||||
maven("https://catcoder.pl.ua/snapshots") // Import the ProtocolSidebar repo.
|
||||
maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }
|
||||
System.getProperty("SELF_MAVEN_LOCAL_REPO")?.let { // TrueOG Bootstrap mavenLocal().
|
||||
val dir = file(it)
|
||||
@@ -66,13 +67,10 @@ dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare Purpur API version to be packaged.
|
||||
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.3") // Import MiniPlaceholders API.
|
||||
compileOnlyApi(project(":libs:Utilities-OG")) // Import TrueOG Network Utilities-OG Java API (from source).
|
||||
compileOnlyApi(project(":libs:GxUI-OG")) // Import TrueOG Network GxUI-OG Java API (from source).
|
||||
compileOnlyApi(project(":libs:Chat-OG")) {
|
||||
attributes { attribute(kotlinAttribute, true) }
|
||||
} // Import TrueOG Network Chat-OG Kotlin API (from source).
|
||||
compileOnlyApi(project(":libs:DiamondBank-OG")) {
|
||||
attributes { attribute(kotlinAttribute, true) }
|
||||
} // Import TrueOG network DiamondBank-OG Kotlin API (from source).
|
||||
compileOnly(files("libs/ProtocolSidebar-1.19.4.jar")) // Import legacy ProtocolSidebar API.
|
||||
}
|
||||
|
||||
apply(from = "eclipse.gradle.kts") // Import eclipse classpath support script.
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ configurations.creating {
|
||||
|
||||
configure<EclipseModel> {
|
||||
project {
|
||||
name = "Template-OG-Plugin"
|
||||
name = "Scoreboard-OG-Plugin"
|
||||
}
|
||||
classpath {
|
||||
plusConfigurations.add(ideLibs)
|
||||
|
||||
-1
Submodule libs/GxUI-OG deleted from d2c5221291.
+1
-1
@@ -1,4 +1,4 @@
|
||||
rootProject.name = "Template-OG"
|
||||
rootProject.name = "Scoreboard-OG"
|
||||
|
||||
ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).inheritIO().start().let {
|
||||
if (it.waitFor() != 0) throw GradleException("bootstrap.sh failed")
|
||||
|
||||
@@ -58,14 +58,14 @@ public class Listeners implements Listener {
|
||||
* });
|
||||
*/
|
||||
|
||||
save(TemplateOG.config(), Bukkit.getOfflinePlayer("TheMonsterEric"));
|
||||
save(ScoreboardOG.config(), Bukkit.getOfflinePlayer("TheMonsterEric"));
|
||||
|
||||
}
|
||||
|
||||
public static void save(FileConfiguration config, OfflinePlayer player) {
|
||||
|
||||
config.set("players." + player.getUniqueId(), player);
|
||||
TemplateOG.getPlugin().saveConfig();
|
||||
ScoreboardOG.getPlugin().saveConfig();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import net.trueog.diamondbankog.DiamondBankAPIJava;
|
||||
|
||||
public class TemplateOG extends JavaPlugin {
|
||||
public class ScoreboardOG extends JavaPlugin {
|
||||
|
||||
private static TemplateOG plugin;
|
||||
private static ScoreboardOG plugin;
|
||||
private static DiamondBankAPIJava diamondBankAPI;
|
||||
private static FileConfiguration config;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TemplateOG extends JavaPlugin {
|
||||
|
||||
}
|
||||
|
||||
public static TemplateOG getPlugin() {
|
||||
public static ScoreboardOG getPlugin() {
|
||||
|
||||
return plugin;
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
// This is free and unencumbered software released into the public domain.
|
||||
// Author: NotAlexNoyle.
|
||||
package plugin;
|
||||
|
||||
// Import libraries.
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.trueog.gxui.GUIBase;
|
||||
import net.trueog.gxui.GUIButton;
|
||||
import net.trueog.gxui.GUIItem;
|
||||
|
||||
public class SpectatorGui extends GUIBase {
|
||||
|
||||
private final Player assignedPlayer;
|
||||
|
||||
public SpectatorGui(JavaPlugin plugin, Player player) {
|
||||
|
||||
super(plugin, player, "&3&lTest GUI", 9, true);
|
||||
|
||||
assignedPlayer = player;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupItems() {
|
||||
|
||||
int curr = 0;
|
||||
GUIItem item = null;
|
||||
final List<String> name = new ArrayList<>(18);
|
||||
|
||||
// Add a new element to the list for each player.
|
||||
Bukkit.getOnlinePlayers().forEach((Player p) -> name.add("&eTeleport to: &d&l" + p.getName()));
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
|
||||
item = new GUIItem(Material.PLAYER_HEAD, 1, name.get(curr), p.getName());
|
||||
final GUIButton guibutton = new GUIButton() {
|
||||
|
||||
@Override
|
||||
public boolean leftClick() {
|
||||
|
||||
assignedPlayer.closeInventory();
|
||||
assignedPlayer.teleport(p);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leftClickShift() {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rightClick() {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rightClickShift() {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
item.setButton(guibutton);
|
||||
|
||||
addItem(curr, item);
|
||||
curr = nextCurr(curr);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int nextCurr(int curr) {
|
||||
|
||||
if (curr == 3) {
|
||||
|
||||
return 6;
|
||||
|
||||
} else {
|
||||
|
||||
return (curr += 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static ArrayList<TextComponent> convertToTextComponents(List<String> stringList) {
|
||||
|
||||
final ArrayList<TextComponent> textComponents = new ArrayList<>(18);
|
||||
for (int i = 0; i < stringList.size(); i++) {
|
||||
|
||||
final String str = stringList.get(i);
|
||||
final TextComponent textComponent = LegacyComponentSerializer.legacyAmpersand().deserialize(str);
|
||||
textComponents.add(textComponent);
|
||||
|
||||
}
|
||||
|
||||
return textComponents;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
name: Template-OG
|
||||
name: Scoreboard-OG
|
||||
author: NotAlexNoyle
|
||||
description: A blank plugin for TrueOG from which to base other plugins off of.
|
||||
website: https://github.com/true-og/Template-OG/
|
||||
description: A simple Scoreboard plugin with MiniPlaceholder API support.
|
||||
website: https://github.com/true-og/Scoreboard-OG/
|
||||
version: '${version}'
|
||||
api-version: '${apiVersion}'
|
||||
main: plugin.TemplateOG
|
||||
main: plugin.ScoreboardOG
|
||||
depend:
|
||||
# - DiamondBank-OG
|
||||
- DiamondBank-OG
|
||||
- Utilities-OG
|
||||
Reference in new issue
Block a user