
CrackedScreen
Members-
Posts
59 -
Joined
-
Last visited
Everything posted by CrackedScreen
-
[1.18.2] How to get SRG/obfuscated names of fields/methods
CrackedScreen replied to CrackedScreen's topic in Modder Support
Thanks, marking this as solved. -
[1.18.2] How to get SRG/obfuscated names of fields/methods
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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 -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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: -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
Registry class: I could try registering this outside of event bus in a non-static context. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Disable crafting recipes from config files
CrackedScreen replied to CrackedScreen's topic in Modder Support
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. -
[1.18.2] [SOLVED] Hide shield model while item is in use
CrackedScreen replied to CrackedScreen's topic in Modder Support
This works, thanks for helping. Marking this thread as solved. -
[1.18.2] [SOLVED] Hide shield model while item is in use
CrackedScreen replied to CrackedScreen's topic in Modder Support
In that case, are there any forge event handlers which allow me to do this or any existing examples where player arms are hidden? -
Adding a Tag to the player and removing it after the new effect is applied, then checking for it at the beginning of the event handler prevents the crash from occurring. I still need a way to check if the potion was applied through drinking/splash effect, I think getPotionSource() is supposed to handle this but it isn't part of PotionApplicableEvent. Are there any cleaner implementations for this aside from using event handler?
-
Denying a PotionApplicable event and attempting to apply a "replacement" potion with a weaker effect/duration causes a ticking player entity crash, likely because it is triggering the event handler infinitely. Is there any way to modify an incoming potion effect, as well as determine whether the potion was applied through drinking/splash? Code: Crash log:
-
{ "type": "loot_test:mod_loot", "conditions": [ { "condition": "minecraft:alternative", "terms": [ { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/ruined_portal" }, { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/nether_bridge" } ] } ], "min": 1, "max": 3, "chance": 0.5 } This works. Marking the thread as solved.
-
I cannot swap the type to minecraft:alternatives since the type field is used by the loot table serializer. If you have an example of an OR condition I could use for the json in my previous post that would work best. I'm specifically looking to change the condition so that loot will be added to multiple loot chest types instead of only "ruined_portal".
-
{ "type": "loot_test:mod_loot", "conditions": [ { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/ruined_portal" } ], "min": 1, "max": 3, "chance": 0.5 } Do loot table files currently support multiple conditions (such as adding modded loot in ruined_portal and nether_bridge loot) or will a new file need to be created and serialized for this?