mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Implement getBlockCacheNode correctly (no interface).
This commit is contained in:
parent
cc538ee5a5
commit
67a500ede9
|
@ -320,16 +320,32 @@ public abstract class BlockCache {
|
|||
return nBounds;
|
||||
}
|
||||
|
||||
// TODO: Interface / Override annotation.
|
||||
/**
|
||||
* Get the internally stored BlockCacheNode instance for the given
|
||||
* coordinates. Creation/updating is controlled with forceSetAll.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param forceSetAll
|
||||
* @return If forceSetAll is true, a node will always be returned with all
|
||||
* properties set. If forceSetAll is false, null might be returned,
|
||||
* if no node is present for the given coordinates.
|
||||
*/
|
||||
public BlockCacheNode getBlockCacheNode(int x, int y, int z, boolean forceSetAll) {
|
||||
final BlockCacheNode node = getOrCreateNode(x, y, z);
|
||||
if (!node.isDataFetched()) {
|
||||
node.setData(fetchData(x, y, z));
|
||||
if (forceSetAll) {
|
||||
final BlockCacheNode node = getOrCreateNode(x, y, z);
|
||||
if (!node.isDataFetched()) {
|
||||
node.setData(fetchData(x, y, z));
|
||||
}
|
||||
if (!node.isBoundsFetched()) {
|
||||
node.setBounds(fetchBounds(x, y, z));
|
||||
}
|
||||
return node;
|
||||
}
|
||||
if (!node.isBoundsFetched()) {
|
||||
node.setBounds(fetchBounds(x, y, z));
|
||||
else {
|
||||
return nodeMap.get(x, y, z);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user