Add support for Soul Fire'd and fix a bug #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
gradle-wrapper.properties
to go from Gradle8.5
to8.8
.build.gradle
to upgrade Loom from1.4-SNAPSHOT
to1.5-SNAPSHOT
.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'dmodImplementation
.gradle.properties
to addsoul_fired_d_version
.fabric.mod.json
to declare Soul Fire'd as an optional dependency.ladysnake/impaled/common/Impaled.java
to fix compile errors.ladysnake/impaled/common/init/ImpaledItems.java
to remove redundant calls to.fireproof()
when instantiating Hellfork items.ladysnake/impaled/compat/SoulFired.java
class to handle the optional dependency and compatibility.ladysnake/impaled/common/item/HellforkItem.java
to useSoulFired.java
class method if the item is a Soulfork one and Soul Fire'd is loaded at runtime.ladysnake/impaled/common/entity/FireTridentEntity.java
abstract class to greatly reduce code duplication betweenSoulforkEntity
andHellforkEntity
. 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.setTargetOnFireFor
inHellforkEntity
to simply calltarget.setOnFireFor(seconds)
.setTargetOnFireFor
inSoulforkEntity
to useSoulFired
class if Soul Fire'd is loaded at runtime, otherwise do the same asHellforkEntity
.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.onEntityHit
inFireTridentEntity
to apply the same workaround described in the previous point. After this, it still calls the super method.