-
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.
Allow LargeAutoclave to enable
canBeDsitinct()
when enableGTBees
…
…is true (#3)
- Loading branch information
Showing
7 changed files
with
118 additions
and
3 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
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
6 changes: 6 additions & 0 deletions
6
src/main/java/com/github/gtexpert/gtbm/api/capability/IMultiblockDistinctable.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,6 @@ | ||
package com.github.gtexpert.gtbm.api.capability; | ||
|
||
public interface IMultiblockDistinctable { | ||
|
||
boolean canBeDistinct(); | ||
} |
62 changes: 62 additions & 0 deletions
62
src/main/java/com/github/gtexpert/gtbm/mixins/GTBMMixinLoader.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,62 @@ | ||
package com.github.gtexpert.gtbm.mixins; | ||
|
||
import java.util.AbstractMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import net.minecraftforge.fml.common.Loader; | ||
|
||
import com.github.gtexpert.gtbm.api.ModValues; | ||
import com.github.gtexpert.gtbm.api.util.ModLog; | ||
import com.github.gtexpert.gtbm.api.util.Mods; | ||
|
||
import zone.rong.mixinbooter.ILateMixinLoader; | ||
|
||
public class GTBMMixinLoader implements ILateMixinLoader { | ||
|
||
public static final Map<String, Boolean> modMixinsConfig = Stream.of( | ||
new AbstractMap.SimpleImmutableEntry<>(Mods.Names.GREGICALITY_MULTIBLOCKS, | ||
Mods.GregicalityMultiblocks.isModLoaded())) | ||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); | ||
|
||
@Override | ||
public List<String> getMixinConfigs() { | ||
return modMixinsConfig.keySet().stream().map(mod -> "mixins." + ModValues.MODID + "." + mod + ".json") | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Override | ||
public boolean shouldMixinConfigQueue(String mixinConfig) { | ||
String[] parts = mixinConfig.split("\\."); | ||
|
||
if (parts.length != 4) { | ||
ModLog.logger.fatal("Mixin Config Check Failed! Invalid Length."); | ||
ModLog.logger.fatal("Mixin Config: " + mixinConfig); | ||
return true; | ||
} | ||
|
||
if (!Objects.equals(parts[1], ModValues.MODID)) { | ||
ModLog.logger.error("Non GTExpertCore Mixin Found in Mixin Queue. This is probably an error. Skipping..."); | ||
ModLog.logger.error("Mixin Config: " + mixinConfig); | ||
return true; | ||
} | ||
|
||
if (!Loader.isModLoaded(parts[2])) { | ||
ModLog.logger.error("Mod '" + parts[2] + | ||
"' is not loaded. If this is a normal GTExpertCore instance, this is probably an error."); | ||
ModLog.logger.error("Not Loading Mixin Config " + mixinConfig); | ||
return false; | ||
} | ||
|
||
if (!modMixinsConfig.containsKey(parts[2]) || !modMixinsConfig.get(parts[2])) { | ||
ModLog.logger.info("Integration for Mod '" + parts[2] + "' is not enabled, or does not exist."); | ||
ModLog.logger.info("Not Loading Mixin Config " + mixinConfig); | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/github/gtexpert/gtbm/mixins/gcym/MetaTileEntityLargeAutoclaveMixin.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,18 @@ | ||
package com.github.gtexpert.gtbm.mixins.gcym; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import gregtech.integration.forestry.ForestryConfig; | ||
|
||
import gregicality.multiblocks.common.metatileentities.multiblock.standard.MetaTileEntityLargeAutoclave; | ||
|
||
import com.github.gtexpert.gtbm.api.capability.IMultiblockDistinctable; | ||
|
||
@Mixin(value = MetaTileEntityLargeAutoclave.class, remap = false) | ||
public class MetaTileEntityLargeAutoclaveMixin implements IMultiblockDistinctable { | ||
|
||
@Override | ||
public boolean canBeDistinct() { | ||
return ForestryConfig.enableGTBees; | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"package": "com.github.gtexpert.gtbm.mixins.gcym", | ||
"refmap": "mixins.gtbm.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"MetaTileEntityLargeAutoclaveMixin" | ||
], | ||
"client": [], | ||
"server": [] | ||
} |
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,10 @@ | ||
{ | ||
"package": "com.github.gtexpert.gtbm.mixins", | ||
"refmap": "mixins.gtbm.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [], | ||
"client": [], | ||
"server": [] | ||
} |