diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-09-16 02:29:16 +0200 |
---|---|---|
committer | boubou19 <miisterunknown@gmail.com> | 2024-09-17 22:55:46 +0200 |
commit | d3d71cbd373a3629a1df36b82fd3138cf4294b80 (patch) | |
tree | b0d3b151203c66c8bb2325a12744a23c1e3e4327 /src/main | |
parent | 0d4d99bd4de246d5b6154675d4b083019f573d82 (diff) | |
download | GT5-Unofficial-d3d71cbd373a3629a1df36b82fd3138cf4294b80.tar.gz GT5-Unofficial-d3d71cbd373a3629a1df36b82fd3138cf4294b80.tar.bz2 GT5-Unofficial-d3d71cbd373a3629a1df36b82fd3138cf4294b80.zip |
remove reflection from WerkstoffLoader
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/bartworks/system/material/WerkstoffLoader.java | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/main/java/bartworks/system/material/WerkstoffLoader.java b/src/main/java/bartworks/system/material/WerkstoffLoader.java index a1b1aac2ed..fdfb4f8e9e 100644 --- a/src/main/java/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/bartworks/system/material/WerkstoffLoader.java @@ -2002,38 +2002,25 @@ public class WerkstoffLoader { } /** - * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. + * very hacky way to make my ores/blocks/small ores detectable by gt association in world, well at least the prefix. * used for the miners mostly removing this hacky material from the materials map instantly. we only need the item * data. */ - @SuppressWarnings("unchecked") private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() { - - Map<String, Materials> MATERIALS_MAP = null; - - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - MATERIALS_MAP = (Map<String, Materials>) f.get(null); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - - if (MATERIALS_MAP == null) throw new NullPointerException("MATERIALS_MAP null!"); - Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null); Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null); Materials blockMat = new Materials(-1, null, 0, 0, 0, false, "bwblocks", "bwblocks", null, true, null); - for (int i = 0; i < 16; i++) { GTOreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres, 1, i), true); GTOreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres, 1, i), true); GTOreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks, 1, i), true); } - - MATERIALS_MAP.remove("bwores"); - MATERIALS_MAP.remove("bwsmallores"); - MATERIALS_MAP.remove("bwblocks"); + Materials.getMaterialsMap() + .remove("bwores"); + Materials.getMaterialsMap() + .remove("bwsmallores"); + Materials.getMaterialsMap() + .remove("bwblocks"); } public static void removeIC2Recipes() { |