-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement TCon material blacklist tweak
- Loading branch information
Showing
6 changed files
with
54 additions
and
4 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
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
25 changes: 25 additions & 0 deletions
25
src/main/java/mod/acgaming/universaltweaks/mods/tconstruct/UTTConstructMaterials.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,25 @@ | ||
package mod.acgaming.universaltweaks.mods.tconstruct; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import mod.acgaming.universaltweaks.UniversalTweaks; | ||
import mod.acgaming.universaltweaks.config.UTConfig; | ||
import mod.acgaming.universaltweaks.mods.tconstruct.mixin.MaterialAccessor; | ||
import slimeknights.tconstruct.library.TinkerRegistry; | ||
import slimeknights.tconstruct.library.materials.Material; | ||
|
||
public class UTTConstructMaterials | ||
{ | ||
public static void utHandleBlacklistedMaterials() | ||
{ | ||
Collection<Material> materialList = TinkerRegistry.getAllMaterials(); | ||
if (UTConfig.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.info("+++ TINKERS' CONSTRUCT MATERIALS +++"); | ||
for (Material material : materialList) | ||
{ | ||
if (UTConfig.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.info(material.getIdentifier()); | ||
boolean blacklisted = Arrays.stream(UTConfig.MOD_INTEGRATION.TINKERS_CONSTRUCT.utTConMaterialBlacklist).anyMatch(mat -> mat.equals(material.getIdentifier())); | ||
((MaterialAccessor) material).setHidden(blacklisted); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/mod/acgaming/universaltweaks/mods/tconstruct/mixin/MaterialAccessor.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,12 @@ | ||
package mod.acgaming.universaltweaks.mods.tconstruct.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
import slimeknights.tconstruct.library.materials.Material; | ||
|
||
@Mixin(Material.class) | ||
public interface MaterialAccessor | ||
{ | ||
@Accessor("hidden") | ||
void setHidden(boolean hidden); | ||
} |
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