Skip to content

Commit

Permalink
Add isModLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Nov 7, 2023
1 parent e4709e4 commit 6b4f51d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### 3.3.0
### 3.3.10

- Add Config Library
- Added isModLoaded helper method
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public interface IPlatformHelper {

Path getConfigPath();

boolean isModLoaded(String modId);

@Nullable
default <T extends Entity> Entity teleport(T entity, ServerLevel level, PortalInfo portalInfo) {
return teleportInternal(entity, level, portalInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public Path getConfigPath() {
return FabricLoader.getInstance().getConfigDir();
}

@Override
public boolean isModLoaded(String modId) {
return FabricLoader.getInstance().isModLoaded(modId);
}

@Override
@ApiStatus.Internal
public void addItemToCreativeTab(ResourceKey<CreativeModeTab> tabResourceKey, List<Supplier<? extends Item>> items) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.unrealdinnerbone.trenzalore;

import com.unrealdinnerbone.config.ConfigManager;
import com.unrealdinnerbone.config.config.BooleanConfig;
import com.unrealdinnerbone.trenzalore.platform.ForgePlatformHelper;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.fml.common.Mod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.world.level.portal.PortalInfo;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ITeleporter;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.registries.DeferredRegister;
Expand Down Expand Up @@ -46,6 +47,11 @@ public Path getConfigPath() {
return FMLPaths.CONFIGDIR.get();
}

@Override
public boolean isModLoaded(String modId) {
return ModList.get().isLoaded(modId);
}

@Override
public <T> void registryRegistryObjects(String modId, RegistryObjects<T> registryObjects) {
DeferredRegister<T> deferredRegister = DeferredRegister.create(registryObjects.registryKey(), modId);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
mod_version=3.3.9
mod_version=3.3.10
maven_group=com.unrealdinnerbone
mod_name=Trenzalore
mod_author=UnRealDinnerbone
Expand Down

0 comments on commit 6b4f51d

Please sign in to comment.