mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-24 05:54:31 +00:00
Compare commits
1
Commits
1.2.2
...
1.0.12-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cbd925407 |
@@ -66,7 +66,7 @@ public class ChunkFixerUtility {
|
|||||||
blockConversionInfo.world = world;
|
blockConversionInfo.world = world;
|
||||||
|
|
||||||
int x = index % 16;
|
int x = index % 16;
|
||||||
int y = (index / 256) + (sectionY * 16);
|
int y = (index / 256) + sectionY;
|
||||||
int z = (index / 16) % 16;
|
int z = (index / 16) % 16;
|
||||||
|
|
||||||
blockConversionInfo.x = x + chunkXPos + 1;
|
blockConversionInfo.x = x + chunkXPos + 1;
|
||||||
@@ -94,30 +94,26 @@ public class ChunkFixerUtility {
|
|||||||
levelCompoundTag.setTag("TileEntities", tileEntities);
|
levelCompoundTag.setTag("TileEntities", tileEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
int chunkXPos = chunk.xPosition * 16;
|
|
||||||
int chunkZPos = chunk.zPosition * 16;
|
|
||||||
|
|
||||||
for (ExtendedBlockStorage ebs : chunk.getBlockStorageArray()) {
|
for (ExtendedBlockStorage ebs : chunk.getBlockStorageArray()) {
|
||||||
processSection(ebs, conversionInfoList, chunkXPos, chunkZPos);
|
processSection(ebs, conversionInfoList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void processSection(ExtendedBlockStorage ebs, List<ConversionInfo> conversionInfoList, int chunkXPos,
|
private static void processSection(ExtendedBlockStorage ebs, List<ConversionInfo> conversionInfoList) {
|
||||||
int chunkZPos) {
|
if (ebs instanceof final IExtendedBlockStorageMixin ebsMixin) {
|
||||||
IExtendedBlockStorageMixin ebsMixin = (IExtendedBlockStorageMixin) ebs;
|
|
||||||
short[] blockArray = ebsMixin.getBlock16BArray();
|
|
||||||
short[] metadataArray = ebsMixin.getBlock16BMetaArray();
|
|
||||||
|
|
||||||
int sectionY = ebs.getYLocation();
|
int sectionY = ebs.getYLocation();
|
||||||
|
|
||||||
List<ConversionInfo> filteredList = conversionInfoList.stream()
|
List<ConversionInfo> filteredList = conversionInfoList.stream()
|
||||||
.filter(info -> info.y >= sectionY * 16 && info.y < (sectionY + 1) * 16)
|
.filter(info -> info.y >= sectionY && info.y < (sectionY + 16))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for (ConversionInfo info : filteredList) {
|
for (ConversionInfo info : filteredList) {
|
||||||
int index = (info.y - sectionY * 16) * 256 + (info.z - chunkZPos) * 16 + (info.x - chunkXPos);
|
int localX = info.x & 15;
|
||||||
blockArray[index] = (short) Block.getIdFromBlock(info.blockInfo.block);
|
int localY = info.y & 15;
|
||||||
metadataArray[index] = (short) info.blockInfo.metadata;
|
int localZ = info.z & 15;
|
||||||
|
ebs.func_150818_a(localX, localY, localZ, info.blockInfo.block);
|
||||||
|
ebs.setExtBlockMetadata(localX, localY, localZ, info.blockInfo.metadata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user