Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -1,13 +1,12 @@
package ru.betterend.mixin.common;
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 net.minecraft.world.level.block.AnvilBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
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 ru.betterend.blocks.basis.EndAnvilBlock;
@Mixin(AnvilBlock.class)
@ -15,10 +14,10 @@ public class AnvilBlockMixin {
@Inject(method = "getLandingState", at = @At("HEAD"), cancellable = true)
private static void be_getLandingState(BlockState fallingState, CallbackInfoReturnable<BlockState> info) {
if (fallingState.getBlock() instanceof EndAnvilBlock) {
IntegerProperty destructionProperty = ((EndAnvilBlock) fallingState.getBlock()).getDESTRUCTION();
int destruction = fallingState.get(destructionProperty);
IntegerProperty destructionProperty = ((EndAnvilBlock) fallingState.getBlock()).getDestructionProperty();
int destruction = fallingState.getValue(destructionProperty);
try {
BlockState state = fallingState.with(destructionProperty, destruction + 1);
BlockState state = fallingState.setValue(destructionProperty, destruction + 1);
info.setReturnValue(state);
info.cancel();
} catch (Exception ex) {