Skip to content

Commit

Permalink
Fix custom elytra flight
Browse files Browse the repository at this point in the history
Fixes #152
  • Loading branch information
Su5eD committed Dec 17, 2024
1 parent 9c40919 commit 1af6e62
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.fabricmc.fabric.mixin.entity.event;

import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents;
import net.minecraft.world.entity.LivingEntity;
import net.neoforged.neoforge.common.extensions.IItemStackExtension;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(IItemStackExtension.class)
public interface IItemStackExtensionMixin {

@Inject(method = "canElytraFly", at = @At("HEAD"), cancellable = true)
default void canElytraFly(LivingEntity entity, CallbackInfoReturnable<Boolean> cir) {
if (EntityElytraEvents.CUSTOM.invoker().useCustomElytra(entity, false)) {
cir.setReturnValue(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ServerPlayerEntityMixin",
"elytra.LivingEntityMixin",
"elytra.PlayerEntityMixin",
"IItemExtensionMixin"
"IItemStackExtensionMixin"
],
"injectors": {
"defaultRequire": 1,
Expand Down
2 changes: 1 addition & 1 deletion ffapi.gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
loom.platform=neoforge
fabric.loom.dontRemap=true

implementationVersion=2.0.20
implementationVersion=2.0.21

versionMc=1.21.1
versionForge=21.1.57
Expand Down

0 comments on commit 1af6e62

Please sign in to comment.