Jump to content

saxon564

Forge Modder
  • Posts

    490
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by saxon564

  1. I had forgotten about this post... I found the only way to do this is to listen to the EntityJoinLevelEvent and call level.registryAccess().registryOrThrow(Registries.BIOME).keySet() when an entity joins the level. Here is how I handled it: https://github.com/saxon564/MoChickens/blob/master/src/main/java/com/saxon564/mochickens/events/CommonEvents.java https://github.com/saxon564/MoChickens/blob/master/src/main/java/com/saxon564/mochickens/configs/txts/ItemFile.java
  2. I'm trying to export all the biome keys into a file. I have it working for items, blocks, particles, etc.. But for some reason, the biomes list is coming back empty. I am trying to get this list during the FMLCommonSetupEvent, I even attempted to run it during the BuildCreativeModeTabContentsEvent with the same results. I do not get any errors, and when I log it to the console using the below snippit, it logs "Biomes: []" logger.debug("BIOMES: " + ForgeRegistries.BIOMES.getKeys().toString()) I know this used to work back in 1.15, when I last tried modding. I can't figure out why it isn't working now, especially since it is working for all the other lists. Is there a new way to get a list of biome keys other than ForgeRegistries.BIOMES.getKeys() now?
  3. I managed to get this fixed. I remembered reading someone saying that the command order matters when setting up. Previously I had set up by running gradlew eclipse then gradlew genEclipseRuns I swapped the order and that seems to have fixed my issue.
  4. I recently started trying to get back into modding after having last done anything in 1.15. Now when I try to run the client with Java8 I get this error Exception in thread "main" java.lang.UnsupportedClassVersionError: cpw/mods/bootstraplauncher/BootstrapLauncher has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Doing some research I found I needed to update to at least Java16 to fix this error. But when I do that I now get this error Exception in thread "main" java.lang.ExceptionInInitializerError at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystemInternal(UnionFileSystemProvider.java:115) at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystem(UnionFileSystemProvider.java:105) at cpw.mods.jarhandling.impl.Jar.<init>(Jar.java:84) at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:70) at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:66) at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58) at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:50) at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:84) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field static final java.lang.invoke.MethodHandles$Lookup java.lang.invoke.MethodHandles$Lookup.IMPL_LOOKUP accessible: module java.base does not "opens java.lang.invoke" to unnamed module @7d4793a8 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) at java.base/java.lang.reflect.Field.setAccessible(Field.java:172) at cpw.mods.niofs.union.UnionFileSystem.<clinit>(UnionFileSystem.java:52) ... 8 more I can execute runClient in command prompt without any issues, but not through Eclipse. I have tried this with both Java16 and Java17 and both give this same error. Does anyone have any suggestions to get this working correctly?
  5. What do you mean by "Forgesrc still doesnt show"? Are you actually looking for a folder in your project src that is the forge source? What are you expecting to be seeing and where are you looking?
  6. Are you using eclipse of intellij?
  7. Could you show a screenshot of the contents of the folder 'ye'?
  8. I just had a break through. It seems it is an issue with the world itself. I went to a new fresh world and it works with no issues.
  9. So I have found that the cause seems to be the createExplosion method, which tells me I must be passing some sort of bad information to it, or calling it improperly. But as far as I can tell, I am doing everything right with it.
  10. Does anyone else have any thoughts as to what might be causing this issue?
  11. Do you have json for the item model of your block? Nevermind me, I should have refreshed the page before responding.
  12. The error is a resource pack error, which I can safely say I have never seen from any of the screwed up jsons I have made. It makes me think there is a resource pack installed for a previous version of Minecraft. If you don't have a resource pack installed, it could be.
  13. Lex has a lot of haters. He is blunt and tells it how it is, which most people don't like. Everyone has a run-in with him thats makes them hate him, just some hold that hatred, others let that hatred go and learn that he was helping but is tired of people who don't know what they are doing and refusing to do what they really need to do, usually learning basic java and basic coding in general. The class you have there is as simple as it can get. For a single item the helper method isn"t really needed, but it becomes a more important resource when you start getting many more items since it will make updating the resource locations a lot quicker if something chages. Aside from that, I don't think there is anything anyone will say you can do to make that class any simpler or efficent.
  14. Since I first built this in 1.5.2 I do not remember the reason I did not extend the vanilla chiclen. I would guess that at the time, it was because of spawning issues or issues with making the chickens hostile. As for why code isn"t split between each individual chicken, that is because I have made the chickens highly configurable, so any chicken can do anything. So to put the "respective" code in each chicken class, I would have 21 classes that would be almost 100% identical. Which would also mean loads more time would have to go into updating since I would have to update 21 classes instead of just a single class. I will admit, when I was first building the mod, I did copy and paste a lot of vanilla code, but I have also made several changes to get the code to work the way I wanted/needes it to.
  15. Unfortunately that was not the case, there was no change in the result at all.
  16. I feel like I've done that before with no positive results, but that may have been for a different issue, so I will give it a shot tonight and see if that works.
  17. I have condensed my code down so the link in my first post is off by several lines. So here is the correct link. I also commented out all the code using the Minecraft instance since none of that is important right now. I still can't figure out what is causing the hang. Putting in debug code between each line and even overriding the remove methods and all the debug lines do get called. So it seems to me it is something after the my entity is removed, which makes no sense since if the entity dies in any other way, this is not an issue.
  18. OK, I will add that to my list of things to address. For now though, can we focus on the issue I made the post for?
  19. The value only ever gets used on the client side for sending chat messages when the tamed entity dies. Are you saying you believe that is what is causing the hang though?
  20. My entities have the ability to explode similar to a creeper, and use almost the exact same code as a creeper, but when the entity explodes the server thread freezes. I can still move around and the item entities still spin. But I cannot pickup anything, save the game, or even close the game. I cannot figure out what is causing it. The code is located here.
  21. You are setting x y and z back to 0 every tick, so it doesn't matter how many times you set it, you are always going to update the block at 0, 0, 0. I would declare x y and z at the top of the class instead of the method, this way you won't reset them back to 0 every tick.
  22. Github is the best way to share code. If you upload it correctly, the it will allow others to fork your code and try to do their own debugging to help you, as well as they won't have to ask you to also share other classes, as all your classes will be available.
  23. The lighting updates its previous position as it moves. Unless the entity, or in your case projectile, is moving at over 1 block per tick then you don't need to track the last position. If you really need to, you can check every block in the 3x3 cube centered around the chicken but the need for that would be very rare as that would mean the entity would go perfectly between the corners of 2 blocks and not touch a mutual block. Share your whole class so I can see what you have setup.
  24. You need to call a block update for the block the chicken occupies when it dies. I handle that in the livingUpdate method at the end of the method by having a check for if the chicken is dead and running the code.
  25. I did notice my last working code was actually in 1.12.2 and included entity lighting.
×
×
  • Create New...

Important Information

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