Jump to content

CrackedScreen

Members
  • Posts

    59
  • Joined

  • Last visited

Recent Profile Visitors

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

CrackedScreen's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. Are there any workarounds for reducing potion duration inside of PotionAddedEvent? According to forge source code, durations can only be increased by update().
  2. Do I need to switch between using unobfuscated names and SRG names when running the mod in dev and build environments? I plan on using this for reflection since I need access to private/protected fields and methods.
  3. I need obfuscated names to use access transformers/reflection, but haven't found an up to date list anywhere.
  4. Managed to fix this by creating different conditions for each recipe and reusing the same serializer. Apparently it isn't possible to return different values with the same condition, and the "null issue" is forge working as intended according to here: https://github.com/P3pp3rF1y/Reliquary/issues/529
  5. The test value that I'm using already has a default value set: Will look into using booleans, but I may have tried this + reloading before with no success using something similar:
  6. Adding modid = MOD_ID to my event bus subscriber didn't have any effect. The serializer only has the null issue when the config value is set to false for some reason, if I return true/false directly in the condition class or leave the config value as true there aren't any issues with loading/blocking the recipe.
  7. Registry class: I could try registering this outside of event bus in a non-static context.
  8. You'll have to elaborate on why this is the case since I don't see any immediate issues. I created the condition almost the exact same way the builtin forge conditions are. Edit: The recipes are disabled if the config value is set to false, but only after manually reloading. Will need a fix for the serializer issue and best practices for forcing a reload upon entering a world if the serializer fix doesn't correct this behavior.
  9. I've already tried pulling the value directly from configs, this does not change the result. The recipes aren't being loaded as the serializer is returning null after using /reload, the problem is likely the read() method but I'm not sure what it should return since the examples provided by forge return a new condition with constructor. Would also prefer to reload datapacks from code whenever the world/server is loaded, if possible.
  10. The register event works fine after setting the method to static, though now it seems that changing the config file values inside of the save folder doesn't have any effect on whether the recipe is active or not. Code is still same as above.
  11. Used the following to create the recipe: Condition/Serializer class: Registered the serializer class in RegistryEvents class: Currently getting an "Unknown condition type" error when using the runData task which likely means the condition wasn't registered correctly, but don't know how this is the case.
  12. Late reply, but tried implementing ICondition and copying some code over from ModLoadedCondition: Getting an error for including the test() method since it is marked as deprecated, but forge still requires it to be implemented. Using Forge 1.18.2-40.1.51, if I'm missing anything let me know. EDIT: The mod will still compile and run fine since this isn't actually an error, but will need to know how to pass existing datagen recipes through the serializer since forge does not come with any functional examples by itself. Would still appreciate an answer on how to get rid of the deprecated method in case I am missing something obvious.
  13. I'm trying to disable crafting recipes based on config file values. Currently using datagen for crafting recipes, and ICondition seems to have changed compared to the older IConditionFactory.
  14. This works, thanks for helping. Marking this thread as solved.
×
×
  • Create New...

Important Information

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