mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-02 08:59:31 +01:00
Fixed sign editor closing when sign is too far away in <= 1.19.4
This commit is contained in:
parent
51538b6fc7
commit
8e044e8abc
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
|
||||||
|
* Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen;
|
||||||
|
|
||||||
|
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
|
||||||
|
import net.minecraft.block.entity.SignBlockEntity;
|
||||||
|
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||||
|
import net.raphimc.vialoader.util.VersionEnum;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
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.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(AbstractSignEditScreen.class)
|
||||||
|
public abstract class MixinAbstractSignEditScreen {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private SignBlockEntity blockEntity;
|
||||||
|
|
||||||
|
@Inject(method = "canEdit", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void dontCloseTooFarAwaySigns(CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
|
||||||
|
cir.setReturnValue(this.blockEntity.getType().supports(this.blockEntity.getCachedState()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -112,6 +112,7 @@
|
|||||||
"fixes.minecraft.packet.MixinChatMessageC2SPacket",
|
"fixes.minecraft.packet.MixinChatMessageC2SPacket",
|
||||||
"fixes.minecraft.packet.MixinPacketByteBuf",
|
"fixes.minecraft.packet.MixinPacketByteBuf",
|
||||||
"fixes.minecraft.packet.MixinUpdatePlayerAbilitiesC2SPacket",
|
"fixes.minecraft.packet.MixinUpdatePlayerAbilitiesC2SPacket",
|
||||||
|
"fixes.minecraft.screen.MixinAbstractSignEditScreen",
|
||||||
"fixes.minecraft.screen.MixinAnvilScreen",
|
"fixes.minecraft.screen.MixinAnvilScreen",
|
||||||
"fixes.minecraft.screen.MixinChatHud",
|
"fixes.minecraft.screen.MixinChatHud",
|
||||||
"fixes.minecraft.screen.MixinChatScreen",
|
"fixes.minecraft.screen.MixinChatScreen",
|
||||||
|
Loading…
Reference in New Issue
Block a user