removed server-sided only fix

This commit is contained in:
FlorianMichael 2023-09-24 00:18:30 +02:00
parent dc769fe3d8
commit a407568f62
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -15,7 +15,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialoader.util.VersionEnum;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
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.Redirect; import org.spongepowered.asm.mixin.injection.Redirect;
@ -24,8 +23,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(AbstractSignBlock.class) @Mixin(AbstractSignBlock.class)
public abstract class MixinAbstractSignBlock { public abstract class MixinAbstractSignBlock {
@Shadow protected abstract ActionResult getActionResult(boolean usedSignChanger);
@Redirect(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/SignBlockEntity;isWaxed()Z", ordinal = 1)) @Redirect(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/SignBlockEntity;isWaxed()Z", ordinal = 1))
public boolean removeCondition(SignBlockEntity instance) { public boolean removeCondition(SignBlockEntity instance) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) { if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
@ -45,20 +42,4 @@ public abstract class MixinAbstractSignBlock {
cir.setReturnValue(!((item.isOf(Items.GLOW_INK_SAC) || item.isOf(Items.INK_SAC) || item.getItem() instanceof DyeItem) && player.canModifyBlocks()) && !signBlockEntity.isWaxed() ? ActionResult.CONSUME : ActionResult.SUCCESS); cir.setReturnValue(!((item.isOf(Items.GLOW_INK_SAC) || item.isOf(Items.INK_SAC) || item.getItem() instanceof DyeItem) && player.canModifyBlocks()) && !signBlockEntity.isWaxed() ? ActionResult.CONSUME : ActionResult.SUCCESS);
} }
} }
@Redirect(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/AbstractSignBlock;getActionResult(Z)Lnet/minecraft/util/ActionResult;", ordinal = 0))
public ActionResult returnStaticResult_Pass(AbstractSignBlock instance, boolean usedSignChanger) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
return ActionResult.PASS;
}
return getActionResult(usedSignChanger);
}
@Redirect(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/AbstractSignBlock;getActionResult(Z)Lnet/minecraft/util/ActionResult;", ordinal = 1))
public ActionResult returnStaticResult_Success(AbstractSignBlock instance, boolean usedSignChanger) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
return ActionResult.SUCCESS;
}
return getActionResult(usedSignChanger);
}
} }