mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-01 18:29:14 +01:00
fixed sign interactions and updated ItemReleaseVersionMappings
This commit is contained in:
parent
9e035ca97a
commit
f4dfb63f70
@ -3,10 +3,22 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
|
||||
import net.minecraft.block.AbstractSignBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.SignBlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
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.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(AbstractSignBlock.class)
|
||||
public class MixinAbstractSignBlock {
|
||||
@ -18,4 +30,16 @@ public class MixinAbstractSignBlock {
|
||||
}
|
||||
return instance.isWaxed();
|
||||
}
|
||||
|
||||
@Inject(method = "onUse", at = @At("HEAD"), cancellable = true)
|
||||
public void changeSignApplicators(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
|
||||
if (ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_19_4)) return;
|
||||
|
||||
// Remove HoneycombItem interactions
|
||||
if (world.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity && world.isClient) {
|
||||
final ItemStack item = player.getStackInHand(hand);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,34 @@ public class ItemReleaseVersionMappings {
|
||||
}
|
||||
|
||||
public void load() {
|
||||
register(Items.CALIBRATED_SCULK_SENSOR, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.PITCHER_PLANT, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SNIFFER_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SUSPICIOUS_GRAVEL, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.PITCHER_POD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.HOST_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.ANGLER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.BLADE_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.BREWER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.BURN_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.DANGER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.EXPLORER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.FRIEND_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.HEART_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.HEARTBREAK_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.HOWL_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.MINER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.MOURNER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.PLENTY_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SHEAF_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SHELTER_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.SNORT_POTTERY_SHERD, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
register(Items.MUSIC_DISC_RELIC, ProtocolRange.andNewer(ProtocolVersion.v1_20));
|
||||
|
||||
register(Items.BRUSH, ProtocolRange.andNewer(ProtocolVersion.v1_19_4));
|
||||
register(Items.CHERRY_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19_4));
|
||||
register(Items.CHERRY_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_19_4));
|
||||
|
Loading…
Reference in New Issue
Block a user