From dac6458dfe620eac96cfb4eee4d1de5f603c72ff Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 16 Jun 2024 23:34:09 +0200 Subject: [PATCH 1/2] feat: fabric entrypoint for refined storage platform api --- .../platform/api/RefinedStoragePlugin.java | 8 ++++++++ .../platform/fabric/ModInitializerImpl.java | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/RefinedStoragePlugin.java diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/RefinedStoragePlugin.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/RefinedStoragePlugin.java new file mode 100644 index 000000000..75fdb9c6d --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/RefinedStoragePlugin.java @@ -0,0 +1,8 @@ +package com.refinedmods.refinedstorage2.platform.api; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.13") +public interface RefinedStoragePlugin { + void onPlatformApiAvailable(PlatformApi platformApi); +} diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java index 7d728a03c..257d37da7 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java @@ -1,6 +1,7 @@ package com.refinedmods.refinedstorage2.platform.fabric; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.RefinedStoragePlugin; import com.refinedmods.refinedstorage2.platform.common.AbstractModInitializer; import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; @@ -57,6 +58,7 @@ import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.function.Function; import java.util.function.Predicate; @@ -72,6 +74,7 @@ import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; +import net.fabricmc.loader.api.FabricLoader; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.Container; @@ -102,6 +105,7 @@ public class ModInitializerImpl extends AbstractModInitializer implements ModInitializer { private static final Logger LOGGER = LoggerFactory.getLogger(ModInitializerImpl.class); + private static final String PLUGIN_ENTRYPOINT_KEY = "refinedstorage_plugin"; @Override public void onInitialize() { @@ -124,6 +128,11 @@ public void onInitialize() { registerWrenchingEvent(); registerSecurityBlockBreakEvent(); + final List pluginEntrypoints = FabricLoader.getInstance() + .getEntrypoints(PLUGIN_ENTRYPOINT_KEY, RefinedStoragePlugin.class); + LOGGER.debug("Loading {} Refined Storage plugin entrypoints.", pluginEntrypoints.size()); + pluginEntrypoints.forEach(plugin -> plugin.onPlatformApiAvailable(PlatformApi.INSTANCE)); + LOGGER.debug("Refined Storage 2 has loaded."); } From dff4325b8aa9421d83b5bd182797177d12160307 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 16 Jun 2024 21:46:56 +0000 Subject: [PATCH 2/2] chore: prepare release v2.0.0-milestone.3.13 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f37e9e7..de3d58a13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [2.0.0-milestone.3.13] - 2024-06-16 + ## [2.0.0-milestone.3.12] - 2024-06-16 ### Removed @@ -604,7 +606,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Grid can now use smooth scrolling. - The Grid now has syntax highlighting for the search query. -[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.12...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.13...HEAD + +[2.0.0-milestone.3.13]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.12...v2.0.0-milestone.3.13 [2.0.0-milestone.3.12]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.11...v2.0.0-milestone.3.12