From 6cd733e8bcd3f1a80b2156d2e28d2e1316e2cdc7 Mon Sep 17 00:00:00 2001 From: Awakened-Redstone <40528665+Awakened-Redstone@users.noreply.github.com> Date: Mon, 13 May 2024 22:06:06 -0300 Subject: [PATCH] chore: use NeoSkies Signed-off-by: Awakened-Redstone <40528665+Awakened-Redstone@users.noreply.github.com> --- .../{SkylandsMain.java => NeoSkies.java} | 18 +++---- .../{SkylandsAPI.java => NeoSkiesAPI.java} | 18 +++---- .../neoskies/api/island/PermissionLevel.java | 8 +-- ...ndsCommands.java => NeoSkiesCommands.java} | 14 ++--- .../command/admin/BallanceCommand.java | 12 ++--- .../command/admin/DeleteIslandCommand.java | 6 +-- .../command/admin/IslandDataCommand.java | 10 ++-- .../neoskies/command/admin/ModifyCommand.java | 8 +-- .../command/admin/SettingsCommand.java | 2 +- .../command/island/AcceptCommand.java | 6 +-- .../neoskies/command/island/BanCommands.java | 14 ++--- .../command/island/CreateCommand.java | 4 +- .../command/island/DeleteCommand.java | 10 ++-- .../neoskies/command/island/HomeCommand.java | 16 +++--- .../neoskies/command/island/HubCommands.java | 8 +-- .../neoskies/command/island/KickCommand.java | 10 ++-- .../neoskies/command/island/LevelCommand.java | 30 +++++------ .../command/island/MemberCommands.java | 16 +++--- .../neoskies/command/island/MenuCommand.java | 18 +++---- .../command/island/SettingCommands.java | 12 ++--- .../neoskies/command/island/VisitCommand.java | 8 +-- .../neoskies/command/utils/CommandUtils.java | 20 +++---- .../neoskies/config/source/Config.java | 6 +-- .../neoskies/data/SkylandComponents.java | 6 +-- .../neoskies/data/WorldComponent.java | 6 +-- .../neoskies/event/PlayerConnectEvent.java | 12 ++--- .../neoskies/event/ServerEventListener.java | 48 ++++++++--------- .../neoskies/font/FontManager.java | 8 +-- .../neoskies/font/FontProvider.java | 10 ++-- ...ventListeners.java => EventListeners.java} | 12 ++--- .../awakenedredstone/neoskies/logic/Hub.java | 4 +- .../neoskies/logic/Island.java | 46 ++++++++-------- .../logic/{Skylands.java => IslandLogic.java} | 52 +++++++++--------- .../neoskies/logic/IslandStuck.java | 14 ++--- .../neoskies/logic/economy/Economy.java | 6 +-- ...count.java => NeoSkiesEconomyAccount.java} | 12 ++--- ...ency.java => NeoSkiesEconomyCurrency.java} | 8 +-- ...ider.java => NeoSkiesEconomyProvider.java} | 18 +++---- ...r.java => NeoSkiesProtectionProvider.java} | 8 +-- .../registry/NeoSkiesIslandSettings.java | 10 ++-- ...els.java => NeoSkiesPermissionLevels.java} | 10 ++-- ...egistries.java => NeoSkiesRegistries.java} | 8 +-- .../logic/settings/IslandSettings.java | 8 +-- .../logic/settings/IslandSettingsUtil.java | 6 +-- .../logic/tags/NeoSkiesBlockTags.java | 36 ++++++------- .../logic/tags/NeoSkiesEntityTags.java | 16 +++--- .../neoskies/logic/tags/NeoSkiesItemTags.java | 14 ++--- .../mixin/block/EndPortalBlockMixin.java | 12 ++--- .../neoskies/mixin/entity/EntityMixin.java | 18 +++---- .../mixin/entity/PlayerManagerMixin.java | 30 +++++------ .../mixin/entity/ServerPlayerEntityMixin.java | 6 +-- .../mixin/world/PlayerEntityMixin.java | 6 +-- .../mixin/world/PortalForcerMixin.java | 8 +-- .../mixin/world/ServerWorldMixin.java | 16 +++--- .../neoskies/util/Constants.java | 8 +-- .../neoskies/util/DynamicPlaceholders.java | 4 +- .../neoskies/util/Players.java | 4 +- .../neoskies/util/Scheduler.java | 4 +- .../neoskies/util/ServerUtils.java | 6 +-- .../awakenedredstone/neoskies/util/Texts.java | 4 +- .../neoskies/util/WorldProtection.java | 54 +++++++++---------- .../neoskies/util/Worlds.java | 18 +++---- .../resources/data/neoskies/lang/en_us.json | 2 +- src/main/resources/fabric.mod.json | 2 +- ...ndsTestMain.java => NeoSkiesTestMain.java} | 10 ++-- src/testmod/resources/fabric.mod.json | 2 +- 66 files changed, 433 insertions(+), 433 deletions(-) rename src/main/java/com/awakenedredstone/neoskies/{SkylandsMain.java => NeoSkies.java} (71%) rename src/main/java/com/awakenedredstone/neoskies/api/{SkylandsAPI.java => NeoSkiesAPI.java} (82%) rename src/main/java/com/awakenedredstone/neoskies/command/{SkylandsCommands.java => NeoSkiesCommands.java} (89%) rename src/main/java/com/awakenedredstone/neoskies/logic/{SkylandsEventListeners.java => EventListeners.java} (95%) rename src/main/java/com/awakenedredstone/neoskies/logic/{Skylands.java => IslandLogic.java} (62%) rename src/main/java/com/awakenedredstone/neoskies/logic/economy/{SkylandsEconomyAccount.java => NeoSkiesEconomyAccount.java} (85%) rename src/main/java/com/awakenedredstone/neoskies/logic/economy/{SkylandsEconomyCurrency.java => NeoSkiesEconomyCurrency.java} (79%) rename src/main/java/com/awakenedredstone/neoskies/logic/economy/{SkylandsEconomyProvider.java => NeoSkiesEconomyProvider.java} (79%) rename src/main/java/com/awakenedredstone/neoskies/logic/protection/{SkylandsProtectionProvider.java => NeoSkiesProtectionProvider.java} (93%) rename src/main/java/com/awakenedredstone/neoskies/logic/registry/{SkylandsPermissionLevels.java => NeoSkiesPermissionLevels.java} (77%) rename src/main/java/com/awakenedredstone/neoskies/logic/registry/{SkylandsRegistries.java => NeoSkiesRegistries.java} (78%) rename src/testmod/java/com/awakenedredstone/neoskies/test/{SkylandsTestMain.java => NeoSkiesTestMain.java} (94%) diff --git a/src/main/java/com/awakenedredstone/neoskies/SkylandsMain.java b/src/main/java/com/awakenedredstone/neoskies/NeoSkies.java similarity index 71% rename from src/main/java/com/awakenedredstone/neoskies/SkylandsMain.java rename to src/main/java/com/awakenedredstone/neoskies/NeoSkies.java index 393c0ad..2c72389 100644 --- a/src/main/java/com/awakenedredstone/neoskies/SkylandsMain.java +++ b/src/main/java/com/awakenedredstone/neoskies/NeoSkies.java @@ -1,11 +1,11 @@ package com.awakenedredstone.neoskies; -import com.awakenedredstone.neoskies.command.SkylandsCommands; +import com.awakenedredstone.neoskies.command.NeoSkiesCommands; import com.awakenedredstone.neoskies.font.FontManager; -import com.awakenedredstone.neoskies.logic.Skylands; -import com.awakenedredstone.neoskies.logic.SkylandsEventListeners; +import com.awakenedredstone.neoskies.logic.EventListeners; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.logic.registry.NeoSkiesIslandSettings; -import com.awakenedredstone.neoskies.logic.registry.SkylandsPermissionLevels; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesPermissionLevels; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.fabricmc.api.ModInitializer; @@ -17,7 +17,7 @@ import java.util.HashSet; import java.util.Set; -public class SkylandsMain implements ModInitializer { +public class NeoSkies implements ModInitializer { public static final String MOD_ID = "neoskies"; public static final Logger LOGGER = LoggerFactory.getLogger("NeoSkies"); public static final Set PROTECTION_BYPASS = new HashSet<>(); @@ -30,12 +30,12 @@ public class SkylandsMain implements ModInitializer { @Override public void onInitialize() { NeoSkiesIslandSettings.init(); - SkylandsPermissionLevels.init(); - SkylandsEventListeners.registerEvents(); - SkylandsCommands.init(); + NeoSkiesPermissionLevels.init(); + EventListeners.registerEvents(); + NeoSkiesCommands.init(); FontManager.init(); - Skylands.getConfig().load(); + IslandLogic.getConfig().load(); } public static Identifier id(String path) { diff --git a/src/main/java/com/awakenedredstone/neoskies/api/SkylandsAPI.java b/src/main/java/com/awakenedredstone/neoskies/api/NeoSkiesAPI.java similarity index 82% rename from src/main/java/com/awakenedredstone/neoskies/api/SkylandsAPI.java rename to src/main/java/com/awakenedredstone/neoskies/api/NeoSkiesAPI.java index 3042174..310730f 100644 --- a/src/main/java/com/awakenedredstone/neoskies/api/SkylandsAPI.java +++ b/src/main/java/com/awakenedredstone/neoskies/api/NeoSkiesAPI.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.api; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Constants; import eu.pb4.common.economy.api.EconomyAccount; import net.minecraft.entity.player.PlayerEntity; @@ -12,8 +12,8 @@ import java.util.Optional; import java.util.UUID; -public class SkylandsAPI { - public static final Skylands SKYLANDS = Skylands.getInstance(); +public class NeoSkiesAPI { + public static final IslandLogic NEO_SKIES_LOGIC = IslandLogic.getInstance(); public static boolean isHub(World world) { return world.getRegistryKey() == World.OVERWORLD; @@ -48,19 +48,19 @@ public static boolean isEnd(RegistryKey registryKey) { } public static Optional getIslandByPlayer(PlayerEntity player) { - return SKYLANDS.islands.getFromMember(player); + return NEO_SKIES_LOGIC.islands.getFromMember(player); } public static Optional getIslandByPlayer(String playerName) { - return SKYLANDS.islands.getByPlayer(playerName); + return NEO_SKIES_LOGIC.islands.getByPlayer(playerName); } public static Optional getIslandByPlayer(UUID playerUuid) { - return SKYLANDS.islands.getByPlayer(playerUuid); + return NEO_SKIES_LOGIC.islands.getByPlayer(playerUuid); } public static Optional getIsland(UUID islandId) { - return SKYLANDS.islands.get(islandId); + return NEO_SKIES_LOGIC.islands.get(islandId); } public static Optional getIsland(World world) { @@ -68,8 +68,8 @@ public static Optional getIsland(World world) { } public static Optional getIsland(RegistryKey registryKey) { - if (SkylandsAPI.isIsland(registryKey)) { - return SKYLANDS.islands.getByPlayer(UUID.fromString(registryKey.getValue().getPath())); + if (NeoSkiesAPI.isIsland(registryKey)) { + return NEO_SKIES_LOGIC.islands.getByPlayer(UUID.fromString(registryKey.getValue().getPath())); } return Optional.empty(); } diff --git a/src/main/java/com/awakenedredstone/neoskies/api/island/PermissionLevel.java b/src/main/java/com/awakenedredstone/neoskies/api/island/PermissionLevel.java index 9a3e043..884fc71 100644 --- a/src/main/java/com/awakenedredstone/neoskies/api/island/PermissionLevel.java +++ b/src/main/java/com/awakenedredstone/neoskies/api/island/PermissionLevel.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.api.island; -import com.awakenedredstone.neoskies.logic.registry.SkylandsRegistries; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesRegistries; import net.minecraft.util.Identifier; import java.util.concurrent.atomic.AtomicReference; @@ -25,14 +25,14 @@ public int getLevel() { } private Identifier getIdentifierFromRegistry() { - return SkylandsRegistries.PERMISSION_LEVELS.getId(this); + return NeoSkiesRegistries.PERMISSION_LEVELS.getId(this); } public static PermissionLevel fromValue(Identifier id) { - return SkylandsRegistries.PERMISSION_LEVELS.get(id); + return NeoSkiesRegistries.PERMISSION_LEVELS.get(id); } public static PermissionLevel fromValue(String id) { - return SkylandsRegistries.PERMISSION_LEVELS.get(new Identifier(id)); + return NeoSkiesRegistries.PERMISSION_LEVELS.get(new Identifier(id)); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/command/SkylandsCommands.java b/src/main/java/com/awakenedredstone/neoskies/command/NeoSkiesCommands.java similarity index 89% rename from src/main/java/com/awakenedredstone/neoskies/command/SkylandsCommands.java rename to src/main/java/com/awakenedredstone/neoskies/command/NeoSkiesCommands.java index 07b7b28..1a9e1bd 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/SkylandsCommands.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/NeoSkiesCommands.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.command; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.command.admin.*; import com.awakenedredstone.neoskies.command.island.*; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; @@ -18,14 +18,14 @@ import static com.awakenedredstone.neoskies.command.utils.CommandUtils.adminNode; import static com.awakenedredstone.neoskies.command.utils.CommandUtils.registerAdmin; -public class SkylandsCommands { +public class NeoSkiesCommands { public static void init() { - CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> SkylandsCommands.register(dispatcher)); + CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> NeoSkiesCommands.register(dispatcher)); } private static void register(CommandDispatcher dispatcher) { - SkylandsMain.LOGGER.debug("Registering commands..."); + NeoSkies.LOGGER.debug("Registering commands..."); registerPublicCommands(dispatcher); registerAdminCommands(dispatcher); } @@ -58,7 +58,7 @@ private static void registerAdminCommands(CommandDispatcher .then(CommandManager.literal("reload") .executes(context -> { context.getSource().sendFeedback(() -> Texts.prefixed(Text.translatable("commands.neoskies.reload")), true); - Skylands.getConfig().load(); + IslandLogic.getConfig().load(); return 1; }) ) @@ -75,7 +75,7 @@ private static void registerAdminCommands(CommandDispatcher ServerPlayerEntity player = source.getPlayer(); - Set protectionBypass = SkylandsMain.PROTECTION_BYPASS; + Set protectionBypass = NeoSkies.PROTECTION_BYPASS; boolean overrideMode = protectionBypass.contains(player); if (overrideMode) { protectionBypass.remove(player); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/admin/BallanceCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/admin/BallanceCommand.java index fda6293..02619f2 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/admin/BallanceCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/admin/BallanceCommand.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.command.admin; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.command.utils.CommandUtils; import com.awakenedredstone.neoskies.logic.Island; import com.awakenedredstone.neoskies.util.MapBuilder; @@ -30,14 +30,14 @@ public static void init(CommandDispatcher dispatcher) { .then(literal("get") .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); - return getBalance(context.getSource(), SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null)); + return getBalance(context.getSource(), NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null)); }) ).then(literal("set") .then(argument("amount", LongArgumentType.longArg()) .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); long amount = LongArgumentType.getLong(context, "amount"); - return setBalance(context.getSource(), SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); + return setBalance(context.getSource(), NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); }) ) ).then(literal("add") @@ -45,7 +45,7 @@ public static void init(CommandDispatcher dispatcher) { .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); long amount = LongArgumentType.getLong(context, "amount"); - return addBalance(context.getSource(), SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); + return addBalance(context.getSource(), NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); }) ) ).then(literal("remove") @@ -53,7 +53,7 @@ public static void init(CommandDispatcher dispatcher) { .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); long amount = LongArgumentType.getLong(context, "amount"); - return removeBalance(context.getSource(), SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); + return removeBalance(context.getSource(), NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null), amount); }) ) ) @@ -67,7 +67,7 @@ public static void init(CommandDispatcher dispatcher) { source.sendError(Texts.of("message.neoskies.error.island_not_found")); return null; } - EconomyAccount islandWallet = SkylandsAPI.getIslandWallet(island); + EconomyAccount islandWallet = NeoSkiesAPI.getIslandWallet(island); if (islandWallet == null) { source.sendError(Texts.of("message.neoskies.error.island_wallet_not_found")); return null; diff --git a/src/main/java/com/awakenedredstone/neoskies/command/admin/DeleteIslandCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/admin/DeleteIslandCommand.java index a2194dd..8b064d3 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/admin/DeleteIslandCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/admin/DeleteIslandCommand.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.command.admin; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.StringArgumentType; @@ -20,10 +20,10 @@ public static void init(CommandDispatcher dispatcher) { .then(argument("player", word()) .executes(context -> { var playerName = StringArgumentType.getString(context, "player"); - var island = Skylands.getInstance().islands.getByPlayer(playerName); + var island = IslandLogic.getInstance().islands.getByPlayer(playerName); if (island.isPresent()) { - Skylands.getInstance().islands.delete(playerName); + IslandLogic.getInstance().islands.delete(playerName); context.getSource().sendFeedback(() -> Texts.of("message.neoskies.force_delete.success", map -> map.put("player", playerName)), true); } else { context.getSource().sendFeedback(() -> Texts.of("message.neoskies.force_delete.fail", map -> map.put("player", playerName)), true); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/admin/IslandDataCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/admin/IslandDataCommand.java index 8a19904..170869d 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/admin/IslandDataCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/admin/IslandDataCommand.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.command.admin; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.command.utils.CommandUtils; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.MapBuilder; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; @@ -29,7 +29,7 @@ public static void init(CommandDispatcher dispatcher) { .requires(Permissions.require("neoskies.admin.island.data.find", 4)) .then(argument("player", StringArgumentType.word()) .suggests((context, builder) -> { - List islands = Skylands.getInstance().islands.stuck; + List islands = IslandLogic.getInstance().islands.stuck; for (Island island : islands) { builder.suggest(island.owner.name); island.members.forEach(member -> { @@ -39,7 +39,7 @@ public static void init(CommandDispatcher dispatcher) { return builder.buildFuture(); }).executes(context -> { String playerName = StringArgumentType.getString(context, "player"); - Optional islandOptional = SkylandsAPI.getIslandByPlayer(playerName); + Optional islandOptional = NeoSkiesAPI.getIslandByPlayer(playerName); return getIslandData(context.getSource(), islandOptional.orElse(null)); }) ) @@ -48,7 +48,7 @@ public static void init(CommandDispatcher dispatcher) { .suggests(CommandUtils.ISLAND_SUGGESTIONS) .executes(context -> { String islandId = StringArgumentType.getString(context, "id"); - Optional islandOptional = SkylandsAPI.getIsland(UUID.fromString(islandId)); + Optional islandOptional = NeoSkiesAPI.getIsland(UUID.fromString(islandId)); return getIslandData(context.getSource(), islandOptional.orElse(null)); }) ) diff --git a/src/main/java/com/awakenedredstone/neoskies/command/admin/ModifyCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/admin/ModifyCommand.java index 9e13777..2899e0e 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/admin/ModifyCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/admin/ModifyCommand.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.command.admin; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.command.utils.CommandUtils; import com.awakenedredstone.neoskies.logic.Island; import com.awakenedredstone.neoskies.util.MapBuilder; @@ -35,14 +35,14 @@ public > void visit(GameRules.Key key, GameRules. .then(literal(key.getName()) .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); - Island island = SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null); + Island island = NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null); return getGamerule(context.getSource(), key, island); }) .then(type.argument("value") .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); - Island island = SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null); + Island island = NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null); return setGamerule(context, key, island); }) @@ -60,7 +60,7 @@ public > void visit(GameRules.Key key, GameRules. .executes(context -> { String islandId = StringArgumentType.getString(context, "island"); int size = IntegerArgumentType.getInteger(context, "size"); - return modifyIslandSize(context.getSource(), SkylandsAPI.getIsland(UUID.fromString(islandId)).orElse(null), size); + return modifyIslandSize(context.getSource(), NeoSkiesAPI.getIsland(UUID.fromString(islandId)).orElse(null), size); }) ) ).then(gameruleArgumentBuilder) diff --git a/src/main/java/com/awakenedredstone/neoskies/command/admin/SettingsCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/admin/SettingsCommand.java index 3ffa4e7..9ac310e 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/admin/SettingsCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/admin/SettingsCommand.java @@ -21,7 +21,7 @@ public static void init(CommandDispatcher dispatcher) { return 0; } - //new ConfigScreen(source.getPlayer(), SkylandsMain.MAIN_CONFIG, null, null); + //new ConfigScreen(source.getPlayer(), NeoSkies.MAIN_CONFIG, null, null); source.sendFeedback(() -> Text.literal("In development, they will likely require the client mod"), false); return 1; diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/AcceptCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/AcceptCommand.java index 4402dbb..4d9c787 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/AcceptCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/AcceptCommand.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Players; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; @@ -40,13 +40,13 @@ static void run(ServerPlayerEntity player, String ownerName) { return; } - var island = Skylands.getInstance().islands.getByPlayer(inviter.get()); + var island = IslandLogic.getInstance().islands.getByPlayer(inviter.get()); if (island.isEmpty()) { player.sendMessage(Texts.prefixed("message.neoskies.accept.no_island")); return; } - var invite = Skylands.getInstance().invites.get(island.get(), player); + var invite = IslandLogic.getInstance().invites.get(island.get(), player); if (invite.isEmpty()) { player.sendMessage(Texts.prefixed("message.neoskies.accept.fail")); return; diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/BanCommands.java b/src/main/java/com/awakenedredstone/neoskies/command/island/BanCommands.java index f61dee1..31de387 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/BanCommands.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/BanCommands.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Member; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.StringArgumentType; @@ -43,7 +43,7 @@ public static void init(CommandDispatcher dispatcher) { var player = context.getSource().getPlayer(); if (player != null) { - var island = Skylands.getInstance().islands.getByPlayer(player); + var island = IslandLogic.getInstance().islands.getByPlayer(player); if (island.isPresent()) { var bans = island.get().bans; @@ -73,7 +73,7 @@ public static void init(CommandDispatcher dispatcher) { } static void ban(ServerPlayerEntity player, ServerPlayerEntity banned) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { if (player.getName().getString().equals(banned.getName().getString())) { player.sendMessage(Texts.prefixed("message.neoskies.ban_player.yourself")); } else { @@ -87,9 +87,9 @@ static void ban(ServerPlayerEntity player, ServerPlayerEntity banned) { player.sendMessage(Texts.prefixed("message.neoskies.ban_player.success", map -> map.put("player", banned.getName().getString()))); banned.sendMessage(Texts.prefixed("message.neoskies.ban_player.ban", map -> map.put("owner", island.owner.name))); - SkylandsAPI.getIsland(banned.getWorld()).ifPresent(isl -> { + NeoSkiesAPI.getIsland(banned.getWorld()).ifPresent(isl -> { if (isl.owner.uuid.equals(island.owner.uuid)) { - Skylands.getInstance().hub.visit(banned); + IslandLogic.getInstance().hub.visit(banned); } }); } @@ -99,7 +99,7 @@ static void ban(ServerPlayerEntity player, ServerPlayerEntity banned) { } static void unban(ServerPlayerEntity player, String unbanned) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { if (!island.isBanned(unbanned)) { player.sendMessage(Texts.prefixed("message.neoskies.unban_player.fail")); } else { diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/CreateCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/CreateCommand.java index 943c4b7..64147b6 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/CreateCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/CreateCommand.java @@ -2,7 +2,7 @@ import com.awakenedredstone.neoskies.logic.Island; import com.awakenedredstone.neoskies.logic.IslandStuck; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.server.command.ServerCommandSource; @@ -30,7 +30,7 @@ public static void init(CommandDispatcher dispatcher) { } static void run(ServerPlayerEntity player) { - IslandStuck islands = Skylands.getInstance().islands; + IslandStuck islands = IslandLogic.getInstance().islands; if (islands.getByPlayer(player).isPresent()) { player.sendMessage(Texts.prefixed("message.neoskies.island_create.fail")); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/DeleteCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/DeleteCommand.java index e2e912d..2c9dfde 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/DeleteCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/DeleteCommand.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.command.island; import com.awakenedredstone.neoskies.logic.IslandStuck; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.StringArgumentType; @@ -39,14 +39,14 @@ public static void init(CommandDispatcher dispatcher) { static void run(ServerPlayerEntity player, String confirmWord) { if (confirmWord.equals("CONFIRM")) { - IslandStuck islands = Skylands.getInstance().islands; + IslandStuck islands = IslandLogic.getInstance().islands; islands.getByPlayer(player).ifPresentOrElse(island -> { var created = island.getCreated(); var now = Instant.now(); var seconds = ChronoUnit.SECONDS.between(created, now); - if (seconds >= Skylands.getConfig().deletionCooldown) { + if (seconds >= IslandLogic.getConfig().deletionCooldown) { islands.delete(player); player.sendMessage(Texts.prefixed("message.neoskies.island_delete.success")); } else { @@ -62,14 +62,14 @@ static void run(ServerPlayerEntity player, String confirmWord) { } static void warn(ServerPlayerEntity player) { - IslandStuck islands = Skylands.getInstance().islands; + IslandStuck islands = IslandLogic.getInstance().islands; islands.getByPlayer(player).ifPresentOrElse(island -> { var created = island.getCreated(); var now = Instant.now(); var seconds = ChronoUnit.SECONDS.between(created, now); - if (seconds >= Skylands.getConfig().deletionCooldown) { + if (seconds >= IslandLogic.getConfig().deletionCooldown) { player.sendMessage(Texts.prefixed("message.neoskies.island_delete.warning")); } else { player.sendMessage(Texts.prefixed("message.neoskies.island_delete.too_often")); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/HomeCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/HomeCommand.java index 431f1a6..034dc58 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/HomeCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/HomeCommand.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.SkylandsMain; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.NeoSkies; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.server.command.ServerCommandSource; @@ -31,10 +31,10 @@ public static void init(CommandDispatcher dispatcher) { } static void run(ServerPlayerEntity player) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { - Optional currentIsland = SkylandsAPI.getIsland(player.getWorld()); + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + Optional currentIsland = NeoSkiesAPI.getIsland(player.getWorld()); boolean isHome = currentIsland.isPresent() && currentIsland.get().equals(island); - if (isHome && !Skylands.getConfig().allowVisitCurrentIsland) { + if (isHome && !IslandLogic.getConfig().allowVisitCurrentIsland) { player.sendMessage(Texts.prefixed("message.neoskies.home.fail")); } else { player.sendMessage(Texts.prefixed("message.neoskies.home.success")); @@ -44,8 +44,8 @@ static void run(ServerPlayerEntity player) { } static void run(ServerPlayerEntity visitor, String islandOwner) { - Skylands.getInstance().islands.getByPlayer(islandOwner).ifPresentOrElse(island -> { - if (visitor.getWorld().getRegistryKey().getValue().equals(SkylandsMain.id(island.owner.uuid.toString())) && !Skylands.getConfig().allowVisitCurrentIsland) { + IslandLogic.getInstance().islands.getByPlayer(islandOwner).ifPresentOrElse(island -> { + if (visitor.getWorld().getRegistryKey().getValue().equals(NeoSkies.id(island.owner.uuid.toString())) && !IslandLogic.getConfig().allowVisitCurrentIsland) { visitor.sendMessage(Texts.prefixed("message.neoskies.visit_home.fail", map -> map.put("owner", islandOwner))); } else { if (island.isMember(visitor)) { diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/HubCommands.java b/src/main/java/com/awakenedredstone/neoskies/command/island/HubCommands.java index 1f3e6dd..f3ac789 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/HubCommands.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/HubCommands.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import me.lucko.fabric.api.permissions.v0.Permissions; @@ -58,17 +58,17 @@ public static void init(CommandDispatcher dispatcher) { } static void visit(ServerPlayerEntity player, MinecraftServer server) { - Skylands.getInstance().hub.visit(player); + IslandLogic.getInstance().hub.visit(player); } static void setPos(BlockPos pos, ServerCommandSource source) { - Skylands.getInstance().hub.pos = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); + IslandLogic.getInstance().hub.pos = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); String posText = pos.getX() + " " + pos.getY() + " " + pos.getZ(); source.sendFeedback(() -> Texts.prefixed("message.neoskies.hub_pos_change", map -> map.put("pos", posText)), true); } static void toggleProtection(ServerCommandSource source) { - var hub = Skylands.getInstance().hub; + var hub = IslandLogic.getInstance().hub; if (hub.hasProtection) { hub.hasProtection = false; source.sendFeedback(() -> Texts.prefixed("message.neoskies.hub_protection.disable"), true); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/KickCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/KickCommand.java index 2971640..7759206 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/KickCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/KickCommand.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.api.SkylandsAPI; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.command.argument.EntityArgumentType; @@ -34,19 +34,19 @@ public static void init(CommandDispatcher dispatcher) { } static void run(ServerPlayerEntity player, ServerPlayerEntity kicked) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { if (player.getName().getString().equals(kicked.getName().getString())) { player.sendMessage(Texts.prefixed("message.neoskies.kick_visitor.yourself")); } else { if (island.isMember(kicked)) { player.sendMessage(Texts.prefixed("message.neoskies.kick_visitor.member")); } else { - SkylandsAPI.getIsland(kicked.getWorld()).ifPresent(isl -> { + NeoSkiesAPI.getIsland(kicked.getWorld()).ifPresent(isl -> { if (isl.owner.uuid.equals(island.owner.uuid)) { player.sendMessage(Texts.prefixed("message.neoskies.kick_visitor.success", map -> map.put("player", kicked.getName().getString()))); kicked.sendMessage(Texts.prefixed("message.neoskies.kick_visitor.kick", map -> map.put("owner", player.getName().getString()))); - Skylands.getInstance().hub.visit(kicked); + IslandLogic.getInstance().hub.visit(kicked); } else { player.sendMessage(Texts.prefixed("message.neoskies.kick_visitor.fail", map -> map.put("player", kicked.getName().getString()))); } diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/LevelCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/LevelCommand.java index fb04c09..3373e62 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/LevelCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/LevelCommand.java @@ -1,10 +1,10 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.duck.ExtendedChunk; import com.awakenedredstone.neoskies.gui.PagedGui; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.logic.util.ChunkScanQueue; import com.awakenedredstone.neoskies.util.FontUtils; import com.awakenedredstone.neoskies.util.MapBuilder; @@ -76,7 +76,7 @@ private static int view(ServerCommandSource source) { if (!assertPlayer(source)) return 0; ServerPlayerEntity player = source.getPlayer(); - Island island = SkylandsAPI.getIslandByPlayer(player).orElse(null); + Island island = NeoSkiesAPI.getIslandByPlayer(player).orElse(null); if (!assertIsland(source, island)) return 0; if (island.isScanning()) { source.sendError(Texts.of("message.neoskies.island.error.scanning")); @@ -86,7 +86,7 @@ private static int view(ServerCommandSource source) { List elements = new ArrayList<>(); island.getBlocks().forEach((block, count) -> { - Integer points = Skylands.getRankingConfig().points.getOrDefault(block, 1); + Integer points = IslandLogic.getRankingConfig().points.getOrDefault(block, 1); sum.addAndGet(points * count); Block block1 = Registries.BLOCK.get(block); @@ -115,7 +115,7 @@ private static int runScan(ServerCommandSource source) { if (!assertPlayer(source)) return 0; ServerPlayerEntity player = source.getPlayer(); - Island island = SkylandsAPI.getIslandByPlayer(player).orElse(null); + Island island = NeoSkiesAPI.getIslandByPlayer(player).orElse(null); if (!assertIsland(source, island)) return 0; if (island.isScanning()) { source.sendError(Texts.of("message.neoskies.island.error.scanning")); @@ -156,13 +156,13 @@ private static int runScan(ServerCommandSource source) { textDisplay.setTranslation(new Vec3d(0, 0.25 * (lines / 2d) + 0.0625, 0).toVector3f()); textDisplay.startInterpolation(); - Skylands.getInstance().scheduler.scheduleDelayed(Skylands.getServer(), 8, () -> { + IslandLogic.getInstance().scheduler.scheduleDelayed(IslandLogic.getServer(), 8, () -> { textDisplay.setInterpolationDuration(7); textDisplay.setScale(new Vec3d(0, 0.1, 1).toVector3f()); textDisplay.startInterpolation(); }); - Skylands.getInstance().scheduler.scheduleDelayed(Skylands.getServer(), 15, () -> { + IslandLogic.getInstance().scheduler.scheduleDelayed(IslandLogic.getServer(), 15, () -> { holder.destroy(); holder = null; }); @@ -212,7 +212,7 @@ private static int runScan(ServerCommandSource source) { .putAny("progress", current) .putAny("total", total) .build()); - Skylands.getInstance().scheduler.schedule(new Identifier("neoskies", "island-scan/" + island.getIslandId().toString()), 0, () -> display.setText(progress)); + IslandLogic.getInstance().scheduler.schedule(new Identifier("neoskies", "island-scan/" + island.getIslandId().toString()), 0, () -> display.setText(progress)); return; } @@ -226,9 +226,9 @@ private static int runScan(ServerCommandSource source) { } visualization.append(Text.of("\n")); } - Skylands.getInstance().scheduler.schedule(new Identifier("neoskies", "island-scan/" + island.getIslandId().toString()), 0, () -> display.setText(visualization)); + IslandLogic.getInstance().scheduler.schedule(new Identifier("neoskies", "island-scan/" + island.getIslandId().toString()), 0, () -> display.setText(visualization)); }, (timeTaken, scannedBlocks) -> { - Skylands.syncWithTick(() -> { + IslandLogic.syncWithTick(() -> { source.sendFeedback(() -> Texts.of("message.neoskies.island.level.scan.time_taken", new MapBuilder.StringMap() .put("time", UnitConvertions.formatTimings(timeTaken)) .build()), false); @@ -270,7 +270,7 @@ private static int runScan(ServerCommandSource source) { closeBackground.run(); }), yaw); - Skylands.getScheduler().scheduleDelayed(Skylands.getServer(), 600, () -> { + IslandLogic.getScheduler().scheduleDelayed(IslandLogic.getServer(), 600, () -> { if (holder == null) return; removeBlocksView.run(); closeBackground.run(); @@ -287,25 +287,25 @@ private static int runScan(ServerCommandSource source) { }); textDisplay.setInterpolationDuration(7); - Skylands.getInstance().scheduler.scheduleDelayed(Skylands.getServer(), 0, () -> { + IslandLogic.getInstance().scheduler.scheduleDelayed(IslandLogic.getServer(), 0, () -> { textDisplay.setScale(new Vec3d(1, 0.1, 1).toVector3f()); textDisplay.startInterpolation(); }); - Skylands.getInstance().scheduler.scheduleDelayed(Skylands.getServer(), 10, () -> { + IslandLogic.getInstance().scheduler.scheduleDelayed(IslandLogic.getServer(), 10, () -> { textDisplay.setInterpolationDuration(5); textDisplay.setScale(new Vec3d(1, 1, 1).toVector3f()); textDisplay.setTranslation(new Vec3d(0, 0, 0).toVector3f()); textDisplay.startInterpolation(); }); - Skylands.getInstance().scheduler.scheduleDelayed(Skylands.getServer(), 15, () -> { + IslandLogic.getInstance().scheduler.scheduleDelayed(IslandLogic.getServer(), 15, () -> { message.set(createDisplay(Texts.of("message.neoskies.island.level.scan.confirm"), yaw, new Vec3d(0, 0.25 * (lines / 2d) + 0.0625 + 0.5, 0))); startScanPair.set(createInteraction(startScanText, startScan, yaw, new Vec3d(-2 + getTextWidth(startScanText), 0.25 * (lines / 2d) + 0.0625, 0))); cancalScanPair.set(createInteraction(cancelText, cancelScan, yaw, new Vec3d(2 - getTextWidth(startScanText), 0.25 * (lines / 2d) + 0.0625, 0))); }); - Skylands.getScheduler().scheduleDelayed(Skylands.getServer(), 600, () -> { + IslandLogic.getScheduler().scheduleDelayed(IslandLogic.getServer(), 600, () -> { if (holder != null && holder.getElements().contains(message.get())) { removeDisplay(message.get()); removeInteraction(startScanPair.get()); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/MemberCommands.java b/src/main/java/com/awakenedredstone/neoskies/command/island/MemberCommands.java index 493881b..7667b51 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/MemberCommands.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/MemberCommands.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.api.SkylandsAPI; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.StringArgumentType; @@ -39,7 +39,7 @@ public static void init(CommandDispatcher dispatcher) { var player = context.getSource().getPlayer(); if (player != null) { - var island = Skylands.getInstance().islands.getByPlayer(player); + var island = IslandLogic.getInstance().islands.getByPlayer(player); if (island.isPresent()) { var members = island.get().members; @@ -68,18 +68,18 @@ public static void init(CommandDispatcher dispatcher) { } static void invite(ServerPlayerEntity inviter, ServerPlayerEntity newcomer) { - if (SkylandsAPI.getIslandByPlayer(newcomer).isPresent()) { + if (NeoSkiesAPI.getIslandByPlayer(newcomer).isPresent()) { inviter.sendMessage(Texts.prefixed("message.neoskies.invite_member.already_has_island")); return; } - Skylands.getInstance().islands.getByPlayer(inviter).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(inviter).ifPresentOrElse(island -> { if (island.isMember(newcomer)) { inviter.sendMessage(Texts.prefixed("message.neoskies.invite_member.already_member")); return; } - if (Skylands.getInstance().invites.hasInvite(island, newcomer)) { + if (IslandLogic.getInstance().invites.hasInvite(island, newcomer)) { inviter.sendMessage(Texts.prefixed("message.neoskies.invite_member.already_invited")); } else { inviter.sendMessage(Texts.prefixed("message.neoskies.invite_member.success", (map) -> map.put("newcomer", newcomer.getName().getString()))); @@ -92,13 +92,13 @@ static void invite(ServerPlayerEntity inviter, ServerPlayerEntity newcomer) { newcomer.sendMessage(inviteText.getWithStyle(style).get(0)); newcomer.sendMessage(Texts.prefixed("message.neoskies.invite_member.accept").getWithStyle(style).get(0)); - Skylands.getInstance().invites.create(island, newcomer); + IslandLogic.getInstance().invites.create(island, newcomer); } }, () -> inviter.sendMessage(Texts.prefixed("message.neoskies.invite_member.no_island"))); } static void remove(ServerPlayerEntity player, String removed) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { if (player.getName().getString().equals(removed)) { player.sendMessage(Texts.prefixed("message.neoskies.remove_member.yourself")); } else { diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/MenuCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/MenuCommand.java index 168de29..9c8b2b1 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/MenuCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/MenuCommand.java @@ -1,12 +1,12 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.SkylandsMain; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.NeoSkies; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.gui.IslandSettingsGui; import com.awakenedredstone.neoskies.gui.polymer.CBGuiElementBuilder; import com.awakenedredstone.neoskies.gui.polymer.CBSimpleGuiBuilder; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.awakenedredstone.neoskies.util.UIUtils; import com.mojang.brigadier.CommandDispatcher; @@ -39,7 +39,7 @@ public static void init(CommandDispatcher dispatcher) { ) ); - for (String alias : Skylands.getConfig().commandAliases) { + for (String alias : IslandLogic.getConfig().commandAliases) { dispatcher.register(CommandManager.literal(alias).executes(context -> MenuCommand.execute(context.getSource()))); } } @@ -61,13 +61,13 @@ private static int execute(ServerCommandSource source) { boolean dirty = false; }; final Consumer consumer = slotHolder -> { - Optional islandOptional = SkylandsAPI.getIslandByPlayer(player); + Optional islandOptional = NeoSkiesAPI.getIslandByPlayer(player); UIUtils.fillGui(slotHolder, new CBGuiElementBuilder(Items.BLACK_STAINED_GLASS_PANE).setName(Text.empty()).hideTooltip().build()); if (Permissions.check(player, "neoskies.teleport.hub", true)) { slotHolder.setSlot(10, new CBGuiElementBuilder(Items.BEACON).setName(Texts.of("item_name.neoskies.hub")) .setCallback((index, type, action, gui) -> { //gui.getPlayer().playSound(SoundEvents.UI_BUTTON_CLICK, SoundCategory.MASTER, 0.3f, 1); - Skylands.getInstance().hub.visit(player); + IslandLogic.getInstance().hub.visit(player); gui.close(); }) .build()); @@ -100,7 +100,7 @@ private static int execute(ServerCommandSource source) { .build()); } if (Permissions.check(player, "neoskies.admin.protection.bypass", 4)) { - Set protectionBypass = SkylandsMain.PROTECTION_BYPASS; + Set protectionBypass = NeoSkies.PROTECTION_BYPASS; boolean overrideMode = protectionBypass.contains(player); Item item = overrideMode ? Items.OAK_CHEST_BOAT : Items.OAK_BOAT; slotHolder.setSlot(slotHolder.getSize() - 2, new CBGuiElementBuilder(item).setName(Texts.of("item_name.neoskies.protection_bypass")) @@ -116,7 +116,7 @@ private static int execute(ServerCommandSource source) { slotHolder.setSlot(slotHolder.getSize() - 1, new CBGuiElementBuilder(Items.COMMAND_BLOCK_MINECART).setName(Texts.of("item_name.neoskies.mod_settings")) .setCallback((index, type, action, gui) -> { gui.getPlayer().playSound(SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.MASTER, 0.3f, 1); - new ConfigScreen(source.getPlayer(), SkylandsMain.MAIN_CONFIG, null, null); + new ConfigScreen(source.getPlayer(), NeoSkies.MAIN_CONFIG, null, null); }) .build()); }*/ @@ -128,7 +128,7 @@ private static int execute(ServerCommandSource source) { ref.dirty = false; consumer.accept(gui); if (!Permissions.check(player, "neoskies.admin.protection.bypass", 4)) { - SkylandsMain.PROTECTION_BYPASS.remove(player); + NeoSkies.PROTECTION_BYPASS.remove(player); } } }); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/SettingCommands.java b/src/main/java/com/awakenedredstone/neoskies/command/island/SettingCommands.java index c28720c..ad71af6 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/SettingCommands.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/SettingCommands.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.gui.IslandSettingsGui; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.command.argument.BlockPosArgumentType; @@ -69,7 +69,7 @@ public static void init(CommandDispatcher dispatcher) { } static void toggleVisits(ServerPlayerEntity player) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { if (island.locked) { player.sendMessage(Texts.prefixed("message.neoskies.settings.unlock")); island.locked = false; @@ -82,7 +82,7 @@ static void toggleVisits(ServerPlayerEntity player) { } static void setSpawnPos(ServerPlayerEntity player, BlockPos pos) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { island.spawnPos = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); String posText = pos.getX() + " " + pos.getY() + " " + pos.getZ(); player.sendMessage(Texts.prefixed("message.neoskies.settings.spawn_pos_change", map -> map.put("pos", posText))); @@ -91,7 +91,7 @@ static void setSpawnPos(ServerPlayerEntity player, BlockPos pos) { } static void setVisitsPos(ServerPlayerEntity player, BlockPos pos) { - Skylands.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(player).ifPresentOrElse(island -> { island.visitsPos = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); String posText = pos.getX() + " " + pos.getY() + " " + pos.getZ(); player.sendMessage(Texts.prefixed("message.neoskies.settings.visits_pos_change", map -> map.put("pos", posText))); @@ -107,7 +107,7 @@ private static int settingsGui(ServerCommandSource source) { ServerPlayerEntity player = source.getPlayer(); - Optional optionalIsland = SkylandsAPI.getIslandByPlayer(player); + Optional optionalIsland = NeoSkiesAPI.getIslandByPlayer(player); optionalIsland.ifPresentOrElse(island -> { //noinspection DataFlowIssue player.playSoundToPlayer(SoundEvents.ENTITY_HORSE_SADDLE, SoundCategory.MASTER, 0.4f, 1); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/island/VisitCommand.java b/src/main/java/com/awakenedredstone/neoskies/command/island/VisitCommand.java index 95e05d8..4e0b9cf 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/island/VisitCommand.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/island/VisitCommand.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.command.island; -import com.awakenedredstone.neoskies.SkylandsMain; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.NeoSkies; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import me.lucko.fabric.api.permissions.v0.Permissions; @@ -38,12 +38,12 @@ public static void init(CommandDispatcher dispatcher) { static void run(ServerPlayerEntity visitor, ServerPlayerEntity owner) { String ownerName = owner.getName().getString(); - Skylands.getInstance().islands.getByPlayer(owner).ifPresentOrElse(island -> { + IslandLogic.getInstance().islands.getByPlayer(owner).ifPresentOrElse(island -> { if (!island.isMember(visitor) && island.isBanned(visitor)) { visitor.sendMessage(Texts.prefixed("message.neoskies.island_visit.ban", map -> map.put("owner", ownerName))); } else { if (!island.locked) { - if (visitor.getWorld().getRegistryKey().getValue().equals(SkylandsMain.id(island.owner.uuid.toString())) && !Skylands.getConfig().allowVisitCurrentIsland) { + if (visitor.getWorld().getRegistryKey().getValue().equals(NeoSkies.id(island.owner.uuid.toString())) && !IslandLogic.getConfig().allowVisitCurrentIsland) { visitor.sendMessage(Texts.prefixed("message.neoskies.island_visit.fail", map -> map.put("owner", ownerName))); } else { visitor.sendMessage(Texts.prefixed("message.neoskies.island_visit.success", map -> map.put("owner", ownerName))); diff --git a/src/main/java/com/awakenedredstone/neoskies/command/utils/CommandUtils.java b/src/main/java/com/awakenedredstone/neoskies/command/utils/CommandUtils.java index da74b77..a082c7b 100644 --- a/src/main/java/com/awakenedredstone/neoskies/command/utils/CommandUtils.java +++ b/src/main/java/com/awakenedredstone/neoskies/command/utils/CommandUtils.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.command.utils; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.builder.LiteralArgumentBuilder; @@ -21,7 +21,7 @@ public class CommandUtils { public static final SuggestionProvider ISLAND_SUGGESTIONS = (context, builder) -> { - List islands = Skylands.getInstance().islands.stuck; + List islands = IslandLogic.getInstance().islands.stuck; for (Island island : islands) { builder.suggest(island.getIslandId().toString()); } @@ -51,29 +51,29 @@ public static Predicate playerOnly(@NotNull String permissi } public static Predicate requiresIsland(@NotNull String permission, boolean defaultValue) { - return source -> playerOnly(permission, defaultValue).test(source) && SkylandsAPI.hasIsland(source.getPlayer()); + return source -> playerOnly(permission, defaultValue).test(source) && NeoSkiesAPI.hasIsland(source.getPlayer()); } public static Predicate requiresNoIsland(@NotNull String permission, boolean defaultValue) { - return source -> playerOnly(permission, defaultValue).test(source) && !SkylandsAPI.hasIsland(source.getPlayer()); + return source -> playerOnly(permission, defaultValue).test(source) && !NeoSkiesAPI.hasIsland(source.getPlayer()); } public static Predicate mustBeIslandOwner(@NotNull String permission, boolean defaultValue) { - return source -> requiresIsland(permission, defaultValue).test(source) && SkylandsAPI.isIslandOwner(source.getPlayer()); + return source -> requiresIsland(permission, defaultValue).test(source) && NeoSkiesAPI.isIslandOwner(source.getPlayer()); } public static LiteralArgumentBuilder node() { - return literal(Skylands.getConfig().command); + return literal(IslandLogic.getConfig().command); } public static LiteralArgumentBuilder adminNode() { - return literal(Skylands.getConfig().adminCommand); + return literal(IslandLogic.getConfig().adminCommand); } public static LiteralCommandNode register(CommandDispatcher dispatcher, final LiteralArgumentBuilder command) { LiteralCommandNode node = dispatcher.register(command); - for (String alias : Skylands.getConfig().commandAliases) { + for (String alias : IslandLogic.getConfig().commandAliases) { dispatcher.register(CommandManager.literal(alias).redirect(node)); } @@ -83,7 +83,7 @@ public static LiteralCommandNode register(CommandDispatcher public static LiteralCommandNode registerAdmin(CommandDispatcher dispatcher, final LiteralArgumentBuilder command) { LiteralCommandNode node = dispatcher.register(command); - for (String alias : Skylands.getConfig().adminCommandAliases) { + for (String alias : IslandLogic.getConfig().adminCommandAliases) { dispatcher.register(CommandManager.literal(alias).redirect(node)); } diff --git a/src/main/java/com/awakenedredstone/neoskies/config/source/Config.java b/src/main/java/com/awakenedredstone/neoskies/config/source/Config.java index 2777239..47c15fd 100644 --- a/src/main/java/com/awakenedredstone/neoskies/config/source/Config.java +++ b/src/main/java/com/awakenedredstone/neoskies/config/source/Config.java @@ -3,7 +3,7 @@ import blue.endless.jankson.Jankson; import blue.endless.jankson.JsonGrammar; import blue.endless.jankson.api.SyntaxError; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import net.fabricmc.loader.api.FabricLoader; import java.io.IOException; @@ -38,7 +38,7 @@ public void save() { this.getFileLocation().getParent().toFile().mkdirs(); Files.writeString(this.getFileLocation(), this.interpreter.toJson(this).toJson(JsonGrammar.JANKSON), StandardCharsets.UTF_8); } catch (IOException e) { - SkylandsMain.LOGGER.warn("Could not save config!", e); + NeoSkies.LOGGER.warn("Could not save config!", e); } } @@ -70,7 +70,7 @@ public void load() { } } catch (IOException | SyntaxError | IllegalAccessException e) { - SkylandsMain.LOGGER.warn("Could not load config!", e); + NeoSkies.LOGGER.warn("Could not load config!", e); } finally { this.loading = false; } diff --git a/src/main/java/com/awakenedredstone/neoskies/data/SkylandComponents.java b/src/main/java/com/awakenedredstone/neoskies/data/SkylandComponents.java index 06d58bf..a8f925b 100644 --- a/src/main/java/com/awakenedredstone/neoskies/data/SkylandComponents.java +++ b/src/main/java/com/awakenedredstone/neoskies/data/SkylandComponents.java @@ -1,14 +1,14 @@ package com.awakenedredstone.neoskies.data; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import org.ladysnake.cca.api.v3.component.ComponentKey; import org.ladysnake.cca.api.v3.component.ComponentRegistryV3; import org.ladysnake.cca.api.v3.world.WorldComponentFactoryRegistry; import org.ladysnake.cca.api.v3.world.WorldComponentInitializer; public class SkylandComponents implements WorldComponentInitializer/*, EntityComponentInitializer*/ { - public static final ComponentKey WORLD_DATA = ComponentRegistryV3.INSTANCE.getOrCreate(SkylandsMain.id("world_data"), WorldComponent.class); - //public static final ComponentKey PLAYER_DATA = ComponentRegistryV3.INSTANCE.getOrCreate(SkylandsMain.id("player_data"), PlayerComponent.class); + public static final ComponentKey WORLD_DATA = ComponentRegistryV3.INSTANCE.getOrCreate(NeoSkies.id("world_data"), WorldComponent.class); + //public static final ComponentKey PLAYER_DATA = ComponentRegistryV3.INSTANCE.getOrCreate(NeoSkies.id("player_data"), PlayerComponent.class); @Override public void registerWorldComponentFactories(WorldComponentFactoryRegistry registry) { diff --git a/src/main/java/com/awakenedredstone/neoskies/data/WorldComponent.java b/src/main/java/com/awakenedredstone/neoskies/data/WorldComponent.java index f19a851..e74adbc 100644 --- a/src/main/java/com/awakenedredstone/neoskies/data/WorldComponent.java +++ b/src/main/java/com/awakenedredstone/neoskies/data/WorldComponent.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.data; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; import net.minecraft.world.World; @@ -12,14 +12,14 @@ public record WorldComponent(World world) implements ComponentV3 { @Override public void readFromNbt(@NotNull NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { if (world.getRegistryKey().equals(World.OVERWORLD)) { - Skylands.getInstance().readFromNbt(nbt); + IslandLogic.getInstance().readFromNbt(nbt); } } @Override public void writeToNbt(@NotNull NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { if (world.getRegistryKey().equals(World.OVERWORLD)) { - Skylands.getInstance().writeToNbt(nbt); + IslandLogic.getInstance().writeToNbt(nbt); } } } diff --git a/src/main/java/com/awakenedredstone/neoskies/event/PlayerConnectEvent.java b/src/main/java/com/awakenedredstone/neoskies/event/PlayerConnectEvent.java index 18f53e8..900ad2a 100644 --- a/src/main/java/com/awakenedredstone/neoskies/event/PlayerConnectEvent.java +++ b/src/main/java/com/awakenedredstone/neoskies/event/PlayerConnectEvent.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.event; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Member; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.Texts; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; @@ -11,9 +11,9 @@ public class PlayerConnectEvent { public static void onJoin(MinecraftServer server, ServerPlayerEntity player) { - Skylands.getInstance().islands.getByPlayer(player).ifPresent(island -> island.owner.name = player.getName().getString()); + IslandLogic.getInstance().islands.getByPlayer(player).ifPresent(island -> island.owner.name = player.getName().getString()); - Skylands.getInstance().islands.stuck.forEach(island -> { + IslandLogic.getInstance().islands.stuck.forEach(island -> { for (Member member : island.members) { if (member.uuid.equals(player.getUuid())) { member.name = player.getName().getString(); @@ -26,10 +26,10 @@ public static void onJoin(MinecraftServer server, ServerPlayerEntity player) { } }); - SkylandsAPI.getIsland(player.getWorld()).ifPresent(island -> { + NeoSkiesAPI.getIsland(player.getWorld()).ifPresent(island -> { if (!island.isMember(player) && island.isBanned(player)) { player.sendMessage(Texts.prefixed("message.neoskies.ban_player.ban", map -> map.put("owner", island.owner.name))); - Skylands.getInstance().hub.visit(player); + IslandLogic.getInstance().hub.visit(player); } }); } diff --git a/src/main/java/com/awakenedredstone/neoskies/event/ServerEventListener.java b/src/main/java/com/awakenedredstone/neoskies/event/ServerEventListener.java index 8623dc3..73177de 100644 --- a/src/main/java/com/awakenedredstone/neoskies/event/ServerEventListener.java +++ b/src/main/java/com/awakenedredstone/neoskies/event/ServerEventListener.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.event; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.PreInitData; import com.awakenedredstone.neoskies.util.Texts; import eu.pb4.common.economy.api.CommonEconomy; @@ -17,18 +17,18 @@ public class ServerEventListener { public static void onTick(MinecraftServer server) { - Skylands.getInstance().onTick(server); + IslandLogic.getInstance().onTick(server); } public static void onStart(MinecraftServer server) { - Skylands.init(server); + IslandLogic.init(server); PreInitData.close(); - CommonEconomy.register("neoskies", Skylands.getInstance().economy.PROVIDER); + CommonEconomy.register("neoskies", IslandLogic.getInstance().economy.PROVIDER); registerPlaceholders(); } public static void onStop(MinecraftServer server) { - Skylands.getInstance().close(); + IslandLogic.getInstance().close(); } //TODO: Add placeholders @@ -36,49 +36,49 @@ private static void registerPlaceholders() { String missing = Texts.of("neoskies.island.placeholders.missing_island").getString(); PlaceholderResult invalid = PlaceholderResult.invalid(missing); - Placeholders.register(SkylandsMain.id("locked"), (context, argument) -> { - Optional island = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("locked"), (context, argument) -> { + Optional island = IslandLogic.getInstance().islands.getByPlayer(context.player()); return island.map(value -> PlaceholderResult.value(value.locked ? "Locked" : "Open")).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("size"), (context, argument) -> { - Optional island = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("size"), (context, argument) -> { + Optional island = IslandLogic.getInstance().islands.getByPlayer(context.player()); return island.map(value -> PlaceholderResult.value(String.valueOf(value.radius * 2 + 1))).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("id"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("id"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(island.getIslandId().toString())).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("owner"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("owner"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(island.owner.name)).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("scanning"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("scanning"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(Texts.of(island.isScanning() ? "neoskies.island.scanning" : "neoskies.island.not_scanning"))).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("raw/scanning"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("raw/scanning"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(String.valueOf(island.isScanning()))).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("creation_date"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("creation_date"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy").withZone(ZoneId.systemDefault()); return islandOptional.map(island -> PlaceholderResult.value(formatter.format(island.getCreated()))).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("wallet"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("wallet"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(island.getWallet().formattedBalance())).orElse(invalid); }); - Placeholders.register(SkylandsMain.id("points"), (context, argument) -> { - Optional islandOptional = Skylands.getInstance().islands.getByPlayer(context.player()); + Placeholders.register(NeoSkies.id("points"), (context, argument) -> { + Optional islandOptional = IslandLogic.getInstance().islands.getByPlayer(context.player()); return islandOptional.map(island -> PlaceholderResult.value(String.valueOf(island.getPoints()))).orElse(invalid); }); } diff --git a/src/main/java/com/awakenedredstone/neoskies/font/FontManager.java b/src/main/java/com/awakenedredstone/neoskies/font/FontManager.java index 56ee767..08d5692 100644 --- a/src/main/java/com/awakenedredstone/neoskies/font/FontManager.java +++ b/src/main/java/com/awakenedredstone/neoskies/font/FontManager.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.font; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.util.PreInitData; import com.google.gson.JsonElement; import com.mojang.serialization.JsonOps; @@ -32,7 +32,7 @@ public static void init() { @Override public Identifier getFabricId() { - return SkylandsMain.id("fonts"); + return NeoSkies.id("fonts"); } @Override @@ -41,9 +41,9 @@ public void reload(ResourceManager manager) { if (PreInitData.open()) PreInitData.getInstance().setResourceManager(manager); for (Identifier id : manager.findResources("font", path -> path.getPath().endsWith(".glyphs.json")).keySet()) { try (InputStream stream = manager.getResource(id).get().getInputStream(); Reader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) { - fontProviders = FontProvider.LIST_CODEC.parse(JsonOps.INSTANCE, SkylandsMain.GSON.fromJson(reader, JsonElement.class)).resultOrPartial(SkylandsMain.LOGGER::error).orElseThrow(); + fontProviders = FontProvider.LIST_CODEC.parse(JsonOps.INSTANCE, NeoSkies.GSON.fromJson(reader, JsonElement.class)).resultOrPartial(NeoSkies.LOGGER::error).orElseThrow(); } catch (Exception e) { - SkylandsMain.LOGGER.error("Error occurred while loading the fonts data for " + id.toString(), e); + NeoSkies.LOGGER.error("Error occurred while loading the fonts data for " + id.toString(), e); } } } diff --git a/src/main/java/com/awakenedredstone/neoskies/font/FontProvider.java b/src/main/java/com/awakenedredstone/neoskies/font/FontProvider.java index 64c1011..5b3660e 100644 --- a/src/main/java/com/awakenedredstone/neoskies/font/FontProvider.java +++ b/src/main/java/com/awakenedredstone/neoskies/font/FontProvider.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.font; -import com.awakenedredstone.neoskies.SkylandsMain; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.NeoSkies; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.util.Identifier; @@ -44,11 +44,11 @@ public FontProvider(String type, @Nullable Map advances, @Nulla this.chars = chars; if (StringUtils.isNotBlank(sizes)) { - try (InputStream inputStream = Skylands.getResourceManager().open(Identifier.tryParse(this.sizes))) { + try (InputStream inputStream = IslandLogic.getResourceManager().open(Identifier.tryParse(this.sizes))) { fontSizes = inputStream.readNBytes(65536); } catch (IOException e) { - SkylandsMain.LOGGER.error("Cannot load {}, unicode glyphs may not be calcualted correctly", sizes); - SkylandsMain.LOGGER.error("Failed to load font sizes", e); + NeoSkies.LOGGER.error("Cannot load {}, unicode glyphs may not be calcualted correctly", sizes); + NeoSkies.LOGGER.error("Failed to load font sizes", e); } } this.glyphSizes = fontSizes; diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/SkylandsEventListeners.java b/src/main/java/com/awakenedredstone/neoskies/logic/EventListeners.java similarity index 95% rename from src/main/java/com/awakenedredstone/neoskies/logic/SkylandsEventListeners.java rename to src/main/java/com/awakenedredstone/neoskies/logic/EventListeners.java index e4a7cad..0653993 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/SkylandsEventListeners.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/EventListeners.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.event.GenericEntityDamageEvent; import com.awakenedredstone.neoskies.event.PlayerConnectEvent; import com.awakenedredstone.neoskies.event.PlayerEvents; @@ -36,7 +36,7 @@ import java.util.Map; -public class SkylandsEventListeners { +public class EventListeners { public static void registerEvents() { ServerLifecycleEvents.SERVER_STARTING.register(ServerEventListener::onStart); ServerLifecycleEvents.SERVER_STOPPED.register(ServerEventListener::onStop); @@ -45,9 +45,9 @@ public static void registerEvents() { ServerPlayConnectionEvents.DISCONNECT.register((handler, server) -> PlayerConnectEvent.onLeave(server, handler.player)); PlayerEvents.TICK.register(player -> { - if (player.getY() < player.getWorld().getBottomY() - Skylands.getConfig().safeVoidBlocksBelow) { - if ((Skylands.getConfig().safeVoid && SkylandsAPI.getIsland(player.getWorld()).isPresent()) || SkylandsAPI.isHub(player.getWorld())) { - player.server.execute(() -> Worlds.returnToIslandSpawn(player, Skylands.getConfig().safeVoidFallDamage || !SkylandsAPI.isHub(player.getWorld()))); + if (player.getY() < player.getWorld().getBottomY() - IslandLogic.getConfig().safeVoidBlocksBelow) { + if ((IslandLogic.getConfig().safeVoid && NeoSkiesAPI.getIsland(player.getWorld()).isPresent()) || NeoSkiesAPI.isHub(player.getWorld())) { + player.server.execute(() -> Worlds.returnToIslandSpawn(player, IslandLogic.getConfig().safeVoidFallDamage || !NeoSkiesAPI.isHub(player.getWorld()))); } } }); @@ -113,7 +113,7 @@ public static void registerEvents() { return ActionResult.PASS; }); - Stimuli.global().listen(GenericEntityDamageEvent.EVENT, SkylandsEventListeners::onEntityDamage); + Stimuli.global().listen(GenericEntityDamageEvent.EVENT, EventListeners::onEntityDamage); Stimuli.global().listen(EntityShearEvent.EVENT, (entity, player, hand, pos) -> { if (!WorldProtection.canModify(player.getWorld(), pos, player, NeoSkiesIslandSettings.SHEAR_ENTITY)) { diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/Hub.java b/src/main/java/com/awakenedredstone/neoskies/logic/Hub.java index 8bff5a0..cc5893b 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/Hub.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/Hub.java @@ -19,7 +19,7 @@ public void visit(PlayerEntity player) { } public void visit(PlayerEntity player, boolean silent) { - var world = Skylands.getServer().getOverworld(); + var world = IslandLogic.getServer().getOverworld(); if (!silent) player.sendMessage(Texts.prefixed("message.neoskies.hub_visit")); FabricDimensions.teleport(player, world, new TeleportTarget(this.pos, new Vec3d(0, 0, 0), 0, 0)); IslandEvents.ON_HUB_VISIT.invoker().invoke(player, world); @@ -35,7 +35,7 @@ public void positionInto(ServerPlayerEntity player) { /*public void initSongPlayer(MinecraftServer server) { PositionSongPlayer sp = new PositionSongPlayer(SongsData.INSTANCE.playlist, server.getOverworld()); sp.setDistance(256); - sp.setId(SkylandsMain.id("hub_song_player")); + sp.setId(NeoSkies.id("hub_song_player")); sp.setBlockPos(BlockPos.ofFloored(pos)); this.songPlayer = sp; }*/ diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/Island.java b/src/main/java/com/awakenedredstone/neoskies/logic/Island.java index 1231767..bea441b 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/Island.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/Island.java @@ -1,11 +1,11 @@ package com.awakenedredstone.neoskies.logic; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.api.events.IslandEvents; import com.awakenedredstone.neoskies.api.island.CurrentSettings; import com.awakenedredstone.neoskies.api.island.PermissionLevel; -import com.awakenedredstone.neoskies.logic.economy.SkylandsEconomyAccount; -import com.awakenedredstone.neoskies.logic.registry.SkylandsRegistries; +import com.awakenedredstone.neoskies.logic.economy.NeoSkiesEconomyAccount; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesRegistries; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import com.awakenedredstone.neoskies.logic.settings.IslandSettingsUtil; import com.awakenedredstone.neoskies.util.Constants; @@ -42,7 +42,7 @@ //TODO: Island levels //TODO: Advanced island settings public class Island { - protected final Fantasy fantasy = Skylands.getInstance().fantasy; + protected final Fantasy fantasy = IslandLogic.getInstance().fantasy; protected final Map settings = new HashMap<>(); public final Member owner; private UUID islandId = UUID.randomUUID(); @@ -51,13 +51,13 @@ public class Island { protected RuntimeWorldConfig endConfig = null; public final List members = new ArrayList<>(); public final List bans = new ArrayList<>(); - public int radius = Skylands.getConfig().defaultIslandRadius; + public int radius = IslandLogic.getConfig().defaultIslandRadius; private EconomyAccount wallet; boolean freshCreated = false; public boolean locked = false; - public Vec3d spawnPos = Skylands.getConfig().defaultIslandLocation; - public Vec3d visitsPos = Skylands.getConfig().defaultIslandLocation; + public Vec3d spawnPos = IslandLogic.getConfig().defaultIslandLocation; + public Vec3d visitsPos = IslandLogic.getConfig().defaultIslandLocation; //TODO: not store hundreds of blocks in memory protected Map blocks = new LinkedHashMap<>(); private long points = 0; @@ -78,8 +78,8 @@ public Island(PlayerEntity owner) { public Island(Member owner) { this.owner = owner; - this.wallet = new SkylandsEconomyAccount(islandId, new Identifier(owner.uuid.toString(), islandId.toString())); - Skylands.getInstance().economy.PROVIDER.getAccounts().computeIfAbsent(islandId, id -> wallet); + this.wallet = new NeoSkiesEconomyAccount(islandId, new Identifier(owner.uuid.toString(), islandId.toString())); + IslandLogic.getInstance().economy.PROVIDER.getAccounts().computeIfAbsent(islandId, id -> wallet); } public static Island fromNbt(NbtCompound nbt) { @@ -95,8 +95,8 @@ public static Island fromNbt(NbtCompound nbt) { NbtCompound walletNbt = nbt.getCompound("wallet"); Identifier id = new Identifier(walletNbt.getString("id")); long balance = walletNbt.getLong("balance"); - island.wallet = new SkylandsEconomyAccount(island.islandId, id, balance); - Skylands.getInstance().economy.PROVIDER.getAccounts().computeIfAbsent(island.islandId, id1 -> island.wallet); + island.wallet = new NeoSkiesEconomyAccount(island.islandId, id, balance); + IslandLogic.getInstance().economy.PROVIDER.getAccounts().computeIfAbsent(island.islandId, id1 -> island.wallet); NbtCompound spawnPosNbt = nbt.getCompound("spawnPos"); double spawnPosX = spawnPosNbt.getDouble("x"); @@ -124,7 +124,7 @@ public static Island fromNbt(NbtCompound nbt) { island.bans.add(Member.fromNbt(member)); } - for (IslandSettings islandSetting : SkylandsRegistries.ISLAND_SETTINGS) { + for (IslandSettings islandSetting : NeoSkiesRegistries.ISLAND_SETTINGS) { CurrentSettings currentSettings = new CurrentSettings(islandSetting, islandSetting.getDefaultLevel()); island.settings.put(islandSetting.getIdentifier(), currentSettings); } @@ -134,7 +134,7 @@ public static Island fromNbt(NbtCompound nbt) { Identifier identifier = new Identifier(key); NbtCompound settingsDataNbt = settingsNbt.getCompound(key); PermissionLevel level = PermissionLevel.fromValue(settingsDataNbt.getString("permission")); - IslandSettings islandSettings = SkylandsRegistries.ISLAND_SETTINGS.get(identifier); + IslandSettings islandSettings = NeoSkiesRegistries.ISLAND_SETTINGS.get(identifier); if (level != null) { CurrentSettings currentSettings = new CurrentSettings(islandSettings, level); island.settings.put(identifier, currentSettings); @@ -199,7 +199,7 @@ public NbtCompound toNbt() { } nbt.put("bans", bansNbt); - for (IslandSettings islandSetting : SkylandsRegistries.ISLAND_SETTINGS) { + for (IslandSettings islandSetting : NeoSkiesRegistries.ISLAND_SETTINGS) { CurrentSettings currentSettings = new CurrentSettings(islandSetting, islandSetting.getDefaultLevel()); this.settings.put(islandSetting.getIdentifier(), currentSettings); } @@ -308,11 +308,11 @@ public RuntimeWorldHandle getOverworldHandler() { if (this.islandConfig == null) { this.islandConfig = createIslandConfig(); } - return this.fantasy.getOrOpenPersistentWorld(SkylandsMain.id(this.owner.uuid.toString()), this.islandConfig); + return this.fantasy.getOrOpenPersistentWorld(NeoSkies.id(this.owner.uuid.toString()), this.islandConfig); } private RuntimeWorldConfig createIslandConfig() { - var biome = Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.PLAINS)); + var biome = IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.PLAINS)); FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), biome, List.of()); FlatChunkGenerator generator = new FlatChunkGenerator(flat); @@ -333,7 +333,7 @@ public RuntimeWorldHandle getNetherHandler() { } private RuntimeWorldConfig createNetherConfig() { - var biome = Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.NETHER_WASTES)); + var biome = IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.NETHER_WASTES)); FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), biome, List.of()); FlatChunkGenerator generator = new FlatChunkGenerator(flat); @@ -353,7 +353,7 @@ public RuntimeWorldHandle getEndHandler() { } private RuntimeWorldConfig createEndConfig() { - var biome = Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(Skylands.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.THE_END)); + var biome = IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getEntry(IslandLogic.getServer().getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.THE_END)); FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), biome, List.of()); FlatChunkGenerator generator = new FlatChunkGenerator(flat); @@ -391,7 +391,7 @@ public void updateBlocks(@Nullable LinkedHashMap blocks) { if (blocks != null) this.blocks = blocks; this.points = 0; this.blocks.forEach((block, integer) -> { - Integer points = Skylands.getConfig().blockPoints.getOrDefault(block, 1); + Integer points = IslandLogic.getConfig().blockPoints.getOrDefault(block, 1); this.points += (long) integer * points; }); } @@ -426,7 +426,7 @@ public void visitAsVisitor(PlayerEntity player) { public void onFirstLoad(PlayerEntity player) { ServerWorld world = this.getOverworld(); - StructureTemplate structure = Skylands.getServer().getStructureTemplateManager().getTemplateOrBlank(SkylandsMain.id("start_island")); + StructureTemplate structure = IslandLogic.getServer().getStructureTemplateManager().getTemplateOrBlank(NeoSkies.id("start_island")); StructurePlacementData data = new StructurePlacementData().setMirror(BlockMirror.NONE).setIgnoreEntities(true); structure.place(world, new BlockPos(-7, 65, -7), new BlockPos(0, 0, 0), data, world.getRandom(), Block.NOTIFY_ALL); IslandEvents.ON_ISLAND_FIRST_LOAD.invoker().invoke(player, world, this); @@ -437,7 +437,7 @@ void onFirstNetherLoad(ServerWorld world) { MinecraftServer server = world.getServer(); - StructureTemplate structure = server.getStructureTemplateManager().getTemplateOrBlank(SkylandsMain.id("nether_island")); + StructureTemplate structure = server.getStructureTemplateManager().getTemplateOrBlank(NeoSkies.id("nether_island")); StructurePlacementData data = new StructurePlacementData().setMirror(BlockMirror.NONE).setIgnoreEntities(true); structure.place(world, new BlockPos(-7, 65, -7), new BlockPos(0, 0, 0), data, world.getRandom(), Block.NOTIFY_ALL); IslandEvents.ON_NETHER_FIRST_LOAD.invoker().onLoad(world, this); @@ -450,7 +450,7 @@ void onFirstEndLoad(ServerWorld world) { MinecraftServer server = world.getServer(); - StructureTemplate structure = server.getStructureTemplateManager().getTemplateOrBlank(SkylandsMain.id("end_island")); + StructureTemplate structure = server.getStructureTemplateManager().getTemplateOrBlank(NeoSkies.id("end_island")); StructurePlacementData data = new StructurePlacementData().setMirror(BlockMirror.NONE).setIgnoreEntities(true); structure.place(world, new BlockPos(-7, 65, -7), new BlockPos(0, 0, 0), data, world.getRandom(), Block.NOTIFY_ALL); IslandEvents.ON_END_FIRST_LOAD.invoker().onLoad(world, this); @@ -464,7 +464,7 @@ public Identifier getIslandIdentifier() { public EconomyAccount getWallet() { if (wallet == null) { - wallet = new SkylandsEconomyAccount(islandId, new Identifier(owner.uuid.toString(), islandId.toString())); + wallet = new NeoSkiesEconomyAccount(islandId, new Identifier(owner.uuid.toString(), islandId.toString())); } return wallet; } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/Skylands.java b/src/main/java/com/awakenedredstone/neoskies/logic/IslandLogic.java similarity index 62% rename from src/main/java/com/awakenedredstone/neoskies/logic/Skylands.java rename to src/main/java/com/awakenedredstone/neoskies/logic/IslandLogic.java index 83adf18..a2aa658 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/Skylands.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/IslandLogic.java @@ -1,10 +1,10 @@ package com.awakenedredstone.neoskies.logic; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.config.IslandRanking; import com.awakenedredstone.neoskies.config.MainConfig; import com.awakenedredstone.neoskies.logic.economy.Economy; -import com.awakenedredstone.neoskies.logic.protection.SkylandsProtectionProvider; +import com.awakenedredstone.neoskies.logic.protection.NeoSkiesProtectionProvider; import com.awakenedredstone.neoskies.util.NbtMigrator; import com.awakenedredstone.neoskies.util.PreInitData; import com.awakenedredstone.neoskies.util.Scheduler; @@ -14,9 +14,9 @@ import net.minecraft.server.MinecraftServer; import xyz.nucleoid.fantasy.Fantasy; -public class Skylands { +public class IslandLogic { private int format = 1; - private static Skylands instance; + private static IslandLogic instance; private final MinecraftServer server; public final Fantasy fantasy; public final IslandStuck islands; @@ -24,11 +24,11 @@ public class Skylands { public final Invites invites; public final Economy economy; public final Scheduler scheduler; - private final SkylandsProtectionProvider protectionProvider; + private final NeoSkiesProtectionProvider protectionProvider; private static final MainConfig CONFIG = new MainConfig(); private static final IslandRanking RANKING_CONFIG = new IslandRanking(); - public Skylands(MinecraftServer server) { + public IslandLogic(MinecraftServer server) { this.scheduler = new Scheduler(); this.server = server; this.fantasy = Fantasy.get(server); @@ -36,11 +36,11 @@ public Skylands(MinecraftServer server) { this.hub = new Hub(); this.invites = new Invites(); this.economy = new Economy(); - this. protectionProvider = new SkylandsProtectionProvider(); - CommonProtection.register(SkylandsMain.id("neoskies"), protectionProvider); + this. protectionProvider = new NeoSkiesProtectionProvider(); + CommonProtection.register(NeoSkies.id("neoskies"), protectionProvider); } - public static Skylands getInstance() { + public static IslandLogic getInstance() { return instance; } @@ -49,30 +49,30 @@ public int getFormat() { } public void readFromNbt(NbtCompound nbt) { - NbtCompound skylandsNbt = nbt.getCompound("neoskies"); - if (skylandsNbt.isEmpty()) return; + NbtCompound neoskiesNbt = nbt.getCompound("neoskies"); + if (neoskiesNbt.isEmpty()) return; - NbtMigrator.update(skylandsNbt); + NbtMigrator.update(neoskiesNbt); - this.format = skylandsNbt.getInt("format"); - this.hub.readFromNbt(skylandsNbt); - this.islands.readFromNbt(skylandsNbt); + this.format = neoskiesNbt.getInt("format"); + this.hub.readFromNbt(neoskiesNbt); + this.islands.readFromNbt(neoskiesNbt); } public void writeToNbt(NbtCompound nbt) { - NbtCompound skylandsNbt = new NbtCompound(); + NbtCompound neoskiesNbt = new NbtCompound(); - skylandsNbt.putInt("format", this.format); - this.islands.writeToNbt(skylandsNbt); - this.hub.writeToNbt(skylandsNbt); + neoskiesNbt.putInt("format", this.format); + this.islands.writeToNbt(neoskiesNbt); + this.hub.writeToNbt(neoskiesNbt); - nbt.put("neoskies", skylandsNbt); + nbt.put("neoskies", neoskiesNbt); } //Lock the instance so noone can possibly change it public static void init(MinecraftServer server) { - if (Skylands.instance != null) throw new IllegalStateException("Skylands already has been initialized!"); - Skylands.instance = new Skylands(server); + if (IslandLogic.instance != null) throw new IllegalStateException("NeoSkies already has been initialized!"); + IslandLogic.instance = new IslandLogic(server); } public void onTick(MinecraftServer server) { @@ -81,9 +81,9 @@ public void onTick(MinecraftServer server) { } public void close() { - Skylands.instance = null; + IslandLogic.instance = null; this.scheduler.close(); - CommonProtection.remove(SkylandsMain.id("neoskies")); + CommonProtection.remove(NeoSkies.id("neoskies")); } public static MinecraftServer getServer() { @@ -95,7 +95,7 @@ public static Scheduler getScheduler() { } public static ResourceManager getResourceManager() { - return instance == null ? PreInitData.getInstance().getResourceManager() : Skylands.getServer().getResourceManager(); + return instance == null ? PreInitData.getInstance().getResourceManager() : IslandLogic.getServer().getResourceManager(); } public static MainConfig getConfig() { @@ -107,6 +107,6 @@ public static IslandRanking getRankingConfig() { } public static void syncWithTick(Runnable runnable) { - Skylands.getScheduler().schedule(0, runnable); + IslandLogic.getScheduler().schedule(0, runnable); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/IslandStuck.java b/src/main/java/com/awakenedredstone/neoskies/logic/IslandStuck.java index bcf90ec..60a1f79 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/IslandStuck.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/IslandStuck.java @@ -26,7 +26,7 @@ public Island create(PlayerEntity player) { } public void delete(Island island) { - MinecraftServer server = Skylands.getServer(); + MinecraftServer server = IslandLogic.getServer(); island.getOverworldHandler().delete(); island.getNetherHandler().delete(); @@ -41,22 +41,22 @@ public void delete(Island island) { } }); - if (Skylands.getConfig().resetPlayerWithIsland) { + if (IslandLogic.getConfig().resetPlayerWithIsland) { Member owner = island.owner; deletePlayer(owner); island.members.forEach(this::deletePlayer); } - island.getOverworld().getPlayers().forEach(player -> Skylands.syncWithTick(() -> Skylands.getInstance().hub.visit(player, true))); - island.getNether().getPlayers().forEach(player -> Skylands.syncWithTick(() -> Skylands.getInstance().hub.visit(player, true))); - island.getEnd().getPlayers().forEach(player -> Skylands.syncWithTick(() -> Skylands.getInstance().hub.visit(player, true))); + island.getOverworld().getPlayers().forEach(player -> IslandLogic.syncWithTick(() -> IslandLogic.getInstance().hub.visit(player, true))); + island.getNether().getPlayers().forEach(player -> IslandLogic.syncWithTick(() -> IslandLogic.getInstance().hub.visit(player, true))); + island.getEnd().getPlayers().forEach(player -> IslandLogic.syncWithTick(() -> IslandLogic.getInstance().hub.visit(player, true))); stuck.remove(island); } private void deletePlayer(Member member) { - MinecraftServer server = Skylands.getServer(); + MinecraftServer server = IslandLogic.getServer(); PlayerManager playerManager = server.getPlayerManager(); Path playerDataDir = server.saveHandler.playerDataDir.toPath(); @@ -66,7 +66,7 @@ private void deletePlayer(Member member) { ServerPlayerEntity newPlayer = ((ExtendedPlayerManager) playerManager).resetPlayer(player); player.networkHandler.player = newPlayer; server.saveHandler.savePlayerData(newPlayer); - Skylands.getInstance().hub.visit(newPlayer, true); + IslandLogic.getInstance().hub.visit(newPlayer, true); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/economy/Economy.java b/src/main/java/com/awakenedredstone/neoskies/logic/economy/Economy.java index 8257284..1cb48b1 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/economy/Economy.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/economy/Economy.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.economy; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import eu.pb4.common.economy.api.CommonEconomy; import eu.pb4.common.economy.api.EconomyCurrency; import net.minecraft.util.Identifier; @@ -10,6 +10,6 @@ public Economy() { CommonEconomy.register("skycoin", this.PROVIDER); } - public final SkylandsEconomyProvider PROVIDER = new SkylandsEconomyProvider(); - public final EconomyCurrency CURRENCY = new SkylandsEconomyCurrency(new Identifier(SkylandsMain.MOD_ID, "sky_coin")); + public final NeoSkiesEconomyProvider PROVIDER = new NeoSkiesEconomyProvider(); + public final EconomyCurrency CURRENCY = new NeoSkiesEconomyCurrency(new Identifier(NeoSkies.MOD_ID, "sky_coin")); } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyAccount.java b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyAccount.java similarity index 85% rename from src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyAccount.java rename to src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyAccount.java index 6f9772c..a647963 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyAccount.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyAccount.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.economy; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import eu.pb4.common.economy.api.EconomyAccount; import eu.pb4.common.economy.api.EconomyCurrency; import eu.pb4.common.economy.api.EconomyProvider; @@ -11,16 +11,16 @@ import java.math.BigInteger; import java.util.UUID; -public class SkylandsEconomyAccount implements EconomyAccount { +public class NeoSkiesEconomyAccount implements EconomyAccount { private final UUID islandUuid; private final Identifier id; private long balance; - public SkylandsEconomyAccount(UUID islandUuid, Identifier id) { + public NeoSkiesEconomyAccount(UUID islandUuid, Identifier id) { this(islandUuid, id, 0); } - public SkylandsEconomyAccount(UUID islandUuid, Identifier id, long balance) { + public NeoSkiesEconomyAccount(UUID islandUuid, Identifier id, long balance) { this.islandUuid = islandUuid; this.id = id; this.balance = balance; @@ -64,12 +64,12 @@ public void setBalance(long value) { @Override public EconomyProvider provider() { - return Skylands.getInstance().economy.PROVIDER; + return IslandLogic.getInstance().economy.PROVIDER; } @Override public EconomyCurrency currency() { - return Skylands.getInstance().economy.CURRENCY; + return IslandLogic.getInstance().economy.CURRENCY; } private EconomyTransaction failure(long transactionAmount) { diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyCurrency.java b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyCurrency.java similarity index 79% rename from src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyCurrency.java rename to src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyCurrency.java index a5d6f8b..cbae216 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyCurrency.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyCurrency.java @@ -1,16 +1,16 @@ package com.awakenedredstone.neoskies.logic.economy; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import eu.pb4.common.economy.api.EconomyCurrency; import eu.pb4.common.economy.api.EconomyProvider; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @SuppressWarnings("ClassCanBeRecord") -public class SkylandsEconomyCurrency implements EconomyCurrency { +public class NeoSkiesEconomyCurrency implements EconomyCurrency { private final Identifier id; - public SkylandsEconomyCurrency(Identifier id) { + public NeoSkiesEconomyCurrency(Identifier id) { this.id = id; } @@ -37,6 +37,6 @@ public long parseValue(String value) throws NumberFormatException { @Override public EconomyProvider provider() { - return Skylands.getInstance().economy.PROVIDER; + return IslandLogic.getInstance().economy.PROVIDER; } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyProvider.java b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyProvider.java similarity index 79% rename from src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyProvider.java rename to src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyProvider.java index e40fa0b..c2d5006 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/economy/SkylandsEconomyProvider.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/economy/NeoSkiesEconomyProvider.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.logic.economy; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.mojang.authlib.GameProfile; import eu.pb4.common.economy.api.EconomyAccount; import eu.pb4.common.economy.api.EconomyCurrency; @@ -13,7 +13,7 @@ import java.util.*; -public class SkylandsEconomyProvider implements EconomyProvider { +public class NeoSkiesEconomyProvider implements EconomyProvider { private final Map accounts = new HashMap<>(); @Override @@ -27,7 +27,7 @@ public Map getAccounts() { @Override public @Nullable EconomyAccount getAccount(MinecraftServer server, GameProfile profile, String accountId) { - Optional islandOptional = SkylandsAPI.getIsland(profile.getId()); + Optional islandOptional = NeoSkiesAPI.getIsland(profile.getId()); if (islandOptional.isPresent()) { Island island = islandOptional.get(); return getAccountFromIsland(island); @@ -38,7 +38,7 @@ public Map getAccounts() { @Override public Collection getAccounts(MinecraftServer server, GameProfile profile) { - Optional islandOptional = SkylandsAPI.getIslandByPlayer(profile.getId()); + Optional islandOptional = NeoSkiesAPI.getIslandByPlayer(profile.getId()); if (islandOptional.isPresent()) { Island island = islandOptional.get(); return Collections.singleton(getAccountFromIsland(island)); @@ -49,17 +49,17 @@ public Collection getAccounts(MinecraftServer server, GameProfil @Override public @Nullable EconomyCurrency getCurrency(MinecraftServer server, String currencyId) { - return Skylands.getInstance().economy.CURRENCY; + return IslandLogic.getInstance().economy.CURRENCY; } @Override public Collection getCurrencies(MinecraftServer server) { - return Collections.singleton(Skylands.getInstance().economy.CURRENCY); + return Collections.singleton(IslandLogic.getInstance().economy.CURRENCY); } @Override public @Nullable String defaultAccount(MinecraftServer server, GameProfile profile, EconomyCurrency currency) { - Optional islandOptional = SkylandsAPI.getIsland(profile.getId()); + Optional islandOptional = NeoSkiesAPI.getIsland(profile.getId()); if (islandOptional.isPresent()) { Island island = islandOptional.get(); return island.getIslandIdentifier().toString(); @@ -69,6 +69,6 @@ public Collection getCurrencies(MinecraftServer server) { } private EconomyAccount getAccountFromIsland(Island island) { - return accounts.computeIfAbsent(island.getIslandId(), pair -> new SkylandsEconomyAccount(island.getIslandId(), island.getIslandIdentifier())); + return accounts.computeIfAbsent(island.getIslandId(), pair -> new NeoSkiesEconomyAccount(island.getIslandId(), island.getIslandIdentifier())); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/protection/SkylandsProtectionProvider.java b/src/main/java/com/awakenedredstone/neoskies/logic/protection/NeoSkiesProtectionProvider.java similarity index 93% rename from src/main/java/com/awakenedredstone/neoskies/logic/protection/SkylandsProtectionProvider.java rename to src/main/java/com/awakenedredstone/neoskies/logic/protection/NeoSkiesProtectionProvider.java index 1022338..bdb6883 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/protection/SkylandsProtectionProvider.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/protection/NeoSkiesProtectionProvider.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.protection; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.registry.NeoSkiesIslandSettings; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import com.awakenedredstone.neoskies.util.WorldProtection; @@ -19,15 +19,15 @@ import java.util.Map; -public class SkylandsProtectionProvider implements ProtectionProvider { +public class NeoSkiesProtectionProvider implements ProtectionProvider { @Override public boolean isProtected(World world, BlockPos pos) { - return SkylandsAPI.isProtectedArea(world); + return NeoSkiesAPI.isProtectedArea(world); } @Override public boolean isAreaProtected(World world, Box area) { - return SkylandsAPI.isProtectedArea(world); + return NeoSkiesAPI.isProtectedArea(world); } @Override diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesIslandSettings.java b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesIslandSettings.java index c3032c3..0f0481f 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesIslandSettings.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesIslandSettings.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.registry; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import com.awakenedredstone.neoskies.logic.tags.NeoSkiesBlockTags; import com.awakenedredstone.neoskies.logic.tags.NeoSkiesEntityTags; @@ -126,7 +126,7 @@ public static Map, IslandSettings> getRuleItemTags() { } private static IslandSettings register(String id, Item icon) { - return new IslandSettings(SkylandsMain.id(id), icon); + return new IslandSettings(NeoSkies.id(id), icon); } public static void init() { @@ -141,13 +141,13 @@ public static void init() { if (field.getType() == IslandSettings.class) { settings = (IslandSettings) field.get(null); - SkylandsMain.LOGGER.info("Registering {}", settings.getIdentifier()); - Registry.register(SkylandsRegistries.ISLAND_SETTINGS, settings.getIdentifier(), settings); + NeoSkies.LOGGER.info("Registering {}", settings.getIdentifier()); + Registry.register(NeoSkiesRegistries.ISLAND_SETTINGS, settings.getIdentifier(), settings); } if (!access) field.setAccessible(false); } catch (IllegalAccessException e) { - SkylandsMain.LOGGER.error("Failed to register island settings", e); + NeoSkies.LOGGER.error("Failed to register island settings", e); } } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsPermissionLevels.java b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesPermissionLevels.java similarity index 77% rename from src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsPermissionLevels.java rename to src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesPermissionLevels.java index 1e96f8c..ad79964 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsPermissionLevels.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesPermissionLevels.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.registry; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.api.island.DefaultPermissionLevel; import com.awakenedredstone.neoskies.api.island.PermissionLevel; import net.minecraft.registry.Registry; @@ -8,13 +8,13 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; -public class SkylandsPermissionLevels { +public class NeoSkiesPermissionLevels { public static final PermissionLevel OWNER = new DefaultPermissionLevel(99); public static final PermissionLevel MEMBER = new DefaultPermissionLevel(5); public static final PermissionLevel VISITOR = new DefaultPermissionLevel(0); public static void init() { - Class clazz = SkylandsPermissionLevels.class; + Class clazz = NeoSkiesPermissionLevels.class; PermissionLevel settings; for (Field field : clazz.getDeclaredFields()) { try { @@ -25,12 +25,12 @@ public static void init() { if (field.getType() == PermissionLevel.class) { settings = (PermissionLevel) field.get(null); - Registry.register(SkylandsRegistries.PERMISSION_LEVELS, SkylandsMain.id(field.getName().toLowerCase()), settings); + Registry.register(NeoSkiesRegistries.PERMISSION_LEVELS, NeoSkies.id(field.getName().toLowerCase()), settings); } if (!access) field.setAccessible(false); } catch (IllegalAccessException e) { - SkylandsMain.LOGGER.error("Failed to register island settings", e); + NeoSkies.LOGGER.error("Failed to register island settings", e); } } } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsRegistries.java b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesRegistries.java similarity index 78% rename from src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsRegistries.java rename to src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesRegistries.java index 0ad631e..ff45cbe 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/registry/SkylandsRegistries.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/registry/NeoSkiesRegistries.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.logic.registry; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import com.awakenedredstone.neoskies.api.island.PermissionLevel; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; @@ -8,9 +8,9 @@ import net.minecraft.registry.SimpleRegistry; import net.minecraft.util.Identifier; -public class SkylandsRegistries { - public static final SimpleRegistry ISLAND_SETTINGS = createRegistry(SkylandsMain.id("island_settings")); - public static final SimpleRegistry PERMISSION_LEVELS = createRegistry(SkylandsMain.id("permission_levels")); +public class NeoSkiesRegistries { + public static final SimpleRegistry ISLAND_SETTINGS = createRegistry(NeoSkies.id("island_settings")); + public static final SimpleRegistry PERMISSION_LEVELS = createRegistry(NeoSkies.id("permission_levels")); @SuppressWarnings("unchecked") private static SimpleRegistry createRegistry(Identifier identifier) { diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettings.java b/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettings.java index 1d29f90..0bc970a 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettings.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettings.java @@ -4,8 +4,8 @@ import com.awakenedredstone.neoskies.gui.polymer.CBGuiElement; import com.awakenedredstone.neoskies.gui.polymer.CBGuiElementBuilder; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.registry.SkylandsPermissionLevels; -import com.awakenedredstone.neoskies.logic.registry.SkylandsRegistries; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesPermissionLevels; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesRegistries; import com.awakenedredstone.neoskies.util.MapBuilder; import com.awakenedredstone.neoskies.util.Texts; import net.minecraft.item.Item; @@ -33,7 +33,7 @@ public IslandSettings(Identifier identifier, CBGuiElement icon, PermissionLevel } public IslandSettings(Identifier identifier, CBGuiElement icon) { - this(identifier, icon, SkylandsPermissionLevels.MEMBER); + this(identifier, icon, NeoSkiesPermissionLevels.MEMBER); } public IslandSettings(Identifier identifier, Item icon) { @@ -78,7 +78,7 @@ public List buildLore(Island island) { lore.add(Text.empty()); int value = island.getSettings().get(identifier).getPermissionLevel().getLevel(); List levels = new ArrayList<>(); - for (Map.Entry, PermissionLevel> entry : SkylandsRegistries.PERMISSION_LEVELS.getEntrySet()) { + for (Map.Entry, PermissionLevel> entry : NeoSkiesRegistries.PERMISSION_LEVELS.getEntrySet()) { levels.add(entry.getValue().getLevel()); } if (!levels.contains(value)) levels.add(value); diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettingsUtil.java b/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettingsUtil.java index 2d6abcb..488a721 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettingsUtil.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/settings/IslandSettingsUtil.java @@ -2,7 +2,7 @@ import com.awakenedredstone.neoskies.api.island.CurrentSettings; import com.awakenedredstone.neoskies.api.island.PermissionLevel; -import com.awakenedredstone.neoskies.logic.registry.SkylandsRegistries; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesRegistries; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; @@ -12,7 +12,7 @@ public class IslandSettingsUtil { public static void offsetPermission(CurrentSettings settings, int offset) { int position = 0; - List levels = SkylandsRegistries.PERMISSION_LEVELS.streamEntries().map(RegistryEntry.Reference::value).toList(); + List levels = NeoSkiesRegistries.PERMISSION_LEVELS.streamEntries().map(RegistryEntry.Reference::value).toList(); int length = levels.size(); for (int i = 0; i < length; i++) { if (levels.get(i) == settings.getPermissionLevel()) { @@ -35,7 +35,7 @@ public static void offsetPermission(CurrentSettings settings, int offset) { @Nullable public static CurrentSettings getModifiable(Identifier identifier) { - return getModifiable(SkylandsRegistries.ISLAND_SETTINGS.get(identifier)); + return getModifiable(NeoSkiesRegistries.ISLAND_SETTINGS.get(identifier)); } @Nullable diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesBlockTags.java b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesBlockTags.java index 3530cf7..4c27b91 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesBlockTags.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesBlockTags.java @@ -1,29 +1,29 @@ package com.awakenedredstone.neoskies.logic.tags; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import net.minecraft.block.Block; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; public class NeoSkiesBlockTags { - public static final TagKey ANVIL = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/anvil")); - public static final TagKey BEACON = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/beacon")); - public static final TagKey BREWING_STAND = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/brewing_stand")); - public static final TagKey COMPOSTER = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/composter")); - public static final TagKey CONTAINERS = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/containers")); - public static final TagKey CONTAINERS_WITH_ITEM = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/containers_with_item")); - public static final TagKey DOORS = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/doors")); - public static final TagKey DRAGON_EGG = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/interact/dragon_egg")); - public static final TagKey EXTINGUISHABLE = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/extinguishable")); - public static final TagKey HARVEST = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/harvest")); - public static final TagKey LECTERN = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/lectern")); - public static final TagKey LODESTONE = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/lodestone")); - public static final TagKey OTHERS = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/interact/others")); - public static final TagKey REDSTONE = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/redstone")); - public static final TagKey RESPAWN_ANCHOR = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/respawn_anchor")); - public static final TagKey SPAWNER = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/spawner")); - public static final TagKey SIGNS = TagKey.of(RegistryKeys.BLOCK, SkylandsMain.id("protection/use/signs")); + public static final TagKey ANVIL = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/anvil")); + public static final TagKey BEACON = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/beacon")); + public static final TagKey BREWING_STAND = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/brewing_stand")); + public static final TagKey COMPOSTER = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/composter")); + public static final TagKey CONTAINERS = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/containers")); + public static final TagKey CONTAINERS_WITH_ITEM = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/containers_with_item")); + public static final TagKey DOORS = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/doors")); + public static final TagKey DRAGON_EGG = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/interact/dragon_egg")); + public static final TagKey EXTINGUISHABLE = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/extinguishable")); + public static final TagKey HARVEST = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/harvest")); + public static final TagKey LECTERN = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/lectern")); + public static final TagKey LODESTONE = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/lodestone")); + public static final TagKey OTHERS = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/interact/others")); + public static final TagKey REDSTONE = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/redstone")); + public static final TagKey RESPAWN_ANCHOR = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/respawn_anchor")); + public static final TagKey SPAWNER = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/spawner")); + public static final TagKey SIGNS = TagKey.of(RegistryKeys.BLOCK, NeoSkies.id("protection/use/signs")); public static final TagKey UNWAXED_COPPER_BLOCKS = TagKey.of(RegistryKeys.BLOCK, new Identifier("c", "copper_blocks/unwaxed")); public static final TagKey WAXED_COPPER_BLOCKS = TagKey.of(RegistryKeys.BLOCK, new Identifier("c", "copper_blocks/waxed")); diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesEntityTags.java b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesEntityTags.java index eeaeaf1..182c92e 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesEntityTags.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesEntityTags.java @@ -1,16 +1,16 @@ package com.awakenedredstone.neoskies.logic.tags; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import net.minecraft.entity.EntityType; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; public class NeoSkiesEntityTags { - public static final TagKey> ARMOR_STAND = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/interact/armor_stand")); - public static final TagKey> LEASH_KNOT = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/use/leash_knot")); - public static final TagKey> ITEM_FRAME = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/use/item_frame")); - public static final TagKey> MINECARTS = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/ride/minecarts")); - public static final TagKey> BOATS = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/ride/item_frame")); - public static final TagKey> RIDEABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/ride/rideable")); - public static final TagKey> BREAK = TagKey.of(RegistryKeys.ENTITY_TYPE, SkylandsMain.id("protection/break/block")); + public static final TagKey> ARMOR_STAND = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/interact/armor_stand")); + public static final TagKey> LEASH_KNOT = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/use/leash_knot")); + public static final TagKey> ITEM_FRAME = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/use/item_frame")); + public static final TagKey> MINECARTS = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/ride/minecarts")); + public static final TagKey> BOATS = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/ride/item_frame")); + public static final TagKey> RIDEABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/ride/rideable")); + public static final TagKey> BREAK = TagKey.of(RegistryKeys.ENTITY_TYPE, NeoSkies.id("protection/break/block")); } diff --git a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesItemTags.java b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesItemTags.java index 6d582d9..af49ff6 100644 --- a/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesItemTags.java +++ b/src/main/java/com/awakenedredstone/neoskies/logic/tags/NeoSkiesItemTags.java @@ -1,15 +1,15 @@ package com.awakenedredstone.neoskies.logic.tags; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; import net.minecraft.item.Item; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; public class NeoSkiesItemTags { - public static final TagKey MINECART = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/use/minecart")); - public static final TagKey LEAD = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/lead")); - public static final TagKey PLACE = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/place")); - public static final TagKey CONTAINERS = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/containers")); - public static final TagKey LODESTONE = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/locestone")); - public static final TagKey SPAWNER = TagKey.of(RegistryKeys.ITEM, SkylandsMain.id("protection/spawner")); + public static final TagKey MINECART = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/use/minecart")); + public static final TagKey LEAD = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/lead")); + public static final TagKey PLACE = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/place")); + public static final TagKey CONTAINERS = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/containers")); + public static final TagKey LODESTONE = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/locestone")); + public static final TagKey SPAWNER = TagKey.of(RegistryKeys.ITEM, NeoSkies.id("protection/spawner")); } diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/block/EndPortalBlockMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/block/EndPortalBlockMixin.java index ce44426..2a3892a 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/block/EndPortalBlockMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/block/EndPortalBlockMixin.java @@ -1,8 +1,8 @@ package com.awakenedredstone.neoskies.mixin.block; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import net.minecraft.block.BlockState; import net.minecraft.block.EndPortalBlock; import net.minecraft.entity.Entity; @@ -22,15 +22,15 @@ public class EndPortalBlockMixin { @Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;moveToWorld(Lnet/minecraft/server/world/ServerWorld;)Lnet/minecraft/entity/Entity;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) public void resourceKey(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { - if (SkylandsAPI.isIsland(world)) { - if (!Skylands.getConfig().enableEndIsland) { + if (NeoSkiesAPI.isIsland(world)) { + if (!IslandLogic.getConfig().enableEndIsland) { ci.cancel(); return; } - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { ServerWorld targetWorld; - if (SkylandsAPI.isEnd(world.getRegistryKey())) { + if (NeoSkiesAPI.isEnd(world.getRegistryKey())) { targetWorld = island.get().getOverworld(); } else { targetWorld = island.get().getEnd(); diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/EntityMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/EntityMixin.java index d343204..6a8261f 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/EntityMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/EntityMixin.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.mixin.entity; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; import com.awakenedredstone.neoskies.util.Worlds; import net.minecraft.entity.Entity; @@ -39,14 +39,14 @@ public abstract class EntityMixin { @ModifyVariable(method = "tickPortal", at = @At("STORE"), ordinal = 0) public RegistryKey tickPortal_modifyRegistryKey(RegistryKey instance) { - if (SkylandsAPI.isIsland(world) && !SkylandsAPI.isNether(world.getRegistryKey())) { - Optional island = SkylandsAPI.getIsland(world); + if (NeoSkiesAPI.isIsland(world) && !NeoSkiesAPI.isNether(world.getRegistryKey())) { + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { return island.get().getNether().getRegistryKey(); } } - if (SkylandsAPI.isIsland(world) && SkylandsAPI.isNether(world.getRegistryKey())) { - Optional island = SkylandsAPI.getIsland(world); + if (NeoSkiesAPI.isIsland(world) && NeoSkiesAPI.isNether(world.getRegistryKey())) { + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { return island.get().getOverworld().getRegistryKey(); } @@ -66,8 +66,8 @@ public RegistryKey getTeleportTarget_redirectRegistryKey(World instance) @Inject(method = "getTeleportTarget", at = @At(value = "RETURN", ordinal = 0), cancellable = true) public void fixEndTeleportTarget(ServerWorld destination, CallbackInfoReturnable cir) { - if (SkylandsAPI.isIsland(world)) { - Island island = SkylandsAPI.getIsland(world).get(); + if (NeoSkiesAPI.isIsland(world)) { + Island island = NeoSkiesAPI.getIsland(world).get(); Vec3d spawnPos = island.spawnPos; cir.setReturnValue(new TeleportTarget(spawnPos, getVelocity(), getYaw(), getPitch())); } @@ -76,8 +76,8 @@ public void fixEndTeleportTarget(ServerWorld destination, CallbackInfoReturnable @SuppressWarnings("InvalidInjectorMethodSignature") @Inject(method = "getTeleportTarget", at = @At(value = "RETURN", ordinal = 2), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD) public void teleportProtection(ServerWorld destination, CallbackInfoReturnable cir, boolean bl, WorldBorder worldBorder, double d, BlockPos blockPos2) { - if (SkylandsAPI.isIsland(world)) { - Island island = SkylandsAPI.getIsland(world).get(); + if (NeoSkiesAPI.isIsland(world)) { + Island island = NeoSkiesAPI.getIsland(world).get(); if (!island.isWithinBorder(blockPos2)) { Vec3d spawnPos = island.spawnPos; cir.setReturnValue(new TeleportTarget(spawnPos, getVelocity(), getYaw(), getPitch())); diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/PlayerManagerMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/PlayerManagerMixin.java index d79201c..d076f79 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/PlayerManagerMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/PlayerManagerMixin.java @@ -1,10 +1,10 @@ package com.awakenedredstone.neoskies.mixin.entity; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.duck.ExtendedPlayerManager; import com.awakenedredstone.neoskies.duck.ExtendedServerPlayerEntity; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.llamalad7.mixinextras.sugar.Local; import net.minecraft.advancement.AdvancementProgress; import net.minecraft.entity.Entity; @@ -62,33 +62,33 @@ public abstract class PlayerManagerMixin implements ExtendedPlayerManager { @Inject(method = "onPlayerConnect", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;getWorld(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/server/world/ServerWorld;", shift = At.Shift.BEFORE)) private void loadIsland(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData clientData, CallbackInfo ci, @Local RegistryKey registryKey) { - if (SkylandsAPI.isIsland(registryKey)) { - Optional islandOptional = SkylandsAPI.getIsland(registryKey); + if (NeoSkiesAPI.isIsland(registryKey)) { + Optional islandOptional = NeoSkiesAPI.getIsland(registryKey); if (islandOptional.isPresent()) { Island island = islandOptional.get(); //Load the proper island dimension - if (SkylandsAPI.isOverworld(registryKey)) { + if (NeoSkiesAPI.isOverworld(registryKey)) { LOGGER.debug("Loading overworld for {}", registryKey.getValue()); island.getOverworld(); - } else if (SkylandsAPI.isNether(registryKey)) { + } else if (NeoSkiesAPI.isNether(registryKey)) { LOGGER.debug("Loading nether for {}", registryKey.getValue()); island.getNether(); - } else if (SkylandsAPI.isEnd(registryKey)) { + } else if (NeoSkiesAPI.isEnd(registryKey)) { LOGGER.debug("Loading end for {}", registryKey.getValue()); island.getEnd(); } } else { LOGGER.warn("Unknown island {}, defaulting to hub", registryKey.getValue()); - Skylands.getInstance().hub.positionInto(player); + IslandLogic.getInstance().hub.positionInto(player); } } } @Redirect(method = "respawnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;getSpawnPointPosition()Lnet/minecraft/util/math/BlockPos;")) - private BlockPos skylands$respawnOnIsland(ServerPlayerEntity player) { - if (SkylandsAPI.isIsland(player.getWorld())) { - Optional islandOptional = SkylandsAPI.getIsland(player.getWorld()); + private BlockPos neoskies$respawnOnIsland(ServerPlayerEntity player) { + if (NeoSkiesAPI.isIsland(player.getWorld())) { + Optional islandOptional = NeoSkiesAPI.getIsland(player.getWorld()); if (islandOptional.isPresent()) { Island island = islandOptional.get(); if (island.isMember(player)) { @@ -98,16 +98,16 @@ private void loadIsland(ClientConnection connection, ServerPlayerEntity player, } } } - return BlockPos.ofFloored(Skylands.getInstance().hub.pos); + return BlockPos.ofFloored(IslandLogic.getInstance().hub.pos); } @Redirect(method = "respawnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;getSpawnPointDimension()Lnet/minecraft/registry/RegistryKey;")) - private RegistryKey skylands$fixRespawnDimension(ServerPlayerEntity player) { + private RegistryKey neoskies$fixRespawnDimension(ServerPlayerEntity player) { return player.getWorld().getRegistryKey(); } @Redirect(method = "respawnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;findRespawnPosition(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;FZZ)Ljava/util/Optional;")) - private Optional skylands$respawnOnIsland(ServerWorld world, BlockPos pos, float angle, boolean forced, boolean alive) { + private Optional neoskies$respawnOnIsland(ServerWorld world, BlockPos pos, float angle, boolean forced, boolean alive) { return Optional.of(pos.toCenterPos()); } @@ -135,7 +135,7 @@ public ServerPlayerEntity resetPlayer(ServerPlayerEntity player) { this.players.remove(player); player.getServerWorld().removePlayer(player, Entity.RemovalReason.DISCARDED); - BlockPos blockPos = BlockPos.ofFloored(Skylands.getInstance().hub.pos); + BlockPos blockPos = BlockPos.ofFloored(IslandLogic.getInstance().hub.pos); float f = player.getSpawnAngle(); boolean bl = player.isSpawnForced(); ServerWorld serverWorld = this.server.getOverworld(); diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/ServerPlayerEntityMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/ServerPlayerEntityMixin.java index 3d4a947..3fb15f9 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/entity/ServerPlayerEntityMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/entity/ServerPlayerEntityMixin.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.mixin.entity; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.duck.ExtendedServerPlayerEntity; import com.awakenedredstone.neoskies.event.PlayerEvents; import com.awakenedredstone.neoskies.util.Worlds; @@ -52,14 +52,14 @@ public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile @Inject(method = "createEndSpawnPlatform", at = @At("HEAD"), cancellable = true) public void blockEndPlatform(CallbackInfo ci) { - if (SkylandsAPI.isIsland(getWorld())) { + if (NeoSkiesAPI.isIsland(getWorld())) { ci.cancel(); } } @ModifyExpressionValue(method = "getPortalRect", at = @At(value = "INVOKE", target = "Ljava/util/Optional;isEmpty()Z")) public boolean skipErrorMessage(boolean original) { - if (SkylandsAPI.isIsland(getWorld())) { + if (NeoSkiesAPI.isIsland(getWorld())) { return false; } diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/world/PlayerEntityMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/world/PlayerEntityMixin.java index f96621a..71e8ca6 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/world/PlayerEntityMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/world/PlayerEntityMixin.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.mixin.world; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; import com.awakenedredstone.neoskies.mixin.block.accessor.WorldBorderAccessor; import com.awakenedredstone.neoskies.util.Worlds; @@ -32,9 +32,9 @@ protected PlayerEntityMixin(EntityType entityType, World // TODO: Add other visual ways to show the limit @Inject(method = "travel", at = @At("HEAD")) private void increaseTravelMotionStats(Vec3d movementInput, CallbackInfo ci) { - if (((PlayerEntity) (Object) this) instanceof ServerPlayerEntity serverPlayer && SkylandsAPI.isIsland(getWorld()) && !lastPos.equals(getPos())) { + if (((PlayerEntity) (Object) this) instanceof ServerPlayerEntity serverPlayer && NeoSkiesAPI.isIsland(getWorld()) && !lastPos.equals(getPos())) { WorldBorder defaultWorldBorder = getWorld().getWorldBorder(); - Island island = SkylandsAPI.getIsland(getWorld()).get(); + Island island = NeoSkiesAPI.getIsland(getWorld()).get(); if (island.radius <= 0) { if (lastSize != -1) { WorldBorder border = new WorldBorder(); diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/world/PortalForcerMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/world/PortalForcerMixin.java index 4a37185..9fdc5e0 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/world/PortalForcerMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/world/PortalForcerMixin.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.mixin.world; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Island; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; @@ -23,9 +23,9 @@ public class PortalForcerMixin { @Inject(method = "createPortal", at = @At("HEAD"), cancellable = true) private void fixPortals(BlockPos pos, Direction.Axis axis, CallbackInfoReturnable> cir) { - if (SkylandsAPI.isIsland(world)) { - Island island = SkylandsAPI.getIsland(world).get(); - if (!island.isWithinBorder(pos) || SkylandsAPI.isEnd(world.getRegistryKey())) { + if (NeoSkiesAPI.isIsland(world)) { + Island island = NeoSkiesAPI.getIsland(world).get(); + if (!island.isWithinBorder(pos) || NeoSkiesAPI.isEnd(world.getRegistryKey())) { cir.setReturnValue(Optional.empty()); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/mixin/world/ServerWorldMixin.java b/src/main/java/com/awakenedredstone/neoskies/mixin/world/ServerWorldMixin.java index 7be663b..b9c3942 100644 --- a/src/main/java/com/awakenedredstone/neoskies/mixin/world/ServerWorldMixin.java +++ b/src/main/java/com/awakenedredstone/neoskies/mixin/world/ServerWorldMixin.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.mixin.world; -import com.awakenedredstone.neoskies.api.SkylandsAPI; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.util.WorldProtection; import com.google.common.collect.ImmutableList; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; @@ -54,7 +54,7 @@ protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey @ModifyExpressionValue(method = "tickChunk", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I", ordinal = 0)) private int disableLightningOnHub(int original) { - if (SkylandsAPI.isHub(this) && Skylands.getConfig().disableLightningOnHub) { + if (NeoSkiesAPI.isHub(this) && IslandLogic.getConfig().disableLightningOnHub) { return 1; } return original; @@ -62,7 +62,7 @@ private int disableLightningOnHub(int original) { @Inject(method = "spawnEntity", at = @At("HEAD"), cancellable = true) private void spawnEntity(Entity entity, CallbackInfoReturnable cir) { - if (!Skylands.getConfig().disableEntitiesOutsideIslands) return; + if (!IslandLogic.getConfig().disableEntitiesOutsideIslands) return; if (entity instanceof ItemEntity || entity instanceof ProjectileEntity) return; World world = entity.getWorld(); BlockPos blockPos = entity.getBlockPos(); @@ -74,15 +74,15 @@ private void spawnEntity(Entity entity, CallbackInfoReturnable cir) { } @Inject(method = "", at = @At("TAIL")) - private void skylands$fixSpawning(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey worldKey, DimensionOptions dimensionOptions, WorldGenerationProgressListener worldGenerationProgressListener, boolean debugWorld, long seed, List spawners, boolean shouldTickTime, RandomSequencesState randomSequencesState, CallbackInfo ci) { - if (SkylandsAPI.isIsland(worldKey)) { + private void neoskies$fixSpawning(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey worldKey, DimensionOptions dimensionOptions, WorldGenerationProgressListener worldGenerationProgressListener, boolean debugWorld, long seed, List spawners, boolean shouldTickTime, RandomSequencesState randomSequencesState, CallbackInfo ci) { + if (NeoSkiesAPI.isIsland(worldKey)) { this.spawners = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new ZombieSiegeManager(), new WanderingTraderManager(properties)); } } @Inject(method = "createEndSpawnPlatform", at = @At("HEAD"), cancellable = true) - private static void skylands$fixEndSpawn(ServerWorld world, CallbackInfo ci) { - if (SkylandsAPI.isIsland(world.getRegistryKey())) { + private static void neoskies$fixEndSpawn(ServerWorld world, CallbackInfo ci) { + if (NeoSkiesAPI.isIsland(world.getRegistryKey())) { ci.cancel(); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/Constants.java b/src/main/java/com/awakenedredstone/neoskies/util/Constants.java index 941ec40..9b437d2 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/Constants.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/Constants.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.SkylandsMain; +import com.awakenedredstone.neoskies.NeoSkies; public class Constants { - public static final String NAMESPACE = SkylandsMain.MOD_ID; - public static final String NAMESPACE_NETHER = SkylandsMain.MOD_ID + "_nether"; - public static final String NAMESPACE_END = SkylandsMain.MOD_ID + "_end"; + public static final String NAMESPACE = NeoSkies.MOD_ID; + public static final String NAMESPACE_NETHER = NeoSkies.MOD_ID + "_nether"; + public static final String NAMESPACE_END = NeoSkies.MOD_ID + "_end"; } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/DynamicPlaceholders.java b/src/main/java/com/awakenedredstone/neoskies/util/DynamicPlaceholders.java index 9f1f0d7..b723635 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/DynamicPlaceholders.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/DynamicPlaceholders.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import eu.pb4.placeholders.api.PlaceholderContext; import eu.pb4.placeholders.api.PlaceholderHandler; import eu.pb4.placeholders.api.PlaceholderResult; @@ -18,7 +18,7 @@ public static Text parseText(String inputText, Map placeholders) { public static Text parseText(Text inputText, Map placeholders) { return Placeholders.parseText(Text.literal(Texts.getTextString(inputText)), - PlaceholderContext.of(Skylands.getServer()), + PlaceholderContext.of(IslandLogic.getServer()), Placeholders.PLACEHOLDER_PATTERN_CUSTOM, id -> getPlaceholder(id, placeholders)); } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/Players.java b/src/main/java/com/awakenedredstone/neoskies/util/Players.java index df04192..e9ecb13 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/Players.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/Players.java @@ -1,13 +1,13 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; import java.util.Optional; public class Players { - static final MinecraftServer server = Skylands.getServer(); + static final MinecraftServer server = IslandLogic.getServer(); public static Optional get(String name) { for (var player : server.getPlayerManager().getPlayerList()) { diff --git a/src/main/java/com/awakenedredstone/neoskies/util/Scheduler.java b/src/main/java/com/awakenedredstone/neoskies/util/Scheduler.java index 7f82b42..3e0f89d 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/Scheduler.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/Scheduler.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import net.minecraft.server.MinecraftServer; import net.minecraft.util.Identifier; @@ -20,7 +20,7 @@ public void tick(MinecraftServer server) { Event event; while ((event = this.events.peek()) != null && event.triggerTime <= server.getOverworld().getTime()) { this.events.remove(); - Skylands.getServer().execute(event.callback); + IslandLogic.getServer().execute(event.callback); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/ServerUtils.java b/src/main/java/com/awakenedredstone/neoskies/util/ServerUtils.java index fb374fd..60ff6ae 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/ServerUtils.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/ServerUtils.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; @@ -11,13 +11,13 @@ public class ServerUtils { public static void protectionWarning(PlayerEntity player, String key) { - if (Skylands.getConfig().showProtectionMessages) { + if (IslandLogic.getConfig().showProtectionMessages) { actionbarPrefixed(player, "island_protection." + key); } } public static void protectionWarning(PlayerEntity player, IslandSettings settings) { - if (Skylands.getConfig().showProtectionMessages) { + if (IslandLogic.getConfig().showProtectionMessages) { actionbarPrefixed(player, "island_protection." + settings.getTranslationKey()); } } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/Texts.java b/src/main/java/com/awakenedredstone/neoskies/util/Texts.java index 0e42c6c..241f39c 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/Texts.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/Texts.java @@ -1,6 +1,6 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import eu.pb4.placeholders.api.TextParserUtils; import net.minecraft.text.Text; import net.minecraft.text.TranslatableTextContent; @@ -19,7 +19,7 @@ public class Texts { public static String getTextString(Text text) { if (text.getContent() instanceof TranslatableTextContent tanslatable) { - return Localization.text(text, ServerLanguage.getLanguage(Skylands.getConfig().language)).getString(); + return Localization.text(text, ServerLanguage.getLanguage(IslandLogic.getConfig().language)).getString(); } else return text.getString(); } diff --git a/src/main/java/com/awakenedredstone/neoskies/util/WorldProtection.java b/src/main/java/com/awakenedredstone/neoskies/util/WorldProtection.java index da27379..466fb7f 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/WorldProtection.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/WorldProtection.java @@ -1,11 +1,11 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.SkylandsMain; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.NeoSkies; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.api.island.PermissionLevel; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; -import com.awakenedredstone.neoskies.logic.registry.SkylandsPermissionLevels; +import com.awakenedredstone.neoskies.logic.IslandLogic; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesPermissionLevels; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import me.lucko.fabric.api.permissions.v0.Permissions; import net.minecraft.entity.player.PlayerEntity; @@ -22,17 +22,17 @@ public class WorldProtection { **/ @Deprecated public static boolean canModify(@NotNull World world, @NotNull PlayerEntity player) { - if (SkylandsMain.PROTECTION_BYPASS.contains(player)) { + if (NeoSkies.PROTECTION_BYPASS.contains(player)) { if (Permissions.check(player, "neoskies.admin.protection.bypass", 4)) return true; - else SkylandsMain.PROTECTION_BYPASS.remove(player); + else NeoSkies.PROTECTION_BYPASS.remove(player); } - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent() && !island.get().isMember(player)) { return false; } if (world.getRegistryKey().equals(World.OVERWORLD)) { - return !Skylands.getInstance().hub.hasProtection; + return !IslandLogic.getInstance().hub.hasProtection; } return true; @@ -43,14 +43,14 @@ public static boolean canModify(@NotNull World world, @NotNull PlayerEntity play **/ @Deprecated public static boolean canModify(@NotNull World world, @NotNull BlockPos pos, @NotNull PlayerEntity player) { - if (SkylandsMain.PROTECTION_BYPASS.contains(player)) { + if (NeoSkies.PROTECTION_BYPASS.contains(player)) { if (Permissions.check(player, "neoskies.admin.protection.bypass", 4)) { return true; } else { - SkylandsMain.PROTECTION_BYPASS.remove(player); + NeoSkies.PROTECTION_BYPASS.remove(player); } } - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { if (!island.get().isWithinBorder(pos)) { return false; @@ -60,7 +60,7 @@ public static boolean canModify(@NotNull World world, @NotNull BlockPos pos, @No } if (world.getRegistryKey().equals(World.OVERWORLD)) { - return !Skylands.getInstance().hub.hasProtection; + return !IslandLogic.getInstance().hub.hasProtection; } return false; @@ -78,15 +78,15 @@ public static boolean canModify(@NotNull World world, } public static boolean canModify(@NotNull World world, @NotNull BlockPos pos, @NotNull PlayerEntity player, @NotNull T setting) { - if (SkylandsMain.PROTECTION_BYPASS.contains(player)) { + if (NeoSkies.PROTECTION_BYPASS.contains(player)) { if (Permissions.check(player, "neoskies.admin.protection.bypass", 4)) { return true; } else { - SkylandsMain.PROTECTION_BYPASS.remove(player); + NeoSkies.PROTECTION_BYPASS.remove(player); } } - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { if (!island.get().isWithinBorder(pos)) { return false; @@ -96,7 +96,7 @@ public static boolean canModify(@NotNull World world, } } - if (world.getRegistryKey().equals(World.OVERWORLD) && Skylands.getInstance().hub.hasProtection) { + if (world.getRegistryKey().equals(World.OVERWORLD) && IslandLogic.getInstance().hub.hasProtection) { return false; } @@ -104,22 +104,22 @@ public static boolean canModify(@NotNull World world, } public static boolean canModify(@NotNull World world, @NotNull PlayerEntity player, @NotNull T setting) { - if (SkylandsMain.PROTECTION_BYPASS.contains(player)) { + if (NeoSkies.PROTECTION_BYPASS.contains(player)) { if (Permissions.check(player, "neoskies.admin.protection.bypass", 4)) { return true; } else { - SkylandsMain.PROTECTION_BYPASS.remove(player); + NeoSkies.PROTECTION_BYPASS.remove(player); } } - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent()) { if (island.get().isInteractionAllowed(setting.getIdentifier(), getPlayerPermissionLevel(world, player))) { return true; } } - if (world.getRegistryKey().equals(World.OVERWORLD) && Skylands.getInstance().hub.hasProtection) { + if (world.getRegistryKey().equals(World.OVERWORLD) && IslandLogic.getInstance().hub.hasProtection) { return false; } @@ -127,23 +127,23 @@ public static boolean canModify(@NotNull World world, } public static @NotNull PermissionLevel getPlayerPermissionLevel(@NotNull World world, @NotNull PlayerEntity player) { - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); if (island.isPresent() && island.get().isMember(player)) { if (island.get().owner.uuid == player.getUuid()) { - return SkylandsPermissionLevels.OWNER; + return NeoSkiesPermissionLevels.OWNER; } else { - return SkylandsPermissionLevels.MEMBER; + return NeoSkiesPermissionLevels.MEMBER; } } - return SkylandsPermissionLevels.VISITOR; + return NeoSkiesPermissionLevels.VISITOR; } public static boolean isWithinIsland(@NotNull World world, @NotNull BlockPos pos) { - Optional island = SkylandsAPI.getIsland(world); + Optional island = NeoSkiesAPI.getIsland(world); - if (SkylandsAPI.isHub(world)) { + if (NeoSkiesAPI.isHub(world)) { return true; } @@ -152,7 +152,7 @@ public static boolean isWithinIsland(@NotNull World world, @NotNull BlockPos pos } if (world.getRegistryKey().equals(World.OVERWORLD)) { - return !Skylands.getInstance().hub.hasProtection; + return !IslandLogic.getInstance().hub.hasProtection; } return true; diff --git a/src/main/java/com/awakenedredstone/neoskies/util/Worlds.java b/src/main/java/com/awakenedredstone/neoskies/util/Worlds.java index 495001f..f0c57b6 100644 --- a/src/main/java/com/awakenedredstone/neoskies/util/Worlds.java +++ b/src/main/java/com/awakenedredstone/neoskies/util/Worlds.java @@ -1,9 +1,9 @@ package com.awakenedredstone.neoskies.util; -import com.awakenedredstone.neoskies.api.SkylandsAPI; +import com.awakenedredstone.neoskies.api.NeoSkiesAPI; import com.awakenedredstone.neoskies.logic.Hub; import com.awakenedredstone.neoskies.logic.Island; -import com.awakenedredstone.neoskies.logic.Skylands; +import com.awakenedredstone.neoskies.logic.IslandLogic; import net.fabricmc.fabric.api.dimension.v1.FabricDimensions; import net.minecraft.registry.RegistryKey; import net.minecraft.server.network.ServerPlayerEntity; @@ -21,8 +21,8 @@ public static void returnToIslandSpawn(ServerPlayerEntity player, boolean fallDa player.stopRiding(); - if (SkylandsAPI.isIsland(player.getWorld())) { - Optional islandOptional = SkylandsAPI.getIsland(player.getWorld()); + if (NeoSkiesAPI.isIsland(player.getWorld())) { + Optional islandOptional = NeoSkiesAPI.getIsland(player.getWorld()); if (islandOptional.isPresent()) { Island island = islandOptional.get(); if (island.isMember(player)) { @@ -34,20 +34,20 @@ public static void returnToIslandSpawn(ServerPlayerEntity player, boolean fallDa } } } else { - Hub hub = Skylands.getInstance().hub; - if (!Skylands.getConfig().safeVoidFallDamage) player.fallDistance = 0; + Hub hub = IslandLogic.getInstance().hub; + if (!IslandLogic.getConfig().safeVoidFallDamage) player.fallDistance = 0; hub.visit(player, true); } } public static RegistryKey redirect(RegistryKey registryKey) { - if (SkylandsAPI.isOverworld(registryKey)) { + if (NeoSkiesAPI.isOverworld(registryKey)) { return World.OVERWORLD; } - if (SkylandsAPI.isEnd(registryKey)) { + if (NeoSkiesAPI.isEnd(registryKey)) { return World.END; } - if (SkylandsAPI.isNether(registryKey)) { + if (NeoSkiesAPI.isNether(registryKey)) { return World.NETHER; } return registryKey; diff --git a/src/main/resources/data/neoskies/lang/en_us.json b/src/main/resources/data/neoskies/lang/en_us.json index 764b775..68c5212 100644 --- a/src/main/resources/data/neoskies/lang/en_us.json +++ b/src/main/resources/data/neoskies/lang/en_us.json @@ -226,7 +226,7 @@ "text.neoskies.nyi": "Not yet implemented", "text.neoskies.protection_bypass": "Bypass status: %value%", - "gui.neoskies.menu": "Skylands menu", + "gui.neoskies.menu": "NeoSkies menu", "gui.neoskies.island_settings": "Island settings", "gui.neoskies.close": "Close", "item_name.neoskies.hub": "Go to hub", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 981d07e..3970b24 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -13,7 +13,7 @@ "environment": "*", "entrypoints": { "main": [ - "com.awakenedredstone.neoskies.SkylandsMain" + "com.awakenedredstone.neoskies.NeoSkies" ], "fabric-datagen": [ "com.awakenedredstone.neoskies.datagen.NeoSkiesDatagen" diff --git a/src/testmod/java/com/awakenedredstone/neoskies/test/SkylandsTestMain.java b/src/testmod/java/com/awakenedredstone/neoskies/test/NeoSkiesTestMain.java similarity index 94% rename from src/testmod/java/com/awakenedredstone/neoskies/test/SkylandsTestMain.java rename to src/testmod/java/com/awakenedredstone/neoskies/test/NeoSkiesTestMain.java index f7ba0c8..9520121 100644 --- a/src/testmod/java/com/awakenedredstone/neoskies/test/SkylandsTestMain.java +++ b/src/testmod/java/com/awakenedredstone/neoskies/test/NeoSkiesTestMain.java @@ -1,7 +1,7 @@ package com.awakenedredstone.neoskies.test; import com.awakenedredstone.neoskies.command.utils.CommandUtils; -import com.awakenedredstone.neoskies.logic.registry.SkylandsRegistries; +import com.awakenedredstone.neoskies.logic.registry.NeoSkiesRegistries; import com.awakenedredstone.neoskies.logic.settings.IslandSettings; import eu.pb4.polymer.core.api.item.PolymerBlockItem; import net.fabricmc.api.ModInitializer; @@ -25,7 +25,7 @@ import static net.minecraft.server.command.CommandManager.argument; import static net.minecraft.server.command.CommandManager.literal; -public final class SkylandsTestMain implements ModInitializer { +public final class NeoSkiesTestMain implements ModInitializer { @Override public void onInitialize() { TestBlock testBlock = Registry.register(Registries.BLOCK, new Identifier("neoskies", "test_block"), new TestBlock(AbstractBlock.Settings.create().dropsNothing().solid().strength(999, 999))); @@ -56,7 +56,7 @@ public void onInitialize() { .executes(context -> { ServerCommandSource source = context.getSource(); MutableText text = Text.empty(); - for (IslandSettings settings : SkylandsRegistries.ISLAND_SETTINGS) { + for (IslandSettings settings : NeoSkiesRegistries.ISLAND_SETTINGS) { Language lang = Language.getInstance(); String translationKey = settings.getIdentifier().toTranslationKey(); boolean hasTranslation = lang.hasTranslation("island_protection." + translationKey); @@ -74,7 +74,7 @@ public void onInitialize() { .executes(context -> { ServerCommandSource source = context.getSource(); MutableText text = Text.empty(); - for (IslandSettings settings : SkylandsRegistries.ISLAND_SETTINGS) { + for (IslandSettings settings : NeoSkiesRegistries.ISLAND_SETTINGS) { Language lang = Language.getInstance(); String translationKey = settings.getIdentifier().toTranslationKey(); boolean hasTranslation = lang.hasTranslation("island_settings." + translationKey); @@ -92,7 +92,7 @@ public void onInitialize() { .executes(context -> { ServerCommandSource source = context.getSource(); MutableText text = Text.empty(); - for (IslandSettings settings : SkylandsRegistries.ISLAND_SETTINGS) { + for (IslandSettings settings : NeoSkiesRegistries.ISLAND_SETTINGS) { Language lang = Language.getInstance(); String translationKey = settings.getIdentifier().toTranslationKey(); boolean hasTranslation = lang.hasTranslation("island_settings." + translationKey + ".description"); diff --git a/src/testmod/resources/fabric.mod.json b/src/testmod/resources/fabric.mod.json index 51959d4..8b780b9 100644 --- a/src/testmod/resources/fabric.mod.json +++ b/src/testmod/resources/fabric.mod.json @@ -9,7 +9,7 @@ "environment": "*", "entrypoints": { "main": [ - "com.awakenedredstone.neoskies.test.SkylandsTestMain" + "com.awakenedredstone.neoskies.test.NeoSkiesTestMain" ] } }