Archived
0

LockObserveList implementation, tests for Lock and List

This commit is contained in:
Daniil
2018-08-05 13:40:02 +07:00
parent b5a7942b67
commit 6ab8658399
3 changed files with 150 additions and 9 deletions

View File

@@ -6,17 +6,23 @@ package mc.core;
import lombok.AllArgsConstructor;
import lombok.Data;
import mc.core.world.Chunk;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.io.Serializable;
@AllArgsConstructor
@Data
public class Location implements Serializable{
public class Location implements Serializable {
private double x, y, z;
public Location(long compactValue) {
set(compactValue);
}
private static int floor_double(double value) {
int i = (int)value;
return value < (double)i ? i - 1 : i;
int i = (int) value;
return value < (double) i ? i - 1 : i;
}
public static Location copyOf(Location location) {
@@ -27,12 +33,8 @@ public class Location implements Serializable{
);
}
public static Location startPointLocation () {
return new Location(0,10,0);
}
public Location(long compactValue) {
set(compactValue);
public static Location startPointLocation() {
return new Location(0, 10, 0);
}
public void set(Location location) {
@@ -55,6 +57,11 @@ public class Location implements Serializable{
);
}
public Chunk getChunk() {
// TODO: Implement
throw new NotImplementedException();
}
public int getBlockX() {
return (int) x;
}