Jump to content

fuzzybat23

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by fuzzybat23

  1. Kind of helpful but not looking for the method, looking for the field. What you meant to say was, I have to include three arguments with findField, not two. Instead of final Field f = ReflectionHelper.findField(RenderGlobal.class, "damagedBlocks"); it has to look like this final Field f = ReflectionHelper.findField(RenderGlobal.class, "damagedBlocks", "field_72738_E"); which is how you supply both mcp and srg names. See, that's how you provide a helpful answer, with examples. So if anyone out there with the same problem as me comes across this post. There it is. An example of how you do it, not just someone saying oh, you have to provide these two things. Still, thanks for your small breadcrumb trail I was able to use to dig through pages after pages on google to find the answer myself. Once again, examples examples examples, because not everyone is as smart as you when it comes to java coding. And yes, that extra little ,"field_72738_E" got it working perfectly with no errors.
  2. Can you give me a little more to go on besides " you need to supply both the MCP and SRG names " like an actual example of how such a code should look? I say that because I have absolutely no idea how to do such a thing. You can't exactly learn Forge programming in a text book.
  3. Well, I did this and it compiled and tested correctly from within IntelliJ, but when I moved the compiled mod to my main mincraft folder to test. it still ends up throwing the same error and fails to access the damagedBlocks field. This particular field I'm trying to access is within RenderGlobal.class private final Map<Integer, DestroyBlockProgress> damagedBlocks = Maps.newHashMap(); class GetBlockDamage { static float getBlockDamage(RayTraceResult target) { try { final Field f = ReflectionHelper.findField(RenderGlobal.class, "damagedBlocks"); f.setAccessible(true); HashMap<Integer, DestroyBlockProgress> map = (HashMap<Integer, DestroyBlockProgress>) f.get(Minecraft.getMinecraft().renderGlobal); for (DestroyBlockProgress destroyblockprogress : map.values()) { if (destroyblockprogress.getPosition().equals(target.getBlockPos())) { if (destroyblockprogress.getPartialBlockDamage() >= 0 && destroyblockprogress.getPartialBlockDamage() <= 10) return destroyblockprogress.getPartialBlockDamage() / 10.0F; } } } catch (Exception e) { e.printStackTrace(); } return 0F; } } 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToFindFieldException: java.lang.NoSuchFieldException: damagedBlocks 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraftforge.fml.relauncher.ReflectionHelper.findField(ReflectionHelper.java:107) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at com.fuzzybat23.esbb.GetBlockDamage.getBlockDamage(GetBlockDamage.java:28) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at com.fuzzybat23.esbb.ESBB.drawSelectionBox(ESBB.java:192) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at com.fuzzybat23.esbb.ESBB.onDrawBlockSelectionBox(ESBB.java:99) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_29_ESBB_onDrawBlockSelectionBox_DrawBlockHighlightEvent.invoke(.dynamic) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(ForgeHooksClient.java:155) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at java.lang.reflect.Method.invoke(Method.java:483) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at Reflector.callBoolean(Reflector.java:569) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityRenderer.java:1784) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1590) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1361) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1117) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.client.main.Main.main(SourceFile:123) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at java.lang.reflect.Method.invoke(Method.java:483) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) 06:29:04 game info [10:29:04] [main/INFO]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:43]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
  4. But there's no actual page for Reflection Helper in Forgedocs like there should have been from the very start. Something native to forge, but with no helpful documentation within ForgeDocs. I suppose you can see my, and other coder's frustrations when they do that?
  5. I don't suppose there's a tutorial for this ReflectionHelper Class? I suppose it would go something like this, which would then be changed to add in this ReflectionHelper thing of which I know absolutely nothing about? package com.fuzzybat23.esbb; +import ... class GetBlockDamage { private static final Field f = RenderGlobal.class.getDeclaredField("damagedBlocks"); }
  6. Were there any changes to the damagedBlocks field between 1.12 and 1.12.1? This code worked perfectly in 1.12, but I was just notified that it started throwing an error with 1.12.1. s package com.fuzzybat23.esbb; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.DestroyBlockProgress; import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.util.math.RayTraceResult; import java.lang.reflect.Field; import java.util.HashMap; class GetBlockDamage { static float getBlockDamage(RayTraceResult target) { try { Field f; try { f = RenderGlobal.class.getDeclaredField("damagedBlocks"); } catch (NoSuchFieldException e) { f = RenderGlobal.class.getDeclaredField("damagedBlocks"); } f.setAccessible(true); HashMap<Integer, DestroyBlockProgress> map = (HashMap<Integer, DestroyBlockProgress>) f.get(Minecraft.getMinecraft().renderGlobal); for (DestroyBlockProgress destroyblockprogress : map.values()) { if (destroyblockprogress.getPosition().equals(target.getBlockPos())) { if (destroyblockprogress.getPartialBlockDamage() >= 0 && destroyblockprogress.getPartialBlockDamage() <= 10) return destroyblockprogress.getPartialBlockDamage() / 10.0F; } } } catch (Exception e) { e.printStackTrace(); } return 0F; } } [01:31:59] [main/INFO] [STDERR]: [com.fuzzybat23.esbb.GetBlockDamage:getBlockDamage:34]: java.lang.NoSuchFieldException: damagedBlocks
  7. Well, I think I have all the bugs and kinks worked out. The alpha channel animation, where it used the damageprogress as the alpha ended up crashing and freezing the client, so I just dropped that part completely. Everything else seems to work. If anyone can give me an experienced review, mostly to make sure I haven't caused some catastrophic memory hole, or some such, I'd greatly appreciate it. https://github.com/fuzzybat23/Enhanced-Bounding-Box
  8. Oh yeah, I suppose using an Enum would be much easier to accomplish this. I just hope they get it fixed so I can use the chat color cycle ;>
  9. New thought. Is it possible to change the text within the Depth Buffer boolean button itself? Instead of saying True and False, it would say Enable and Disable?
  10. Ah, yeah! So change loadVariables to a public static void and call it within onConfigChanged. That makes sense.
  11. Ok, that's working right. But now in game I noticed that the values set when outside of the game, if you enter the mod config from the main menu, those values are loaded into the game. But if you hit esc while in game and go to mod config and change the values, the original values that were set are still there. So not only do I need to initialize the variables within preInit, but.. as part of the eventhandler that checks if I'm looking at a block? public void preInit(FMLPreInitializationEvent event) throws InvocationTargetException, IllegalAccessException { loadVariables(); } @SubscribeEvent public void onDrawBlockSelectionBox(DrawBlockHighlightEvent event) { loadVariables(); drawSelectionBox(event.getPlayer(), event.getTarget(), event.getSubID(), event.getPartialTicks()); event.setCanceled(true); } public void loadVariables() { Red = ModConfig.aFrame.Red; Green = ModConfig.aFrame.Green; Blue = ModConfig.aFrame.Blue; Alpha = ModConfig.aFrame.Alpha; Width = ModConfig.aFrame.Width; bRed = ModConfig.bBlink.Red; bGreen = ModConfig.bBlink.Green; bBlue = ModConfig.bBlink.Blue; bAlpha = ModConfig.bBlink.Alpha; switch(ModConfig.cBreak.Animation) { case NONE: Animation = 0; break; case SHRINK: Animation = 1; break; case DOWN: Animation = 2; break; case ALPHA: Animation = 3; break; default: Animation = 0; } DepthBuffer = ModConfig.cBreak.dBuffer; Speed = ModConfig.cBreak.Speed; } Only, doing that will force it to refresh the variables every single tick in game time. Is that wise, or should it be an issue?
  12. I have to put the check in the ModConfig's onConfigChanged. My main mod file looks like this, so far. It's still largely incomplete, I'm just focusing on getting the variables initialized. package com.fuzzybat23.csbr; import com.fuzzybat23.csbr.proxy.CommonProxy; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.RayTraceResult; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.fml.client.config.GuiConfigEntries; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL11; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @net.minecraftforge.fml.common.Mod(modid = "csbr", version = "1.0", clientSideOnly = true, acceptedMinecraftVersions = "[1.12, 1.13)") public class CSBR { @net.minecraftforge.fml.common.Mod.Instance("CSBR") public static final String MODID = "csbr"; public static final Logger LOGGER = LogManager.getLogger(); public static final String CLIENT_PROXY_CLASS = "com.fuzzybat23.csbr.proxy.ClientProxy"; public static final String CLIENT_SERVER_CLASS = "com.fuzzybat23.csbr.proxy.ServerProxy"; public static float Red; public static float Green; public static float Blue; public static float Alpha; public static float Width; public static float bRed; public static float bGreen; public static float bBlue; public static float bAlpha; public static float Speed; public static int Animation; public static boolean DepthBuffer; @Mod.Instance public static CSBR instance; @SidedProxy(clientSide = CLIENT_PROXY_CLASS, serverSide = CLIENT_SERVER_CLASS) public static CommonProxy proxy; @Mod.EventHandler @SideOnly(Side.CLIENT) public void preInit(FMLPreInitializationEvent event) throws InvocationTargetException, IllegalAccessException { proxy.registerTickHandler(); MinecraftForge.EVENT_BUS.register(this); Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); Configuration config = (Configuration)method.invoke(null, CSBR.MODID, null); ConfigCategory csbf = config.getCategory("general.custom selection box frame"); for(Property p: csbf.getOrderedValues()) { p.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); } ConfigCategory csbc = config.getCategory("general.custom selection box frame"); for(Property p: csbc.getOrderedValues()) { p.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); } ConfigCategory csba = config.getCategory("general.custom selection box animation"); Property csba_speed_prop = csba.get("2) Blink Animation Speed"); csba_speed_prop.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); Red = ModConfig.aFrame.Red; Green = ModConfig.aFrame.Green; Blue = ModConfig.aFrame.Blue; Alpha = ModConfig.aFrame.Alpha; Width = ModConfig.aFrame.Width; bRed = ModConfig.bBlink.Red; bGreen = ModConfig.bBlink.Green; bBlue = ModConfig.bBlink.Blue; bAlpha = ModConfig.bBlink.Alpha; switch(ModConfig.cBreak.Animation) { case NONE: Animation = 0; break; case SHRINK: Animation = 1; break; case DOWN: Animation = 2; break; case ALPHA: Animation = 3; break; default: Animation = 0; } DepthBuffer = ModConfig.cBreak.dBuffer; Speed = ModConfig.cBreak.Speed; } @SubscribeEvent public void onDrawBlockSelectionBox(DrawBlockHighlightEvent event) { drawSelectionBox(event.getPlayer(), event.getTarget(), event.getSubID(), event.getPartialTicks()); event.setCanceled(true); } public void drawSelectionBox(EntityPlayer player, RayTraceResult movingObjectPositionIn, int execute, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); if(execute == 0 && movingObjectPositionIn.typeOfHit == RayTraceResult.Type.BLOCK) { if(DepthBuffer) { GL11.glDisable(GL11.GL_DEPTH_TEST); } GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(Width); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); LOGGER.info(" Red = " + Red + " | Green = " + Green + " | Blue = " + Blue + " | Alpha = " + Alpha); LOGGER.info(" bRed = " + bRed + " | bGreen = " + bGreen + " | bBlue = " + bBlue + " | bAlpha = " + bAlpha); LOGGER.info("Line = " + Width + " | Speed = " + Speed + " | Animation = " + (Animation == 0 ? "NONE" : Animation == 1 ? "SHRINK" : Animation == 2 ? "DOWN" : "ALPHA") + " | Depth Buffer = " + (DepthBuffer ? "True" : "False")); } } } So to set the correct value for DepthBuffer based on which animation is picked, I need to add this to the onConfigChanged in my ModConfig file. @Mod.EventBusSubscriber(modid = CSBR.MODID) private static class EventHandler { @SubscribeEvent public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { if (event.getModID().equals(CSBR.MODID)) { if(CSBR.Animation == 1 || CSBR.Animation == 2) { ModConfig.cBreak.dBuffer = true; } ConfigManager.sync(CSBR.MODID, Config.Type.INSTANCE); } } } I think.. That way it should set the correct value and sync it to the actual cfg file, right?
  13. I suppose that when I load the values from the config file into the variables located in my main class, I could have it set the value of the config file to true if any animation is selected but NONE. That way, no matter what is picked in the config file, for the depth buffer, it will default to having the depth buffer disabled for those animations. public class CSBR { public static float Red; public static float Green; public static float Blue; public static float Alpha; public static float Width; public static float bRed; public static float bGreen; public static float bBlue; public static float bAlpha; public static float Speed; public static int Animation; public static boolean DepthBuffer; @Mod.EventHandler @SideOnly(Side.CLIENT) public void preInit(FMLPreInitializationEvent event) throws InvocationTargetException, IllegalAccessException { Red = ModConfig.aFrame.Red; Green = ModConfig.aFrame.Green; Blue = ModConfig.aFrame.Blue; Alpha = ModConfig.aFrame.Alpha; Width = ModConfig.aFrame.Width; bRed = ModConfig.bBlink.Red; bGreen = ModConfig.bBlink.Green; bBlue = ModConfig.bBlink.Blue; bAlpha = ModConfig.bBlink.Alpha; ConfigCategory csba = config.getCategory("general.custom selection box animation"); Property csba_depth_prop = csba.get("3) Depth Buffer"); switch(ModConfig.cBreak.Animation) { case NONE: Animation = 0; break; case SHRINK: { Animation = 1; csba_depth_prop.setValue(true); break; case DOWN: Animation = 2; csba_depth_prop.setValue(true); break; case ALPHA: Animation = 3; csba_depth_prop.setValue(true); break; default: Animation = 0; } DepthBuffer = ModConfig.cBreak.dBuffer; Speed = ModConfig.cBreak.Speed; } It wouldn't change the state of the Depth Buffer button on the config screen as the animation is picked, but I don't really care about that. As long as the internal code knows to turn it off if those animations are set is what's important.
  14. Depth Buffer turned off essentially lets you see the entire wireframe through the block itself. It's kind of a neat effect. Sometimes i use it with no break animation set. So what would this IConfigEntry look like?
  15. Oh yeah! There was one other thing I just thought of. With the enum control (None, shrink, down, alpha) If any but NONE are selected, how can I force it to set DepthBuffer boolean to true in real time. Say, the cycle button is on NONE by default. You click it to SHRINK and the button for Depth Buffer immediately greens with true being set.
  16. Well crap, this was doomed to failure from the start then Hope they do get that fixed soon. For now, I'll just keep it in the rgb slider system. Now I need to plug in the main guts of my mod to test it out fully. Thanks again :> Hopefully this thread will help out anyone else looking up the annotation system. There really should be a section in Docs detailing everything that the annotation @Config system can do. Doesn't make sense to introduce a powerful and simple modding tool and not tell anyone about it
  17. There really needs to be a section in Docs outlining everything modders can do with the new @Config annotation based system.
  18. Instead of an Enum, I should instead use an array @Name("2) Break Animation") @Comment("Break Animation") public String[] animation = new String[] {"NONE", "SHRINK", "DOWN", "ALPHA"}; and use GuiConfigEntries.ChatColorEntry.class on that?
  19. It didn't work before I just tried this again and tested it and it does seem to work. Little cleaner looking, too, I think. for(Property p: cat.getOrderedValues()) { p.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); } Anyway, yeah, I was thinking about ChatColorEntry too. I tried to test it with the enum I already had setup. ConfigCategory cat2 = config.getCategory("general.custom selection box animation"); Property prop = cat2.get("animation"); prop.setConfigEntryClass(GuiConfigEntries.ChatColorEntry.class); but all that did was throw an error. Time: 7/15/17 9:23 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Custom Selection Box Revised (csbr) Caused by: java.lang.NullPointerException at com.fuzzybat23.csbr.CSBR.preInit(CSBR.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:630) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:252) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:230) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266) at net.minecraft.client.Minecraft.init(Minecraft.java:508) at net.minecraft.client.Minecraft.run(Minecraft.java:416) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.12 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_131, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 891752248 bytes (850 MB) / 1135607808 bytes (1083 MB) up to 3808428032 bytes (3632 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.40 Powered by Forge 14.21.1.2387 6 mods loaded, 6 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH minecraft{1.12} [Minecraft] (minecraft.jar) UCH mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2387.jar) UCH forge{14.21.1.2387} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2387.jar) UCE csbr{1.0} [Custom Selection Box Revised] (CSBR_main) UCH squeedometer{1.0.3} [Squeedometer] (Squeedometer-mc1.12.x-1.0.3.jar) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 384.76' Renderer: 'GeForce GTX 770/PCIe/SSE2' [09:23:11] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# E:\Users\RigAlpha\Documents\My Projects\Minecraft\Git\CSBR\run\.\crash-reports\crash-2017-07-15_09.23.11-client.txt Process finished with exit code -1
  20. I don't suppose there's a way to get a block at the bottom, under Wire Thickness, that will change colors according to the slider values? Kind of like the chat color picker. In that case, I'd probably drop the red green blue entirely and just go with the basic, what is it.. 16 colors that Minecraft uses? Either way, this is exactly what I was looking for. Thanks! More in depth tutorials on the @config system need to me made for this reason I did find the source for that, too. I guess if I went that route, it would be a cycle value button instead of a number slider. The number slider would still be used for the animation speed, frame thickness and alpha channels, though. /** * ChatColorEntry * * Provides a GuiButton that cycles through the list of chat color codes. */ public static class ChatColorEntry extends CycleValueEntry { ChatColorEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); this.btnValue.enabled = enabled(); updateValueButtonText(); } @Override public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial) { this.btnValue.packedFGColour = GuiUtils.getColorCode(this.configElement.getValidValues()[currentIndex].charAt(0), true); super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial); } @Override public void updateValueButtonText() { this.btnValue.displayString = I18n.format(configElement.getValidValues()[currentIndex]) + " - " + I18n.format("fml.configgui.sampletext"); } }
  21. I had to play around with the category name, it wasn't general.aFrame or general.Frame, but general.custom selecton box frame
  22. I think I see. for(int i = 0; i < cat.getOrderedValues().size(); i++) { cat.getOrderedValues().get(i).setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); }
  23. I don't have much experience with the immutable.. Something like this? List<Property> props = new ArrayList<Property>(cat.getOrderedValues()); for(Property p:props) { p.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); }
  24. I'm going to try to get a little fancy here. Like this, right? ConfigCategory cat = config.getCategory("general.aFrame"); Property propaFrame[] = new Property[5]; propaFrame[0] = cat.get("Red"); propaFrame[1] = cat.get("Green"); propaFrame[2] = cat.get("Blue"); propaFrame[3] = cat.get("Alpha"); propaFrame[4] = cat.get("Width"); for(Property p:propaFrame) { p.setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class); }
  25. And if I want all the props in aFrame to have the slider, I'd need to set it up more like this, right? ConfigCategory cat = config.getCategory("general.aFrame"); Property propRed = cat.get("Red"); Property propGreen = cat.get("Green"); Property propBlue = cat.get("Blue"); Property propAlpha = cat.get("Alpha"); Property propWidth = cat.get("Width");
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.