123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package me.km.api;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.World;
- public class Location
- {
- private final World w;
- private final Vec3d pos;
- private float yaw;
- private float pitch;
-
- public Location(World w, Vec3d pos, float yaw, float pitch)
- {
- this.w = w;
- this.pos = pos;
- this.yaw = yaw;
- this.pitch = pitch;
- }
-
- public Location(World w, Vec3d pos)
- {
- this(w, pos, 0, 0);
- }
-
- public Location(World w, BlockPos pos, float yaw, float pitch)
- {
- this(w, new Vec3d(pos.getX(), pos.getY(), pos.getZ()), yaw, pitch);
- }
-
- public Location(World w, BlockPos pos)
- {
- this(w, pos, 0, 0);
- }
- public World getWorld()
- {
- return w;
- }
- public Vec3d getPos()
- {
- return pos;
- }
- public float getYaw()
- {
- return yaw;
- }
- public float getPitch()
- {
- return pitch;
- }
- public void setPitch(float pitch)
- {
- this.pitch = pitch;
- }
- public void setYaw(float yaw)
- {
- this.yaw = yaw;
- }
-
- public static IBlockState getRelativeBlock(World w, BlockPos pos, int x, int y, int z)
- {
- return w.getBlockState(pos.add(x, y, z));
- }
- }
|