Fix poss ball again

This commit is contained in:
Tara Piccari 2024-01-30 17:31:34 -07:00
parent 4ed87fcae9
commit bc1e6e9dca
2 changed files with 9 additions and 7 deletions

View file

@ -49,7 +49,7 @@ mod_name=Thresholds
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1.4.013024.1537
mod_version=1.4.013024.1601
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -69,13 +69,10 @@ public class ThrownPossBall extends ThrowableItemProjectile
@Override
protected void onHitEntity(EntityHitResult pResult) {
super.onHitEntity(pResult);
if(getItem().getTag().contains("entity"))
//super.onHitEntity(pResult);
if(getItem().getTag() == null || !getItem().getTag().contains("entity"))
{
// Don't capture the entity
pResult.getEntity().hurt(this.shooter.getLastDamageSource().thrown(this, this.getOwner()), 0.1F);
} else {
if(pResult.getEntity() instanceof LivingEntity le && !(le instanceof Player))
{
// We don't want to capture players
@ -97,12 +94,17 @@ public class ThrownPossBall extends ThrowableItemProjectile
le.remove(RemovalReason.DISCARDED);
}
} else {
// Don't capture the entity
pResult.getEntity().hurt(this.shooter.getLastDamageSource().thrown(this, this.getOwner()), 0.1F);
}
}
@Override
protected void onHit(HitResult pResult) {
super.onHit(pResult);
//super.onHit(pResult);
if(ServerUtilities.isServer())
{
// We do two things here