mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-28 07:40:02 -04:00
Fix crash when none player entities are flying with an elytra. (#4218)
Fixes #4217
(cherry picked from commit 825023f82e
)
This commit is contained in:
parent
6d397b1b49
commit
60fccc7682
1 changed files with 1 additions and 2 deletions
|
@ -25,7 +25,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents;
|
||||
|
@ -64,7 +63,7 @@ abstract class LivingEntityMixin extends Entity {
|
|||
@SuppressWarnings("ConstantConditions")
|
||||
@Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EquipmentSlot;VALUES:Ljava/util/List;"), method = "canGlide", allow = 1, cancellable = true)
|
||||
void injectElytraCheck(CallbackInfoReturnable<Boolean> cir) {
|
||||
PlayerEntity self = (PlayerEntity) (Object) this;
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
|
||||
if (!EntityElytraEvents.ALLOW.invoker().allowElytraFlight(self)) {
|
||||
cir.setReturnValue(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue