update
This commit is contained in:
@@ -25,12 +25,13 @@ import net.minecraft.world.World;
|
|||||||
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;
|
||||||
|
|
||||||
@Mixin(Block.class)
|
@Mixin(Block.class)
|
||||||
public class BlockMixin {
|
public class BlockMixin {
|
||||||
|
|
||||||
@Inject(method = "onBreak", at = @At("HEAD"))
|
@Inject(method = "onBreak", at = @At("HEAD"))
|
||||||
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) {
|
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable<BlockState> cir) {
|
||||||
player.increaseStat(RMC.RMC_STAT_ID, 1);
|
player.increaseStat(RMC.RMC_STAT_ID, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
"package": "cn.rtast.rmc.mixin",
|
"package": "cn.rtast.rmc.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"BlockMixin"
|
"BlockMixin",
|
||||||
|
"PlayerManagerMixin",
|
||||||
|
"ServerPlayerEntityMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
Reference in New Issue
Block a user