Skip to content

Commit

Permalink
Merge pull request #13 from FTBTeam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
desht authored Dec 4, 2023
2 parents f6c1980 + 0f0e7cd commit dc0f8e3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.4]

### Fixed

* Fixed FTB Ranks / Luckperms integration not being picked up correctly due to bug introduced in 2.0.2

## [2.0.3]

### Fixed
Expand All @@ -13,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
* Basic KJS/FTB Teams integration; fire events when a player joins or leaves a team
* Added configurability for backend implementations of stages and permissions mods

## [2.0.1]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.ftb.mods.ftbxmodcompat;

import dev.architectury.platform.Platform;
import dev.ftb.mods.ftblibrary.snbt.config.ConfigUtil;
import dev.ftb.mods.ftbxmodcompat.config.FTBXModConfig;
import dev.ftb.mods.ftbxmodcompat.ftbchunks.FTBChunksSetup;
import dev.ftb.mods.ftbxmodcompat.ftbquests.FTBQuestsSetup;
import dev.ftb.mods.ftbxmodcompat.generic.gamestages.StagesSetup;
Expand Down Expand Up @@ -29,6 +31,8 @@ public class FTBXModCompat {
public static void init() {
detectLoadedMods();

ConfigUtil.loadDefaulted(FTBXModConfig.CONFIG, ConfigUtil.CONFIG_DIR, MOD_ID);

StagesSetup.init();
PermissionsSetup.init();
if (isFTBQuestsLoaded) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dev.ftb.mods.ftbxmodcompat.FTBXModCompat;
import dev.ftb.mods.ftbxmodcompat.config.FTBXModConfig;
import dev.ftb.mods.ftbxmodcompat.config.FTBXModConfig.PermSelector;
import org.jetbrains.annotations.NotNull;

public class PermissionsSetup {
public static void init() {
Expand All @@ -13,13 +14,25 @@ public static void init() {
sel = PermSelector.DEFAULT;
}

PermissionHelper pHelper = setupPermissionHelper(sel);

FTBXModCompat.LOGGER.info("Chose [{}] as the active permissions implementation", pHelper.getProvider().getName());
}

@NotNull
private static PermissionHelper setupPermissionHelper(PermSelector sel) {
PermissionHelper pHelper = PermissionHelper.INSTANCE;
switch (sel) {
case LUCKPERMS -> pHelper.setProviderImpl(new LuckPermsProvider());
case FTB_RANKS -> pHelper.setProviderImpl(new FTBRanksProvider());
case DEFAULT -> { /* do nothing, this is the fallback */ }
case DEFAULT -> {
if (FTBXModCompat.isFTBRanksLoaded) {
pHelper.setProviderImpl(new FTBRanksProvider());
} else if (FTBXModCompat.isLuckPermsLoaded) {
pHelper.setProviderImpl(new LuckPermsProvider());
}
}
}

FTBXModCompat.LOGGER.info("Chose [{}] as the active permissions implementation", pHelper.getProvider().getName());
return pHelper;
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.20.1
enabled_platforms=fabric,forge

archives_base_name=ftb-xmod-compat
mod_version=2.0.3
mod_version=2.0.4
maven_group=dev.ftb.mods
curseforge_id=889915

Expand Down

0 comments on commit dc0f8e3

Please sign in to comment.