Update VV API usage

This commit is contained in:
FlorianMichael 2024-05-26 22:59:36 +02:00
parent c455ccbc98
commit 50f78eea5e
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
9 changed files with 27 additions and 27 deletions

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1144.providers;
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;
@ -28,13 +28,13 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
final HitResult crosshairTarget = MinecraftClient.getInstance().crosshairTarget;
if (crosshairTarget instanceof BlockHitResult) {
final BlockPos pos = ((BlockHitResult) crosshairTarget).getBlockPos();
return new Position(pos.getX(), pos.getY(), pos.getZ());
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1152.providers;
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;
@ -28,13 +28,13 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
final HitResult crosshairTarget = MinecraftClient.getInstance().crosshairTarget;
if (crosshairTarget instanceof BlockHitResult) {
final BlockPos pos = ((BlockHitResult) crosshairTarget).getBlockPos();
return new Position(pos.getX(), pos.getY(), pos.getZ());
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1165.providers;
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;
@ -28,13 +28,13 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
final HitResult crosshairTarget = MinecraftClient.getInstance().crosshairTarget;
if (crosshairTarget instanceof BlockHitResult) {
final BlockPos pos = ((BlockHitResult) crosshairTarget).getBlockPos();
return new Position(pos.getX(), pos.getY(), pos.getZ());
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1171.providers;
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;
@ -28,13 +28,13 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
final HitResult crosshairTarget = MinecraftClient.getInstance().crosshairTarget;
if (crosshairTarget instanceof BlockHitResult) {
final BlockPos pos = ((BlockHitResult) crosshairTarget).getBlockPos();
return new Position(pos.getX(), pos.getY(), pos.getZ());
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1182.providers;
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;
@ -28,13 +28,13 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
final HitResult crosshairTarget = MinecraftClient.getInstance().crosshairTarget;
if (crosshairTarget instanceof BlockHitResult) {
final BlockPos pos = ((BlockHitResult) crosshairTarget).getBlockPos();
return new Position(pos.getX(), pos.getY(), pos.getZ());
return new BlockPosition(pos.getX(), pos.getY(), pos.getZ());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1194.providers;
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;
@ -27,12 +27,12 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
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());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1201.providers;
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;
@ -27,12 +27,12 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
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());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1204.providers;
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;
@ -27,12 +27,12 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
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());
}
return null;
}

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1206.providers;
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;
@ -27,12 +27,12 @@ import net.minecraft.util.math.BlockPos;
public class VFPlayerLookTargetProvider extends PlayerLookTargetProvider {
@Override
public Position getPlayerLookTarget(UserConnection info) {
public BlockPosition getPlayerLookTarget(UserConnection info) {
if (!info.isClientSide()) return null;
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());
}
return null;
}