Dungeons Gear

Dungeons Gear

6M Downloads

Allowing Modded Entities to Use Artifacts

LukeGrahamLandry opened this issue ยท 2 comments

commented

Hey,

I'm working on a mod and I'd like my mobs to be compatible with the Dungeons Gear artifact items. I think it would be feasible to change your artifact implementations to be a bit more generic, letting them act on a LivingEntity instead of requiring a PlayerEntity. This would make it easier to do mod compatibility without needed to make a fake player as an intermediary between modded entities and the artifacts.

I'd be happy to do all the work to make this happen. I'm just wondering if you might accept a pull request that makes these changes.

  • Instead of using an ItemUseContext for ArtifactItem#procArtifact, make a class that holds the same information but with a LivingEntity instead of a PlayerEntity. This could be a drop in replacement for all the artifact methods.
  • Go through all the implementations of procArtifact and replace all the PlayerEntities with LivingEntities. I haven't looked at them all yet but so far it seems that this wouldn't actually need any changes to their logic as most of the methods used are actually on LivingEntity.
  • The other mod could bind your summoner & combo capability to the entity they wanted to be able to use artifacts. No changes needed here.
  • The other entities would need a CooldownTracker. Instead of calling playerEntity.getCooldowns(), there could be a TracksCooldowns interface that modded entities could implement (and could be added to players with a mixin).

If this is something you're interested in, I'll submit a pull request that does it. lmk what you think :)

(I'm not asking for any money/cf points, I just think your mod is cool and I'd love to make adding mod compatibility more simple)

commented

I love this. However, you need to be aware that recently we have been moving a bunch of code into Dungeons Libraries, so we can use it also for some of our other mods. Primarily, an upcoming mod Dungeons Additions, that adds our own content as it would fit dungeons.
A rewrite of the artifacts is planned for this and I would love to work together with you to make this happen. Some of your suggestions are great, although CooldownTracker should be moved into a capability, so we can add it to the player without a mixin.
Some artifacts would also not really work well with mobs, Love Medaillon comes to mind. We will have to add some classifications to the artifacts.

If you want to go more in depth on this, hop on our discord. We can talk it over during a call or in a chat. Just Ping @Patrigan
https://discord.com/invite/uxdUvTw

commented

Hey, I'm planning to make this possible to some extent in 1.19.3. It won't be possible for all artifacts, but it should be for most. I'm willing to sit together with you to see what would be needed for you. Would this be an option for you?