From 137eb049e600788b8a8e050fd393980b6514e51b Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Mon, 7 Aug 2017 23:09:43 +1000 Subject: $ Fixed RTG reflection. $ Fixed issue where RTGs would revert back to HV after a restart/rejoin. $ Fixed the Thermal Boiler Assembly. % Migrated TAE to use slot 96+. + Added some extra logging to verify. $ Made Shelves have textures. --- .../gtPlusPlus/core/util/reflect/ReflectionUtils.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index dd3adac3bc..c789871b6f 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -145,19 +145,21 @@ public class ReflectionUtils { } - public static void setByte(Class clazz, String fieldName, byte newValue) throws Exception { - /*Field nameField = getField(clazz, fieldName); + public static void setByte(Object clazz, String fieldName, byte newValue) throws Exception { + Field nameField = getField(clazz.getClass(), fieldName); nameField.setAccessible(true); int modifiers = nameField.getModifiers(); Field modifierField = nameField.getClass().getDeclaredField("modifiers"); modifiers = modifiers & ~Modifier.FINAL; modifierField.setAccessible(true); - modifierField.set(nameField, modifiers); - nameField.set(clazz, newValue);*/ + modifierField.setInt(nameField, modifiers); + //Utils.LOG_INFO("O-"+(byte) nameField.get(clazz) + " | "+newValue); + nameField.setByte(clazz, newValue); + //Utils.LOG_INFO("N-"+(byte) nameField.get(clazz)); - final Field fieldA = clazz.getDeclaredField(fieldName); - fieldA.setAccessible( true ); - fieldA.setByte(clazz, newValue ); + /*final Field fieldA = getField(clazz.getClass(), fieldName); + fieldA.setAccessible(true); + fieldA.setByte(clazz, newValue);*/ } -- cgit