getBlockState -> getBlockEntity

This commit is contained in:
dfsek 2021-12-17 08:37:51 -07:00
parent 5401917703
commit 7da87c27ee
5 changed files with 9 additions and 9 deletions

View File

@ -38,7 +38,7 @@ public class BufferedLootApplication implements BufferedItem {
@Override
public void paste(Vector3 origin, WritableWorld world) {
try {
BlockEntity data = world.getBlockState(origin);
BlockEntity data = world.getBlockEntity(origin);
if(!(data instanceof Container container)) {
LOGGER.error("Failed to place loot at {}; block {} is not a container", origin, data);
return;

View File

@ -27,7 +27,7 @@ public class BufferedStateManipulator implements BufferedItem {
@Override
public void paste(Vector3 origin, WritableWorld world) {
try {
BlockEntity state = world.getBlockState(origin);
BlockEntity state = world.getBlockEntity(origin);
state.applyState(data);
state.update(false);
} catch(Exception e) {

View File

@ -17,13 +17,13 @@ public interface ReadableWorld extends World {
return getBlockData(position.getX(), position.getY(), position.getZ());
}
BlockEntity getBlockState(int x, int y, int z);
BlockEntity getBlockEntity(int x, int y, int z);
default BlockEntity getBlockState(Vector3 position) {
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
default BlockEntity getBlockEntity(Vector3 position) {
return getBlockEntity(position.getBlockX(), position.getBlockY(), position.getBlockZ());
}
default BlockEntity getBlockState(Vector3Int position) {
return getBlockState(position.getX(), position.getY(), position.getZ());
default BlockEntity getBlockEntity(Vector3Int position) {
return getBlockEntity(position.getX(), position.getY(), position.getZ());
}
}

View File

@ -53,7 +53,7 @@ public class BukkitProtoWorld implements ProtoWorld {
}
@Override
public BlockEntity getBlockState(int x, int y, int z) {
public BlockEntity getBlockEntity(int x, int y, int z) {
return BukkitBlockEntity.newInstance(delegate.getBlockState(x, y, z));
}

View File

@ -73,7 +73,7 @@ public class BukkitServerWorld implements ServerWorld {
}
@Override
public BlockEntity getBlockState(int x, int y, int z) {
public BlockEntity getBlockEntity(int x, int y, int z) {
return BukkitBlockEntity.newInstance(delegate.getBlockAt(x, y, z).getState());
}