mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-16 10:55:39 +01:00
Update VV API usage
This commit is contained in:
parent
6b115b712f
commit
249d46470b
@ -14,10 +14,10 @@ maven_group=de.florianmichael
|
||||
archives_base_name=ViaFabricPlus
|
||||
|
||||
# ViaVersion Libraries
|
||||
viaversion_version=5.0.0-20240519.100112-11
|
||||
viabackwards_version=5.0.0-20240515.152913-2
|
||||
vialegacy_version=3.0.0-20240517.210413-2
|
||||
viaaprilfools_version=3.0.0-20240517.172611-2
|
||||
viaversion_version=5.0.0-20240522.084313-18
|
||||
viabackwards_version=5.0.0-20240522.081413-6
|
||||
vialegacy_version=3.0.0-20240521.130712-3
|
||||
viaaprilfools_version=3.0.0-20240521.130815-3
|
||||
vialoader_version=3.0.0-SNAPSHOT
|
||||
|
||||
# RaphiMC Libraries
|
||||
|
@ -32,7 +32,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(value = Protocol1_20To1_20_2.class, remap = false)
|
||||
public abstract class MixinProtocol1_20To1_20_2 {
|
||||
|
||||
@Inject(method = "lambda$queueServerboundPacket$11", at = @At("HEAD"), cancellable = true)
|
||||
@Inject(method = "lambda$queueServerboundPacket$12", at = @At("HEAD"), cancellable = true)
|
||||
private static void dontQueueConfigPackets(ServerboundPackets1_20_2 packetType, PacketWrapper wrapper, CallbackInfo ci) {
|
||||
if (!DebugSettings.global().queueConfigPackets.getValue()) {
|
||||
ci.cancel();
|
||||
|
@ -20,7 +20,7 @@
|
||||
package de.florianmichael.viafabricplus.protocoltranslator.impl.provider.viaversion;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.minecraft.BlockPosition;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
@ -29,10 +29,10 @@ import net.minecraft.util.math.BlockPos;
|
||||
public class ViaFabricPlusPlayerLookTargetProvider extends PlayerLookTargetProvider {
|
||||
|
||||
@Override
|
||||
public Position getPlayerLookTarget(UserConnection info) {
|
||||
public BlockPosition getPlayerLookTarget(UserConnection info) {
|
||||
if (MinecraftClient.getInstance().crosshairTarget instanceof BlockHitResult blockHitResult) {
|
||||
final BlockPos pos = blockHitResult.getBlockPos();
|
||||
return new Position(pos.getX(), pos.getY(), pos.getZ());
|
||||
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
package de.florianmichael.viafabricplus.protocoltranslator.translator;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.minecraft.BlockPosition;
|
||||
import com.viaversion.viaversion.api.protocol.packet.Direction;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
@ -47,7 +47,7 @@ public class BlockStateTranslator {
|
||||
try {
|
||||
final PacketWrapper levelEvent = PacketWrapper.create(ClientboundPackets1_18.LEVEL_EVENT, DUMMY_USER_CONNECTION);
|
||||
levelEvent.write(Types.INT, 2001); // eventId
|
||||
levelEvent.write(Types.BLOCK_POSITION1_14, new Position(0, 0, 0)); // position
|
||||
levelEvent.write(Types.BLOCK_POSITION1_14, new BlockPosition(0, 0, 0)); // position
|
||||
levelEvent.write(Types.INT, blockStateId); // data
|
||||
levelEvent.write(Types.BOOLEAN, false); // global
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user