Java Code Examples for cn.nukkit.blockentity.BlockEntity#getFloorY()
The following examples show how to use
cn.nukkit.blockentity.BlockEntity#getFloorY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseFullChunk.java From Nukkit with GNU General Public License v3.0 | 6 votes |
@Override public void addBlockEntity(BlockEntity blockEntity) { if (this.tiles == null) { this.tiles = new Long2ObjectOpenHashMap<>(); this.tileList = new Int2ObjectOpenHashMap<>(); } this.tiles.put(blockEntity.getId(), blockEntity); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); if (this.tileList.containsKey(index) && !this.tileList.get(index).equals(blockEntity)) { BlockEntity entity = this.tileList.get(index); this.tiles.remove(entity.getId()); entity.close(); } this.tileList.put(index, blockEntity); if (this.isInit) { this.setChanged(); } }
Example 2
Source File: BaseFullChunk.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public void addBlockEntity(BlockEntity blockEntity) { this.tiles.put(blockEntity.getId(), blockEntity); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); if (this.tileList.containsKey(index) && !this.tileList.get(index).equals(blockEntity)) { this.tileList.get(index).close(); } this.tileList.put(index, blockEntity); if (this.isInit) { this.hasChanged = true; } }
Example 3
Source File: BaseFullChunk.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public void removeBlockEntity(BlockEntity blockEntity) { this.tiles.remove(blockEntity.getId()); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); this.tileList.remove(index); if (this.isInit) { this.hasChanged = true; } }
Example 4
Source File: BaseFullChunk.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public void removeBlockEntity(BlockEntity blockEntity) { if (this.tiles != null) { this.tiles.remove(blockEntity.getId()); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); this.tileList.remove(index); if (this.isInit) { this.setChanged(); } } }
Example 5
Source File: BaseFullChunk.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public void addBlockEntity(BlockEntity blockEntity) { this.tiles.put(blockEntity.getId(), blockEntity); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); if (this.tileList.containsKey(index) && !this.tileList.get(index).equals(blockEntity)) { this.tileList.get(index).close(); } this.tileList.put(index, blockEntity); if (this.isInit) { this.setChanged(); } }
Example 6
Source File: BaseFullChunk.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public void removeBlockEntity(BlockEntity blockEntity) { this.tiles.remove(blockEntity.getId()); int index = ((blockEntity.getFloorZ() & 0x0f) << 12) | ((blockEntity.getFloorX() & 0x0f) << 8) | (blockEntity.getFloorY() & 0xff); this.tileList.remove(index); if (this.isInit) { this.setChanged(); } }