Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Soul Fire'd and fix a bug #60

Open
wants to merge 3 commits into
base: 1.20
Choose a base branch
from

Conversation

Crystal-Spider
Copy link

@Crystal-Spider Crystal-Spider commented Jun 20, 2024

This PR main focus is to add support to Soul Fire'd, but I also noticed and fixed a bug affecting both Hellfork and Soulfork.

First of all, I had to update the Gradle distribution version to 8.8 and Loom to 1.5-SNAPSHOT to build the project. For the same reason, I also had to remove some .build() calls from the loot table modify event.
Secondly, I added Soul Fire'd v4.0.0 to the project as an optional dependency.
Lastly, I noticed that entities killed by both Hellfork and Soulfork would drop raw food, so I fixed that. As I was doing this, I also added a new abstract class to reduce code duplication between the two tridents.

Fixes Impaled #44 and Soul Fire'd #19.
If compatibility for Soul Fire'd gets added, I will add Impaled to the public list of mods that support Soul Fire'd. Let me know if you don't want this.

If you have any question let me know!

List of changes:

  • Project wide changes:
    • Updated gradle-wrapper.properties to go from Gradle 8.5 to 8.8.
    • Updated build.gradle to upgrade Loom from 1.4-SNAPSHOT to 1.5-SNAPSHOT.
    • Updated build.gradle to add Crystal Nest Maven repo (Soul Fire'd is hosted there), Fuzs repo (FCAP, a required dependency for Soul Fire'd, is hosted there), and add Soul Fire'd modImplementation.
    • Updated gradle.properties to add soul_fired_d_version.
    • Updated fabric.mod.json to declare Soul Fire'd as an optional dependency.
    • Updated ladysnake/impaled/common/Impaled.java to fix compile errors.
    • Updated ladysnake/impaled/common/init/ImpaledItems.java to remove redundant calls to .fireproof() when instantiating Hellfork items.
  • Soul Fire'd compatibility changes:
    • Added ladysnake/impaled/compat/SoulFired.java class to handle the optional dependency and compatibility.
    • Updated ladysnake/impaled/common/item/HellforkItem.java to use SoulFired.java class method if the item is a Soulfork one and Soul Fire'd is loaded at runtime.
    • Added ladysnake/impaled/common/entity/FireTridentEntity.java abstract class to greatly reduce code duplication between SoulforkEntity and HellforkEntity. Basically all the code has been moved there, and a new abstract method, setTargetOnFireFor(LivingEntity, int), has been added to let each trident set targets on fire differently.
    • Implemented setTargetOnFireFor in HellforkEntity to simply call target.setOnFireFor(seconds).
    • Implemented setTargetOnFireFor in SoulforkEntity to use SoulFired class if Soul Fire'd is loaded at runtime, otherwise do the same as HellforkEntity.
  • Bug fix changes:
    • Added a new mixin method in impaled.PlayerEntityMixin to apply the "Vanilla workaround" of setting entities on fire before damaging them so that, if they happen to die in oneshot, their drops are cooked/smelted.
    • Added an override for onEntityHit in FireTridentEntity to apply the same workaround described in the previous point. After this, it still calls the super method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant