9
0
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:
XiaoMoMi
2023-09-04 03:23:41 +08:00
parent bbcacb68bf
commit 6ff1678f3f
141 changed files with 1420 additions and 101 deletions

View 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;

View 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.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

View 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.command;

View 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.command.sub;

View 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.command.sub;

View 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.command.sub;

View File

@@ -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;

View 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.compatibility.block;

View 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.compatibility.block;

View 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.compatibility.item;

View 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.compatibility.mob;

View 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.compatibility.mob;

View 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.compatibility.papi;

View 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.compatibility.papi;

View 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.compatibility.papi;

View 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.mechanic.action;

View 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.mechanic.bag;

View 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.mechanic.block;

View 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.mechanic.competition;

View 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.mechanic.competition;

View 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.mechanic.competition;

View File

@@ -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);

View File

@@ -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);

View 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.mechanic.effect;

View 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.mechanic.fishing;

View 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.mechanic.fishing;

View 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.mechanic.fishing;

View 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.mechanic.game;

View 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.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)
)

View 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.mechanic.loot;

View 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.mechanic.market;

View 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.mechanic.market;

View 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.mechanic.market;

View 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.mechanic.market;

View 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.mechanic.mob;

View 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.mechanic.requirement;

View 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.mechanic.requirement;

View 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.mechanic.requirement;

View 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.mechanic.requirement.inbuilt;

View 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.mechanic.totem;

View 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.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"));
}

View 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.setting;

View 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;

View 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.method;

View 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.method.database.nosql;

View 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.method.database.nosql;

View 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.method.database.sql;

View 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.method.database.sql;

View 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.method.database.sql;

View 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.method.database.sql;

View 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.method.database.sql;

View 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.method.database.sql;

View 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.method.file;

View 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;

View 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;

View 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.util;

View 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.util;

View File

@@ -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: