Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakllp committed Dec 9, 2024
1 parent 4e7cc91 commit 30a5aa2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,21 @@ This means everything will be created properly in the beginning, will be handled
//Post-Handle Vanilla Registry
entityRegistry.freeze();

/* Let me explain what's happening here:
Earlier we saved allTags. They contain stuff like special vulnerabilities to enchantments,
FallDamage-Resistance and in some instances (namely the Turtle) the ability for a Mob to
breath underwater.
Through the above code we reset those tags so we now have to do 2 things:
First re-add the Tags (that's why we saved them)
And then tell Minecraft to reload those values for them to actually take effect.
Gotta love MC */
ReflectionUtil.setFieldValue(allTagsField, entityRegistry, allTagsSaved);
Method refreshMethod = ReflectionUtil.getMethod(MappedRegistry.class, "u");
try {
refreshMethod.invoke(entityRegistry);
} catch (Exception e) {
e.printStackTrace();
}

if(custReg != null) {
//Gotta put the custom Registry back into place
Expand Down

0 comments on commit 30a5aa2

Please sign in to comment.