Unknown025 / Flans-Mod-Plus

Revision of Flan's Mod Plus for 1.7.10
Other
25 stars 20 forks source link

Bug Fix: Bullets from Flan's Mod are no longer being blocked by any kind of Projectiles #189

Closed AntonIT99 closed 1 year ago

AntonIT99 commented 1 year ago

Description of changes

When the EntityBullet checks for potential hits, some entites are excluded so that they can be passed through/ignored. This change aims at expanding the list of these entites.

  1. any class implementing IProjectile needs to be excluded since many other mods use IProjectile for their projectiles. This was done by replacing !(entity instanceof EntityXPOrb) && !(entity instanceof EntityArrow) by !(entity instanceof IProjectile) since these two already implement IProjectile.
  2. To make sure potential subclasses of EntityBullet are excluded (I used a subclass in my NPC vehicles mod) entity != this was replaced by !(entity instanceof EntityBullet) which is a broader clause that is not entirely covered by !entity.getClass().toString().contains("flansmod.") since subclasses of EntityBullet can exist outside of the "flansmod" package.

Intended usage in Content Packs/Users of the mod

Nothing changed here.

Compatibility

More Stability and Better Compatibility with other mods by taking more use cases with projectiles into account.

GoldSloth commented 1 year ago

I think that's okay, though it took a while to understand the logic