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 @@ -54,7 +54,7 @@ public class PaperweightGetBlocks_Copy implements IChunkGet {

protected PaperweightGetBlocks_Copy(LevelChunk levelChunk) {
this.levelChunk = levelChunk;
this.serverLevel = levelChunk.level;
this.serverLevel = (ServerLevel) levelChunk.getLevel();
this.minHeight = serverLevel.getMinY();
this.maxHeight = serverLevel.getMaxY() - 1; // Minecraft max limit is exclusive.
this.blocks = new char[getSectionCount()][];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ public static BiomeType adapt(Holder<Biome> biome, LevelAccessor levelAccessor)

static void removeBeacon(BlockEntity beacon, LevelChunk levelChunk) {
try {
if (levelChunk.loaded || levelChunk.level.isClientSide()) {
if (levelChunk.loaded || levelChunk.getLevel().isClientSide()) {
BlockEntity blockEntity = levelChunk.blockEntities.remove(beacon.getBlockPos());
if (blockEntity != null) {
if (!levelChunk.level.isClientSide()) {
methodRemoveGameEventListener.invoke(levelChunk, beacon, levelChunk.level);
if (!levelChunk.getLevel().isClientSide()) {
methodRemoveGameEventListener.invoke(levelChunk, beacon, levelChunk.getLevel());
}
fieldRemove.set(beacon, true);
}
Expand All @@ -670,13 +670,13 @@ static void removeBeacon(BlockEntity beacon, LevelChunk levelChunk) {

static List<Entity> getEntities(LevelChunk chunk) {
if (PaperSupport.isPaper()) {
return Optional.ofNullable(chunk.level
return Optional.ofNullable(chunk.getLevel()
.moonrise$getEntityLookup()
.getChunk(chunk.locX, chunk.locZ)).map(ChunkEntitySlices::getAllEntities).orElse(Collections.emptyList());
}
try {
//noinspection unchecked
return getEntitySectionManager(chunk.level).getEntities(chunk.getPos());
return getEntitySectionManager((ServerLevel) chunk.getLevel()).getEntities(chunk.getPos());
} catch (IllegalAccessException e) {
throw new RuntimeException("Failed to lookup entities [PAPER=false]", e);
}
Expand Down