Skip to content

Commit

Permalink
Added Reload on TradeShop Reload
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerOfPie committed Aug 28, 2021
1 parent 4bbd96b commit 06875e1
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>org.shanerx</groupId>
<artifactId>tradeshop-arm</artifactId>
<version>0.0.2-DEV</version>
<version>0.0.3-DEV</version>
<name>TradeShop-ARM</name>
<url>https://tradeshop.github.io/</url>
<description>Add-On plugin for Tradeshop that adds support for Advanced Region Management</description>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/shanerx/tradeshoparm/TradeShopARM.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void onEnable() {
PluginManager pm = getServer().getPluginManager();

pm.registerEvents(new ARMRestoreRegionEventListener(this), this);
pm.registerEvents(new TradeShopReloadEventListener(), this);

if (Setting.CHECK_UPDATES.getBoolean()) {
new Thread(() -> getUpdater().checkCurrentVersion()).start();
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/shanerx/tradeshoparm/enumys/Setting.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public enum Setting {

CONFIG_VERSION(SettingSectionKeys.NONE, "config-version", 1.0, "", "\n"),

// Language Options
MESSAGE_PREFIX(SettingSectionKeys.LANGUAGE_OPTIONS, "message-prefix", "&a[&eTradeShop-ARM&a] ", "The prefix the displays before all plugin messages", "\n"),

// System Options
ENABLE_DEBUG(SettingSectionKeys.SYSTEM_OPTIONS, "enable-debug", 0, "What debug code should be run. this will add significant amounts of spam to the console/log, generally not used unless requested by Devs (must be a whole number)"),
CHECK_UPDATES(SettingSectionKeys.SYSTEM_OPTIONS, "check-updates", true, "Should we check for updates when the server starts"),
ALLOW_METRICS(SettingSectionKeys.SYSTEM_OPTIONS, "allow-metrics", true, "Allow us to connect anonymous metrics so we can see how our plugin is being used to better develop it");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
*
* Copyright (c) 2016-2019
* SparklingComet @ http://shanerx.org
* KillerOfPie @ http://killerofpie.github.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* NOTICE: All modifications made by others to the source code belong
* to the respective contributor. No contributor should be held liable for
* any damages of any kind, whether be material or moral, which were
* caused by their contribution(s) to the project. See the full License for more information.
*
*/

package org.shanerx.tradeshoparm.listeners;

import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.shanerx.tradeshop.framework.events.TradeShopReloadEvent;
import org.shanerx.tradeshop.utils.Utils;
import org.shanerx.tradeshoparm.enumys.Setting;


public class TradeShopReloadEventListener implements Listener {

public TradeShopReloadEventListener() {}

@EventHandler(priority = EventPriority.MONITOR)
public void onTradeShopReload(TradeShopReloadEvent event) {
Setting.reload();
event.sender.sendMessage(new Utils().colorize(Setting.MESSAGE_PREFIX.getString() + "&6The configuration files have been reloaded!"));
}
}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2-DEV
0.0.3-DEV

0 comments on commit 06875e1

Please sign in to comment.