mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-30 12:29:19 +00:00
updated copyright
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.adventure;
|
||||
@@ -30,6 +29,7 @@ import net.kyori.adventure.title.Title;
|
||||
import net.momirealms.customfishing.api.CustomFishingPlugin;
|
||||
import net.momirealms.customfishing.api.manager.AdventureManager;
|
||||
import net.momirealms.customfishing.api.util.ReflectionUtils;
|
||||
import net.momirealms.customfishing.setting.Config;
|
||||
import net.momirealms.customfishing.setting.Locale;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -60,7 +60,11 @@ public class AdventureManagerImpl implements AdventureManager {
|
||||
|
||||
@Override
|
||||
public Component getComponentFromMiniMessage(String text) {
|
||||
return MiniMessage.miniMessage().deserialize(text);
|
||||
if (Config.legacyColorSupport) {
|
||||
return MiniMessage.miniMessage().deserialize(legacyToMiniMessage(text));
|
||||
} else {
|
||||
return MiniMessage.miniMessage().deserialize(text);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.command;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.command.sub;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.command.sub;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.command.sub;
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) <2022> <XiaoMoMi>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility;
|
||||
|
||||
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.block;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.block;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.item;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.mob;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.mob;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.papi;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.papi;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.compatibility.papi;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.action;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.bag;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.block;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.competition;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.competition;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.competition;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class ActionBarSender {
|
||||
text.update(privatePlaceholders);
|
||||
AdventureManagerImpl.getInstance().sendActionbar(
|
||||
player,
|
||||
AdventureManagerImpl.getInstance().legacyToMiniMessage(text.getLatestValue())
|
||||
text.getLatestValue()
|
||||
);
|
||||
}
|
||||
}, 50, 50, TimeUnit.MILLISECONDS);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class BossBarSender {
|
||||
Object chatComponent = ReflectionUtils.iChatComponentMethod.invoke(null,
|
||||
GsonComponentSerializer.gson().serialize(
|
||||
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
|
||||
AdventureManagerImpl.getInstance().legacyToMiniMessage(text.getLatestValue())
|
||||
text.getLatestValue()
|
||||
)));
|
||||
Object updatePacket = ReflectionUtils.updateConstructor.newInstance(chatComponent);
|
||||
packet.getModifier().write(1, updatePacket);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.effect;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.fishing;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.fishing;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.fishing;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.game;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.item;
|
||||
@@ -346,12 +345,11 @@ public class ItemManagerImpl implements ItemManager {
|
||||
@Override
|
||||
public ItemBuilder name(String name) {
|
||||
if (name == null) return this;
|
||||
String replacedName = AdventureManagerImpl.getInstance().legacyToMiniMessage(name);
|
||||
editors.put("name", (player, nbtItem, placeholders) -> {
|
||||
NBTCompound displayCompound = nbtItem.getOrCreateCompound("display");
|
||||
displayCompound.setString("Name", AdventureManagerImpl.getInstance().componentToJson(
|
||||
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
|
||||
"<!i>" + PlaceholderManagerImpl.getInstance().parse(player, replacedName, placeholders)
|
||||
"<!i>" + PlaceholderManagerImpl.getInstance().parse(player, name, placeholders)
|
||||
)
|
||||
));
|
||||
});
|
||||
@@ -387,12 +385,11 @@ public class ItemManagerImpl implements ItemManager {
|
||||
@Override
|
||||
public ItemBuilder lore(List<String> lore) {
|
||||
if (lore.size() == 0) return this;
|
||||
List<String> replacedList = lore.stream().map(s -> AdventureManagerImpl.getInstance().legacyToMiniMessage(s)).toList();
|
||||
editors.put("lore", (player, nbtItem, placeholders) -> {
|
||||
NBTCompound displayCompound = nbtItem.getOrCreateCompound("display");
|
||||
NBTList<String> list = displayCompound.getStringList("Lore");
|
||||
list.clear();
|
||||
list.addAll(replacedList.stream().map(s -> AdventureManagerImpl.getInstance().componentToJson(
|
||||
list.addAll(lore.stream().map(s -> AdventureManagerImpl.getInstance().componentToJson(
|
||||
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
|
||||
"<!i>" + PlaceholderManagerImpl.getInstance().parse(player, s, placeholders)
|
||||
)
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.loot;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.market;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.market;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.market;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.market;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.mob;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.requirement;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.requirement;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.requirement;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.requirement.inbuilt;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.mechanic.totem;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.setting;
|
||||
@@ -92,6 +91,8 @@ public class Config {
|
||||
//
|
||||
public static int dataSaveInterval;
|
||||
|
||||
public static boolean legacyColorSupport;
|
||||
|
||||
public static void load() {
|
||||
try {
|
||||
YamlDocument.create(
|
||||
@@ -151,6 +152,7 @@ public class Config {
|
||||
placeholderLimit = config.getInt("mechanics.competition.placeholder-limit", 3);
|
||||
|
||||
dataSaveInterval = config.getInt("other-settings.data-saving-interval", 600);
|
||||
legacyColorSupport = config.getBoolean("other-settings.legacy-color-code-support", false);
|
||||
|
||||
OffsetUtils.loadConfig(config.getConfigurationSection("other-settings.offset-characters"));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.setting;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.nosql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.nosql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.database.sql;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.method.file;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.user;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.storage.user;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.util;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.momirealms.customfishing.util;
|
||||
|
||||
@@ -109,6 +109,8 @@ mechanics:
|
||||
|
||||
# Other settings
|
||||
other-settings:
|
||||
# It's recommended to use MiniMessage format. If you insist on using legacy color code "&", enable the support below.
|
||||
legacy-color-code-support: false
|
||||
|
||||
# Thread pool settings
|
||||
thread-pool-settings:
|
||||
|
||||
Reference in New Issue
Block a user