mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
getBlockState -> getBlockEntity
This commit is contained in:
parent
5401917703
commit
7da87c27ee
@ -38,7 +38,7 @@ public class BufferedLootApplication implements BufferedItem {
|
|||||||
@Override
|
@Override
|
||||||
public void paste(Vector3 origin, WritableWorld world) {
|
public void paste(Vector3 origin, WritableWorld world) {
|
||||||
try {
|
try {
|
||||||
BlockEntity data = world.getBlockState(origin);
|
BlockEntity data = world.getBlockEntity(origin);
|
||||||
if(!(data instanceof Container container)) {
|
if(!(data instanceof Container container)) {
|
||||||
LOGGER.error("Failed to place loot at {}; block {} is not a container", origin, data);
|
LOGGER.error("Failed to place loot at {}; block {} is not a container", origin, data);
|
||||||
return;
|
return;
|
||||||
|
@ -27,7 +27,7 @@ public class BufferedStateManipulator implements BufferedItem {
|
|||||||
@Override
|
@Override
|
||||||
public void paste(Vector3 origin, WritableWorld world) {
|
public void paste(Vector3 origin, WritableWorld world) {
|
||||||
try {
|
try {
|
||||||
BlockEntity state = world.getBlockState(origin);
|
BlockEntity state = world.getBlockEntity(origin);
|
||||||
state.applyState(data);
|
state.applyState(data);
|
||||||
state.update(false);
|
state.update(false);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
@ -17,13 +17,13 @@ public interface ReadableWorld extends World {
|
|||||||
return getBlockData(position.getX(), position.getY(), position.getZ());
|
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) {
|
default BlockEntity getBlockEntity(Vector3 position) {
|
||||||
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
return getBlockEntity(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
default BlockEntity getBlockState(Vector3Int position) {
|
default BlockEntity getBlockEntity(Vector3Int position) {
|
||||||
return getBlockState(position.getX(), position.getY(), position.getZ());
|
return getBlockEntity(position.getX(), position.getY(), position.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class BukkitProtoWorld implements ProtoWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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));
|
return BukkitBlockEntity.newInstance(delegate.getBlockState(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class BukkitServerWorld implements ServerWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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());
|
return BukkitBlockEntity.newInstance(delegate.getBlockAt(x, y, z).getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user