9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-04 15:41:35 +00:00

gui translation

This commit is contained in:
XiaoMoMi
2023-12-13 21:30:01 +08:00
parent 89e977526d
commit a55dca8e0e
63 changed files with 1848 additions and 364 deletions

View File

@@ -60,6 +60,9 @@ public class AdventureManagerImpl implements AdventureManager {
@Override
public Component getComponentFromMiniMessage(String text) {
if (text == null) {
return Component.empty();
}
if (CFConfig.legacyColorSupport) {
return MiniMessage.miniMessage().deserialize(legacyToMiniMessage(text));
} else {

View File

@@ -11,7 +11,7 @@ public class GUIEditorCommand {
public static GUIEditorCommand INSTANCE = new GUIEditorCommand();
public CommandAPICommand getEditorCommand() {
return new CommandAPICommand("editor")
return new CommandAPICommand("browser")
.executesPlayer((player, arg) -> {
new FileSelector(player, new File(CustomFishingPlugin.get().getDataFolder(), "contents"));
});

View File

@@ -1,3 +1,20 @@
/*
* 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.gui;
public interface Icon {

View File

@@ -1,3 +1,20 @@
/*
* 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.gui;
import net.momirealms.customfishing.gui.icon.BackToPageItem;

View File

@@ -1,3 +1,20 @@
/*
* 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.gui;
import org.bukkit.configuration.ConfigurationSection;

View File

@@ -1,3 +1,20 @@
/*
* 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.gui;
public interface YamlPage extends ParentPage {

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.gui.Icon;

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.Icon;
import net.momirealms.customfishing.gui.page.file.FileSelector;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -29,7 +47,7 @@ public class BackToFolderItem extends AbstractItem implements Icon {
if (file != null && file.getPath().startsWith("plugins\\CustomFishing\\contents")) {
return new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF8C00>Back to parent folder"
CFLocale.GUI_BACK_TO_PARENT_FOLDER
)))
.setLore(List.of(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FFA500>-> " + file.getName()

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.ParentPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,7 +42,7 @@ public class BackToPageItem extends AbstractItem {
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF8C00>Back to parent page"
CFLocale.GUI_BACK_TO_PARENT_PAGE
)));
}

View File

@@ -1,6 +1,26 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.Icon;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import xyz.xenondevs.invui.gui.PagedGui;
import xyz.xenondevs.invui.item.ItemProvider;
@@ -16,11 +36,16 @@ public class NextPageItem extends PageItem implements Icon {
@Override
public ItemProvider getItemProvider(PagedGui<?> gui) {
ItemBuilder builder = new ItemBuilder(Material.GREEN_STAINED_GLASS_PANE);
builder.setDisplayName("§7Next page")
.addLoreLines(gui.hasNextPage()
? "§7Go to page §e" + (gui.getCurrentPage() + 2) + "§7/§e" + gui.getPageAmount()
: "§cThere are no more pages");
builder.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_NEXT_PAGE
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
gui.hasNextPage()
? CFLocale.GUI_GOTO_NEXT_PAGE
.replace("{0}", String.valueOf(gui.getCurrentPage()))
.replace("{1}", String.valueOf(gui.getPageAmount()))
: CFLocale.GUI_CANNOT_GOTO_NEXT_PAGE
)));
return builder;
}
}

View File

@@ -1,6 +1,26 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.Icon;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import xyz.xenondevs.invui.gui.PagedGui;
import xyz.xenondevs.invui.item.ItemProvider;
@@ -16,10 +36,16 @@ public class PreviousPageItem extends PageItem implements Icon {
@Override
public ItemProvider getItemProvider(PagedGui<?> gui) {
ItemBuilder builder = new ItemBuilder(Material.RED_STAINED_GLASS_PANE);
builder.setDisplayName("§7Previous page")
.addLoreLines(gui.hasPreviousPage()
? "§7Go to page §e" + gui.getCurrentPage() + "§7/§e" + gui.getPageAmount()
: "§cYou can't go further back");
builder.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_PREVIOUS_PAGE
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
gui.hasPreviousPage()
? CFLocale.GUI_GOTO_PREVIOUS_PAGE
.replace("{0}", String.valueOf(gui.getCurrentPage()))
.replace("{1}", String.valueOf(gui.getPageAmount()))
: CFLocale.GUI_CANNOT_GOTO_PREVIOUS_PAGE
)));
return builder;
}
}

View File

@@ -1,6 +1,26 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.Icon;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import xyz.xenondevs.invui.gui.ScrollGui;
import xyz.xenondevs.invui.item.ItemProvider;
@@ -16,9 +36,13 @@ public class ScrollDownItem extends ScrollItem implements Icon {
@Override
public ItemProvider getItemProvider(ScrollGui<?> gui) {
ItemBuilder builder = new ItemBuilder(Material.GREEN_STAINED_GLASS_PANE);
builder.setDisplayName("§7Scroll down");
builder.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_SCROLL_DOWN
)));
if (!gui.canScroll(1))
builder.addLoreLines("§cYou can't scroll further down");
builder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_CANNOT_SCROLL_DOWN
)));
return builder;
}
}

View File

@@ -1,6 +1,26 @@
/*
* 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.gui.icon;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.Icon;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import xyz.xenondevs.invui.gui.ScrollGui;
import xyz.xenondevs.invui.item.ItemProvider;
@@ -16,9 +36,13 @@ public class ScrollUpItem extends ScrollItem implements Icon {
@Override
public ItemProvider getItemProvider(ScrollGui<?> gui) {
ItemBuilder builder = new ItemBuilder(Material.RED_STAINED_GLASS_PANE);
builder.setDisplayName("§7Scroll up");
builder.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_SCROLL_UP
)));
if (!gui.canScroll(-1))
builder.addLoreLines("§cYou've reached the top");
builder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_CANNOT_SCROLL_UP
)));
return builder;
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.AmountEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,26 +43,24 @@ public class AmountItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.IRON_NUGGET)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#1E90FF>● Amount"
CFLocale.GUI_ITEM_AMOUNT
)))
.setAmount(itemPage.getSection().getInt("amount", 1));
if (itemPage.getSection().contains("amount")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getInt("amount")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getInt("amount")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.CustomModelDataEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class CMDItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.GLOW_INK_SAC)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FFC0CB>● Custom Model Data"
CFLocale.GUI_ITEM_MODEL_DATA
)));
if (itemPage.getSection().contains("custom-model-data")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getInt("custom-model-data")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getInt("custom-model-data")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.DisplayNameEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class DisplayNameItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.NAME_TAG)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FAFAD2>● Display Name"
CFLocale.GUI_ITEM_DISPLAY_NAME
)));
if (itemPage.getSection().contains("display.name")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: </gray>" + itemPage.getSection().getString("display.name")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getString("display.name")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.DurabilityEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class DurabilityItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.DIAMOND_CHESTPLATE)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#1E90FF>● Custom Durability"
CFLocale.GUI_ITEM_DURABILITY
)));
if (itemPage.getSection().contains("max-durability")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getInt("max-durability")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getInt("max-durability")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.EnchantmentEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -29,33 +47,29 @@ public class EnchantmentItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.IRON_HOE)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#8A2BE2>● Enchantment"
CFLocale.GUI_ITEM_ENCHANTMENT
)))
.addEnchantment(Enchantment.ARROW_FIRE,1,true)
.addItemFlags(ItemFlag.HIDE_ENCHANTS);
if (itemPage.getSection().contains("enchantments")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: "
CFLocale.GUI_CURRENT_VALUE
)));
for (Map.Entry<String, Object> entry : itemPage.getSection().getConfigurationSection("enchantments").getValues(false).entrySet()) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
" <gray>- <white>" + entry.getKey() + ":" + entry.getValue()
)));
}
itemBuilder.addLoreLines("").addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.CustomFishingPluginImpl;
@@ -5,6 +22,7 @@ import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.api.CustomFishingPlugin;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -28,15 +46,13 @@ public class Head64Item extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.PLAYER_HEAD)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#2E8B57>● Head64"
CFLocale.GUI_ITEM_HEAD64
)));
if (itemPage.getSection().contains("head64")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>"
CFLocale.GUI_CURRENT_VALUE
)));
String head64 = itemPage.getSection().getString("head64", "");
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < head64.length(); i += 16) {
if (i + 16 > head64.length()) {
@@ -50,18 +66,16 @@ public class Head64Item extends AbstractItem {
"<white>"+ line
)));
}
itemBuilder.addLoreLines("").addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.ItemFlagEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,12 +43,11 @@ public class ItemFlagItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.CYAN_BANNER)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#E6E6FA>● Item Flag"
CFLocale.GUI_ITEM_FLAG
)));
if (itemPage.getSection().contains("item-flags")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: </gray>"
CFLocale.GUI_CURRENT_VALUE
)));
for (String lore : itemPage.getSection().getStringList("item-flags")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
@@ -39,16 +56,15 @@ public class ItemFlagItem extends AbstractItem {
}
itemBuilder.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.LoreEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,12 +43,11 @@ public class LoreItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.BIRCH_SIGN)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FA8072>● Lore"
CFLocale.GUI_ITEM_LORE
)));
if (itemPage.getSection().contains("display.lore")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: </gray>"
CFLocale.GUI_CURRENT_VALUE
)));
for (String lore : itemPage.getSection().getStringList("display.lore")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
@@ -39,16 +56,15 @@ public class LoreItem extends AbstractItem {
}
itemBuilder.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.MaterialEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class MaterialItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.COD)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF00FF>● Material"
CFLocale.GUI_ITEM_MATERIAL
)));
if (itemPage.getSection().contains("material")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: </gray>" + itemPage.getSection().getString("material")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getString("material")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.NBTEditor;
import net.momirealms.customfishing.setting.CFLocale;
import net.momirealms.customfishing.util.ConfigUtils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -26,30 +44,28 @@ public class NBTItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.COMMAND_BLOCK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FA8072>● NBT"
CFLocale.GUI_ITEM_NBT
)));
var section = itemPage.getSection().getConfigurationSection("nbt");
if (section != null) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: "
CFLocale.GUI_CURRENT_VALUE
)));
for (String line : ConfigUtils.getReadableSection(section.getValues(false))) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
line
)));
}
itemBuilder.addLoreLines("").addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class PreventGrabItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.DRAGON_EGG)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF4500>● Prevent Grabbing"
CFLocale.GUI_ITEM_PREVENT_GRAB
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("prevent-grabbing", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("prevent-grabbing", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.PriceEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,31 +43,29 @@ public class PriceItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.GOLD_INGOT)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FFD700>● Price"
CFLocale.GUI_ITEM_PRICE
)));
if (itemPage.getSection().contains("price")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: "
CFLocale.GUI_CURRENT_VALUE
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - base: <white>" + itemPage.getSection().getDouble("price.base")
CFLocale.GUI_ITEM_PRICE_BASE + itemPage.getSection().getDouble("price.base")
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - bonus: <white>" + itemPage.getSection().getDouble("price.bonus")
CFLocale.GUI_ITEM_PRICE_BONUS + itemPage.getSection().getDouble("price.bonus")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,16 +42,15 @@ public class RandomDurabilityItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.LEATHER_BOOTS)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FFFF00>● Random Durability"
CFLocale.GUI_ITEM_RANDOM_DURABILITY
)))
.setDamage(15);
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("random-durability", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("random-durability", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.SizeEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class SizeItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.PUFFERFISH)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FFF0F5>● Size"
CFLocale.GUI_ITEM_SIZE
)));
if (itemPage.getSection().contains("size")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getString("size")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getString("size")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class StackableItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.CHEST_MINECART)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#9370DB>● Stackable"
CFLocale.GUI_ITEM_STACKABLE
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("stackable", true)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("stackable", true)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.EnchantmentEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -29,33 +47,29 @@ public class StoredEnchantmentItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.ENCHANTED_BOOK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#6A5ACD>● Stored Enchantment"
CFLocale.GUI_ITEM_STORED_ENCHANTMENT
)))
.addEnchantment(Enchantment.ARROW_FIRE,1,true)
.addItemFlags(ItemFlag.HIDE_ENCHANTS);
if (itemPage.getSection().contains("stored-enchantments")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: "
CFLocale.GUI_CURRENT_VALUE
)));
for (Map.Entry<String, Object> entry : itemPage.getSection().getConfigurationSection("stored-enchantments").getValues(false).entrySet()) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
" <gray>- <white>" + entry.getKey() + ":" + entry.getValue()
)));
}
itemBuilder.addLoreLines("").addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class TagItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.TOTEM_OF_UNDYING)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#2E8B57>● Tag"
CFLocale.GUI_ITEM_TAG
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("tag", true)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("tag", true)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class UnbreakableItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.BEDROCK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#C0C0C0>● Unbreakable"
CFLocale.GUI_ITEM_UNBREAKABLE
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("unbreakable", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("unbreakable", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class DisableGameItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.LEAD)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#8B4513>● Disable Game"
CFLocale.GUI_LOOT_DISABLE_GAME
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("disable-game", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("disable-game", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class DisableStatsItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.WRITTEN_BOOK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#CD853F>● Disable Statistics"
CFLocale.GUI_LOOT_DISABLE_STATS
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("disable-stat", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("disable-stat", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class InstantGameItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.FISHING_ROD)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#7B68EE>● Instant Game"
CFLocale.GUI_LOOT_INSTANT_GAME
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("instant-game", false)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("instant-game", false)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.NickEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class NickItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.WRITABLE_BOOK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF00>● Nick"
CFLocale.GUI_LOOT_NICK
)));
if (itemPage.getSection().contains("nick")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: </gray>" + itemPage.getSection().getString("nick")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getString("nick")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.page.property.ScoreEditor;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -25,25 +43,23 @@ public class ScoreItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.NETHER_STAR)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF1493>● Score"
CFLocale.GUI_LOOT_SCORE
)));
if (itemPage.getSection().contains("score")) {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getDouble("score")
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getDouble("score")
)))
.addLoreLines("");
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to reset"
CFLocale.GUI_RIGHT_CLICK_RESET
)));
} else {
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to set"
CFLocale.GUI_LEFT_CLICK_EDIT
)));
}
return itemBuilder;
}

View File

@@ -1,8 +1,26 @@
/*
* 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.gui.icon.property.loot;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -24,17 +42,15 @@ public class ShowInFinderItem extends AbstractItem {
public ItemProvider getItemProvider() {
ItemBuilder itemBuilder = new ItemBuilder(Material.COMPASS)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#5F9EA0>● Show In Fish Finder"
CFLocale.GUI_LOOT_SHOW_IN_FINDER
)));
itemBuilder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray>Current value: <white>" + itemPage.getSection().getBoolean("show-in-fishfinder", true)
CFLocale.GUI_CURRENT_VALUE + itemPage.getSection().getBoolean("show-in-fishfinder", true)
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to toggle"
CFLocale.GUI_CLICK_TO_TOGGLE
)));
return itemBuilder;
}

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.file;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
@@ -8,6 +25,7 @@ import net.momirealms.customfishing.gui.icon.BackToFolderItem;
import net.momirealms.customfishing.gui.icon.ScrollDownItem;
import net.momirealms.customfishing.gui.icon.ScrollUpItem;
import net.momirealms.customfishing.gui.page.item.ItemSelector;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@@ -66,9 +84,9 @@ public class FileSelector {
Window window = Window.single()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Select file")
))
.setTitle(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_SELECT_FILE
)))
.setGui(gui)
.build();

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
@@ -8,6 +25,7 @@ import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.gui.icon.BackToPageItem;
import net.momirealms.customfishing.gui.icon.NextPageItem;
import net.momirealms.customfishing.gui.icon.PreviousPageItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -75,7 +93,7 @@ public abstract class AbstractSectionEditor implements SectionPage {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit " + key)
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_EDIT_KEY.replace("{0}", key))
))
.setUpperGui(upperGui)
.setLowerGui(gui)

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import net.momirealms.customfishing.gui.icon.property.item.*;

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import net.momirealms.customfishing.gui.icon.property.item.*;

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import de.tr7zw.changeme.nbtapi.NBTItem;
@@ -10,6 +27,7 @@ import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.gui.icon.BackToFolderItem;
import net.momirealms.customfishing.gui.icon.NextPageItem;
import net.momirealms.customfishing.gui.icon.PreviousPageItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -36,7 +54,7 @@ import java.util.Map;
public class ItemSelector implements YamlPage {
public static final String SEARCH = "Search";
private final String SEARCH;
private final Player player;
private final YamlConfiguration yaml;
private String prefix;
@@ -49,6 +67,7 @@ public class ItemSelector implements YamlPage {
this.player = player;
this.file = file;
this.type = type;
this.SEARCH = CFLocale.GUI_SEARCH;
this.prefix = SEARCH;
this.reOpenWithFilter(SEARCH);
}
@@ -61,9 +80,7 @@ public class ItemSelector implements YamlPage {
public void reOpenWithFilter(String filter) {
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
Gui upperGui = Gui.normal()
.setStructure(
"a # #"
)
.setStructure("a # #")
.addIngredient('a', new SimpleItem(new ItemBuilder(Material.NAME_TAG).setDisplayName(filter)))
.addIngredient('#', border)
.build();
@@ -86,8 +103,9 @@ public class ItemSelector implements YamlPage {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Select item to edit")
))
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_SELECT_ITEM
)))
.addRenameHandler(s -> {
long current = System.currentTimeMillis();
if (current - coolDown < 100) return;
@@ -104,14 +122,12 @@ public class ItemSelector implements YamlPage {
}
public void reOpenWithNewKey() {
String tempKey = "New Key";
String tempKey = CFLocale.GUI_TEMP_NEW_KEY;
prefix = tempKey;
var confirmIcon = new ConfirmIcon();
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
Gui upperGui = Gui.normal()
.setStructure(
"a # b"
)
.setStructure("a # b")
.addIngredient('a', new SimpleItem(new ItemBuilder(Material.NAME_TAG).setDisplayName(tempKey)))
.addIngredient('b', confirmIcon)
.addIngredient('#', border)
@@ -134,7 +150,7 @@ public class ItemSelector implements YamlPage {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Set key name")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_SET_NEW_KEY)
))
.addRenameHandler(s -> {
long current = System.currentTimeMillis();
@@ -179,18 +195,10 @@ public class ItemSelector implements YamlPage {
public void openEditor(String key) {
switch (type) {
case "item" -> {
new SectionEditor(player, key, this, yaml.getConfigurationSection(key));
}
case "rod" -> {
new RodEditor(player, key, this, yaml.getConfigurationSection(key));
}
case "bait" -> {
new BaitEditor(player, key, this, yaml.getConfigurationSection(key));
}
case "hook" -> {
new HookEditor(player, key, this, yaml.getConfigurationSection(key));
}
case "item" -> new SectionEditor(player, key, this, yaml.getConfigurationSection(key));
case "rod" -> new RodEditor(player, key, this, yaml.getConfigurationSection(key));
case "bait" -> new BaitEditor(player, key, this, yaml.getConfigurationSection(key));
case "hook" -> new HookEditor(player, key, this, yaml.getConfigurationSection(key));
}
}
@@ -215,9 +223,9 @@ public class ItemSelector implements YamlPage {
key
))).addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
this.itemSelector = itemSelector;
}
@@ -244,7 +252,7 @@ public class ItemSelector implements YamlPage {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.ANVIL).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<green>[+] Add a new key"
CFLocale.GUI_ADD_NEW_KEY
)));
}
@@ -264,15 +272,15 @@ public class ItemSelector implements YamlPage {
prefix
)));
builder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to confirm"
CFLocale.GUI_CLICK_CONFIRM
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1> -> Right click to cancel"
CFLocale.GUI_RIGHT_CLICK_CANCEL
)));
return builder;
} else {
return new ItemBuilder(Material.BARRIER)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Duplicated or invalid key"
CFLocale.GUI_DUPE_INVALID_KEY
)));
}
}

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import net.momirealms.customfishing.gui.icon.property.item.*;

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.item;
import net.momirealms.customfishing.gui.icon.property.item.*;

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -54,7 +72,7 @@ public class AmountEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Display Name")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_AMOUNT)
))
.addRenameHandler(s -> {
amount = s;
@@ -73,7 +91,7 @@ public class AmountEditor {
public ItemProvider getItemProvider() {
if (amount == null || amount.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
@@ -81,17 +99,17 @@ public class AmountEditor {
if (m >= 1) {
return new ItemBuilder(Material.IRON_NUGGET)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)))
.setAmount(m);
} else {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
@@ -5,6 +22,7 @@ import net.momirealms.customfishing.adventure.component.ShadedAdventureComponent
import net.momirealms.customfishing.api.CustomFishingPlugin;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -66,7 +84,7 @@ public class CustomModelDataEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit CustomModelData")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_MODEL_DATA)
))
.addRenameHandler(s -> {
cmd = s;
@@ -85,7 +103,7 @@ public class CustomModelDataEditor {
public ItemProvider getItemProvider() {
if (cmd == null || cmd.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
@@ -97,18 +115,18 @@ public class CustomModelDataEditor {
.getItemStackAppearance(player, material)
)
.setCustomModelData(value)
.setDisplayName("New value: " + value)
.setDisplayName(CFLocale.GUI_NEW_VALUE + value)
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
} else {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -33,10 +51,8 @@ public class DisplayNameEditor {
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
var confirm = new ConfirmIcon();
Gui upperGui = Gui.normal()
.setStructure(
"a # b"
)
.addIngredient('a', new ItemBuilder(Material.NAME_TAG).setDisplayName(section.getString("display.name", "New name")))
.setStructure("a # b")
.addIngredient('a', new ItemBuilder(Material.NAME_TAG).setDisplayName(section.getString("display.name", CFLocale.GUI_NEW_DISPLAY_NAME)))
.addIngredient('#', border)
.addIngredient('b', confirm)
.build();
@@ -56,7 +72,7 @@ public class DisplayNameEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Display Name")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_DISPLAY_NAME)
))
.addRenameHandler(s -> {
name = s;
@@ -75,15 +91,15 @@ public class DisplayNameEditor {
public ItemProvider getItemProvider() {
if (name == null || name.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
return new ItemBuilder(Material.NAME_TAG)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<white>" + name
"<!i>" + name
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -54,7 +72,7 @@ public class DurabilityEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Custom Durability")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_CUSTOM_DURABILITY)
))
.addRenameHandler(s -> {
dur = s;
@@ -73,7 +91,7 @@ public class DurabilityEditor {
public ItemProvider getItemProvider() {
if (dur == null || dur.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
@@ -81,20 +99,20 @@ public class DurabilityEditor {
if (m >= 1) {
return new ItemBuilder(Material.NETHERITE_PICKAXE)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New value: " + dur
CFLocale.GUI_NEW_VALUE + dur
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)))
.setDamage(Math.max(0, Material.NETHERITE_PICKAXE.getMaxDurability() - m));
} else {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -40,7 +58,7 @@ public class EnchantmentEditor {
this.store = store;
this.index = 0;
this.enchantments = new ArrayList<>();
this.enchantments.add("Select one enchantment");
this.enchantments.add(CFLocale.GUI_SELECT_ONE_ENCHANTMENT);
ConfigurationSection eSection = section.getConfigurationSection(store ? "stored-enchantments" : "enchantments");
if (eSection != null)
for (Map.Entry<String, Object> entry : eSection.getValues(false).entrySet()) {
@@ -53,9 +71,7 @@ public class EnchantmentEditor {
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
var confirm = new ConfirmIcon();
Gui upperGui = Gui.normal()
.setStructure(
"a # b"
)
.setStructure("a # b")
.addIngredient('a', new ItemBuilder(Material.NAME_TAG).setDisplayName(enchantments.get(idx)))
.addIngredient('#', border)
.addIngredient('b', confirm)
@@ -77,7 +93,7 @@ public class EnchantmentEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit" + (store ? " Stored ": " ") + "Enchantment")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(store ? CFLocale.GUI_TITLE_STORED_ENCHANTMENT : CFLocale.GUI_TITLE_ENCHANTMENT)
))
.addRenameHandler(s -> {
if (index == 0) return;
@@ -107,7 +123,7 @@ public class EnchantmentEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.ANVIL).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<green>[+] <gray>Add a new enchantment"
CFLocale.GUI_ADD_NEW_ENCHANTMENT
)));
}
@@ -135,9 +151,9 @@ public class EnchantmentEditor {
line
))).addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -161,18 +177,18 @@ public class EnchantmentEditor {
List<String> subList = enchantments.subList(1, enchantments.size());
if (subList.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
var builder = new ItemBuilder(Material.NAME_TAG)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
for (String enchantment : subList) {
String[] split = enchantment.split(":");
if (split.length != 3) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Illegal format"
CFLocale.GUI_ILLEGAL_FORMAT
)));
}
try {
@@ -182,7 +198,7 @@ public class EnchantmentEditor {
)));
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Illegal format"
CFLocale.GUI_ILLEGAL_FORMAT
)));
}
}

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
@@ -5,6 +22,7 @@ import net.momirealms.customfishing.adventure.component.ShadedAdventureComponent
import net.momirealms.customfishing.api.CustomFishingPlugin;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -65,7 +83,7 @@ public class ItemFlagEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Item Flag")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_ITEM_FLAG)
))
.setUpperGui(upperGui)
.setLowerGui(gui)

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -37,7 +55,7 @@ public class LoreEditor {
this.section = parentPage.getSection();
this.index = 0;
this.lore = new ArrayList<>(section.getStringList("display.lore"));
this.lore.add(0, "Select one line");
this.lore.add(0, CFLocale.GUI_SELECT_ONE_LORE);
reOpen(0);
}
@@ -45,9 +63,7 @@ public class LoreEditor {
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
var confirm = new ConfirmIcon();
Gui upperGui = Gui.normal()
.setStructure(
"a # b"
)
.setStructure("a # b")
.addIngredient('a', new ItemBuilder(Material.NAME_TAG).setDisplayName(lore.get(idx)))
.addIngredient('#', border)
.addIngredient('b', confirm)
@@ -69,7 +85,7 @@ public class LoreEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Lore")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_LORE)
))
.addRenameHandler(s -> {
if (index == 0) return;
@@ -99,7 +115,7 @@ public class LoreEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.ANVIL).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<green>[+] <gray>Add a new line"
CFLocale.GUI_ADD_NEW_LORE
)));
}
@@ -127,9 +143,9 @@ public class LoreEditor {
line
))).addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -153,12 +169,12 @@ public class LoreEditor {
List<String> subList = lore.subList(1, lore.size());
if (subList.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
var builder = new ItemBuilder(Material.NAME_TAG)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
for (String lore : subList) {
builder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(

View File

@@ -1,3 +1,20 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
@@ -6,6 +23,7 @@ import net.momirealms.customfishing.api.CustomFishingPlugin;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.mechanic.item.ItemManagerImpl;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -72,7 +90,7 @@ public class MaterialEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Material")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_MATERIAL)
))
.addRenameHandler(s -> {
material = s;
@@ -89,16 +107,11 @@ public class MaterialEditor {
ArrayList<Item> items = new ArrayList<>();
for (String lib : ((ItemManagerImpl) CustomFishingPlugin.get().getItemManager()).getItemLibraries()) {
switch (lib) {
case "MMOItems" -> {
items.add(new SimpleItem(new ItemBuilder(Material.BELL).setDisplayName(lib + ":TYPE:ID")));
}
case "vanilla", "CustomFishing" -> {
}
default -> {
items.add(new SimpleItem(new ItemBuilder(Material.BELL).setDisplayName(lib + ":ID")));
}
case "MMOItems" -> items.add(new SimpleItem(new ItemBuilder(Material.BELL).setDisplayName(lib + ":TYPE:ID")));
case "ItemsAdder" -> items.add(new SimpleItem(new ItemBuilder(Material.BELL).setDisplayName(lib + ":namespace:id")));
case "vanilla", "CustomFishing" -> {}
default -> items.add(new SimpleItem(new ItemBuilder(Material.BELL).setDisplayName(lib + ":ID")));
}
}
return items;
}
@@ -109,20 +122,19 @@ public class MaterialEditor {
public ItemProvider getItemProvider() {
if (material == null || material.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
var builder = new ItemBuilder(
CustomFishingPlugin.get()
.getItemManager()
.getItemStackAppearance(player, material)
).setDisplayName("New value: " + material)
).setDisplayName(CFLocale.GUI_NEW_VALUE + material)
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
if (section.contains("custom-model-data"))
builder.setCustomModelData(section.getInt("custom-model-data"));
return builder;
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import net.momirealms.customfishing.util.ConfigUtils;
import net.momirealms.customfishing.util.NBTUtils;
import org.bukkit.Material;
@@ -90,7 +108,7 @@ public class NBTEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit NBT")))
.setTitle(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_NBT_EDIT_TITLE)))
.setUpperGui(upperGui)
.setLowerGui(gui)
.build();
@@ -125,7 +143,7 @@ public class NBTEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit compound key")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_NBT_COMPOUND)
))
.addRenameHandler(s -> {
value = s;
@@ -165,7 +183,7 @@ public class NBTEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit list key")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_NBT_LIST)
))
.addRenameHandler(s -> {
value = s;
@@ -181,9 +199,7 @@ public class NBTEditor {
public void reOpenAddValue() {
var confirm =new ConfirmValueItem();
Gui upperGui = Gui.normal()
.setStructure(
"a b c"
)
.setStructure("a b c")
.addIngredient('a', new ItemBuilder(Material.COMMAND_BLOCK).setDisplayName(""))
.addIngredient('b', new ItemStack(Material.AIR))
.addIngredient('c', confirm)
@@ -206,7 +222,7 @@ public class NBTEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit key")))
.setTitle(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_TITLE_NBT_KEY)))
.addRenameHandler(s -> {
value = s;
confirm.notifyWindows();
@@ -245,7 +261,7 @@ public class NBTEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Set value")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_NBT_SET_VALUE_TITLE)
))
.addRenameHandler(s -> {
value = s;
@@ -313,16 +329,16 @@ public class NBTEditor {
public ItemProvider getItemProvider() {
if (value == null || value.equals("") || value.contains(".") || currentSection.contains(value)) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>Invaild key"
CFLocale.GUI_NBT_INVALID_KEY
)));
}
return new ItemBuilder(Material.COMMAND_BLOCK_MINECART).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New key: " + value
CFLocale.GUI_NEW_VALUE + value
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to confirm"
CFLocale.GUI_CLICK_CONFIRM
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1> -> Right click to cancel"
CFLocale.GUI_RIGHT_CLICK_CANCEL
)));
}
@@ -348,16 +364,15 @@ public class NBTEditor {
public ItemProvider getItemProvider() {
if (value == null || value.equals("") || value.contains(".") || currentSection.contains(value)) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>Invaild key"
CFLocale.GUI_NBT_INVALID_KEY
)));
}
return new ItemBuilder(Material.CHAIN_COMMAND_BLOCK).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New key: " + value
CFLocale.GUI_NEW_VALUE + value
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to confirm"
CFLocale.GUI_CLICK_CONFIRM
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1> -> Right click to cancel"
CFLocale.GUI_RIGHT_CLICK_CANCEL
)));
}
@@ -383,16 +398,16 @@ public class NBTEditor {
public ItemProvider getItemProvider() {
if (value == null || value.equals("") || value.contains(".") || currentSection.contains(value)) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>Invaild key"
CFLocale.GUI_NBT_INVALID_KEY
)));
}
return new ItemBuilder(Material.COMMAND_BLOCK).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New key: " + value
CFLocale.GUI_NEW_VALUE + value
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to confirm"
CFLocale.GUI_CLICK_CONFIRM
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1> -> Right click to cancel"
CFLocale.GUI_RIGHT_CLICK_CANCEL
)));
}
@@ -417,7 +432,7 @@ public class NBTEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.OAK_SIGN).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Add a new compound"
CFLocale.GUI_NBT_ADD_COMPOUND
)));
}
@@ -432,7 +447,7 @@ public class NBTEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.SPRUCE_SIGN).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Add a new list"
CFLocale.GUI_NBT_ADD_LIST
)));
}
@@ -447,7 +462,7 @@ public class NBTEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.ACACIA_SIGN).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Add a new value"
CFLocale.GUI_NBT_ADD_VALUE
)));
}
@@ -474,9 +489,9 @@ public class NBTEditor {
"Compound: " + splits[splits.length -1]
))).addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -510,9 +525,9 @@ public class NBTEditor {
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to edit"
CFLocale.GUI_LEFT_CLICK_EDIT
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -544,11 +559,9 @@ public class NBTEditor {
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> <st>Left click to edit</st>"
"<st>" + CFLocale.GUI_LEFT_CLICK_EDIT + "</st>"
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Use text editor instead"
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -577,11 +590,9 @@ public class NBTEditor {
)))
.addLoreLines("")
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> <st>Left click to edit</st>"
"<st>" + CFLocale.GUI_LEFT_CLICK_EDIT + "</st>"
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Use text editor instead"
))).addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#FF6347> -> Right click to delete"
CFLocale.GUI_RIGHT_CLICK_DELETE
)));
}
@@ -609,12 +620,14 @@ public class NBTEditor {
return new ItemBuilder(Material.COMMAND_BLOCK)
.setDisplayName(value)
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Left click to confirm")))
CFLocale.GUI_CLICK_CONFIRM
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1> -> Right click to cancel")));
CFLocale.GUI_RIGHT_CLICK_CANCEL
)));
} catch (IllegalArgumentException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Invalid format"
CFLocale.GUI_ILLEGAL_FORMAT
)));
}
}
@@ -642,7 +655,7 @@ public class NBTEditor {
public ItemProvider getItemProvider() {
if (nbtSection.getValues(false).size() > 0) {
var builder = new ItemBuilder(Material.ACACIA_SIGN).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<green>● NBT Preview"
CFLocale.GUI_NBT_PREVIEW
)));
for (String line : ConfigUtils.getReadableSection(nbtSection.getValues(false))) {
builder.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
@@ -652,7 +665,7 @@ public class NBTEditor {
return builder;
} else {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
}
}
@@ -672,7 +685,7 @@ public class NBTEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.MINECART).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Back to parent compound"
CFLocale.GUI_NBT_BACK_TO_COMPOUND
)));
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -33,10 +51,8 @@ public class NickEditor {
Item border = new SimpleItem(new ItemBuilder(Material.AIR));
var confirm = new ConfirmIcon();
Gui upperGui = Gui.normal()
.setStructure(
"a # b"
)
.addIngredient('a', new ItemBuilder(Material.WRITABLE_BOOK).setDisplayName(section.getString("nick", "New nick")))
.setStructure("a # b")
.addIngredient('a', new ItemBuilder(Material.WRITABLE_BOOK).setDisplayName(section.getString("nick", CFLocale.GUI_NICK_NEW)))
.addIngredient('#', border)
.addIngredient('b', confirm)
.build();
@@ -56,7 +72,7 @@ public class NickEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Nick")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_NICK_TITLE)
))
.addRenameHandler(s -> {
nick = s;
@@ -75,15 +91,15 @@ public class NickEditor {
public ItemProvider getItemProvider() {
if (nick == null || nick.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
return new ItemBuilder(Material.WRITABLE_BOOK)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<white>" + nick
"<!i><white>" + nick
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -64,7 +82,7 @@ public class PriceEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Price")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_PRICE_TITLE)
))
.addRenameHandler(s -> {
if (s == null || s.equals("")) {
@@ -86,7 +104,7 @@ public class PriceEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.GOLD_BLOCK).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Base"
CFLocale.GUI_PRICE_BASE
)));
}
@@ -102,7 +120,7 @@ public class PriceEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.GOLD_NUGGET).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Bonus"
CFLocale.GUI_PRICE_BONUS
)));
}
@@ -119,7 +137,7 @@ public class PriceEditor {
public ItemProvider getItemProvider() {
if (price[0].equals("0") && price[1].equals("0")) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
@@ -127,20 +145,20 @@ public class PriceEditor {
Double.parseDouble(price[1]);
return new ItemBuilder(Material.GOLD_INGOT)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New value: "
CFLocale.GUI_NEW_VALUE
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - base: <white>" + price[0]
CFLocale.GUI_ITEM_PRICE_BASE + price[0]
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - bonus: <white>" + price[1]
CFLocale.GUI_ITEM_PRICE_BONUS + price[1]
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -54,7 +72,7 @@ public class ScoreEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Score")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_SCORE_TITLE)
))
.addRenameHandler(s -> {
score = s;
@@ -73,27 +91,21 @@ public class ScoreEditor {
public ItemProvider getItemProvider() {
if (score == null || score.isEmpty()) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
double m = Double.parseDouble(score);
if (m >= 0) {
return new ItemBuilder(Material.NETHER_STAR)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New value: " + score
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
)));
} else {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
)));
}
Double.parseDouble(score);
return new ItemBuilder(Material.NETHER_STAR)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_NEW_VALUE + score
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
CFLocale.GUI_CLICK_CONFIRM
)));
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -1,9 +1,27 @@
/*
* 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.gui.page.property;
import net.momirealms.customfishing.adventure.AdventureManagerImpl;
import net.momirealms.customfishing.adventure.component.ShadedAdventureComponentWrapper;
import net.momirealms.customfishing.gui.SectionPage;
import net.momirealms.customfishing.gui.icon.BackGroundItem;
import net.momirealms.customfishing.setting.CFLocale;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -64,7 +82,7 @@ public class SizeEditor {
var window = AnvilWindow.split()
.setViewer(player)
.setTitle(new ShadedAdventureComponentWrapper(
AdventureManagerImpl.getInstance().getComponentFromMiniMessage("Edit Size")
AdventureManagerImpl.getInstance().getComponentFromMiniMessage(CFLocale.GUI_SIZE_TITLE)
))
.addRenameHandler(s -> {
if (s == null || s.equals("")) {
@@ -86,7 +104,7 @@ public class SizeEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.IRON_INGOT).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Min"
CFLocale.GUI_SIZE_MIN
)));
}
@@ -102,7 +120,7 @@ public class SizeEditor {
@Override
public ItemProvider getItemProvider() {
return new ItemBuilder(Material.IRON_BLOCK).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"Max"
CFLocale.GUI_SIZE_MAX
)));
}
@@ -119,7 +137,7 @@ public class SizeEditor {
public ItemProvider getItemProvider() {
if (size[0].equals("0") && size[1].equals("0")) {
return new ItemBuilder(Material.STRUCTURE_VOID).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00CED1>● Delete property"
CFLocale.GUI_DELETE_PROPERTY
)));
} else {
try {
@@ -129,25 +147,22 @@ public class SizeEditor {
if (min <= max) {
return new ItemBuilder(Material.PUFFERFISH)
.setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"New value: "
CFLocale.GUI_NEW_VALUE
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - min: <white>" + size[0]
"<gray> - <white>" + size[0] + "~" + size[1]
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<gray> - max: <white>" + size[1]
)))
.addLoreLines(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<#00FF7F> -> Click to confirm"
CFLocale.GUI_CLICK_CONFIRM
)));
} else {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Max must be greater than min"
CFLocale.GUI_SIZE_MAX_NO_LESS
)));
}
} catch (NumberFormatException e) {
return new ItemBuilder(Material.BARRIER).setDisplayName(new ShadedAdventureComponentWrapper(AdventureManagerImpl.getInstance().getComponentFromMiniMessage(
"<red>● Invalid number"
CFLocale.GUI_INVALID_NUMBER
)));
}
}

View File

@@ -60,6 +60,98 @@ public class CFLocale {
public static String FORMAT_Hour;
public static String FORMAT_Minute;
public static String FORMAT_Second;
public static String GUI_SCROLL_DOWN;
public static String GUI_SCROLL_UP;
public static String GUI_CANNOT_SCROLL_UP;
public static String GUI_CANNOT_SCROLL_DOWN;
public static String GUI_NEXT_PAGE;
public static String GUI_GOTO_NEXT_PAGE;
public static String GUI_CANNOT_GOTO_NEXT_PAGE;
public static String GUI_PREVIOUS_PAGE;
public static String GUI_GOTO_PREVIOUS_PAGE;
public static String GUI_CANNOT_GOTO_PREVIOUS_PAGE;
public static String GUI_BACK_TO_PARENT_PAGE;
public static String GUI_BACK_TO_PARENT_FOLDER;
public static String GUI_CURRENT_VALUE;
public static String GUI_CLICK_TO_TOGGLE;
public static String GUI_LEFT_CLICK_EDIT;
public static String GUI_RIGHT_CLICK_RESET;
public static String GUI_RIGHT_CLICK_DELETE;
public static String GUI_LOOT_SHOW_IN_FINDER;
public static String GUI_LOOT_SCORE;
public static String GUI_LOOT_NICK;
public static String GUI_LOOT_INSTANT_GAME;
public static String GUI_LOOT_DISABLE_STATS;
public static String GUI_LOOT_DISABLE_GAME;
public static String GUI_ITEM_AMOUNT;
public static String GUI_ITEM_MODEL_DATA;
public static String GUI_ITEM_DISPLAY_NAME;
public static String GUI_ITEM_DURABILITY;
public static String GUI_ITEM_ENCHANTMENT;
public static String GUI_ITEM_HEAD64;
public static String GUI_ITEM_FLAG;
public static String GUI_ITEM_LORE;
public static String GUI_ITEM_MATERIAL;
public static String GUI_ITEM_NBT;
public static String GUI_ITEM_PREVENT_GRAB;
public static String GUI_ITEM_PRICE;
public static String GUI_ITEM_PRICE_BASE;
public static String GUI_ITEM_PRICE_BONUS;
public static String GUI_ITEM_RANDOM_DURABILITY;
public static String GUI_ITEM_SIZE;
public static String GUI_ITEM_STACKABLE;
public static String GUI_ITEM_STORED_ENCHANTMENT;
public static String GUI_ITEM_TAG;
public static String GUI_ITEM_UNBREAKABLE;
public static String GUI_DELETE_PROPERTY;
public static String GUI_NEW_VALUE;
public static String GUI_CLICK_CONFIRM;
public static String GUI_INVALID_NUMBER;
public static String GUI_ILLEGAL_FORMAT;
public static String GUI_TITLE_AMOUNT;
public static String GUI_TITLE_MODEL_DATA;
public static String GUI_TITLE_DISPLAY_NAME;
public static String GUI_NEW_DISPLAY_NAME;
public static String GUI_TITLE_CUSTOM_DURABILITY;
public static String GUI_TITLE_ENCHANTMENT;
public static String GUI_TITLE_STORED_ENCHANTMENT;
public static String GUI_SELECT_ONE_ENCHANTMENT;
public static String GUI_ADD_NEW_ENCHANTMENT;
public static String GUI_TITLE_ITEM_FLAG;
public static String GUI_TITLE_LORE;
public static String GUI_ADD_NEW_LORE;
public static String GUI_SELECT_ONE_LORE;
public static String GUI_TITLE_MATERIAL;
public static String GUI_TITLE_NBT_COMPOUND;
public static String GUI_TITLE_NBT_LIST;
public static String GUI_TITLE_NBT_KEY;
public static String GUI_NBT_INVALID_KEY;
public static String GUI_RIGHT_CLICK_CANCEL;
public static String GUI_NBT_ADD_COMPOUND;
public static String GUI_NBT_ADD_LIST;
public static String GUI_NBT_ADD_VALUE;
public static String GUI_NBT_PREVIEW;
public static String GUI_NBT_BACK_TO_COMPOUND;
public static String GUI_NBT_SET_VALUE_TITLE;
public static String GUI_NBT_EDIT_TITLE;
public static String GUI_NICK_TITLE;
public static String GUI_NICK_NEW;
public static String GUI_PRICE_TITLE;
public static String GUI_PRICE_BASE;
public static String GUI_PRICE_BONUS;
public static String GUI_SCORE_TITLE;
public static String GUI_SIZE_TITLE;
public static String GUI_SIZE_MIN;
public static String GUI_SIZE_MAX;
public static String GUI_SIZE_MAX_NO_LESS;
public static String GUI_SELECT_FILE;
public static String GUI_SELECT_ITEM;
public static String GUI_ADD_NEW_KEY;
public static String GUI_DUPE_INVALID_KEY;
public static String GUI_SEARCH;
public static String GUI_TEMP_NEW_KEY;
public static String GUI_SET_NEW_KEY;
public static String GUI_EDIT_KEY;
public static void load() {
try {
@@ -107,12 +199,107 @@ public class CFLocale {
MSG_Data_Not_Loaded = msgSection.getString("data-not-loaded");
MSG_Market_GUI_Open = msgSection.getString("open-market-gui");
MSG_Fishing_Bag_Open = msgSection.getString("open-fishing-bag");
MSG_Split_Char = msgSection.getString("split-char");
MSG_Possible_Loots = msgSection.getString("possible-loots");
FORMAT_Day = msgSection.getString("format-day");
FORMAT_Hour = msgSection.getString("format-hour");
FORMAT_Minute = msgSection.getString("format-minute");
FORMAT_Second = msgSection.getString("format-second");
MSG_Split_Char = msgSection.getString("split-char");
MSG_Possible_Loots = msgSection.getString("possible-loots");
}
ConfigurationSection guiSection = locale.getConfigurationSection("gui");
if (guiSection != null) {
GUI_SEARCH = guiSection.getString("search");
GUI_EDIT_KEY = guiSection.getString("edit-key");
GUI_DELETE_PROPERTY = guiSection.getString("delete-property");
GUI_DUPE_INVALID_KEY = guiSection.getString("dupe-invalid-key");
GUI_SELECT_ITEM = guiSection.getString("select-item");
GUI_SELECT_FILE = guiSection.getString("select-file");
GUI_TEMP_NEW_KEY = guiSection.getString("temp-new-key");
GUI_SET_NEW_KEY = guiSection.getString("set-new-key");
GUI_ADD_NEW_KEY = guiSection.getString("page-add-new-key");
GUI_SCROLL_UP = guiSection.getString("scroll-up");
GUI_SCROLL_DOWN = guiSection.getString("scroll-down");
GUI_CANNOT_SCROLL_UP = guiSection.getString("cannot-scroll-up");
GUI_CANNOT_SCROLL_DOWN = guiSection.getString("cannot-scroll-down");
GUI_NEXT_PAGE = guiSection.getString("next-page");
GUI_GOTO_NEXT_PAGE = guiSection.getString("goto-next-page");
GUI_CANNOT_GOTO_NEXT_PAGE = guiSection.getString("cannot-goto-next-page");
GUI_PREVIOUS_PAGE = guiSection.getString("previous-page");
GUI_GOTO_PREVIOUS_PAGE = guiSection.getString("goto-previous-page");
GUI_CANNOT_GOTO_PREVIOUS_PAGE = guiSection.getString("cannot-goto-previous-page");
GUI_BACK_TO_PARENT_PAGE = guiSection.getString("back-to-parent-page");
GUI_BACK_TO_PARENT_FOLDER = guiSection.getString("back-to-parent-folder");
GUI_CURRENT_VALUE = guiSection.getString("current-value");
GUI_CLICK_TO_TOGGLE = guiSection.getString("click-to-toggle");
GUI_LEFT_CLICK_EDIT = guiSection.getString("left-click-edit");
GUI_RIGHT_CLICK_RESET = guiSection.getString("right-click-reset");
GUI_RIGHT_CLICK_DELETE = guiSection.getString("right-click-delete");
GUI_RIGHT_CLICK_CANCEL = guiSection.getString("right-click-cancel");
GUI_LOOT_SHOW_IN_FINDER = guiSection.getString("loot-show-in-finder");
GUI_LOOT_SCORE = guiSection.getString("loot-score");
GUI_LOOT_NICK = guiSection.getString("loot-nick");
GUI_LOOT_INSTANT_GAME = guiSection.getString("loot-instant-game");
GUI_LOOT_DISABLE_STATS = guiSection.getString("loot-disable-statistics");
GUI_LOOT_DISABLE_GAME = guiSection.getString("loot-disable-game");
GUI_ITEM_AMOUNT = guiSection.getString("item-amount");
GUI_ITEM_MODEL_DATA = guiSection.getString("item-custom-model-data");
GUI_ITEM_DISPLAY_NAME = guiSection.getString("item-display-name");
GUI_ITEM_DURABILITY = guiSection.getString("item-custom-durability");
GUI_ITEM_ENCHANTMENT = guiSection.getString("item-enchantment");
GUI_ITEM_HEAD64 = guiSection.getString("item-head64");
GUI_ITEM_FLAG = guiSection.getString("item-item-flag");
GUI_ITEM_LORE = guiSection.getString("item-lore");
GUI_ITEM_MATERIAL = guiSection.getString("item-material");
GUI_ITEM_NBT = guiSection.getString("item-nbt");
GUI_ITEM_PREVENT_GRAB = guiSection.getString("item-prevent-grab");
GUI_ITEM_PRICE = guiSection.getString("item-price");
GUI_ITEM_PRICE_BASE = guiSection.getString("item-price-base");
GUI_ITEM_PRICE_BONUS = guiSection.getString("item-price-bonus");
GUI_ITEM_RANDOM_DURABILITY = guiSection.getString("item-random-durability");
GUI_ITEM_SIZE = guiSection.getString("item-size");
GUI_ITEM_STACKABLE = guiSection.getString("item-stackable");
GUI_ITEM_STORED_ENCHANTMENT = guiSection.getString("item-stored-enchantment");
GUI_ITEM_TAG = guiSection.getString("item-tag");
GUI_ITEM_UNBREAKABLE = guiSection.getString("item-unbreakable");
GUI_NEW_VALUE = guiSection.getString("new-value");
GUI_CLICK_CONFIRM = guiSection.getString("click-confirm");
GUI_INVALID_NUMBER = guiSection.getString("invalid-number");
GUI_ILLEGAL_FORMAT = guiSection.getString("illegal-format");
GUI_TITLE_AMOUNT = guiSection.getString("page-amount-title");
GUI_TITLE_MODEL_DATA = guiSection.getString("page-model-data-title");
GUI_TITLE_DISPLAY_NAME = guiSection.getString("page-display-name-title");
GUI_NEW_DISPLAY_NAME = guiSection.getString("page-new-display-name");
GUI_TITLE_CUSTOM_DURABILITY = guiSection.getString("page-custom-durability-title");
GUI_TITLE_ENCHANTMENT = guiSection.getString("page-enchantment-title");
GUI_TITLE_STORED_ENCHANTMENT = guiSection.getString("page-stored-enchantment-title");
GUI_SELECT_ONE_ENCHANTMENT = guiSection.getString("page-select-one-enchantment");
GUI_ADD_NEW_ENCHANTMENT = guiSection.getString("page-add-new-enchantment");
GUI_TITLE_ITEM_FLAG = guiSection.getString("page-item-flag-title");
GUI_TITLE_LORE = guiSection.getString("page-lore-title");
GUI_ADD_NEW_LORE = guiSection.getString("page-add-new-lore");
GUI_SELECT_ONE_LORE = guiSection.getString("page-select-one-lore");
GUI_TITLE_MATERIAL = guiSection.getString("page-material-title");
GUI_TITLE_NBT_COMPOUND = guiSection.getString("page-nbt-compound-key-title");
GUI_TITLE_NBT_LIST = guiSection.getString("page-nbt-list-key-title");
GUI_TITLE_NBT_KEY = guiSection.getString("page-nbt-key-title");
GUI_NBT_INVALID_KEY = guiSection.getString("page-nbt-invalid-key");
GUI_NBT_ADD_COMPOUND = guiSection.getString("page-nbt-add-new-compound");
GUI_NBT_ADD_LIST = guiSection.getString("page-nbt-add-new-list");
GUI_NBT_ADD_VALUE = guiSection.getString("page-nbt-add-new-value");
GUI_NBT_PREVIEW = guiSection.getString("page-nbt-preview");
GUI_NBT_BACK_TO_COMPOUND = guiSection.getString("page-nbt-back-to-compound");
GUI_NBT_SET_VALUE_TITLE = guiSection.getString("page-nbt-set-value-title");
GUI_NBT_EDIT_TITLE = guiSection.getString("page-nbt-edit-title");
GUI_NICK_TITLE = guiSection.getString("page-nick-title");
GUI_NICK_NEW = guiSection.getString("page-new-nick");
GUI_PRICE_TITLE = guiSection.getString("page-price-title");
GUI_PRICE_BASE = guiSection.getString("page-base-price");
GUI_PRICE_BONUS = guiSection.getString("page-base-bonus");
GUI_SCORE_TITLE = guiSection.getString("page-score-title");
GUI_SIZE_TITLE = guiSection.getString("page-size-title");
GUI_SIZE_MIN = guiSection.getString("page-size-min");
GUI_SIZE_MAX = guiSection.getString("page-size-max");
GUI_SIZE_MAX_NO_LESS = guiSection.getString("page-size-max-no-less-min");
}
}
}

View File

@@ -1,5 +1,5 @@
# Don't change this
config-version: '26'
config-version: '31'
messages:
prefix: '<gradient:#0070B3:#A0EACF>[CustomFishing] </gradient>'
@@ -28,4 +28,98 @@ messages:
format-day: '天'
format-hour: '小时'
format-minute: '分'
format-second: '秒'
format-second: '秒'
gui:
search: 搜索
select-file: 选择文件
select-item-to-edit: 选择要编辑的物品
dupe-invalid-key: <red>● 重复或无效的键
new-value: '新值: '
temp-new-key: '新键'
set-new-key: '设置新键'
edit-key: '修改 {0}'
delete-property: <#00CED1>● 删除属性
click-confirm: <#00FF7F> -> 点击确认
invalid-number: <red>● 无效的数字
illegal-format: <red>● 非法的格式
scroll-up: <gray>● 向上翻
scroll-down: <gray>● 向下翻
cannot-scroll-up: <red>你已经到顶了
cannot-scroll-down: <red>你不能再往下了
next-page: <gray>● 下一页
goto-next-page: <gray>前往 <yellow>{0} <gray>/ <yellow>{1}
cannot-goto-next-page: <red>没有更多页了
previous-page: <gray>● 上一页
goto-previous-page: <gray>前往 <yellow>{0} <gray>/ <yellow>{1}
cannot-goto-previous-page: <red>已经到达第一页了
back-to-parent-page: <#FF8C00>返回上一界面
back-to-parent-folder: <#FF8C00>返回父文件夹
current-value: '<gray>当前值: <white>'
click-to-toggle: <#00FF7F> -> 点击切换
left-click-edit: <#00FF7F> -> 左键编辑
right-click-reset: <#FF6347> -> 右键重置
right-click-delete: <#FF6347> -> 右键删除
right-click-cancel: <#00CED1> -> 右键取消
loot-show-in-finder: <#5F9EA0>● 在找鱼器中可见
loot-score: <#FF1493>● 比赛分数
loot-nick: <#00FF00>● 昵称
loot-instant-game: <#7B68EE>● 咬钩立即游戏
loot-disable-statistics: <#CD853F>● 禁用统计数据
loot-disable-game: <#8B4513>● 禁用游戏
item-amount: <#1E90FF>● 数量
item-custom-model-data: <#FFC0CB>● 自定义模型值
item-display-name: <#FAFAD2>● 名称
item-custom-durability: <#1E90FF>● 自定义耐久度
item-enchantment: <#8A2BE2>● 附魔
item-head64: <#2E8B57>● 头颅base64
item-item-flag: <#E6E6FA>● 物品标签
item-lore: <#FA8072>● 描述
item-material: <#FF00FF>● 材质
item-nbt: <#FA8072>● NBT
item-prevent-grab: <#FF4500>● 防止抢夺
item-price: <#FFD700>● 价格
item-price-base: '<gray> - 基础: <white>'
item-price-bonus: '<gray> - 尺寸增益: <white>'
item-random-durability: <#FFFF00>● 随机耐久
item-size: <#FFF0F5>● 尺寸
item-stackable: <#9370DB>● 是否可以堆叠
item-stored-enchantment: <#9370DB>● 存储附魔
item-tag: <#2E8B57>● 启用CustomFishing标签
item-unbreakable: <#C0C0C0>● 不可破坏
page-amount-title: 修改数量
page-model-data-title: 修改自定义模型值
page-display-name-title: 修改名称
page-new-display-name: 新名称
page-custom-durability-title: 修改自定义耐久度
page-stored-enchantment-title: 修改存储附魔
page-enchantment-title: 修改附魔
page-select-one-enchantment: 选择一个附魔
page-add-new-enchantment: <green>[+] <gray>新增一个附魔
page-item-flag-title: 修改物品标签
page-lore-title: 修改描述
page-add-new-lore: <green>[+] <gray>新增一行描述
page-select-one-lore: 选择一行描述
page-material-title: 修改材质
page-nbt-compound-key-title: 修改复合键名
page-nbt-list-key-title: 修改列表名
page-nbt-key-title: 修改键
page-nbt-invalid-key: <red>无效的键
page-nbt-add-new-compound: <green>[+] <gray>新增一个复合NBT
page-nbt-add-new-list: <green>[+] <gray>新增一个列表
page-nbt-add-new-value: <green>[+] <gray>新增一个值
page-add-new-key: <green>[+] <gray>新增一个键
page-nbt-preview: <green>● NBT 预览
page-nbt-back-to-compound: <gray>返回父复合NBT
page-nbt-set-value-title: 设置值
page-nbt-edit-title: 修改NBT
page-nick-title: 修改昵称
page-new-nick: 新昵称
page-price-title: 修改价格
page-base-price: 基础
page-base-bonus: 尺寸增益
page-score-title: 修改分数
page-size-title: 修改尺寸
page-size-min: 最小值
page-size-max: 最大值
page-size-max-no-less-min: <red>● 最大值必须大于最小值

View File

@@ -1,5 +1,5 @@
# Don't change this
config-version: '26'
config-version: '31'
messages:
prefix: '<gradient:#0070B3:#A0EACF>[CustomFishing] </gradient>'
@@ -28,4 +28,98 @@ messages:
format-day: 'd'
format-hour: 'h'
format-minute: 'm'
format-second: 's'
format-second: 's'
gui:
search: "Search"
select-file: 'Select file'
select-item: "Select item"
dupe-invalid-key: "<red>● Duplicated or invalid key"
new-value: "New value: "
temp-new-key: 'New key'
set-new-key: "Set new key"
edit-key: 'Edit {0}'
delete-property: "<#00CED1>● Delete property"
click-confirm: "<#00FF7F> -> Click to confirm"
invalid-number: "<red>● Invalid number"
illegal-format: "<red>● Illegal format"
scroll-up: '<gray>● Scroll up'
scroll-down: '<gray>● Scroll down'
cannot-scroll-up: "<red>You've reached the top"
cannot-scroll-down: "<red>You can't scroll further down"
next-page: '<gray>● Next Page'
goto-next-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-next-page: '<red>There are no more pages'
previous-page: '<gray>● Previous page'
goto-previous-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-previous-page: "<red>You can't go further back"
back-to-parent-page: "<#FF8C00>Back to parent page"
back-to-parent-folder: "<#FF8C00>Back to parent folder"
current-value: "<gray>Current value: <white>"
click-to-toggle: "<#00FF7F> -> Click to toggle"
left-click-edit: "<#00FF7F> -> Left click to edit"
right-click-reset: "<#FF6347> -> Right click to reset"
right-click-delete: "<#FF6347> -> Right click to delete"
right-click-cancel: "<#00CED1> -> Right click to cancel"
loot-show-in-finder: "<#5F9EA0>● Show In Fish Finder"
loot-score: "<#FF1493>● Score"
loot-nick: "<#00FF00>● Nick"
loot-instant-game: "<#7B68EE>● Instant Game"
loot-disable-statistics: "<#CD853F>● Disable Statistics"
loot-disable-game: "<#8B4513>● Disable Game"
item-amount: "<#1E90FF>● Amount"
item-custom-model-data: "<#FFC0CB>● Custom Model Data"
item-display-name: "<#FAFAD2>● Display Name"
item-custom-durability: "<#1E90FF>● Custom Durability"
item-enchantment: "<#8A2BE2>● Enchantment"
item-head64: "<#2E8B57>● Head64"
item-item-flag: "<#E6E6FA>● Item Flag"
item-lore: "<#FA8072>● Lore"
item-material: "<#FF00FF>● Material"
item-nbt: "<#FA8072>● NBT"
item-prevent-grab: "<#FF4500>● Prevent Grabbing"
item-price: "<#FFD700>● Price"
item-price-base: "<gray> - base: <white>"
item-price-bonus: "<gray> - bonus: <white>"
item-random-durability: "<#FFFF00>● Random Durability"
item-size: "<#FFF0F5>● Size"
item-stackable: "<#9370DB>● Stackable"
item-stored-enchantment: "<#9370DB>● Stored Enchantment"
item-tag: "<#2E8B57>● Tag"
item-unbreakable: "<#C0C0C0>● Unbreakable"
page-amount-title: "Edit Amount"
page-model-data-title: "Edit CustomModelData"
page-display-name-title: "Edit display name"
page-new-display-name: "New name"
page-custom-durability-title: "Edit custom durability"
page-stored-enchantment-title: "Edit stored enchantment"
page-enchantment-title: "Edit enchantment"
page-select-one-enchantment: "Select one enchantment"
page-add-new-enchantment: "<green>[+] <gray>Add a new enchantment"
page-item-flag-title: "Edit item flag"
page-lore-title: "Edit lore"
page-add-new-lore: "<green>[+] <gray>Add a new line"
page-select-one-lore: "Select one line"
page-material-title: "Edit Material"
page-nbt-compound-key-title: "Edit compound key"
page-nbt-list-key-title: "Edit list key"
page-nbt-key-title: "Edit key"
page-nbt-invalid-key: "<red>Invaild key"
page-nbt-add-new-compound: "<green>[+] <gray>Add a new compound"
page-nbt-add-new-list: "<green>[+] <gray>Add a new list"
page-nbt-add-new-value: "<green>[+] <gray>Add a new value"
page-add-new-key: "<green>[+] <gray>Add a new key"
page-nbt-preview: "<green>● NBT Preview"
page-nbt-back-to-compound: "<gray>Back to parent compound"
page-nbt-set-value-title: "Set value"
page-nbt-edit-title: "Edit NBT"
page-nick-title: "Edit nick"
page-new-nick: "New nick"
page-price-title: "Edit price"
page-base-price: "Base"
page-base-bonus: "Bonus"
page-score-title: "Edit score"
page-size-title: "Edit size"
page-size-min: "Minimum"
page-size-max: "Maximum"
page-size-max-no-less-min: "<red>● Max must be no less than min"

View File

@@ -29,3 +29,98 @@ messages:
format-hour: 'h'
format-minute: 'm'
format-second: 's'
# We're looking for a translator :D
gui:
search: "Search"
select-file: 'Select file'
select-item: "Select item"
dupe-invalid-key: "<red>● Duplicated or invalid key"
new-value: "New value: "
temp-new-key: 'New key'
set-new-key: "Set new key"
edit-key: 'Edit {0}'
delete-property: "<#00CED1>● Delete property"
click-confirm: "<#00FF7F> -> Click to confirm"
invalid-number: "<red>● Invalid number"
illegal-format: "<red>● Illegal format"
scroll-up: '<gray>● Scroll up'
scroll-down: '<gray>● Scroll down'
cannot-scroll-up: "<red>You've reached the top"
cannot-scroll-down: "<red>You can't scroll further down"
next-page: '<gray>● Next Page'
goto-next-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-next-page: '<red>There are no more pages'
previous-page: '<gray>● Previous page'
goto-previous-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-previous-page: "<red>You can't go further back"
back-to-parent-page: "<#FF8C00>Back to parent page"
back-to-parent-folder: "<#FF8C00>Back to parent folder"
current-value: "<gray>Current value: <white>"
click-to-toggle: "<#00FF7F> -> Click to toggle"
left-click-edit: "<#00FF7F> -> Left click to edit"
right-click-reset: "<#FF6347> -> Right click to reset"
right-click-delete: "<#FF6347> -> Right click to delete"
right-click-cancel: "<#00CED1> -> Right click to cancel"
loot-show-in-finder: "<#5F9EA0>● Show In Fish Finder"
loot-score: "<#FF1493>● Score"
loot-nick: "<#00FF00>● Nick"
loot-instant-game: "<#7B68EE>● Instant Game"
loot-disable-statistics: "<#CD853F>● Disable Statistics"
loot-disable-game: "<#8B4513>● Disable Game"
item-amount: "<#1E90FF>● Amount"
item-custom-model-data: "<#FFC0CB>● Custom Model Data"
item-display-name: "<#FAFAD2>● Display Name"
item-custom-durability: "<#1E90FF>● Custom Durability"
item-enchantment: "<#8A2BE2>● Enchantment"
item-head64: "<#2E8B57>● Head64"
item-item-flag: "<#E6E6FA>● Item Flag"
item-lore: "<#FA8072>● Lore"
item-material: "<#FF00FF>● Material"
item-nbt: "<#FA8072>● NBT"
item-prevent-grab: "<#FF4500>● Prevent Grabbing"
item-price: "<#FFD700>● Price"
item-price-base: "<gray> - base: <white>"
item-price-bonus: "<gray> - bonus: <white>"
item-random-durability: "<#FFFF00>● Random Durability"
item-size: "<#FFF0F5>● Size"
item-stackable: "<#9370DB>● Stackable"
item-stored-enchantment: "<#9370DB>● Stored Enchantment"
item-tag: "<#2E8B57>● Tag"
item-unbreakable: "<#C0C0C0>● Unbreakable"
page-amount-title: "Edit Amount"
page-model-data-title: "Edit CustomModelData"
page-display-name-title: "Edit display name"
page-new-display-name: "New name"
page-custom-durability-title: "Edit custom durability"
page-stored-enchantment-title: "Edit stored enchantment"
page-enchantment-title: "Edit enchantment"
page-select-one-enchantment: "Select one enchantment"
page-add-new-enchantment: "<green>[+] <gray>Add a new enchantment"
page-item-flag-title: "Edit item flag"
page-lore-title: "Edit lore"
page-add-new-lore: "<green>[+] <gray>Add a new line"
page-select-one-lore: "Select one line"
page-material-title: "Edit Material"
page-nbt-compound-key-title: "Edit compound key"
page-nbt-list-key-title: "Edit list key"
page-nbt-key-title: "Edit key"
page-nbt-invalid-key: "<red>Invaild key"
page-nbt-add-new-compound: "<green>[+] <gray>Add a new compound"
page-nbt-add-new-list: "<green>[+] <gray>Add a new list"
page-nbt-add-new-value: "<green>[+] <gray>Add a new value"
page-add-new-key: "<green>[+] <gray>Add a new key"
page-nbt-preview: "<green>● NBT Preview"
page-nbt-back-to-compound: "<gray>Back to parent compound"
page-nbt-set-value-title: "Set value"
page-nbt-edit-title: "Edit NBT"
page-nick-title: "Edit nick"
page-new-nick: "New nick"
page-price-title: "Edit price"
page-base-price: "Base"
page-base-bonus: "Bonus"
page-score-title: "Edit score"
page-size-title: "Edit size"
page-size-min: "Minimum"
page-size-max: "Maximum"
page-size-max-no-less-min: "<red>● Max must be no less than min"

View File

@@ -29,3 +29,98 @@ messages:
format-hour: 'ó'
format-minute: 'p'
format-second: 'mp'
# We're looking for a translator :D
gui:
search: "Search"
select-file: 'Select file'
select-item: "Select item"
dupe-invalid-key: "<red>● Duplicated or invalid key"
new-value: "New value: "
temp-new-key: 'New key'
set-new-key: "Set new key"
edit-key: 'Edit {0}'
delete-property: "<#00CED1>● Delete property"
click-confirm: "<#00FF7F> -> Click to confirm"
invalid-number: "<red>● Invalid number"
illegal-format: "<red>● Illegal format"
scroll-up: '<gray>● Scroll up'
scroll-down: '<gray>● Scroll down'
cannot-scroll-up: "<red>You've reached the top"
cannot-scroll-down: "<red>You can't scroll further down"
next-page: '<gray>● Next Page'
goto-next-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-next-page: '<red>There are no more pages'
previous-page: '<gray>● Previous page'
goto-previous-page: '<gray>Go to page <yellow>{0} <gray>/ <yellow>{1}'
cannot-goto-previous-page: "<red>You can't go further back"
back-to-parent-page: "<#FF8C00>Back to parent page"
back-to-parent-folder: "<#FF8C00>Back to parent folder"
current-value: "<gray>Current value: <white>"
click-to-toggle: "<#00FF7F> -> Click to toggle"
left-click-edit: "<#00FF7F> -> Left click to edit"
right-click-reset: "<#FF6347> -> Right click to reset"
right-click-delete: "<#FF6347> -> Right click to delete"
right-click-cancel: "<#00CED1> -> Right click to cancel"
loot-show-in-finder: "<#5F9EA0>● Show In Fish Finder"
loot-score: "<#FF1493>● Score"
loot-nick: "<#00FF00>● Nick"
loot-instant-game: "<#7B68EE>● Instant Game"
loot-disable-statistics: "<#CD853F>● Disable Statistics"
loot-disable-game: "<#8B4513>● Disable Game"
item-amount: "<#1E90FF>● Amount"
item-custom-model-data: "<#FFC0CB>● Custom Model Data"
item-display-name: "<#FAFAD2>● Display Name"
item-custom-durability: "<#1E90FF>● Custom Durability"
item-enchantment: "<#8A2BE2>● Enchantment"
item-head64: "<#2E8B57>● Head64"
item-item-flag: "<#E6E6FA>● Item Flag"
item-lore: "<#FA8072>● Lore"
item-material: "<#FF00FF>● Material"
item-nbt: "<#FA8072>● NBT"
item-prevent-grab: "<#FF4500>● Prevent Grabbing"
item-price: "<#FFD700>● Price"
item-price-base: "<gray> - base: <white>"
item-price-bonus: "<gray> - bonus: <white>"
item-random-durability: "<#FFFF00>● Random Durability"
item-size: "<#FFF0F5>● Size"
item-stackable: "<#9370DB>● Stackable"
item-stored-enchantment: "<#9370DB>● Stored Enchantment"
item-tag: "<#2E8B57>● Tag"
item-unbreakable: "<#C0C0C0>● Unbreakable"
page-amount-title: "Edit Amount"
page-model-data-title: "Edit CustomModelData"
page-display-name-title: "Edit display name"
page-new-display-name: "New name"
page-custom-durability-title: "Edit custom durability"
page-stored-enchantment-title: "Edit stored enchantment"
page-enchantment-title: "Edit enchantment"
page-select-one-enchantment: "Select one enchantment"
page-add-new-enchantment: "<green>[+] <gray>Add a new enchantment"
page-item-flag-title: "Edit item flag"
page-lore-title: "Edit lore"
page-add-new-lore: "<green>[+] <gray>Add a new line"
page-select-one-lore: "Select one line"
page-material-title: "Edit Material"
page-nbt-compound-key-title: "Edit compound key"
page-nbt-list-key-title: "Edit list key"
page-nbt-key-title: "Edit key"
page-nbt-invalid-key: "<red>Invaild key"
page-nbt-add-new-compound: "<green>[+] <gray>Add a new compound"
page-nbt-add-new-list: "<green>[+] <gray>Add a new list"
page-nbt-add-new-value: "<green>[+] <gray>Add a new value"
page-add-new-key: "<green>[+] <gray>Add a new key"
page-nbt-preview: "<green>● NBT Preview"
page-nbt-back-to-compound: "<gray>Back to parent compound"
page-nbt-set-value-title: "Set value"
page-nbt-edit-title: "Edit NBT"
page-nick-title: "Edit nick"
page-new-nick: "New nick"
page-price-title: "Edit price"
page-base-price: "Base"
page-base-bonus: "Bonus"
page-score-title: "Edit score"
page-size-title: "Edit size"
page-size-min: "Minimum"
page-size-max: "Maximum"
page-size-max-no-less-min: "<red>● Max must be no less than min"

View File

@@ -27,5 +27,4 @@ softdepend:
- Zaphkiel
permissions:
fishingbag.user:
default: true
fishingbag.loot
default: true