本文整理汇总了Java中ethanjones.cubes.world.CoordinateConverter.area方法的典型用法代码示例。如果您正苦于以下问题:Java CoordinateConverter.area方法的具体用法?Java CoordinateConverter.area怎么用?Java CoordinateConverter.area使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ethanjones.cubes.world.CoordinateConverter
的用法示例。
在下文中一共展示了CoordinateConverter.area方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryPropagateRemove
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue,
LightWorldSection w, int x, int y, int z, int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
return;
int p = ((a.light[ref] >> 4) & 0xF);
if (p != 0 && p < l) {
a.light[ref] = (byte) (a.light[ref] & 0xF); // same as
// ((a.light[ref] &
// 0xF0) | (0 << 4))
a.updateRender(y / SIZE_BLOCKS);
a.modify();
removeQueue.add(new LightNode(x, y, z, p));
} else if (p >= l) {
addQueue.add(new LightNode(x, y, z, p));
}
}
示例2: tryPropagateAdd
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z,
int ln) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
return;
int i = ((a.light[ref] >> 4) & 0xF);
if (i + 1 <= ln) { // DIFFERENT + 1 instead of + 2
a.light[ref] = (byte) ((a.light[ref] & 0xF) | (ln << 4));
a.updateRender(y / SIZE_BLOCKS);
a.modify();
lightQueue.add(new LightNode(x, y, z, ln));
}
}
示例3: tryPropagateRemove
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue,
LightWorldSection w, int x, int y, int z, int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
return;
int p = a.light[ref] & 0xF;
if (p != 0 && p < l) {
a.light[ref] = (byte) (a.light[ref] & 0xF0); // same as
// ((a.light[ref] &
// 0xF0) | 0)
a.updateRender(y / SIZE_BLOCKS);
a.modify();
removeQueue.add(new LightNode(x, y, z, p));
} else if (p >= l) {
addQueue.add(new LightNode(x, y, z, p));
}
}
示例4: tryPropagateRemove
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue, LightWorldSection w, int x, int y, int z, int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
int p = ((a.light[ref] >> 4) & 0xF);
if (p != 0 && p < l) {
a.light[ref] = (byte) (a.light[ref] & 0xF); // same as ((a.light[ref] & 0xF0) | (0 << 4))
a.updateRender(y / SIZE_BLOCKS);
a.modify();
removeQueue.add(new LightNode(x, y, z, p));
} else if (p >= l) {
addQueue.add(new LightNode(x, y, z, p));
}
}
示例5: tryPropagateRemove
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateRemove(ArrayDeque<LightNode> removeQueue, ArrayDeque<LightNode> addQueue, LightWorldSection w, int x, int y, int z, int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
int p = a.light[ref] & 0xF;
if (p != 0 && p < l) {
a.light[ref] = (byte) (a.light[ref] & 0xF0); // same as ((a.light[ref] & 0xF0) | 0)
a.updateRender(y / SIZE_BLOCKS);
a.modify();
removeQueue.add(new LightNode(x, y, z, p));
} else if (p >= l) {
addQueue.add(new LightNode(x, y, z, p));
}
}
示例6: tryPropagateAdd
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z,
int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref]))
return;
if ((a.light[ref] & 0xF) + 2 <= l) {
a.light[ref] = (byte) ((a.light[ref] & 0xF0) | (l - 1));
a.updateRender(y / SIZE_BLOCKS);
a.modify();
lightQueue.add(new LightNode(x, y, z, l - 1));
}
}
示例7: getEntitiesForSave
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public DataGroup[] getEntitiesForSave(int areaX, int areaZ) {
lock.readLock();
ArrayList<DataGroup> dataGroups = new ArrayList<DataGroup>();
for (Entity entity : values()) {
if (areaX == CoordinateConverter.area(entity.position.x)
&& areaZ == CoordinateConverter.area(entity.position.z) && !(entity instanceof Player)) {
dataGroups.add(entity.write());
}
}
DataGroup[] array = dataGroups.size() == 0 ? new DataGroup[0]
: dataGroups.toArray(new DataGroup[dataGroups.size()]);
lock.readUnlock();
return array;
}
示例8: tryPropagateAdd
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z, int ln) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
int i = ((a.light[ref] >> 4) & 0xF);
if (i + 1 <= ln) { // DIFFERENT + 1 instead of + 2
a.light[ref] = (byte) ((a.light[ref] & 0xF) | (ln << 4));
a.updateRender(y / SIZE_BLOCKS);
a.modify();
lightQueue.add(new LightNode(x, y, z, ln));
}
}
示例9: tryPropagateAdd
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
private static void tryPropagateAdd(ArrayDeque<LightNode> lightQueue, LightWorldSection w, int x, int y, int z, int l) {
int dX = CoordinateConverter.area(x) - w.initialAreaX;
int dZ = CoordinateConverter.area(z) - w.initialAreaZ;
Area a = w.areas[dX + 1][dZ + 1];
int ref = getRef(x - a.minBlockX, y, z - a.minBlockZ);
if (!a.isReady() || y > a.maxY || !TransparencyManager.isTransparent(a.blocks[ref])) return;
if ((a.light[ref] & 0xF) + 2 <= l) {
a.light[ref] = (byte) ((a.light[ref] & 0xF0) | (l - 1));
a.updateRender(y / SIZE_BLOCKS);
a.modify();
lightQueue.add(new LightNode(x, y, z, l - 1));
}
}
示例10: getEntitiesForSave
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public DataGroup[] getEntitiesForSave(int areaX, int areaZ) {
lock.readLock();
ArrayList<DataGroup> dataGroups = new ArrayList<DataGroup>();
for (Entity entity : values()) {
if (areaX == CoordinateConverter.area(entity.position.x) && areaZ == CoordinateConverter.area(entity.position.z) && !(entity instanceof Player)) {
dataGroups.add(entity.write());
}
}
DataGroup[] array = dataGroups.size() == 0 ? new DataGroup[0] : dataGroups.toArray(new DataGroup[dataGroups.size()]);
lock.readUnlock();
return array;
}
示例11: setFromBlockCoordinates
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromBlockCoordinates(int blockX, int blockZ) {
this.areaX = CoordinateConverter.area(blockX);
this.areaZ = CoordinateConverter.area(blockZ);
this.hashCode = 0;
return this;
}
示例12: setFromBlockReference
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromBlockReference(BlockReference blockReference) {
this.areaX = CoordinateConverter.area(blockReference.blockX);
this.areaZ = CoordinateConverter.area(blockReference.blockZ);
this.hashCode = 0;
return this;
}
示例13: setFromPosition
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public AreaReference setFromPosition(float x, float z) {
this.areaX = CoordinateConverter.area(CoordinateConverter.block(x));
this.areaZ = CoordinateConverter.area(CoordinateConverter.block(z));
this.hashCode = 0;
return this;
}
示例14: contains
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public boolean contains(Vector3 position) {
int areaX = CoordinateConverter.area(position.x);
int areaZ = CoordinateConverter.area(position.z);
return areaX >= minAreaX && areaX <= maxAreaX && areaZ >= minAreaZ && areaZ <= maxAreaZ;
}
示例15: positionInLoadRange
import ethanjones.cubes.world.CoordinateConverter; //导入方法依赖的package包/类
public boolean positionInLoadRange(Vector3 position) {
int areaX = CoordinateConverter.area(position.x);
int areaZ = CoordinateConverter.area(position.z);
return areaX >= (playerArea.areaX - loadDistance) && areaX <= (playerArea.areaX + loadDistance)
&& areaZ >= (playerArea.areaZ - loadDistance) && areaZ <= (playerArea.areaZ + loadDistance);
}