diff --git a/common-api/src/main/java/dev/compactmods/machines/api/core/CMRegistryKeys.java b/common-api/src/main/java/dev/compactmods/machines/api/core/CMRegistryKeys.java index 4d3de41..cb5665d 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/core/CMRegistryKeys.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/core/CMRegistryKeys.java @@ -1,6 +1,7 @@ package dev.compactmods.machines.api.core; -import dev.compactmods.machines.api.upgrade.RoomUpgradeAction; +import dev.compactmods.machines.api.room.RoomTemplate; +import dev.compactmods.machines.api.upgrade.RoomUpgrade; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -9,5 +10,13 @@ public interface CMRegistryKeys { - ResourceKey> UPGRADE_ACTIONS = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "upgrade_actions")); + /** + * Used to store upgrade definitions for rooms (such as chunkloading) + */ + ResourceKey> ROOM_UPGRADES = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "room_upgrades")); + + /** + * Used to look up and store definitions for room templates. + */ + ResourceKey> ROOM_TEMPLATES = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "room_templates")); } diff --git a/common-api/src/main/java/dev/compactmods/machines/api/core/CMTags.java b/common-api/src/main/java/dev/compactmods/machines/api/core/CMTags.java index 221f3b3..02d65f0 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/core/CMTags.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/core/CMTags.java @@ -7,10 +7,28 @@ import net.minecraft.world.level.block.Block; public interface CMTags { + /** + * Marks an item as a room upgrade. Not yet used by the main mod. + */ TagKey ROOM_UPGRADE_ITEM = TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(Constants.MOD_ID, "room_upgrade")); + + /** + * Marks an item as a Compact Machine item. + */ TagKey MACHINE_ITEM = TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(Constants.MOD_ID, "machine")); + + /** + * Marks a block as a Compact Machine; applied to both legacy sized machines and the new machine blocks. + */ TagKey MACHINE_BLOCK = TagKey.create(Registry.BLOCK_REGISTRY, new ResourceLocation(Constants.MOD_ID, "machine")); + /** + * Applied to solid wall items. + */ TagKey SOLID_WALL_ITEMS = TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(Constants.MOD_ID, "solid_walls")); + + /** + * Applied to solid walls and tunnel blocks. + */ TagKey SOLID_WALL_BLOCKS = TagKey.create(Registry.BLOCK_REGISTRY, new ResourceLocation(Constants.MOD_ID, "solid_walls")); } diff --git a/common-api/src/main/java/dev/compactmods/machines/api/room/Rooms.java b/common-api/src/main/java/dev/compactmods/machines/api/room/Rooms.java index 89c3635..e886962 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/room/Rooms.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/room/Rooms.java @@ -1,6 +1,7 @@ package dev.compactmods.machines.api.room; -import dev.compactmods.machines.api.upgrade.RoomUpgradeAction; +import dev.compactmods.machines.api.core.CMRegistryKeys; +import dev.compactmods.machines.api.upgrade.RoomUpgrade; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -10,12 +11,14 @@ public class Rooms { - public static final ResourceKey> TEMPLATE_REG_KEY = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "room_templates")); + @Deprecated(forRemoval = true) + public static final ResourceKey> TEMPLATE_REG_KEY = CMRegistryKeys.ROOM_TEMPLATES; - public static final ResourceKey> ROOM_UPGRADES_REG_KEY = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "room_upgrades")); + @Deprecated(forRemoval = true) + public static final ResourceKey> ROOM_UPGRADES_REG_KEY = CMRegistryKeys.ROOM_UPGRADES; public static Registry getTemplates(MinecraftServer server) { final var regAccess = server.registryAccess(); - return regAccess.registryOrThrow(TEMPLATE_REG_KEY); + return regAccess.registryOrThrow(CMRegistryKeys.ROOM_TEMPLATES); } } diff --git a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/ILevelLoadedUpgradeListener.java b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/ILevelLoadedUpgradeListener.java index 50290f6..3b2bee8 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/ILevelLoadedUpgradeListener.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/ILevelLoadedUpgradeListener.java @@ -3,7 +3,7 @@ import dev.compactmods.machines.api.room.registration.IRoomRegistration; import net.minecraft.server.level.ServerLevel; -public interface ILevelLoadedUpgradeListener extends RoomUpgradeAction { +public interface ILevelLoadedUpgradeListener extends RoomUpgrade { /** * Called when a level is loaded, typically when the server first boots up. diff --git a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeAppliedListener.java b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeAppliedListener.java index a0429d1..5ce5daa 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeAppliedListener.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeAppliedListener.java @@ -3,7 +3,7 @@ import dev.compactmods.machines.api.room.registration.IRoomRegistration; import net.minecraft.server.level.ServerLevel; -public interface IUpgradeAppliedListener extends RoomUpgradeAction { +public interface IUpgradeAppliedListener extends RoomUpgrade { /** * Called when an upgrade is first applied to a room. diff --git a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeRemovedListener.java b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeRemovedListener.java index 8168a88..247b8ab 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeRemovedListener.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/IUpgradeRemovedListener.java @@ -3,7 +3,7 @@ import dev.compactmods.machines.api.room.registration.IRoomRegistration; import net.minecraft.server.level.ServerLevel; -public interface IUpgradeRemovedListener extends RoomUpgradeAction { +public interface IUpgradeRemovedListener extends RoomUpgrade { /** * Called when an update is removed from a room. diff --git a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeAction.java b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgrade.java similarity index 56% rename from common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeAction.java rename to common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgrade.java index 4c996fe..ff35c97 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeAction.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgrade.java @@ -7,9 +7,9 @@ import static dev.compactmods.machines.api.core.Constants.MOD_ID; -public interface RoomUpgradeAction { +public interface RoomUpgrade { - ResourceKey> REG_KEY = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "upgrade_actions")); + ResourceKey> REG_KEY = ResourceKey.createRegistryKey(new ResourceLocation(MOD_ID, "upgrade_actions")); - Codec codec(); + Codec codec(); } diff --git a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeInstance.java b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeInstance.java index 02c767d..f12aaec 100644 --- a/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeInstance.java +++ b/common-api/src/main/java/dev/compactmods/machines/api/upgrade/RoomUpgradeInstance.java @@ -1,3 +1,3 @@ package dev.compactmods.machines.api.upgrade; -public record RoomUpgradeInstance(T upgrade, String room) {} \ No newline at end of file +public record RoomUpgradeInstance(T upgrade, String room) {} \ No newline at end of file