Everything posted by fernthedev
-
[SOLVED] [1.13] Config not being created
Thanks ?
-
[1.13] How to enable Config GUI (Config button grayed out)
So with the old 1.12 config annotation system, you used to be able to make a custom config GUI. Is this still implemented, if so how to enable it?
-
[SOLVED] [1.13] Config not being created
Played around with Cadiboo's NoCubes code and somehow got it working. I believe this was caused by calling the config register on the FML Setup event rather than the constructor.
-
[SOLVED] [1.13] Config not being created
Well I posted an error on forums where my config object was missing and that was no luck at time of writing. However, I noticed that when Cadiboo on my original Config post mentioned the ModConfig.ModConfigEvent, I went looking through his mod NoCubes to see how he was making the config get created in the first place or to get the instance working. I found the event which was the only part missing in my code, yet my config is still not being created and the event isn't being fired and I haven't found any methods that his mod is using to fire the event or to create the config. Most of my config is handled in these classes/packages https://github.com/Fernthedev/controller-remap/tree/beta/mod-1-13-x/src/main/java/com/github/fernthedev/controllerremapmod/config https://github.com/Fernthedev/controller-remap/blob/beta/mod-1-13-x/src/main/java/com/github/fernthedev/controllerremapmod/ControllerRemapModMain.java#L69-L92 Sorry for posting so many config topics, I can't find any documentation for the new system in the docs (they still mention the old 1.12 annotation config system)
-
[1.13] Caused by: java.lang.NullPointerException: Cannot get config value without assigned Config object present
The full source is at: https://github.com/Fernthedev/controller-remap/tree/beta I'm having an issue with using the config system in which I am getting this error: [09:28:09.236] [modloading-worker-1/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event FMLCommonSetupEvent dispatch for modid controller-remap java.lang.ExceptionInInitializerError: null at com.github.fernthedev.controllerremapmod.ControllerRemapModMain.getConfigHandler(ControllerRemapModMain.java:216) ~[main/:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at com.github.fernthedev.controllerremapmod.core.ControllerHandler.setHandler(ControllerHandler.java:30) ~[mod-core-1.0-SNAPSHOT.jar:?] {} at com.github.fernthedev.controllerremapmod.ControllerRemapModMain.setup(ControllerRemapModMain.java:77) ~[main/:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:208) ~[eventbus-0.9.2-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:200) ~[eventbus-0.9.2-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:254) ~[eventbus-0.9.2-service.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105) ~[?:25.0] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_172] {} at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_172] {} at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:111) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraftforge.fml.ModList.lambda$null$9(ModList.java:120) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_172] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_172] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_172] {} at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) ~[?:1.8.0_172] {} at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[?:1.8.0_172] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_172] {} at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401) ~[?:1.8.0_172] {} at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) ~[?:1.8.0_172] {} at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160) ~[?:1.8.0_172] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174) ~[?:1.8.0_172] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[?:1.8.0_172] {} at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_172] {} at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583) ~[?:1.8.0_172] {} at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$10(ModList.java:120) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) [?:1.8.0_172] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_172] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_172] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_172] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_172] {} Caused by: java.lang.NullPointerException: Cannot get config value without assigned Config object present at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787) ~[guava-21.0.jar:?] {} at net.minecraftforge.common.ForgeConfigSpec$ConfigValue.get(ForgeConfigSpec.java:632) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at com.github.fernthedev.controllerremapmod.config.TomlSettingsConfig.parseFromConfig(TomlSettingsConfig.java:87) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at com.github.fernthedev.controllerremapmod.config.TomlSettingsConfig.build(TomlSettingsConfig.java:29) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at com.github.fernthedev.controllerremapmod.config.ConfigHandler.<init>(ConfigHandler.java:57) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraftforge.common.ForgeConfigSpec$Builder.configure(ForgeConfigSpec.java:478) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at com.github.fernthedev.controllerremapmod.config.ConfigHandler.<clinit>(ConfigHandler.java:49) ~[?:?] {pl:eventbus:A,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} ... 30 more The error seems to be called at sensitivity = sensitivityConfig.get(); when this check is being done: Preconditions.checkNotNull(spec.childConfig, "Cannot get config value without assigned Config object present"); Am I supposed to do something other than using this: (Merged some classes together) final Pair<ConfigHandler, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(ConfigHandler::new); CLIENT_SPEC = specPair.getRight(); //After all of the functions in the constructor is called final ModLoadingContext modLoadingContext = ModLoadingContext.get(); modLoadingContext.registerConfig(ModConfig.Type.CLIENT,ConfigHandler.CLIENT_SPEC); private ConfigHandler(ForgeConfigSpec.Builder builder) { settingsConfig = new TomlSettingsConfig(); settingsConfig.build(builder); } public void build(ForgeConfigSpec.Builder builder) { load(builder); parseFromConfig(builder); } private void load(ForgeConfigSpec.Builder builder) { builder.push(MAIN_CATEGORY); sensitivityConfig = builder.comment("The sensitivity of the controller").defineInRange("sensitivity",1,-3,-3); selectedMappingConfig = builder.comment("The controller mapping that should be used").define("selectedmapping",new XboxOneMapping().toJson()); builder.pop(); builder.build(); } @Override public void parseFromConfig(Object configObject) { sensitivity = sensitivityConfig.get(); selectedMapping = Mapping.loadFromJSON(selectedMappingConfig.get()); }
-
[1.13] Missing @Config annotation and package
Is there any way to get the configuration directory without hard coding a string such as ".minecraft/config/mod/" and save it as a File instance?
-
[1.13] Missing @Config annotation and package
As in, I want my controller mod to be able to support controller mappings through config files. Basically make a config file inside a folder with all the mapping info in it and then in code read through that mapping file. Basically this but not just one mapping file, multiple for convenience.
-
[1.13] Missing @Config annotation and package
So basically if I wanted to access a folder of config files that follow the same schema that can be created by the user to be used ingame is currently not possible (at least not easily anyways)? Is there any chance of the 1.12 config system coming back, I found that to work quite well in design and usability
-
[1.13] Missing @Config annotation and package
That wasn't my question, my question was to access a custom config file set in a custom path/folder within the default config's folder. For example /modconfigfolder/randomfolder/someconfig.toml
-
[1.13] Missing @Config annotation and package
How would I go to view a specific config file, say /configdir/somerandomdir/test.toml?
-
[1.13] Missing @Config annotation and package
Does 1.13 have a new config system that I have to use? Or I use the legacy config system if any? (Any wiki/tutorial on the legacy system if it is?)
-
[SOLVED] How to call clickMouse to break blocks in survival and have a delay in breaking in creative
Well somehow I changed some code and accidentally fixed my issue. Thanks to anyone who was going to try to help though
-
[SOLVED] How to call clickMouse to break blocks in survival and have a delay in breaking in creative
So basically every time InputUpdateEvent I am calling this method that I created public void clickMouse(boolean leftClick) { try { if(clickMethod == null) { clickMethod = ObfuscationReflectionHelper.findMethod(minecraftClass,"func_147116_af"); //clickMouse(); clickBlockMethod = ObfuscationReflectionHelper.findMethod(minecraftClass,"func_147115_a",boolean.class); //sendClickBlockToController(boolean leftClick); clickMethod.setAccessible(true); clickBlockMethod.setAccessible(true); } if(leftClick) { clickMethod.invoke(Minecraft.getInstance()); } clickBlockMethod.invoke(Minecraft.getInstance(),leftClick); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } } However calling it every event makes it so it breaks a block seemingly every tick in creative and in survival it doesn't actually break the block, just creates the block hit particles. I looked into Minecraft's code and saw it had the delays in the methods built-in for the tick time, however they seemed to be skipped. Do I have to implement my own delays? Or am I just missing a call to a function? Should I also stop calling clickMethod after it's been called once until they let go of the trigger?
-
How to move player camera, while also making it smoothly
Right now, the camera moves perfectly fine, though the result is quite bad because it stutters a lot. How do I go to making this move smoothly? The method I am using is called on InputUpdateEvent and am using this: if(!handler.isGuiOpen()) { int multiplier = 5; //TODO: Will be changed to sensitivity and will add a menu for changing this value //Equivalent to (Minecraft.getMinecraft().thePlayer.rotationPitch += controller.getAxes().getHORIZONTAL_RIGHT_STICKER().getValue();) if(deadzone(controller.getAxes().getHORIZONTAL_RIGHT_STICKER().getValue(),-0.1,0.1)) player.addRotationPitch( controller.getAxes().getHORIZONTAL_RIGHT_STICKER().getValue() * multiplier); // -1 is down, 1 is up, 0 is stateless if(deadzone(controller.getAxes().getVERTICAL_RIGHT_STICKER().getValue(),-0.1,0.1)) //Equivalent to (Minecraft.getMinecraft().thePlayer.rotationYaw += controller.getAxes().getVERTICAL_RIGHT_STICKER().getValue();) player.addRotationYaw(controller.getAxes().getVERTICAL_RIGHT_STICKER().getValue() * multiplier); // -1 IS DOWN, 1 IS UP, 0 IS STATELESS }
-
[1.13] How to make a fat jar and possibly minimize any unused code or dependencies
What if it's a project dependecy such as compile project(':mod-core')
-
[1.13] How to make a fat jar and possibly minimize any unused code or dependencies
I've tried ShadowJar to accomplish this, and it works on anything pre-1.13. However, I kept running into an issue which I asked for help and no solution was suggested. Due to this, I'm just deciding to see if creating a new thread on doing this instead of just a specific bug or issue would be better. How would I accomplish this while also keeping the jar small and not including the minecraft obfuscated code like some methods I've tried.
-
[1.13] Shadowjar reobf "No value has been specified for property 'mappings'"
bump
-
[1.13] Shadowjar reobf "No value has been specified for property 'mappings'"
So my 1.13 project uses some libraries which have to be shaded in and whenever I use shadowjar on anything pre 1.13 works fine, however if I use this: shadowJar { minimize() } reobf { //noinspection GroovyMissingReturnStatement shadowJar {} } I get this error: > Task :mod-1-13-x:compileJava > Task :mod-1-13-x:processResources > Task :mod-1-13-x:classes > Task :mod-1-13-x:jar > Task :mod-1-13-x:downloadMcpConfig > Task :mod-1-13-x:extractSrg > Task :mod-1-13-x:createMcpToSrg > Task :mod-1-13-x:reobfJar > Task :mod-1-13-x:shadowJar > Task :mod-1-13-x:reobfShadowJar FAILED FAILURE: Build failed with an exception. * What went wrong: A problem was found with the configuration of task ':mod-1-13-x:reobfShadowJar'. > No value has been specified for property 'mappings'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 19 actionable tasks: 19 executed No value has been specified for property 'mappings'. 11:32:26 AM: Tasks execution finished 'clean build'.
-
How to execute the equivalent of left click,right click, jump etc. in java code
There is one reason to use it, though it's not really that important anyways. It's mostly used for pvp, aka sword blocking. However have any ideas on mods that fix that problem on later versions like 1.13? Or any idea on how to achieve the same functionality without making it look somewhat fake (I know it's off topic, I might make another topic just for that)
-
How to execute the equivalent of left click,right click, jump etc. in java code
Welp, so basically give up on 1.8.9 forever?
-
How to execute the equivalent of left click,right click, jump etc. in java code
What about pre 1.9? Aka 1.8.9, didn't realize it was in 1.12 because Intellij was recommending 1.13 dependency ;/
-
How to execute the equivalent of left click,right click, jump etc. in java code
I was able to look into InputUpdateEvent, however it's a 1.13 only thing as I see it. Did this exist before, if so, what is it's legacy name? I can't seem to find anything similar to it in the same package.
-
How to execute the equivalent of left click,right click, jump etc. in java code
Thanks for the clarification, I'll keep that in mind until I can work on my code again. Thank you for your valuable help ?
-
How to execute the equivalent of left click,right click, jump etc. in java code
I did not check due to being away from my development workspace at the moment, however as I see it, I use the instance of the event to jump by setting a value or calling a method, no? Same for walking or do I keep my old walk method and put it in the tick method or the moveinput event?
-
How to execute the equivalent of left click,right click, jump etc. in java code
Amazing tips and help you've given me. So in the movement event I can call jump/sneak methods and use my move methods? Sorry for my repetition, I just need that fully clarified
IPS spam blocked by CleanTalk.