Skip to content

Commit

Permalink
refactor: better variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Mar 23, 2024
1 parent 6aad18d commit e3a0447
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public static Builder builder() {
@Override
public void beforeSetChunk(Dimension dimension) {
if (blockEntityNbtList != null && !blockEntityNbtList.isEmpty()) {
for (var n : blockEntityNbtList) {
BlockEntity entity = BlockEntityHelper.fromNBT(dimension, n);
if (entity == null) continue;
Position3ic position = entity.getPosition();
for (var nbt : blockEntityNbtList) {
BlockEntity blockEntity = BlockEntityHelper.fromNBT(dimension, nbt);
if (blockEntity == null) continue;
Position3ic position = blockEntity.getPosition();
var key = HashUtils.hashChunkXYZ(position.x() & 15, position.y(), position.z() & 15);
this.blockEntities.put(key, entity);
this.blockEntities.put(key, blockEntity);
}
blockEntityNbtList = null;
}
Expand All @@ -83,8 +83,8 @@ public void beforeSetChunk(Dimension dimension) {
@Override
public void afterSetChunk(Dimension dimension) {
if (entityNbtList != null && !entityNbtList.isEmpty()) {
for (var n : entityNbtList) {
Entity entity = EntityHelper.fromNBT(dimension, n);
for (var nbt : entityNbtList) {
Entity entity = EntityHelper.fromNBT(dimension, nbt);
if (entity == null) continue;
dimension.getEntityService().addEntity(entity);
}
Expand Down

0 comments on commit e3a0447

Please sign in to comment.