Skip to content

Refactor of PrimedDenseTnt, Loot dropping, and ClientModel#259

Merged
danielkrafft merged 9 commits into
mainfrom
misc-cleanup
Jan 20, 2026
Merged

Refactor of PrimedDenseTnt, Loot dropping, and ClientModel#259
danielkrafft merged 9 commits into
mainfrom
misc-cleanup

Conversation

@JackLawford

Copy link
Copy Markdown
Collaborator

PrimedDenseTnt now extends PrimedTnt, making it easier to use in other classes.

Loot drops for entities moved out of loot tables into their classes for localization of logic

New constructor for simple entity ClientModels, allowing for single entity name to be passed through ClientModel.ofEntity(entityPath). This can just be used in the Renderer classes, circumventing excessive 5 lines model classes. For dynamic texture/model/both changes, the following methods can be used:

public ClientModel<T> withConditionalTexture(Predicate<T> condition, String texturePath)

public ClientModel<T> withConditionalModel(Predicate<T> condition, String modelPath)

public ClientModel<T> withConditionalResource(Predicate<T> condition, String texturePath, String modelPath)

These methods are then used to insert the conditions and the model changes into a list, which is then used to determine what texture and model will be passed when geckolib's getModelResource and getTextreResource are called, based on which one has a condition returning true. If multiple return true, the first in the list will be used (So order does matter when you create the ClientModel instances in the Renderer classes!)

@danielkrafft danielkrafft left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test animated weapons and items
converge the entity and item geo model stuff

@JackLawford JackLawford changed the title Refactor of PrimedDesnseTnt, Loot dropping, and ClientModel Refactor of PrimedDenseTnt, Loot dropping, and ClientModel Jan 19, 2026
@JackLawford

Copy link
Copy Markdown
Collaborator Author

Updates to PR:

  • Tested with animated weapons and items, confirmed functionality is maintained
  • ClientModel class further refined to have less entity-specific logic, easier to implement for weapons/items
  • WDWeapons is now wider in scope, supporting both ranged and non-ranged weapons
  • General cleanup on several weapons, animations fixed on WindCannon, textures consolidated for LaserSword, other similar fixes.

Details on WDWeapon and usage:

This is now pretty much just a combination of the existing WDWeapons and WDRangedWeapons classes. The idea here is that the logic was going down a path of requiring an over-specialized parent class for each type and sub-type and sub-sub-type of weapon. Worth noting:

  • Models are now auto constructed using the name field of the weapon implementing WDWeapon, and then that is used to also create a WDWeaponRenderer (Same as the existing inner class from WDRangedWeapons and WDWeapons). If you want to have dynamic models or textures on animation files, you can simply override configureModel(ClientModel model) and then use the methods in ClientModel to add conditional resources. A good example of this can be seen in the WindBow class.
  • Most logic is still left to be freely implemented in each weapon's class through the use(), onUse(), and releaseUsing() and similar method overrides.

@danielkrafft danielkrafft merged commit 3a64c75 into main Jan 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants