Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,28 @@ public void removeSectionLighting(int layer, boolean sky) {

@Override
public FaweCompoundTag tile(final int x, final int y, final int z) {
BlockEntity blockEntity = getChunk().getBlockEntity(new BlockPos((x & 15) + (
chunkX << 4), y, (z & 15) + (
chunkZ << 4)));
if (blockEntity == null) {
return null;
}
return NMS_TO_TILE.apply(blockEntity);
LevelChunk chunk = getChunk();
if (chunk == null) return null;

BlockPos pos = new BlockPos((x & 15) + (chunkX << 4), y, (z & 15) + (chunkZ << 4));
Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null) return null;

BlockEntity blockEntity = tiles.get(pos);
if (blockEntity == null) return null;

return NMS_TO_TILE.apply(blockEntity);
}

@Override
public Map<BlockVector3, FaweCompoundTag> tiles() {
Map<BlockPos, BlockEntity> nmsTiles = getChunk().getBlockEntities();
if (nmsTiles.isEmpty()) {
return Collections.emptyMap();
}
return AdaptedMap.immutable(nmsTiles, posNms2We, NMS_TO_TILE);
LevelChunk chunk = getChunk();
if (chunk == null) return Collections.emptyMap();

Map<BlockPos, BlockEntity> tiles = chunk.getBlockEntities();
if (tiles == null || tiles.isEmpty()) return Collections.emptyMap();

return AdaptedMap.immutable(tiles, posNms2We, NMS_TO_TILE);
}

@Override
Expand Down
Loading