mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
Remove no longer needed injections
This commit is contained in:
parent
5502e32281
commit
dc3f390032
@ -26,7 +26,6 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.protocols.v1_11_1to1_12.Protocol1_11_1To1_12;
|
||||
import com.viaversion.viaversion.protocols.v1_9_1to1_9_3.packet.ServerboundPackets1_9_3;
|
||||
import de.florianmichael.viafabricplus.fixes.data.ItemRegistryDiff;
|
||||
import de.florianmichael.viafabricplus.injection.access.IMouseKeyboard;
|
||||
import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import de.florianmichael.viafabricplus.settings.impl.DebugSettings;
|
||||
@ -34,10 +33,6 @@ import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.Mouse;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.network.ClientPlayerInteractionManager;
|
||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@ -71,23 +66,6 @@ public abstract class MixinMinecraftClient {
|
||||
@Final
|
||||
public Keyboard keyboard;
|
||||
|
||||
@Redirect(method = "doItemPick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;addPickBlock(Lnet/minecraft/item/ItemStack;)V"))
|
||||
private void filterItem(PlayerInventory instance, ItemStack stack) {
|
||||
if (ItemRegistryDiff.keepItem(stack.getItem())) {
|
||||
instance.addPickBlock(stack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Never happens in Vanilla, this is only for {@link ItemRegistryDiff} to work
|
||||
*/
|
||||
@Redirect(method = "doItemPick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;clickCreativeStack(Lnet/minecraft/item/ItemStack;I)V"))
|
||||
private void dontSendEmptyItem(ClientPlayerInteractionManager instance, ItemStack stack, int slotId) {
|
||||
if (!stack.isEmpty()) {
|
||||
instance.clickCreativeStack(stack, slotId);
|
||||
}
|
||||
}
|
||||
|
||||
@WrapWithCondition(method = "handleInputEvents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;swingHand(Lnet/minecraft/util/Hand;)V"))
|
||||
private boolean disableSwing(ClientPlayerEntity instance, Hand hand) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_15);
|
||||
|
@ -37,10 +37,10 @@ public abstract class MixinSkeletonHorseEntity extends AbstractHorseEntity {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
@Inject(method = "getBaseMovementSpeedMultiplier", at = @At("HEAD"), cancellable = true)
|
||||
private void modifyBaseMovementSpeedMultiplier(CallbackInfoReturnable<Float> cir) {
|
||||
@Inject(method = "getBaseWaterMovementSpeedMultiplier", at = @At("HEAD"), cancellable = true)
|
||||
private void modifyBaseWaterMovementSpeedMultiplier(CallbackInfoReturnable<Float> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
|
||||
cir.setReturnValue(super.getBaseMovementSpeedMultiplier());
|
||||
cir.setReturnValue(super.getBaseWaterMovementSpeedMultiplier());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user