mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-12-21 16:17:37 +01:00
Update VV API usage
This commit is contained in:
parent
c455ccbc98
commit
50f78eea5e
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user