mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 00:15:35 +00:00
getBlockState -> getBlockEntity
This commit is contained in:
parent
5401917703
commit
7da87c27ee
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user