From 2535e2d1714a51ceff3267500843d9ee3c398db4 Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Mon, 13 Jun 2022 03:49:59 -0400 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependency-reduced-pom.xml | 17 +-- pom.xml | 27 ++-- .../sefiraat/netheopoiesis/Netheopoiesis.java | 2 +- .../netheopoiesis/slimefun/Items.java | 14 +- .../netheopoiesis/slimefun/RecipeTypes.java | 33 ++-- .../netheopoiesis/slimefun/Stacks.java | 41 +++-- .../slimefun/groups/DiscoveriesFlexGroup.java | 16 +- .../slimefun/groups/MainFlexGroup.java | 10 +- .../slimefun/groups/NpsGroups.java | 14 +- .../groups/PurificationFlexGroup.java | 143 +++++++++--------- .../slimefun/tools/PurificationBarometer.java | 4 +- .../slimefun/tools/PurificationScanner.java | 4 +- .../sefiraat/netheopoiesis/utils/Theme.java | 30 ++-- 13 files changed, 181 insertions(+), 174 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index eee15ba..14f1e67 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -31,6 +31,7 @@ + true org.bstats @@ -44,6 +45,10 @@ io.papermc.lib dev.sefiraat.netheopoiesis.paperlib + + net.guizhanss.guizhanlib + dev.sefiraat.netheopoiesis.guizhanlib + @@ -86,18 +91,8 @@ - java:S6206 - ** - e1,e2,e3 - 16 - java:S125 - https://sonarcloud.io - sefiraat - Networks 16 + 16 UTF-8 - ** - ** - java:S6212 diff --git a/pom.xml b/pom.xml index 6ec31a3..041b754 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,7 @@ maven-shade-plugin 3.3.0 + true org.bstats @@ -29,6 +30,10 @@ io.papermc.lib dev.sefiraat.netheopoiesis.paperlib + + net.guizhanss.guizhanlib + dev.sefiraat.netheopoiesis.guizhanlib + @@ -68,22 +73,6 @@ 16 16 UTF-8 - Networks - sefiraat - https://sonarcloud.io - - e1,e2,e3 - java:S6212 - ** - - java:S125 - ** - - java:S2245 - ** - - java:S6206 - ** @@ -140,6 +129,12 @@ 1.0.7 compile + + net.guizhanss + GuizhanLib + 0.9.7 + compile + diff --git a/src/main/java/dev/sefiraat/netheopoiesis/Netheopoiesis.java b/src/main/java/dev/sefiraat/netheopoiesis/Netheopoiesis.java index caf9bc5..95db853 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/Netheopoiesis.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/Netheopoiesis.java @@ -36,7 +36,7 @@ public class Netheopoiesis extends JavaPlugin implements SlimefunAddon { private PlantRegistry plantRegistry; public Netheopoiesis() { - this.username = "Sefiraat"; + this.username = "SlimefunGuguProject"; this.repo = "Netheopoiesis"; this.branch = "master"; } diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Items.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Items.java index 849e1fe..0bd1c15 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Items.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Items.java @@ -160,7 +160,7 @@ public static void setup(Netheopoiesis addon) { oakPlank, oakPlank, null, }, 25 - ); + ).register(addon); new HarvestingTool( NpsGroups.TOOLS, @@ -172,7 +172,7 @@ public static void setup(Netheopoiesis addon) { ironIngot, ironIngot, null, }, 150 - ); + ).register(addon); new PurificationBarometer( NpsGroups.TOOLS, @@ -183,7 +183,7 @@ public static void setup(Netheopoiesis addon) { glass, redstone, glass, SlimefunItems.ZINC_INGOT, glass, SlimefunItems.ZINC_INGOT, } - ); + ).register(addon); new PurificationScanner( NpsGroups.TOOLS, @@ -194,7 +194,7 @@ public static void setup(Netheopoiesis addon) { glass, Stacks.PURIFICATION_BAROMETER, glass, SlimefunItems.BILLON_INGOT, glass, SlimefunItems.BILLON_INGOT, } - ); + ).register(addon); new Analyser( NpsGroups.TOOLS, @@ -205,7 +205,7 @@ public static void setup(Netheopoiesis addon) { null, glass, null, null, glass, null, } - ); + ).register(addon); new Analyser( NpsGroups.TOOLS, @@ -216,7 +216,7 @@ public static void setup(Netheopoiesis addon) { SlimefunItems.BRASS_INGOT, glass, SlimefunItems.BRASS_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, redstone, SlimefunItems.DAMASCUS_STEEL_INGOT, } - ); + ).register(addon); new EnderCake( NpsGroups.TOOLS, @@ -227,7 +227,7 @@ public static void setup(Netheopoiesis addon) { Stacks.ADDON_JAM, Stacks.ADDON_JAM, Stacks.ADDON_JAM, wheat, wheat, wheat, } - ); + ).register(addon); // endregion diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/RecipeTypes.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/RecipeTypes.java index c7c7017..456d57e 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/RecipeTypes.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/RecipeTypes.java @@ -22,9 +22,9 @@ private RecipeTypes() { Theme.themedItemStack( Material.WITHER_ROSE, Theme.RECIPE_TYPE, - "Nether Purification", - "These items are made by purifying the Nether.", - "This is done by planting Purifying Seeds." + "净化下界", + "该物品可以通过净化下界获得.", + "种植净化之种以开始净化." ) ); @@ -34,8 +34,8 @@ private RecipeTypes() { Theme.themedItemStack( Material.PRISMARINE_SHARD, Theme.RECIPE_TYPE, - "Plant Harvesting", - "This item can be harvested from a plant." + "收获植物", + "该物品可以通过收获植物获得." ) ); @@ -45,17 +45,18 @@ private RecipeTypes() { Theme.themedItemStack( Material.FLOWER_POT, Theme.RECIPE_TYPE, - "Plant Breeding", - "This seed is found via breeding.", - "You breed plants by placing", - "two plants down with an air block", - "between them.", + "培育植物", + "这个种子可以通过培育获得.", "", - "The breeding dictionary can be used", - "to track your discoveries.", + "你需要将两株植物放在一起,", + "中间间隔一格空气,", + "来进行培育.", "", - "Hint: Black particles mean the", - "two plants CANNOT breed." + "你可以通过培育笔记", + "来查看所有已发现的培育.", + "", + "提示: 黑色粒子代表", + "两株植物不能进行培育." ) ); @@ -65,8 +66,8 @@ private RecipeTypes() { Theme.themedItemStack( Material.BROWN_DYE, Theme.RECIPE_TYPE, - "World Drop", - "Drops from blocks when broken in the world." + "方块掉落物", + "通过破坏方块获得." ) ); } diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Stacks.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Stacks.java index 6d4cb9a..2a77d74 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Stacks.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/Stacks.java @@ -27,19 +27,20 @@ private Stacks() { "NPS_ADDON_BERRY", Material.SWEET_BERRIES, Theme.CRAFTING, - "Addon Berry", - "A deliciously sweet berry that", - "can be made into jam." + "附加浆果", + "一种美味的甜浆果,", + "可以被制成果酱." ); public static final SlimefunItemStack ADDON_JAM = Theme.themedSlimefunItemStack( "NPS_ADDON_JAM", ItemStackUtils.potion(Color.RED), Theme.CRAFTING, - "Addon Jam", - "A very sweet jam.", - "For some reason, it feels rushed", - "and incomplete." + "附加果酱", + "一种非常甜的果酱.", + "不知为何, 它看上去像赶制的.", + "(这个物品的英文名是Addon Jam,", + "也是本次附属竞赛的名称)" ); // endregion @@ -50,11 +51,10 @@ private Stacks() { "NPS_CRUDE_HARVESTING_TOOL", Material.PRISMARINE_SHARD, Theme.TOOL, - "Crude Harvesting Tool", - "This tool will harvest plants", - "where possible.", - "This one is very shoddy and won't", - "last long", + "粗制收获工具", + "这个工具可以收获植物.", + "似乎是个劣质品,", + "没法用太久.", "", LoreBuilder.usesLeft(25) ); @@ -63,11 +63,10 @@ private Stacks() { "NPS_HARVESTING_TOOL", Material.PRISMARINE_SHARD, Theme.TOOL, - "Harvesting Tool", - "This tool will harvest plants", - "where possible.", - "This one is sturdier but still won't", - "last long", + "收获工具", + "这个工具可以收获植物.", + "它更加结实,", + "但也没法用太久.", "", LoreBuilder.usesLeft(150) ); @@ -76,16 +75,16 @@ private Stacks() { "NPS_PURIFICATION_BAROMETER", Material.CLOCK, Theme.TOOL, - "Purification Barometer", - "When used, this tool will tell you", - "how purified the current chunk is." + "净化测量仪", + "使用后, 可以获取", + "当前区块的净化值." ); public static final SlimefunItemStack PURIFICATION_SCANNER = Theme.themedSlimefunItemStack( "NPS_PURIFICATION_SCANNER", Material.BRICK, Theme.TOOL, - "Purification Scanner", + "净化扫描仪", "When used on a relevant block or plant,", "this tool will tell you what its", "purifying effect on the world is." diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/DiscoveriesFlexGroup.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/DiscoveriesFlexGroup.java index 7c60547..cb13dae 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/DiscoveriesFlexGroup.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/DiscoveriesFlexGroup.java @@ -14,8 +14,10 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.NamespacedKey; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -61,17 +63,17 @@ public class DiscoveriesFlexGroup extends FlexItemGroup { private static final ItemStack MOTHER_INFO = new CustomItemStack( Material.LIGHT_BLUE_STAINED_GLASS_PANE, - Theme.PASSIVE + "'Mother' Seed" + Theme.PASSIVE + "母种子" ); private static final ItemStack FATHER_INFO = new CustomItemStack( Material.LIGHT_BLUE_STAINED_GLASS_PANE, - Theme.PASSIVE + "'Father' Seed" + Theme.PASSIVE + "父种子" ); private static final ItemStack CHILD_INFO = new CustomItemStack( Material.LIGHT_BLUE_STAINED_GLASS_PANE, - Theme.PASSIVE + "'Child' Seed" + Theme.PASSIVE + "子种子" ); private static final ItemStack HELD_SLOT = new CustomItemStack( @@ -94,7 +96,7 @@ public boolean isVisible(Player player, PlayerProfile playerProfile, SlimefunGui @Override @ParametersAreNonnullByDefault public void open(Player p, PlayerProfile profile, SlimefunGuideMode mode) { - final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "Breeding Discoveries"); + final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "遗传笔记"); for (int slot : HEADER) { chestMenu.addItem(slot, ChestMenuUtils.getBackground(), (player1, i1, itemStack, clickAction) -> false); @@ -123,12 +125,16 @@ private void setupPage(Player player, PlayerProfile profile, SlimefunGuideMode m reapplyFooter(player, profile, mode, menu, page, totalPages); + // Sound + menu.addMenuOpeningHandler((p) -> p.playSound(p.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.0F, 1.0F)); + // Back menu.replaceExistingItem( GUIDE_BACK, ChestMenuUtils.getBackButton( player, - Slimefun.getLocalization().getMessage("guide.back.guide") + "", + ChatColor.GRAY + Slimefun.getLocalization().getMessage(player, "guide.back.guide") ) ); menu.addMenuClickHandler(GUIDE_BACK, (player1, slot, itemStack, clickAction) -> { diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/MainFlexGroup.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/MainFlexGroup.java index aae3abd..7532936 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/MainFlexGroup.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/MainFlexGroup.java @@ -9,7 +9,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; +import org.bukkit.ChatColor; import org.bukkit.NamespacedKey; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -48,7 +50,7 @@ public boolean isVisible(Player player, PlayerProfile playerProfile, SlimefunGui @Override @ParametersAreNonnullByDefault public void open(Player p, PlayerProfile profile, SlimefunGuideMode mode) { - final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "Netheopoiesis"); + final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "下界净灵"); for (int slot : HEADER) { chestMenu.addItem(slot, ChestMenuUtils.getBackground(), (player1, i1, itemStack, clickAction) -> false); @@ -70,12 +72,16 @@ private void setupPage(Player player, PlayerProfile profile, SlimefunGuideMode m menu.addMenuClickHandler(slot, ((player1, i, itemStack, clickAction) -> false)); } + // Sound + menu.addMenuOpeningHandler((p) -> p.playSound(p.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.0F, 1.0F)); + // Back menu.replaceExistingItem( GUIDE_BACK, ChestMenuUtils.getBackButton( player, - Slimefun.getLocalization().getMessage("guide.back.guide") + "", + ChatColor.GRAY + Slimefun.getLocalization().getMessage(player, "guide.back.guide") ) ); menu.addMenuClickHandler(GUIDE_BACK, (player1, slot, itemStack, clickAction) -> { diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/NpsGroups.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/NpsGroups.java index 1d4d4d9..274d2ec 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/NpsGroups.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/NpsGroups.java @@ -20,7 +20,7 @@ private NpsGroups() { Keys.newKey("main"), new CustomItemStack( new ItemStack(Material.WITHER_ROSE), - Theme.MAIN.color("Netheopoiesis") + Theme.MAIN.color("下界净灵") ) ); @@ -28,7 +28,7 @@ private NpsGroups() { Keys.newKey("crafting"), new CustomItemStack( new ItemStack(Material.STICK), - Theme.MAIN.color("Netheopoiesis Crafting Items") + Theme.MAIN.color("下界净灵 - 合成材料") ) ); @@ -36,7 +36,7 @@ private NpsGroups() { Keys.newKey("tools"), new CustomItemStack( new ItemStack(Material.COMPASS), - Theme.MAIN.color("Netheopoiesis Tools") + Theme.MAIN.color("下界净灵 - 工具") ) ); @@ -44,7 +44,7 @@ private NpsGroups() { Keys.newKey("seeds"), new CustomItemStack( new ItemStack(Material.MELON_SEEDS), - Theme.MAIN.color("Netheopoiesis Seeds") + Theme.MAIN.color("下界净灵 - 种子") ) ); @@ -52,7 +52,7 @@ private NpsGroups() { Keys.newKey("crux"), new CustomItemStack( new ItemStack(Material.MYCELIUM), - Theme.MAIN.color("Netheopoiesis Crux'") + Theme.MAIN.color("下界净灵 - 结构") ) ); @@ -60,7 +60,7 @@ private NpsGroups() { Keys.newKey("discoveries"), new CustomItemStack( new ItemStack(Material.WHEAT_SEEDS), - Theme.MAIN.color("Breeding Discoveries'") + Theme.MAIN.color("培育笔记") ) ); @@ -68,7 +68,7 @@ private NpsGroups() { Keys.newKey("guide"), new CustomItemStack( new ItemStack(Material.BOOKSHELF), - Theme.MAIN.color("Purification Information") + Theme.MAIN.color("净化协议") ) ); diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/PurificationFlexGroup.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/PurificationFlexGroup.java index 2e2643b..5341f60 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/PurificationFlexGroup.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/groups/PurificationFlexGroup.java @@ -12,8 +12,10 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.NamespacedKey; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -43,109 +45,108 @@ public class PurificationFlexGroup extends FlexItemGroup { private static final ItemStack SLEEP_STACK = new CustomItemStack( Material.BLACK_BED, - Theme.MAIN + "Sleeping in the Nether", - Theme.PASSIVE.apply("You can finally sleep in the"), - Theme.PASSIVE.apply("Nether! But check the purification"), - Theme.PASSIVE.apply("level first, else you may explode!"), + Theme.MAIN + "在下界睡觉", + Theme.PASSIVE.apply("你终于能在下界睡觉了!"), + Theme.PASSIVE.apply("但是, 先看一眼净化等级,"), + Theme.PASSIVE.apply("不然你就会爆炸的!"), "", - Theme.CLICK_INFO.asTitle("Purification Required", Purification.SLEEP_IN_BED) + Theme.CLICK_INFO.asTitle("需要净化值达到", Purification.SLEEP_IN_BED) ); private static final ItemStack WATER_STACK = new CustomItemStack( Material.BUCKET, - Theme.MAIN + "Water in the Nether", - Theme.PASSIVE.apply("With a high enough purification"), - Theme.PASSIVE.apply("value, you will be able to place"), - Theme.PASSIVE.apply("water in the Nether, allowing you"), - Theme.PASSIVE.apply("to grow overworld crops."), - Theme.PASSIVE.apply("Water also adds 1 to the purification value"), + Theme.MAIN + "在下界放水", + Theme.PASSIVE.apply("当净化等级足够高时,"), + Theme.PASSIVE.apply("你就可以在下界中放水了."), + Theme.PASSIVE.apply("你可以用来种植主世界的植物."), + Theme.PASSIVE.apply("水也可以增加净化值."), "", - Theme.CLICK_INFO.asTitle("Purification Required", Purification.PLACE_WATER) + Theme.CLICK_INFO.asTitle("需要净化值达到", Purification.PLACE_WATER) ); private static final ItemStack REGEN_STACK = new CustomItemStack( ItemStackUtils.enchantedItemStack(Material.APPLE), - Theme.MAIN + "Regeneration Aura", - Theme.PASSIVE.apply("With a high enough purification"), - Theme.PASSIVE.apply("value, you will be be enveloped"), - Theme.PASSIVE.apply("in a healing mist that increases"), - Theme.PASSIVE.apply("in power as the level gets higher"), + Theme.MAIN + "恢复光环", + Theme.PASSIVE.apply("当净化等级足够高时,"), + Theme.PASSIVE.apply("你会被治疗迷雾笼罩,"), + Theme.PASSIVE.apply("效果会随着净化等级提升"), + Theme.PASSIVE.apply("而增强。"), "", - Theme.CLICK_INFO.asTitle("Regen 1", Purification.REGEN_1), - Theme.CLICK_INFO.asTitle("Regen 2", Purification.REGEN_2), - Theme.CLICK_INFO.asTitle("Regen 3", Purification.REGEN_3) + Theme.PASSIVE.apply("净化值需求:"), + Theme.CLICK_INFO.asTitle("生命恢复1", Purification.REGEN_1), + Theme.CLICK_INFO.asTitle("生命恢复2", Purification.REGEN_2), + Theme.CLICK_INFO.asTitle("生命恢复3", Purification.REGEN_3) ); private static final ItemStack MOBS_1_STACK = new CustomItemStack( Material.SPAWNER, - Theme.MAIN + "Mob Spawning 1", - Theme.PASSIVE.apply("With a high enough purification"), - Theme.PASSIVE.apply("value, some mobs will no longer"), - Theme.PASSIVE.apply("spawn, instead spawning an overworld"), - Theme.PASSIVE.apply("mobs. Passive or Hostile depending"), - Theme.PASSIVE.apply("on the time of day."), - Theme.PASSIVE.apply("More mobs as your value increases"), + Theme.MAIN + "生物生成 1", + Theme.PASSIVE.apply("当净化等级足够高时,"), + Theme.PASSIVE.apply("某些下界生物将不再生成,"), + Theme.PASSIVE.apply("取而代之,生成主世界生物."), + Theme.PASSIVE.apply("当下界为白天(?)时, 生成友好生物."), + Theme.PASSIVE.apply("当下界为夜间时, 生成敌对生物."), + Theme.PASSIVE.apply("净化等级提升会取代更多生物."), "", - Theme.CLICK_INFO.asTitle("Magma Cube", Purification.SWAP_MAGMA_CUBE), - Theme.CLICK_INFO.asTitle("Blaze", Purification.SWAP_BLAZE), - Theme.CLICK_INFO.asTitle("Zombified Piglin", Purification.SWAP_ZOMBIFIED_PIGLIN), - Theme.CLICK_INFO.asTitle("Hoglin", Purification.SWAP_HOGLIN), - Theme.CLICK_INFO.asTitle("Piglin Brute", Purification.SWAP_PIGLIN_BRUTE), - Theme.CLICK_INFO.asTitle("Ghast", Purification.SWAP_GHAST), - Theme.CLICK_INFO.asTitle("Wither Skeleton", Purification.SWAP_WITHER_SKELETON) + Theme.PASSIVE.apply("净化值需求:"), + Theme.CLICK_INFO.asTitle("岩浆怪", Purification.SWAP_MAGMA_CUBE), + Theme.CLICK_INFO.asTitle("烈焰人", Purification.SWAP_BLAZE), + Theme.CLICK_INFO.asTitle("僵尸猪灵", Purification.SWAP_ZOMBIFIED_PIGLIN), + Theme.CLICK_INFO.asTitle("疣猪兽", Purification.SWAP_HOGLIN), + Theme.CLICK_INFO.asTitle("猪灵蛮兵", Purification.SWAP_PIGLIN_BRUTE), + Theme.CLICK_INFO.asTitle("恶魂", Purification.SWAP_GHAST), + Theme.CLICK_INFO.asTitle("凋零骷髅", Purification.SWAP_WITHER_SKELETON) ); private static final ItemStack MOBS_2_STACK = new CustomItemStack( Material.SPAWNER, - Theme.MAIN + "Mob Spawning 2", - Theme.PASSIVE.apply("With a high enough purification"), - Theme.PASSIVE.apply("value, certain passive mobs will"), - Theme.PASSIVE.apply("spawn around the player."), - Theme.PASSIVE.apply("More mobs as your value increases."), + Theme.MAIN + "生物生成 2", + Theme.PASSIVE.apply("当净化等级足够高时,"), + Theme.PASSIVE.apply("这些友好生物将生成在玩家附近."), + Theme.PASSIVE.apply("净化等级提升会生成更多生物."), "", - Theme.CLICK_INFO.asTitle("Squid", Purification.SPAWN_SQUID), - Theme.CLICK_INFO.asTitle("Salmon", Purification.SPAWN_SALMON), - Theme.CLICK_INFO.asTitle("Cod", Purification.SPAWN_COD), - Theme.CLICK_INFO.asTitle("Pufferfish", Purification.SPAWN_PUFFER_FISH), - Theme.CLICK_INFO.asTitle("Tropical Fish", Purification.SPAWN_TROPICAL_FISH), - Theme.CLICK_INFO.asTitle("Axolotl", Purification.SPAWN_AXOLOTL), - Theme.CLICK_INFO.asTitle("Wandering Trader", Purification.WANDERING_TRADER) + Theme.PASSIVE.apply("净化值需求:"), + Theme.CLICK_INFO.asTitle("鱿鱼", Purification.SPAWN_SQUID), + Theme.CLICK_INFO.asTitle("鲑鱼", Purification.SPAWN_SALMON), + Theme.CLICK_INFO.asTitle("鳕鱼", Purification.SPAWN_COD), + Theme.CLICK_INFO.asTitle("河豚", Purification.SPAWN_PUFFER_FISH), + Theme.CLICK_INFO.asTitle("热带鱼", Purification.SPAWN_TROPICAL_FISH), + Theme.CLICK_INFO.asTitle("美西螈", Purification.SPAWN_AXOLOTL), + Theme.CLICK_INFO.asTitle("流浪商人", Purification.WANDERING_TRADER) ); private static final ItemStack PIGLIN_STACK = new CustomItemStack( Material.PIGLIN_SPAWN_EGG, - Theme.MAIN + "Friendly Mobs", - Theme.PASSIVE.apply("With a high enough purification"), - Theme.PASSIVE.apply("value, nearby piglins will be"), - Theme.PASSIVE.apply("so happy with your progress"), - Theme.PASSIVE.apply("they will stop being hostile."), - Theme.PASSIVE.apply("Other mobs will soon follow suit."), + Theme.MAIN + "友好生物", + Theme.PASSIVE.apply("当净化等级足够高时,"), + Theme.PASSIVE.apply("附近的猪灵将不再视你为敌,"), + Theme.PASSIVE.apply("它们会非常满意你所做的一切,"), + Theme.PASSIVE.apply("其他的生物也会紧随其后."), "", - Theme.CLICK_INFO.asTitle("Piglins", Purification.FRIENDLY_PIGLINS), - Theme.CLICK_INFO.asTitle("Hoglins", Purification.FRIENDLY_HOGLINS) + Theme.PASSIVE.apply("净化值需求:"), + Theme.CLICK_INFO.asTitle("猪灵", Purification.FRIENDLY_PIGLINS), + Theme.CLICK_INFO.asTitle("疣猪兽", Purification.FRIENDLY_HOGLINS) ); private static final ItemStack BARTERING_STACK = new CustomItemStack( Material.GOLD_INGOT, - Theme.MAIN + "Better-Barter", - Theme.PASSIVE.apply("As your purification value"), - Theme.PASSIVE.apply("increases, you will have an"), - Theme.PASSIVE.apply("increased chance to double your"), - Theme.PASSIVE.apply("output from bartering."), + Theme.MAIN + "更好的交易", + Theme.PASSIVE.apply("随着净化等级的提升,"), + Theme.PASSIVE.apply("你会有更高的几率"), + Theme.PASSIVE.apply("从猪灵交易中获得双倍物品."), "", - Theme.CLICK_INFO.asTitle("Double Chance: ", "(Purification Value / " + Purification.FRIENDLY_PIGLINS + ") * 5%") + Theme.CLICK_INFO.asTitle("双倍概率", "(净化值 / " + Purification.FRIENDLY_PIGLINS + ") * 5%") ); private static final ItemStack ENDER_CAKE = new CustomItemStack( Material.CAKE, - Theme.MAIN + "To the End!", - Theme.PASSIVE.apply("Using materials gathered from your"), - Theme.PASSIVE.apply("new Nether plants, you can make an"), - Theme.PASSIVE.apply("Ender Cake. If you have the required"), - Theme.PASSIVE.apply("purification level, you will be transported"), - Theme.PASSIVE.apply("to the end."), + Theme.MAIN + "深入末地!", + Theme.PASSIVE.apply("你可以从全新的下界植物中"), + Theme.PASSIVE.apply("获取材料, 来制作末影蛋糕."), + Theme.PASSIVE.apply("如果净化等级足够, 你就能够"), + Theme.PASSIVE.apply("传送到末地."), "", - Theme.CLICK_INFO.asTitle("Purification Required", Purification.ENDER_CAKE) + Theme.CLICK_INFO.asTitle("需要净化值达到", Purification.ENDER_CAKE) ); public PurificationFlexGroup(NamespacedKey key, ItemStack item) { @@ -161,7 +162,7 @@ public boolean isVisible(Player player, PlayerProfile playerProfile, SlimefunGui @Override @ParametersAreNonnullByDefault public void open(Player p, PlayerProfile profile, SlimefunGuideMode mode) { - final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "Purification"); + final ChestMenu chestMenu = new ChestMenu(Theme.MAIN.getColor() + "净化协议"); for (int slot : HEADER) { chestMenu.addItem(slot, ChestMenuUtils.getBackground(), (player1, i1, itemStack, clickAction) -> false); @@ -183,12 +184,16 @@ private void setupPage(Player player, PlayerProfile profile, SlimefunGuideMode m menu.addMenuClickHandler(slot, ((player1, i, itemStack, clickAction) -> false)); } + // Sound + menu.addMenuOpeningHandler((p) -> p.playSound(p.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.0F, 1.0F)); + // Back menu.replaceExistingItem( GUIDE_BACK, ChestMenuUtils.getBackButton( player, - Slimefun.getLocalization().getMessage("guide.back.guide") + "", + ChatColor.GRAY + Slimefun.getLocalization().getMessage(player, "guide.back.guide") ) ); menu.addMenuClickHandler(GUIDE_BACK, (player1, slot, itemStack, clickAction) -> { diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationBarometer.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationBarometer.java index 09cf87d..99a6f7f 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationBarometer.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationBarometer.java @@ -39,12 +39,12 @@ public ItemUseHandler getItemHandler() { final ItemStack barometer = event.getItem(); if (ItemStackUtils.isOnCooldown(barometer)) { - player.sendMessage(Theme.WARNING + "This item is still on cooldown."); + player.sendMessage(Theme.WARNING + "该物品仍在冷却中."); return; } final String message = Theme.CLICK_INFO.asTitle( - "Chunk Purification Amount", + "当前区块净化值", Purification.getValue(chunk) ); player.sendMessage(message); diff --git a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationScanner.java b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationScanner.java index 8d13d5b..be69424 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationScanner.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/slimefun/tools/PurificationScanner.java @@ -44,7 +44,7 @@ private void onUse(@Nonnull PlayerRightClickEvent event) { final ItemStack analyser = event.getItem(); if (ItemStackUtils.isOnCooldown(analyser)) { - player.sendMessage(Theme.WARNING + "This item is still on cooldown."); + player.sendMessage(Theme.WARNING + "该物品仍在冷却中."); return; } @@ -54,7 +54,7 @@ private void onUse(@Nonnull PlayerRightClickEvent event) { && ProtectionUtils.hasPermission(player, block, Interaction.INTERACT_BLOCK) ) { final String messageValue = Theme.CLICK_INFO.asTitle( - "Purification Value", + "净化值", object.getPurificationValue() ); player.sendMessage(messageValue); diff --git a/src/main/java/dev/sefiraat/netheopoiesis/utils/Theme.java b/src/main/java/dev/sefiraat/netheopoiesis/utils/Theme.java index f62cf62..db2a3cc 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/utils/Theme.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/utils/Theme.java @@ -18,24 +18,24 @@ */ public enum Theme { // Main Theme - MAIN(ChatColor.of("#8a0e0e"), "Netheopoiesis"), + MAIN(ChatColor.of("#8a0e0e"), "下界净灵"), // Basic chat elements - WARNING(ChatColor.YELLOW, "Warning"), - ERROR(ChatColor.RED, "Error"), - NOTICE(ChatColor.WHITE, "Notice"), + WARNING(ChatColor.YELLOW, "警告"), + ERROR(ChatColor.RED, "错误"), + NOTICE(ChatColor.WHITE, "提示"), PASSIVE(ChatColor.GRAY), - SUCCESS(ChatColor.GREEN, "Success"), + SUCCESS(ChatColor.GREEN, "成功"), // Item and SlimefunItem lore/themes - CLICK_INFO(ChatColor.of("#e4ed32"), "Click here"), - RESEARCH(ChatColor.of("#a60e03"), "Research"), - DISCOVEREY(ChatColor.of("#a60e03"), "Discovery"), - CRAFTING(ChatColor.of("#dbcea9"), "Crafting Material"), - RECIPE_TYPE(ChatColor.of("#ffe89c"), "Recipe Type"), - MACHINE(ChatColor.of("#3295a8"), "Machine"), - TOOL(ChatColor.of("#3295a8"), "Tool"), - PURIFYING_SEED(ChatColor.of("#cde06c"), "Purifying Seed"), - SEED(ChatColor.of("#a241bf"), "Seed"), - CRUX(ChatColor.of("#4287f5"), "Crux"), + CLICK_INFO(ChatColor.of("#e4ed32"), "点击此处"), + RESEARCH(ChatColor.of("#a60e03"), "研究"), + DISCOVEREY(ChatColor.of("#a60e03"), "探索"), + CRAFTING(ChatColor.of("#dbcea9"), "合成材料"), + RECIPE_TYPE(ChatColor.of("#ffe89c"), "配方类型"), + MACHINE(ChatColor.of("#3295a8"), "机器"), + TOOL(ChatColor.of("#3295a8"), "工具"), + PURIFYING_SEED(ChatColor.of("#cde06c"), "净化之种"), + SEED(ChatColor.of("#a241bf"), "种子"), + CRUX(ChatColor.of("#4287f5"), "结构"), // Seeds SEED_RED(ChatColor.of("#c41d1d")), SEED_ORANGE(ChatColor.of("#c4761d")),