Skip to content

Commit

Permalink
Swap to New Configuration System
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFishCakes committed Jul 29, 2023
1 parent 197dc0e commit 4bf4a55
Show file tree
Hide file tree
Showing 11 changed files with 998 additions and 491 deletions.
17 changes: 0 additions & 17 deletions patches/api/0001-Graphite-Configuration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,3 @@ index 916b9a9f05c0e83109bc9a4eb1692e2ed6e81eaf..aaff3484283f5c1dfa742582266f9f47
/**
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index bf39c6602cfca70a6352519fa26059cd79143cdd..e1432bf57802177079f7936c11277c2b68059668 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4079,6 +4079,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
@NotNull
public Set<FeatureFlag> getFeatureFlags();
+ // Graphite start - Graphite configuration
+ @NotNull
+ default org.bukkit.configuration.file.YamlConfiguration getGraphiteConfig() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ // Graphite end - Graphite configuration

/**
* Represents various map environment types that a world may be
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrFishCakes <[email protected]>
Date: Wed, 19 Jul 2023 11:38:35 +0100
Subject: [PATCH] Disable reload commands
Date: Sat, 29 Jul 2023 22:21:00 +0100
Subject: [PATCH] Disable Reload Commands

Disable all reload commands from Bukkit, Spigot, Paper, Purpur and Graphite

diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java
index 3ec32b46264cfff857b50129b5e0fa5584943ec6..bc6d1046b6d1cbd10c68d87d8eeaf21f14a10a17 100644
index 3ec32b46264cfff857b50129b5e0fa5584943ec6..178592221b5262158d9a3196a333cbcb435990c2 100644
--- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java
@@ -21,7 +21,12 @@ public class ReloadCommand extends BukkitCommand {
@@ -21,7 +21,14 @@ public class ReloadCommand extends BukkitCommand {
@Override
public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { // Paper
if (!testPermission(sender)) return true;
-
+ // Graphite start - Disable reload commands
+ if (Bukkit.getServer().spigot().getGraphiteConfig().getBoolean("server.disable-reload-commands", true)) {
+ Command.broadcastCommandMessage(sender, net.kyori.adventure.text.Component.text("Reload commands have been disabled by Graphite.", net.kyori.adventure.text.format.NamedTextColor.RED));
+ // Graphite start - Disable Reload Commands
+ if (Bukkit.getServer().spigot().getGraphiteConfig().getBoolean("server-options.server-reloading.disable-commands", true)) {
+ Command.broadcastCommandMessage(sender, net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(
+ Bukkit.getServer().spigot().getGraphiteConfig().getString("server-options.server-reloading.disable-commands",
+ "<click:open_url:'https://github.com/GraphiteMC/Graphite/wiki'><red>Reload commands have been disabled by Graphite. Please check the wiki for more information!</click>")));
+ return true;
+ }
+ // Graphite end - Disable reload commands
+ // Graphite end - Disable Reload Commands
// Paper start - Reload permissions.yml & require confirm
boolean confirmed = System.getProperty("LetMeReload") != null;
if (args.length == 1) {
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrFishCakes <[email protected]>
Date: Wed, 26 Jul 2023 21:15:17 +0100
Subject: [PATCH] Additional enchantment API
Subject: [PATCH] Additional Enchantment API


diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
Expand Down
Loading

0 comments on commit 4bf4a55

Please sign in to comment.