forked from MobiusFlip/CrimsonRevelations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,6 @@ dependencies { | |
transitive = false | ||
} | ||
} | ||
|
||
} | ||
|
||
// Adds Access Transformer files to tasks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/com/mobiusflip/crimsonrevelations/core/CRMixinLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.mobiusflip.crimsonrevelations.core; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import net.minecraftforge.fml.common.Loader; | ||
import net.minecraftforge.fml.relauncher.FMLLaunchHandler; | ||
import zone.rong.mixinbooter.ILateMixinLoader; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.Supplier; | ||
|
||
public class CRMixinLoader implements ILateMixinLoader { | ||
private static final Map<String, Supplier<Boolean>> clientsideMixinConfigs = ImmutableMap.copyOf(new HashMap<String, Supplier<Boolean>>() { | ||
{ | ||
|
||
} | ||
}); | ||
|
||
private static final Map<String, Supplier<Boolean>> commonMixinConfigs = ImmutableMap.copyOf(new HashMap<String, Supplier<Boolean>>() { | ||
{ | ||
|
||
} | ||
}); | ||
|
||
private static boolean loaded(String modid) { | ||
return Loader.isModLoaded(modid); | ||
} | ||
|
||
@Override | ||
public List<String> getMixinConfigs() { | ||
List<String> configs = new ArrayList<>(); | ||
if (FMLLaunchHandler.side().isClient()) { | ||
configs.addAll(clientsideMixinConfigs.keySet()); | ||
} | ||
configs.addAll(commonMixinConfigs.keySet()); | ||
return configs; | ||
} | ||
|
||
@Override | ||
public boolean shouldMixinConfigQueue(String mixinConfig) { | ||
Supplier<Boolean> sidedSupplier = FMLLaunchHandler.side().isClient() ? clientsideMixinConfigs.get(mixinConfig) : null; | ||
Supplier<Boolean> commonSupplier = commonMixinConfigs.get(mixinConfig); | ||
return sidedSupplier != null ? sidedSupplier.get() : commonSupplier == null || commonSupplier.get(); | ||
} | ||
} |