33import com .llamalad7 .mixinextras .injector .ModifyExpressionValue ;
44import com .llamalad7 .mixinextras .sugar .Local ;
55import net .minecraft .entity .Entity ;
6+ import net .minecraft .entity .EntityType ;
7+ import net .minecraft .entity .projectile .AbstractFireballEntity ;
68import net .minecraft .entity .projectile .SmallFireballEntity ;
79import net .minecraft .server .network .ServerPlayerEntity ;
810import net .minecraft .server .world .ServerWorld ;
911import net .minecraft .util .math .BlockPos ;
1012import net .minecraft .world .GameRules ;
13+ import net .minecraft .world .World ;
1114import org .spongepowered .asm .mixin .Mixin ;
1215import org .spongepowered .asm .mixin .injection .At ;
1316
1922 * @author Ampflower
2023 **/
2124@ Mixin (SmallFireballEntity .class )
22- public abstract class MixinSmallFireballEntity {
25+ public abstract class MixinSmallFireballEntity extends AbstractFireballEntity {
26+
27+ public MixinSmallFireballEntity (final EntityType <? extends AbstractFireballEntity > entityType , final World world ) {
28+ super (entityType , world );
29+ }
2330
2431 @ ModifyExpressionValue (
2532 method = "onBlockHit" ,
@@ -28,16 +35,19 @@ public abstract class MixinSmallFireballEntity {
2835 target = "Lnet/minecraft/world/World;isAir(Lnet/minecraft/util/math/BlockPos;)Z"
2936 )
3037 )
31- private static boolean fireblanket$madeAccurate (
38+ private boolean fireblanket$madeAccurate (
3239 final boolean original ,
33- final @ Local ServerWorld world ,
34- final @ Local Entity entity ,
3540 final @ Local BlockPos blockPos
3641 ) {
3742 if (!original ) {
3843 return false ;
3944 }
4045
46+ // we're already past the gate, don't bother to check.
47+ final ServerWorld world = (ServerWorld ) this .getWorld ();
48+ // Annoyingly, we can't just @Local it.
49+ final Entity entity = this .getOwner ();
50+
4151 if (entity == null && !world .getGameRules ().getBoolean (GameRules .DO_FIRE_TICK )) {
4252 return false ;
4353 }
0 commit comments