Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Choonster

Forge Modder
  • Content Count

    5102
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. Java doesn't have ref either, but does have tuples (from Minecraft and Apache Commons Lang).
  2. Thanks, I think that makes sense. I've tried to follow this advice and clean up all my DistExecutor code in this commit, does this look correct?
  3. I have a packet that's sent to the client to open a GUI, which I'm using DistExecutor to do. The packet's handler method does the following: DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClientOnlyNetworkMethods.openClientScreen(message)) ClientOnlyNetworkMethods.openClientScreen currently looks like this: public static DistExecutor.SafeRunnable openClientScreen(final OpenClientScreenMessage message) { return new DistExecutor.SafeRunnable() { @Override public void run() { ClientScreenManager.openScreen(message.getId(), message.getAdditionalData(), Minec
  4. Yes, that probably would have been a useful feature. It's a shame that the author didn't have time to complete it.
  5. Part of the idea with my system was to allow syncing capabilities attached to arbitrary items, not just items that know about their capabilities. What would you recommend for capabilities attached to items from Vanilla or another mod?
  6. I've had a brief look at this and can't see any easy way to work around it, so I've created a suggestion thread for a change here: I'm not sure if it will go anywhere.
  7. I have a system for syncing item capability data that uses ICapabilityListener, as explained here: I discovered in that thread that this pull request for 1.12.2 back in 2017 partially broke my system by changing Container#detectAndSendChanges to only call IContainerListener#sendSlotContents if a slot's Item, count or share tag has changed; which often won't be the case for capability-only updates. The change does make sense for Vanilla IContainerListener implementations to reduce unnecessary network traffic, but would it be possible to allow modded IContainerListeners
  8. It looks like Forge patches Container#detectAndSendChanges to only call IContainerListener#sendSlotContents if a slot's Item, count or share tag has changed; which often won't be the case for capability-only updates. I may need to re-evaluate the IContainerListener system to see if there's any way around this. This change was actually introduced in August 2017 for 1.12.2, six months after I created my system. I thought it was working more recently than that, but I must not have tested it properly.
  9. With my system, each capability type that needs to be synced to the client has several sync-related classes: A single update network message (extending UpdateContainerCapabilityMessage) that syncs the capability data for a single slot of a Container. A bulk update network message (extending BulkUpdateContainerCapabilityMessage) that syncs the capability data for all slots of a Container. A "functions" class containing static methods used by both the single and bulk update messages. A container listener class (extending CapabilityContainerListener) that sends the singl
  10. The OP is asking about Vanilla loot conditions and functions, not global loot modifiers. I'm not 100% sure if it's the correct time to register them, but I do it on the main thread after FMLCommonSetupEvent (i.e. inside a lambda passed to event.enqueueWork). I use the Vanilla registries, just like in your example. I'm not sure if it's necessary to register non-Forge registry entries at any specific time like it is with Forge registry entries. This is my FMLCommonSetup handler, this is my LootConditionType registration and this is my LootFunctionTyp
  11. Thanks, I saw the Supplier overloads but didn't think to use them for lazy/deferred references. I realised after posting that my issue was actually with a SurfaceBuilder rather than a Feature (I could have moved the Feature registration since it wasn't being used in the Biome), but the same solution applies: use the Supplier overload instead of trying to pass the ConfiguredSurfaceBuilder directly. For future reference, I fixed the original issue and a few related worldgen registration issues with this commit. I decided not to go with the JSON route since my
  12. I'm trying to register a Biome with a Feature from my mod, but I'm having difficulty because Biome registration happens before Feature registration. This is the relevant registration code: Feature (DeferredRegister) Biome (DeferredRegister) ConfiguredFeature (Vanilla registry, called from here in RegistryEvent.Register<Biome> with HIGH priority to run before Biome DeferredRegister). The game crashes on startup because the ConfiguredFeature registration runs before the Feature has been registered: java.lang.NullPointerException: Regi
  13. I've cross-posted this to StackOverflow here, hopefully someone over there will have an answer.
  14. That lets it continue to other tasks after javadoc, but the Javadoc generation still fails.
  15. My mod depends on HWYLA, which has an API JAR containing both compiled classes and their source code. Unfortunately there seem to be some Javadoc errors in this code, which is preventing the generation of Javadoc for my own code. The Gradle output looks like this (from this CI run): > Task :processResources > Task :classes > Task :makeLibraryMetas UP-TO-DATE > Task :jar > Task :downloadMcpConfig > Task :extractSrg > Task :createMcpToSrg > Task :reobfJar /home/runner/.gradle/caches/forge_gradle/deobf_dependencies/mcp/mobius/waila/Hwyla/1.10.11-B78_1.16.2_
  16. Instead of using multiple DeferredReigsters and iterating through your Blocks to register your BlockItems, it's probably simpler to just register the BlockItem at the same time as the Block (with DeferredRegister, so the actual registration still happens at the right time). This can be done helper methods like these; you could create a single method that takes the ItemGroup as a parameter, or separate methods for each ItemGroup.
  17. You can register BlockItems with DeferredRegister in the same way as normal Items. Since Blocks are registered before Items, just call RegistryObject#get on your RegistryObject<Block> in the Supplier. I use these two utility methods to automatically register a BlockItem with the Block using DeferredRegister. RegistryUtil.getRequiredRegistryEntry just returns the registry entry from a RegistryObject or throws an exception if it's not present; but this isn't required in 1.15+ because RegistryObject#get already does this (it didn't in 1.14).
  18. You could probably pass a Supplier/RegistryObject of the TileEntityType to the Block's constructor, then use that to create the TileEntity.
  19. williewillus has an explanation of the changes in 1.13/1.14 here and 1.15 here.
  20. cpw created an issue for that a while ago, but hasn't gotten around to fixing it yet.
  21. For mods with Maven repositories, you can use fb.deobf dependencies like this. This deobfuscates the mod for you.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.