ewewukek / mc-musketmod

Mod that adds craftable flintlock weapons
MIT License
11 stars 22 forks source link

crash from shooting self with dispenser #49

Closed lxative closed 1 week ago

lxative commented 1 week ago

Minecraft version

1.20.1

Mod loader you are using

Fabric

Musket Mod version

musketmod-1.20.1-fabric-1.5.3.jar

Modpack info or mod list

cloth-config fabric-api musketmod

The latest.log file and hs_err_pidXXX if exists

https://gist.github.com/lxative/7ff526f63141c3005f66c353d239ae99

Issue description

shooting myself with a dispenser crashes the game

Steps to reproduce (if reproducing the issue requires exact steps)

  1. put paper cartridge in dispenser
  2. activate dispenser to shoot self
  3. reality collapses
IndigoLily commented 1 week ago

This seems to happen when any entity is shot by a dispenser.

I'm not a Java programmer, but it looks to me like the issue is with calling .getTeam() on a shooter that's null because it wasn't shot by an entity.

https://github.com/ewewukek/mc-musketmod/blob/d158977cedd7acf3443f2410406628514486fbcf/src/main/java/ewewukek/musketmod/BulletEntity.java#L313-L317

ewewukek commented 1 week ago

yes, it's exactly that line