mirror of
https://github.com/Mr-dayhappy/Minecraft-place-mod.git
synced 2026-10-23 01:53:39 +08:00
fix: 修正 Mixin 回调参数类型为 CallbackInfoReturnable
placeStructure 有 int 返回值,@Inject 到 RETURN 时回调参数必须是 CallbackInfoReturnable<Integer> 而非 CallbackInfo,否则运行时 mixin 校验报 'Invalid descriptor' 并崩溃。
This commit is contained in:
1 parent
3cd76bcbba
commit
5f1374bcc6
1 file changed
+2
-2
@@ -14,7 +14,7 @@ import net.minecraft.world.level.levelgen.structure.StructureStart;
|
|||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +36,7 @@ public class PlaceCommandMixin {
|
|||||||
private static void placemod$registerStructure(net.minecraft.commands.CommandSourceStack source,
|
private static void placemod$registerStructure(net.minecraft.commands.CommandSourceStack source,
|
||||||
net.minecraft.core.Holder.Reference<Structure> structureHolder,
|
net.minecraft.core.Holder.Reference<Structure> structureHolder,
|
||||||
net.minecraft.core.BlockPos pos,
|
net.minecraft.core.BlockPos pos,
|
||||||
CallbackInfo ci,
|
CallbackInfoReturnable<Integer> cir,
|
||||||
ServerLevel level,
|
ServerLevel level,
|
||||||
Structure structure,
|
Structure structure,
|
||||||
ChunkGenerator generator,
|
ChunkGenerator generator,
|
||||||
|
|||||||
Reference in new issue
Block a user