修复钓鱼竿能钩载具的问题
This commit is contained in:
parent
d5ec42c437
commit
9744d1d656
2 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
package com.atsuishio.superbwarfare.mixins;
|
||||
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.projectile.FishingHook;
|
||||
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(FishingHook.class)
|
||||
public class FishingHookMixin {
|
||||
|
||||
@Inject(method = "canHitEntity(Lnet/minecraft/world/entity/Entity;)Z", at = @At("HEAD"), cancellable = true)
|
||||
private void canHook(Entity entity, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (entity instanceof VehicleEntity) {
|
||||
cir.setReturnValue(false);
|
||||
cir.cancel();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
"mixins": [
|
||||
"ClientboundSetPassengersPacketMixin",
|
||||
"EntityMixin",
|
||||
"FishingHookMixin",
|
||||
"LivingEntityMixin",
|
||||
"PlayerMixin"
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue