Added a couple of raytraceresult.getType() != MISS checks in places where they were absent. This corrects a couple of vanilla oversights and also greatly reduces Forge bus event spam for arrows and llama spit. (#6355)

Signed-off-by: King Lemming <kinglemming@gmail.com>
This commit is contained in:
King Lemming 2019-12-15 14:39:41 -08:00 committed by LexManos
parent 3701ec06d0
commit 9e5ecaaf75
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@
}
- if (raytraceresult != null && !flag) {
+ if (raytraceresult != null && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
+ if (raytraceresult != null && raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
this.func_184549_a(raytraceresult);
this.field_70160_al = true;
}

View File

@ -5,7 +5,7 @@
return !p_213879_1_.func_175149_v() && p_213879_1_ != this.field_190539_a;
}, RayTraceContext.BlockMode.OUTLINE, true);
- if (raytraceresult != null) {
+ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
+ if (raytraceresult != null && raytraceresult.func_216346_c() != RayTraceResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) {
this.func_190536_a(raytraceresult);
}