Jump to content

BatHeart

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by BatHeart

  1. Thanks everyone. I believe I understand it better now. My .addListener() calls were never doing anything. Everything was handled by the @SubscribeEvent and the MinecraftForge.EVENT_BUS.register() calls. I have now taken out all of the .addListener() code, and Forge now loads my mod, and the mod still works. Batty's Mod does not end with 1.15.2! This will be good news to my 'customers' who have been asking me why it suddenly stopped working 😄
  2. Thanks @CAS_ual_TY Much appreciated! I think I am registering to MinecraftForge.EVENT_BUS. I think the problem may be with how I am adding my listeners. For example: final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(battyUI::renderPlayerInfo); but when I register it: MinecraftForge.EVENT_BUS.register(new BattyUI(Minecraft.getInstance())); And in the BattyUI class: @SubscribeEvent public void renderPlayerInfo(RenderGameOverlayEvent event) { I think the problem may be that I am getting the wrong type of mod event bus before I add the listener. As you can see, I am getting an IEventBus. I think I need to find a way of getting an IModBusEvent. Or am I still confused?
  3. I'm not trying to prove a point. Honestly. I just want to know what I should be doing. My mod displays coordinates, a timer and some other information on screen. I've been maintaining a Forge version of it since Minecraft 1.0.1. I need an event that fires when the game screen is being rendered, to call my code to display this information. Am I understanding correctly, that the only events that I can subscribe/listen to are those that implement IModBusEvent? Because there don't seem to be any of them that are connected with screen rendering. It would be a sad day if I had to stop my mod at version 1.15.2, having maintained it for 7 years, but I can see that's where we're heading with this conversation.
  4. I'm sure it must have been firing, or the information I'm displaying on screen would never have appeared. My code would never have been called. So, could you tell me which event I should subscribe to and listen on if I want to display something on screen whenever the main game overlay is being rendered? I would be grateful for any practical assistance.
  5. Well, it's been registered the same way through all the prior versions and was working fine up until 32.0.88. Then this change was made and it no longer works, but I'd like some advice as to how to set a listener on the RenderGameOverlayEvent. Just saying I did it wrong is not very helpful to me.
  6. My mod has always had listeners on various events, one of which is RenderGameOverlayEvent. Since 1.16.1 - 32.0.90 and the introduction of IModBusEvent, my mod fails to load because the listener for this event is not a subtype of IModBusEvent. I can see this described in the Changelog as Introduced IModBusEvent as a marker interface for events on the ModBus. Expect exceptions if you use the modbus for events not listened there. However, I am unclear as to how I should fix the problem (...or even if I can fix it yet. Maybe I have to wait for further code changes in Forge?) Any advice would be greatly appreciated. Thanks
  7. After working on restructuring my whole mod, to bring it as close to @Cadiboo's example as I could, this still wasn't working. (But my mod was so much better structured. Thanks, @Cadiboo!) Then I discovered what the problem had been all along. I had been using an old convention available for KeyBindings, which evidently worked up to and including 1.12. My categories were named 'key.category.batty'. This must now be 'key.categories.batty'. I also had the KeyBindings themselves named e.g. 'key.batty:infodisplay' and this should now be 'key.batty.infodisplay'. One or the other (or both) of these were responsible for my problem. It's very strange, because the whole key binding worked fine while I was in game. It's just that it forgot the key bindings which had been changed the next time I entered game. Anyway. All solved. I just thought I would post this in case anyone else wanders into similar problems. It's all in the name!
  8. Ah. Thank you. Just to confirm that I have got this right - we are both doing exactly the same things, but you do it all in your ClientProxy, whereas I have been doing it in my base mod, and tying them to particular events. Evidently you do not see this problem, so I shall try to replicate your method in my code and hopefully ...
  9. Apologies if this has been asked elsewhere. I looked, but didn't find it. In versions of my Forge mod up to 1.12.2, I was handling KeyBindings like this, and it was working fine: 1. Declare the KeyBindings 2. In FMLPreInitializationEvent, registerKeyBinding 3. Detect the bound keys being used, using a KeyInputEvent, within my code I realise things are slightly different in 1.14.3: 1. I still Declare the KeyBindings as before (but have to use key codes instead of the Keyboard. shortcuts) 2. There is no FMLPreInitializationEvent, so I registerKeyBinding in FMLClientSetupEvent 3. I Detect the keys in virtually the same way, but KeyInputEvent is no more, so I use ClientTickEvent instead All of this basically works in 1.14.3 the same as it used to, but with one problem. If I change a keymapping in-game (on the Controls screen) then it works just fine while I am in-game, and even writes the new key code to the options.txt file, but the next time I go into game, the key mappings are back to the default ones. This didn't happen in 1.12.2. It's as though it is not reading the mappings from options.txt - or is it reading them and then overwriting them with the defaults? Has anyone else experienced this problem in 1.14.3, or maybe you know what I am doing wrong here and can help? Any help would be much appreciated.
  10. Thanks. I'd pretty much worked that out back in Feb. I'm prepared to wait. I wasn't going to say anything more, but then I saw the question Vistaf was asking me, and had to clarify.
  11. I couldn't update them in game. As I say in that post, I don't think the in-game config button is implemented yet, so I just updated the toml file manually. However, since I made that post, I've been shown that the Forge config really wasn't working at that point. Hopefully it's now better, and I'll have another go at including it. I've had to tell people that basically there is no configuration possible of the 1.13 version of my mod.
  12. We've all had to work it out for ourselves, or ask each question as it arises. The readme files in the latest MDKs for 1.13.2 have been updated, so they do describe the new way to set up the workspace for eclipse or IntelliJ. The link at the top of the page "1.13 Update Notes for Mod Creators" is worth looking at for details of many of the major code changes in 1.13.x Minecraft and Forge.
  13. ... and now this is broken again ... I've tried with builds 25.0.47 and 25.0.48 and it appears to be the same - you have to run gradlew genEclipseRuns before the Run Configurations appear. However, now the Client launch fails - even if you try to run it with just the examplemod. The problem is a NullPointerException at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:161) We can go back to using gradlew runClient - but that's not ideal especially if you want to debug.
  14. Oh. I see your example. Well, the problem I get when doing that is I get a run time error saying there is a conflict between my mod's config and itself. It's as though it sees each of them as my mod, and doesn't allow duplicates of the same mod to have config. The log file shows the error as: [22Feb2019 14:20:01.027] [modloading-worker-1/ERROR] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Detected config file conflict coordinatesplusmod-client.toml between coordinatesplusmod and coordinatesplusmod [22Feb2019 14:20:01.028] [modloading-worker-1/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: coordinatesplusmod, class battys.coordinatesplusmod.BattyBaseUI
  15. Difficult to describe without screenshots, but I have too many options to put easily on one screen, so in all of my previous versions I split them up into 3 screens. So when you click on Config the first thing you see is the choice of 3: "Coordinates Options" "Timer Options" or "Infopanel Options". Clicking on "Coordinates Options" brings up a page of just those options, etc. I implemented all this in 1.12 using the @config annotation system, which allowed this kind of structure (outer-level config, 3x inner-level configs) I just don't see whether the new ForgeConfigSpec system permits you to do this.
  16. Thanks for this LTNightshade! I had found another example in the mean time, but all examples are very useful. I have actually got mine working now, but it appears that the Config button on the Mods screen is not yet implemented (It doesn't work for the Forge internal mod either). However, I can edit my configuration toml file manually and my mod picks up the changes, which felt like a great leap forward! The one problem I've had to workaround is that my config was split into 3 subsections. I don't know how to do this in the new ForgeConfigSpec implementation without getting crashes. So for the moment I've just used the one config section.
  17. I've been trying to set up my mod config using the new ForgeConfigSpec calls. For reference, I have been following the way it is done in ForgeConfig, for Forge's own config. I am still puzzled because I can't get it to launch without errors. Does anyone have a working example of this for 1.13.2 - ForgeConfigSpec - that I can examine and learn from?
  18. Don't take me as an expert. I'm muddling through this the same as all of the modders, but the new config system is based around ForgeConfigSpec. I looked at the way ForgeConfig was using ForgeConfigSpec, and followed that. However, I haven't got it working yet. (but I notice nothing seems to activate the 'Config' button on the Mods menu, for the Forge mod either, so maybe it isn't implemented yet) It does seem to be the way to go, but we have to work it out for ourselves.
  19. As I mentioned earlier, I have precisely the same problem - and all I am trying to do is get it to recognise the examplemod included in the MDK. I have used the mods.toml file exactly as it appears in the MDK, but Forge's own example mod is not loaded.
  20. I'm currently stuck at the same point HarryTechReviews. I am only trying to load the example mod that is included in the mdk, but it doesn't get loaded. I have tried tweaking the mods.toml file, following the example of various mods that are already available for 1.13.2 and provide their source. I can't see what's wrong. It all seems ok, but the mod (even the examplemod) doesn't get loaded
  21. I'm puzzled at a similar point, MegaCrafter10. I don't get the error, but if I try to run Minecraft from within eclipse with just the examplemod - in the src and the toml - it doesn't get loaded. Minecraft starts fine, but there is no sign of examplemod in the list of loaded mods. My first thought was that 1.13.2 Forge is version 25, so the toml needs to say 25 rather than 24. But I tried that and still got the same result. That's as far as I've reached right now with 1.13.2. By the way, you can get versions of 1.13 Forge from here: http://files.minecraftforge.net/maven/net/minecraftforge/test/forge/index_1.13.html However, I've reached the same point with 1.13 too. It seems modding in the 1.13.x versions is a matter of solving problem after problem yourself. I wish there was some clear guidance notes somewhere. P.S. I just got the latest mdk (forge-1.13.2-25.0.13-mdk) and I see the version in the toml has been updated from 24 to 25. Still doesn't recognise their own mod, though.
  22. I asked the same question in this thread. I got no replies, but I managed to resolve it myself as I describe in the second post
  23. I managed to solve this myself. Just start up Eclipse and point it at an empty workspace. Then Import - General - Existing projects into workspace, and point this at the base folder where you unzipped Forge and performed the set up (i.e. where the .project file is)
  24. I'm probably just doing something wrong, but I have tried to set up the development workspace for 1.13 and I don't see the end-product that I am expecting. I realise, from checking this forum, that it is no longer necessary to run gradlew setupDecompWorkspace but that I should only run gradlew eclipse. I also cleared out my .gradle folders to give it a clean start. The gradlew eclipse runs through successfully in 6 or 7 minutes and there are no errors thrown. However, I am expecting to see an eclipse folder created, which I point my copy of eclipse to. This is how it always worked previously. But I don't see an eclipse folder, so I don't know what to do next. Has something gone wrong, or am I just not aware of how to continue?
  25. I also noticed this had disappeared from my own forum view. To re-enable, go into your Account Settings, the 'signature' tab, and check the box marked 'View Signatures' (or similar).
×
×
  • Create New...

Important Information

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