mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
getBlockData -> getBlockState
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ public class TerraFlora implements Structure {
|
|||||||
|
|
||||||
private void test(EnumSet<Direction> faces, Direction f, Vector3 b, WritableWorld world) {
|
private void test(EnumSet<Direction> faces, Direction f, Vector3 b, WritableWorld world) {
|
||||||
if(testRotation.contains(
|
if(testRotation.contains(
|
||||||
world.getBlockData(b.getBlockX() + f.getModX(), b.getBlockY() + f.getModY(), b.getBlockZ() + f.getModZ()).getBlockType()))
|
world.getBlockState(b.getBlockX() + f.getModX(), b.getBlockY() + f.getModY(), b.getBlockZ() + f.getModZ()).getBlockType()))
|
||||||
faces.add(f);
|
faces.add(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ public class VanillaOre implements Structure {
|
|||||||
for(int z = zStart; z <= zEnd; z++) {
|
for(int z = zStart; z <= zEnd; z++) {
|
||||||
double d15 = (z + 0.5D - (d3 + (d4 - d3) * iFactor)) / (d11 / 2.0D);
|
double d15 = (z + 0.5D - (d3 + (d4 - d3) * iFactor)) / (d11 / 2.0D);
|
||||||
if(y >= world.getMaxHeight() || y < world.getMinHeight()) continue;
|
if(y >= world.getMaxHeight() || y < world.getMinHeight()) continue;
|
||||||
BlockType block = world.getBlockData(x, y, z).getBlockType();
|
BlockType block = world.getBlockState(x, y, z).getBlockType();
|
||||||
if((d13 * d13 + d14 * d14 + d15 * d15 < 1.0D) && getReplaceable().contains(block)) {
|
if((d13 * d13 + d14 * d14 + d15 * d15 < 1.0D) && getReplaceable().contains(block)) {
|
||||||
world.setBlockData(x, y, z, getMaterial(block), isApplyGravity());
|
world.setBlockData(x, y, z, getMaterial(block), isApplyGravity());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ public class ColumnImpl<T extends WritableWorld> implements Column<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlock(int y) {
|
public BlockState getBlock(int y) {
|
||||||
return world.getBlockData(x, y, z);
|
return world.getBlockState(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ public class BufferedPulledBlock implements BufferedItem {
|
|||||||
public void paste(Vector3 origin, WritableWorld world) {
|
public void paste(Vector3 origin, WritableWorld world) {
|
||||||
Vector3 mutable = origin.clone();
|
Vector3 mutable = origin.clone();
|
||||||
while(mutable.getY() > world.getMinHeight()) {
|
while(mutable.getY() > world.getMinHeight()) {
|
||||||
if(!world.getBlockData(mutable).isAir()) {
|
if(!world.getBlockState(mutable).isAir()) {
|
||||||
world.setBlockData(mutable, data);
|
world.setBlockData(mutable, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ public class CheckBlockFunction implements Function<String> {
|
|||||||
RotationUtil.rotateVector(xz, arguments.getRotation());
|
RotationUtil.rotateVector(xz, arguments.getRotation());
|
||||||
|
|
||||||
String data = arguments.getWorld()
|
String data = arguments.getWorld()
|
||||||
.getBlockData(arguments.getBuffer()
|
.getBlockState(arguments.getBuffer()
|
||||||
.getOrigin()
|
.getOrigin()
|
||||||
.clone()
|
.clone()
|
||||||
.add(new Vector3(FastMath.roundToInt(xz.getX()),
|
.add(new Vector3(FastMath.roundToInt(xz.getX()),
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ public class BufferedBlock implements BufferedItem {
|
|||||||
@Override
|
@Override
|
||||||
public void paste(Vector3 origin, WritableWorld world) {
|
public void paste(Vector3 origin, WritableWorld world) {
|
||||||
try {
|
try {
|
||||||
BlockState current = world.getBlockData(origin);
|
BlockState current = world.getBlockState(origin);
|
||||||
if(overwrite || current.isAir()) {
|
if(overwrite || current.isAir()) {
|
||||||
if(waterlog && current.has(Properties.WATERLOGGED) && current.getBlockType().isWater()) {
|
if(waterlog && current.has(Properties.WATERLOGGED) && current.getBlockType().isWater()) {
|
||||||
current.set(Properties.WATERLOGGED, true);
|
current.set(Properties.WATERLOGGED, true);
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ import com.dfsek.terra.api.util.vector.integer.Vector3Int;
|
|||||||
|
|
||||||
|
|
||||||
public interface ReadableWorld extends World {
|
public interface ReadableWorld extends World {
|
||||||
BlockState getBlockData(int x, int y, int z);
|
BlockState getBlockState(int x, int y, int z);
|
||||||
|
|
||||||
default BlockState getBlockData(Vector3 position) {
|
default BlockState getBlockState(Vector3 position) {
|
||||||
return getBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
default BlockState getBlockData(Vector3Int position) {
|
default BlockState getBlockState(Vector3Int position) {
|
||||||
return getBlockData(position.getX(), position.getY(), position.getZ());
|
return getBlockState(position.getX(), position.getY(), position.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockEntity getBlockEntity(int x, int y, int z);
|
BlockEntity getBlockEntity(int x, int y, int z);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class BukkitProtoWorld implements ProtoWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlockData(int x, int y, int z) {
|
public BlockState getBlockState(int x, int y, int z) {
|
||||||
return BukkitBlockState.newInstance(delegate.getBlockData(x, y, z));
|
return BukkitBlockState.newInstance(delegate.getBlockData(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class BukkitServerWorld implements ServerWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlockData(int x, int y, int z) {
|
public BlockState getBlockState(int x, int y, int z) {
|
||||||
return BukkitAdapter.adapt(delegate.getBlockAt(x, y, z).getBlockData());
|
return BukkitAdapter.adapt(delegate.getBlockAt(x, y, z).getBlockData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user