Jump to content

SpectralGerbil

Members
  • Posts

    29
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SpectralGerbil's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. It's not your problem, the download page is currently down. You'll have to wait, sadly.
  2. Not the answer you want, but we have no idea. Just wait and see. You can still build your mod (as long as you don't need any new dependencies) by running Gradle in offline mode: https://www.baeldung.com/gradle-offline-mode
  3. Send us your entire code file, not just that small portion you posted. You are most likely telling the game to break a block on an event that only happens on the client side.
  4. Look at the vanilla game's code under your project's dependencies, it'll be under something like: minecraft.item.
  5. Yup, right as I go to download new dependencies... x) Hopefully gets fixed soon
  6. I've already been using the bot, but thank you for the link! Had no idea of this functionality!
  7. Hiya, to make a long story start I am altering the Phantom AI and part of this involved using reflection to fetch various private parts of the AI system (like the various goal objects in Forge). Problem I'm having is, after I run all these calculations, I need to put them back into the AI goal - but I can't quite do this. See, the field I'm trying to edit is "attackTargeting", within the Phantom.PhantomAttackPlayerTargetGoal subclass. Problem is, this subclass is not public. Attempting to use reflection to get the value of the field simply throws me an error that the field and subclass are not visible. I'm experienced in Java but have absolutely no idea how to get around accessing a non-visible field without being able to edit said field (which I can't, because it's vanilla code). What can I do here?
  8. Got it working - thanks for the brilliant help!! Will post here how I did it in case others need the same information: //In main class: static List<TagKey<Biome>> biomes = null; static Registry<Biome> biomeregistry = null; @SubscribeEvent public void listBiomes(TagsUpdatedEvent event) { biomeregistry = event.getRegistryAccess().registryOrThrow(Registry.BIOME_REGISTRY); biomes = biomeregistry.getTagNames().toList(); } //In retrieving class: if (Main.biomes != null) { Main.biomes.forEach(t -> { if (world.getBiomeManager().getBiome(pos).is(t)) { if (primaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = false; } if (secondaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = true; } }}); }
  9. So something like this should work for getting the biome tags, saving them, and then checking them against a biome and map? //In main class: //(Just to be sure, does ServerStartingEvent fire on the client or do I need something else? - this mod is client only) static List<TagKey<Biome>> biomes = null; static Registry<Biome> biomeregistry = null; @SubscribeEvent public static void listBiomes(ServerStartingEvent event) { biomeregistry = event.getServer().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY); biomes = biomeregistry.getTagNames().toList(); } //And then retrieve in another class: Main.biomes.forEach(t -> { if (world.getBiomeManager().getBiome(pos).is(t)) { if (primaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = false; } if (secondaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = true; } }});
  10. Ok, so to elaborate - I'm currently on 1.19.2, not 1.19.4 - so "Registries" doesn't exist - going backwards off the link you sent, it seems BuiltInRegistries should work, but that doesn't work with RegistryorThrow or any similar methods I'm aware of within registry access. That's also why the old Forge registry still existed. Any idea how to do this for 1.19.2?
  11. Ohh, thank you! I wasn't fully aware that they needed to be fetched at startup - thanks for the help!
  12. Try installing Atmospheric, it should only be an optional dependency but Peculiars is trying to access it's code for whatever reason. https://www.curseforge.com/minecraft/mc-mods/atmospheric
  13. Hello - I'm having some issues with retrieving and operating on data in a Stream of biome tags and not sure if my issue is with my dated knowledge of Java or my usage of Forge code - so I would appreciate some help. I'm running this method - the stuff inside doesn't really matter here, because nothing inside this method is ever run. I've added print statements to debug and they are never executed. .getTagNames() should return a stream of biome keys which are then operated on. AmbienceMod.biomekeys.getTagNames().forEach(t -> { if (world.getBiomeManager().getBiome(pos).is(t)) { if (primaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = false; } if (secondaryTagMap.containsKey(t.location()) ) { biomereturn = t.location(); secondaryreturn = true; } }}); } And this is my definition of "biomekeys": static @Nullable ITagManager<Biome> biomekeys; <irrelevant code here> biomekeys = ForgeRegistries.BIOMES.tags(); This could be something really trivial I've missed but it's had me scratching my head for a while now.
  14. Thanks for the info - that method you sent is just what I needed and I'll put some measures in place to prevent things from going as you said they might
  15. I'm concerned the answer might be painfully simple, since I've been slightly off base today - but I'm trying to get an Array of all of the "TagKey<Biome>" fields defined in Tags.Biomes (I'll be iterating through them to check for biome tags, and using the keys instead of raw text tags is better for language compatibility). The ones such as "IS_HOT", "IS_LUSH", "IS_MOUNTAIN", etc.. I cannot for the life of me figure out how and where to pull a list of all these from. I would just copy them in manually but that presents potential compatibility issues if another mod chooses to add new tags. Any help?
×
×
  • Create New...

Important Information

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