削弱丘比特之箭的效果

This commit is contained in:
17146 2025-05-10 01:50:38 +08:00 committed by Light_Quanta
parent dc0fad50ff
commit 7b767f228d
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
2 changed files with 0 additions and 27 deletions

View file

@ -1,26 +0,0 @@
package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.entity.CupidLove;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.ai.behavior.VillagerMakeLove;
import net.minecraft.world.entity.npc.Villager;
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;
import java.util.Optional;
@Mixin(VillagerMakeLove.class)
public class VillagerMakeLoveMixin {
@Inject(method = "takeVacantBed(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/npc/Villager;)Ljava/util/Optional;",
at = @At("HEAD"), cancellable = true)
private void takeVacantBed(ServerLevel pLevel, Villager pVillager, CallbackInfoReturnable<Optional<BlockPos>> cir) {
CupidLove entity = CupidLove.getInstance(pVillager);
if (entity.superbwarfare$getCupidLove()) {
cir.setReturnValue(Optional.of(pVillager.getOnPos()));
}
}
}

View file

@ -9,7 +9,6 @@
"FishingHookMixin",
"LivingEntityMixin",
"PlayerMixin",
"VillagerMakeLoveMixin",
"VillagerMixin"
],
"client": [