mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
more properties
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
package com.dfsek.terra.api.block;
|
|
||||||
|
|
||||||
public enum Axis {
|
|
||||||
X, Y, Z
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.dfsek.terra.api.block;
|
package com.dfsek.terra.api.block;
|
||||||
|
|
||||||
import com.dfsek.terra.api.Handle;
|
import com.dfsek.terra.api.Handle;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.Property;
|
||||||
|
|
||||||
public interface BlockState extends Cloneable, Handle {
|
public interface BlockState extends Cloneable, Handle {
|
||||||
|
|
||||||
@@ -15,4 +16,10 @@ public interface BlockState extends Cloneable, Handle {
|
|||||||
boolean isAir();
|
boolean isAir();
|
||||||
|
|
||||||
boolean isStructureVoid();
|
boolean isStructureVoid();
|
||||||
|
|
||||||
|
<T> boolean has(Property<T> property);
|
||||||
|
|
||||||
|
<T> T get(Property<T> property);
|
||||||
|
|
||||||
|
<T> BlockState set(Property<T> property);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.dfsek.terra.api.block.data;
|
package com.dfsek.terra.api.block.data;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.BlockState;
|
import com.dfsek.terra.api.block.BlockState;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|||||||
@@ -1,22 +1,11 @@
|
|||||||
package com.dfsek.terra.api.block.data;
|
package com.dfsek.terra.api.block.data;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.BlockState;
|
import com.dfsek.terra.api.block.BlockState;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.RailShape;
|
||||||
|
|
||||||
public interface Rail extends BlockState {
|
public interface Rail extends BlockState {
|
||||||
Shape getShape();
|
RailShape getShape();
|
||||||
|
|
||||||
void setShape(Shape newShape);
|
void setShape(RailShape newShape);
|
||||||
|
|
||||||
enum Shape {
|
|
||||||
ASCENDING_EAST,
|
|
||||||
ASCENDING_NORTH,
|
|
||||||
ASCENDING_SOUTH,
|
|
||||||
ASCENDING_WEST,
|
|
||||||
EAST_WEST,
|
|
||||||
NORTH_EAST,
|
|
||||||
NORTH_SOUTH,
|
|
||||||
NORTH_WEST,
|
|
||||||
SOUTH_EAST,
|
|
||||||
SOUTH_WEST
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+19
@@ -2,9 +2,28 @@ package com.dfsek.terra.api.block.data.properties.base;
|
|||||||
|
|
||||||
import com.dfsek.terra.api.block.data.properties.Property;
|
import com.dfsek.terra.api.block.data.properties.Property;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
public interface BooleanProperty extends Property<Boolean> {
|
public interface BooleanProperty extends Property<Boolean> {
|
||||||
@Override
|
@Override
|
||||||
default Class<Boolean> getType() {
|
default Class<Boolean> getType() {
|
||||||
return Boolean.class;
|
return Boolean.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BooleanProperty of(String name) {
|
||||||
|
return new BooleanProperty() {
|
||||||
|
private static final Collection<Boolean> BOOLEANS = Arrays.asList(true, false);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Boolean> values() {
|
||||||
|
return BOOLEANS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
@@ -1,6 +1,29 @@
|
|||||||
package com.dfsek.terra.api.block.data.properties.base;
|
package com.dfsek.terra.api.block.data.properties.base;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.data.properties.Property;
|
import com.dfsek.terra.api.block.data.properties.Property;
|
||||||
|
import com.dfsek.terra.api.util.generic.Lazy;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
public interface EnumProperty<T extends Enum<T>> extends Property<T> {
|
public interface EnumProperty<T extends Enum<T>> extends Property<T> {
|
||||||
|
static <T extends Enum<T>> EnumProperty<T> of(String name, Class<T> clazz) {
|
||||||
|
return new EnumProperty<T>() {
|
||||||
|
private final Lazy<Collection<T>> constants = Lazy.of(() -> Arrays.asList(clazz.getEnumConstants()));
|
||||||
|
@Override
|
||||||
|
public Class<T> getType() {
|
||||||
|
return clazz;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<T> values() {
|
||||||
|
return constants.value();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+27
@@ -1,10 +1,37 @@
|
|||||||
package com.dfsek.terra.api.block.data.properties.base;
|
package com.dfsek.terra.api.block.data.properties.base;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.data.properties.Property;
|
import com.dfsek.terra.api.block.data.properties.Property;
|
||||||
|
import com.dfsek.terra.api.util.generic.Construct;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface IntProperty extends Property<Integer> {
|
public interface IntProperty extends Property<Integer> {
|
||||||
@Override
|
@Override
|
||||||
default Class<Integer> getType() {
|
default Class<Integer> getType() {
|
||||||
return Integer.class;
|
return Integer.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static IntProperty of(String name, int min, int max) {
|
||||||
|
return new IntProperty() {
|
||||||
|
private final Collection<Integer> collection = Construct.construct(() -> {
|
||||||
|
List<Integer> ints = new ArrayList<>();
|
||||||
|
for(int i = min; i <= max; i++) {
|
||||||
|
ints.add(i);
|
||||||
|
}
|
||||||
|
return ints;
|
||||||
|
});
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Integer> values() {
|
||||||
|
return collection;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.dfsek.terra.api.block.data.properties.base;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.Direction;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.RailShape;
|
||||||
|
|
||||||
|
public final class Properties {
|
||||||
|
public static final EnumProperty<Direction> DIRECTION = EnumProperty.of("facing", Direction.class);
|
||||||
|
|
||||||
|
public static final BooleanProperty NORTH = BooleanProperty.of("north");
|
||||||
|
public static final BooleanProperty SOUTH = BooleanProperty.of("south");
|
||||||
|
public static final BooleanProperty EAST = BooleanProperty.of("east");
|
||||||
|
public static final BooleanProperty WEST = BooleanProperty.of("west");
|
||||||
|
|
||||||
|
public static final EnumProperty<RailShape> RAIL_SHAPE = EnumProperty.of("shape", RailShape.class);
|
||||||
|
|
||||||
|
public static final IntProperty ROTATION = IntProperty.of("rotation", 0, 15);
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.dfsek.terra.api.block.data.properties.enums;
|
||||||
|
|
||||||
|
public enum Axis {
|
||||||
|
X, Y, Z
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package com.dfsek.terra.api.block.data.properties.enums;
|
||||||
|
|
||||||
|
public enum Direction {
|
||||||
|
NORTH,SOUTH,EAST,WEST,UP,DOWN
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.dfsek.terra.api.block.data.properties.enums;
|
||||||
|
|
||||||
|
public enum RailShape {
|
||||||
|
ASCENDING_EAST,
|
||||||
|
ASCENDING_NORTH,
|
||||||
|
ASCENDING_SOUTH,
|
||||||
|
ASCENDING_WEST,
|
||||||
|
EAST_WEST,
|
||||||
|
NORTH_EAST,
|
||||||
|
NORTH_SOUTH,
|
||||||
|
NORTH_WEST,
|
||||||
|
SOUTH_EAST,
|
||||||
|
SOUTH_WEST
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public final class Construct {
|
||||||
|
public static <T> T construct(Supplier<T> in) {
|
||||||
|
return in.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public final class Lazy<T> {
|
||||||
|
private final Supplier<T> valueSupplier;
|
||||||
|
private T value = null;
|
||||||
|
private boolean got = false;
|
||||||
|
|
||||||
|
private Lazy(Supplier<T> valueSupplier) {
|
||||||
|
this.valueSupplier = valueSupplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T value() {
|
||||||
|
if(!got && value == null) {
|
||||||
|
got = true;
|
||||||
|
value = valueSupplier.get();
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Lazy<T> of(Supplier<T> valueSupplier) {
|
||||||
|
return new Lazy<>(valueSupplier);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.dfsek.terra.api.util;
|
package com.dfsek.terra.api.util;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.RailShape;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.BlockState;
|
import com.dfsek.terra.api.block.BlockState;
|
||||||
import com.dfsek.terra.api.block.BlockFace;
|
import com.dfsek.terra.api.block.BlockFace;
|
||||||
import com.dfsek.terra.api.block.data.Directional;
|
import com.dfsek.terra.api.block.data.Directional;
|
||||||
@@ -174,76 +175,76 @@ public class RotationUtil {
|
|||||||
* @return Rotated/mirrored shape
|
* @return Rotated/mirrored shape
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("fallthrough")
|
@SuppressWarnings("fallthrough")
|
||||||
public static Rail.Shape getRotatedRail(Rail.Shape orig, Rotation r) {
|
public static RailShape getRotatedRail(RailShape orig, Rotation r) {
|
||||||
switch(r) {
|
switch(r) {
|
||||||
case CCW_90:
|
case CCW_90:
|
||||||
switch(orig) {
|
switch(orig) {
|
||||||
case NORTH_WEST:
|
case NORTH_WEST:
|
||||||
return Rail.Shape.SOUTH_WEST;
|
return RailShape.SOUTH_WEST;
|
||||||
case NORTH_SOUTH:
|
case NORTH_SOUTH:
|
||||||
return Rail.Shape.EAST_WEST;
|
return RailShape.EAST_WEST;
|
||||||
case SOUTH_WEST:
|
case SOUTH_WEST:
|
||||||
return Rail.Shape.SOUTH_EAST;
|
return RailShape.SOUTH_EAST;
|
||||||
case SOUTH_EAST:
|
case SOUTH_EAST:
|
||||||
return Rail.Shape.NORTH_EAST;
|
return RailShape.NORTH_EAST;
|
||||||
case EAST_WEST:
|
case EAST_WEST:
|
||||||
return Rail.Shape.NORTH_SOUTH;
|
return RailShape.NORTH_SOUTH;
|
||||||
case NORTH_EAST:
|
case NORTH_EAST:
|
||||||
return Rail.Shape.NORTH_WEST;
|
return RailShape.NORTH_WEST;
|
||||||
case ASCENDING_EAST:
|
case ASCENDING_EAST:
|
||||||
return Rail.Shape.ASCENDING_NORTH;
|
return RailShape.ASCENDING_NORTH;
|
||||||
case ASCENDING_WEST:
|
case ASCENDING_WEST:
|
||||||
return Rail.Shape.ASCENDING_SOUTH;
|
return RailShape.ASCENDING_SOUTH;
|
||||||
case ASCENDING_NORTH:
|
case ASCENDING_NORTH:
|
||||||
return Rail.Shape.ASCENDING_WEST;
|
return RailShape.ASCENDING_WEST;
|
||||||
case ASCENDING_SOUTH:
|
case ASCENDING_SOUTH:
|
||||||
return Rail.Shape.ASCENDING_EAST;
|
return RailShape.ASCENDING_EAST;
|
||||||
}
|
}
|
||||||
case CW_90:
|
case CW_90:
|
||||||
switch(orig) {
|
switch(orig) {
|
||||||
case NORTH_WEST:
|
case NORTH_WEST:
|
||||||
return Rail.Shape.NORTH_EAST;
|
return RailShape.NORTH_EAST;
|
||||||
case NORTH_SOUTH:
|
case NORTH_SOUTH:
|
||||||
return Rail.Shape.EAST_WEST;
|
return RailShape.EAST_WEST;
|
||||||
case SOUTH_WEST:
|
case SOUTH_WEST:
|
||||||
return Rail.Shape.NORTH_WEST;
|
return RailShape.NORTH_WEST;
|
||||||
case SOUTH_EAST:
|
case SOUTH_EAST:
|
||||||
return Rail.Shape.SOUTH_WEST;
|
return RailShape.SOUTH_WEST;
|
||||||
case EAST_WEST:
|
case EAST_WEST:
|
||||||
return Rail.Shape.NORTH_SOUTH;
|
return RailShape.NORTH_SOUTH;
|
||||||
case NORTH_EAST:
|
case NORTH_EAST:
|
||||||
return Rail.Shape.SOUTH_EAST;
|
return RailShape.SOUTH_EAST;
|
||||||
case ASCENDING_EAST:
|
case ASCENDING_EAST:
|
||||||
return Rail.Shape.ASCENDING_SOUTH;
|
return RailShape.ASCENDING_SOUTH;
|
||||||
case ASCENDING_WEST:
|
case ASCENDING_WEST:
|
||||||
return Rail.Shape.ASCENDING_NORTH;
|
return RailShape.ASCENDING_NORTH;
|
||||||
case ASCENDING_NORTH:
|
case ASCENDING_NORTH:
|
||||||
return Rail.Shape.ASCENDING_EAST;
|
return RailShape.ASCENDING_EAST;
|
||||||
case ASCENDING_SOUTH:
|
case ASCENDING_SOUTH:
|
||||||
return Rail.Shape.ASCENDING_WEST;
|
return RailShape.ASCENDING_WEST;
|
||||||
}
|
}
|
||||||
case CW_180:
|
case CW_180:
|
||||||
switch(orig) {
|
switch(orig) {
|
||||||
case NORTH_WEST:
|
case NORTH_WEST:
|
||||||
return Rail.Shape.SOUTH_EAST;
|
return RailShape.SOUTH_EAST;
|
||||||
case NORTH_SOUTH:
|
case NORTH_SOUTH:
|
||||||
return Rail.Shape.NORTH_SOUTH;
|
return RailShape.NORTH_SOUTH;
|
||||||
case SOUTH_WEST:
|
case SOUTH_WEST:
|
||||||
return Rail.Shape.NORTH_EAST;
|
return RailShape.NORTH_EAST;
|
||||||
case SOUTH_EAST:
|
case SOUTH_EAST:
|
||||||
return Rail.Shape.NORTH_WEST;
|
return RailShape.NORTH_WEST;
|
||||||
case EAST_WEST:
|
case EAST_WEST:
|
||||||
return Rail.Shape.EAST_WEST;
|
return RailShape.EAST_WEST;
|
||||||
case NORTH_EAST:
|
case NORTH_EAST:
|
||||||
return Rail.Shape.SOUTH_WEST;
|
return RailShape.SOUTH_WEST;
|
||||||
case ASCENDING_EAST:
|
case ASCENDING_EAST:
|
||||||
return Rail.Shape.ASCENDING_WEST;
|
return RailShape.ASCENDING_WEST;
|
||||||
case ASCENDING_WEST:
|
case ASCENDING_WEST:
|
||||||
return Rail.Shape.ASCENDING_EAST;
|
return RailShape.ASCENDING_EAST;
|
||||||
case ASCENDING_NORTH:
|
case ASCENDING_NORTH:
|
||||||
return Rail.Shape.ASCENDING_SOUTH;
|
return RailShape.ASCENDING_SOUTH;
|
||||||
case ASCENDING_SOUTH:
|
case ASCENDING_SOUTH:
|
||||||
return Rail.Shape.ASCENDING_NORTH;
|
return RailShape.ASCENDING_NORTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return orig;
|
return orig;
|
||||||
@@ -266,7 +267,7 @@ public class RotationUtil {
|
|||||||
mfData.setFace(getRotatedFace(face.getKey(), r), face.getValue());
|
mfData.setFace(getRotatedFace(face.getKey(), r), face.getValue());
|
||||||
}
|
}
|
||||||
} else if(data instanceof Rail) {
|
} else if(data instanceof Rail) {
|
||||||
Rail.Shape newShape = getRotatedRail(((Rail) data).getShape(), r);
|
RailShape newShape = getRotatedRail(((Rail) data).getShape(), r);
|
||||||
((Rail) data).setShape(newShape);
|
((Rail) data).setShape(newShape);
|
||||||
} else if(data instanceof Orientable) {
|
} else if(data instanceof Orientable) {
|
||||||
Axis newAxis = getRotatedAxis(((Orientable) data).getAxis(), r);
|
Axis newAxis = getRotatedAxis(((Orientable) data).getAxis(), r);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.dfsek.terra.bukkit.world;
|
package com.dfsek.terra.bukkit.world;
|
||||||
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.RailShape;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.BlockState;
|
import com.dfsek.terra.api.block.BlockState;
|
||||||
import com.dfsek.terra.api.block.BlockFace;
|
import com.dfsek.terra.api.block.BlockFace;
|
||||||
import com.dfsek.terra.api.block.BlockType;
|
import com.dfsek.terra.api.block.BlockType;
|
||||||
import com.dfsek.terra.api.block.data.Bisected;
|
import com.dfsek.terra.api.block.data.Bisected;
|
||||||
import com.dfsek.terra.api.block.data.Rail;
|
|
||||||
import com.dfsek.terra.api.block.data.RedstoneWire;
|
import com.dfsek.terra.api.block.data.RedstoneWire;
|
||||||
import com.dfsek.terra.api.block.data.Slab;
|
import com.dfsek.terra.api.block.data.Slab;
|
||||||
import com.dfsek.terra.api.block.data.Stairs;
|
import com.dfsek.terra.api.block.data.Stairs;
|
||||||
@@ -200,34 +200,34 @@ public final class BukkitAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Rail.Shape adapt(org.bukkit.block.data.Rail.Shape shape) {
|
public static RailShape adapt(org.bukkit.block.data.Rail.Shape shape) {
|
||||||
switch(shape) {
|
switch(shape) {
|
||||||
case SOUTH_WEST:
|
case SOUTH_WEST:
|
||||||
return Rail.Shape.SOUTH_WEST;
|
return RailShape.SOUTH_WEST;
|
||||||
case SOUTH_EAST:
|
case SOUTH_EAST:
|
||||||
return Rail.Shape.SOUTH_EAST;
|
return RailShape.SOUTH_EAST;
|
||||||
case NORTH_EAST:
|
case NORTH_EAST:
|
||||||
return Rail.Shape.NORTH_EAST;
|
return RailShape.NORTH_EAST;
|
||||||
case NORTH_WEST:
|
case NORTH_WEST:
|
||||||
return Rail.Shape.NORTH_WEST;
|
return RailShape.NORTH_WEST;
|
||||||
case ASCENDING_EAST:
|
case ASCENDING_EAST:
|
||||||
return Rail.Shape.ASCENDING_EAST;
|
return RailShape.ASCENDING_EAST;
|
||||||
case ASCENDING_WEST:
|
case ASCENDING_WEST:
|
||||||
return Rail.Shape.ASCENDING_WEST;
|
return RailShape.ASCENDING_WEST;
|
||||||
case ASCENDING_SOUTH:
|
case ASCENDING_SOUTH:
|
||||||
return Rail.Shape.ASCENDING_SOUTH;
|
return RailShape.ASCENDING_SOUTH;
|
||||||
case ASCENDING_NORTH:
|
case ASCENDING_NORTH:
|
||||||
return Rail.Shape.ASCENDING_NORTH;
|
return RailShape.ASCENDING_NORTH;
|
||||||
case NORTH_SOUTH:
|
case NORTH_SOUTH:
|
||||||
return Rail.Shape.NORTH_SOUTH;
|
return RailShape.NORTH_SOUTH;
|
||||||
case EAST_WEST:
|
case EAST_WEST:
|
||||||
return Rail.Shape.EAST_WEST;
|
return RailShape.EAST_WEST;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static org.bukkit.block.data.Rail.Shape adapt(Rail.Shape shape) {
|
public static org.bukkit.block.data.Rail.Shape adapt(RailShape shape) {
|
||||||
switch(shape) {
|
switch(shape) {
|
||||||
case EAST_WEST:
|
case EAST_WEST:
|
||||||
return org.bukkit.block.data.Rail.Shape.EAST_WEST;
|
return org.bukkit.block.data.Rail.Shape.EAST_WEST;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package com.dfsek.terra.bukkit.world.block.data;
|
package com.dfsek.terra.bukkit.world.block.data;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.data.Orientable;
|
import com.dfsek.terra.api.block.data.Orientable;
|
||||||
import com.dfsek.terra.bukkit.world.BukkitAdapter;
|
import com.dfsek.terra.bukkit.world.BukkitAdapter;
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.dfsek.terra.bukkit.world.block.data;
|
package com.dfsek.terra.bukkit.world.block.data;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.data.Rail;
|
import com.dfsek.terra.api.block.data.Rail;
|
||||||
|
import com.dfsek.terra.api.block.data.properties.enums.RailShape;
|
||||||
import com.dfsek.terra.bukkit.world.BukkitAdapter;
|
import com.dfsek.terra.bukkit.world.BukkitAdapter;
|
||||||
|
|
||||||
public class BukkitRail extends BukkitBlockState implements Rail {
|
public class BukkitRail extends BukkitBlockState implements Rail {
|
||||||
@@ -9,12 +10,12 @@ public class BukkitRail extends BukkitBlockState implements Rail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Shape getShape() {
|
public RailShape getShape() {
|
||||||
return BukkitAdapter.adapt(((org.bukkit.block.data.Rail) getHandle()).getShape());
|
return BukkitAdapter.adapt(((org.bukkit.block.data.Rail) getHandle()).getShape());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setShape(Shape newShape) {
|
public void setShape(RailShape newShape) {
|
||||||
((org.bukkit.block.data.Rail) getHandle()).setShape(BukkitAdapter.adapt(newShape));
|
((org.bukkit.block.data.Rail) getHandle()).setShape(BukkitAdapter.adapt(newShape));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package com.dfsek.terra.fabric.block.data;
|
package com.dfsek.terra.fabric.block.data;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.data.Orientable;
|
import com.dfsek.terra.api.block.data.Orientable;
|
||||||
import com.dfsek.terra.fabric.block.FabricBlockState;
|
import com.dfsek.terra.fabric.block.FabricBlockState;
|
||||||
import com.dfsek.terra.fabric.util.FabricAdapter;
|
import com.dfsek.terra.fabric.util.FabricAdapter;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.dfsek.terra.fabric.util;
|
package com.dfsek.terra.fabric.util;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.Axis;
|
import com.dfsek.terra.api.block.data.properties.enums.Axis;
|
||||||
import com.dfsek.terra.api.block.BlockFace;
|
import com.dfsek.terra.api.block.BlockFace;
|
||||||
import com.dfsek.terra.api.block.data.Bisected;
|
import com.dfsek.terra.api.block.data.Bisected;
|
||||||
import com.dfsek.terra.api.block.data.Slab;
|
import com.dfsek.terra.api.block.data.Slab;
|
||||||
|
|||||||
Reference in New Issue
Block a user