Skip to content

Commit

Permalink
Fix OBO and unticked cells counting for all flowers
Browse files Browse the repository at this point in the history
  • Loading branch information
NEstoll committed May 16, 2024
1 parent eed2ad5 commit 7eeb927
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void update(Level level) {
}

public boolean isSameFlower(DandelifeonBlockEntity flower) {
return !ticked || validCoords.equals(getBlockPos()) && flowerCoords.equals(flower.getEffectivePos());
return validCoords.equals(getBlockPos()) && flowerCoords.equals(flower.getEffectivePos());
}

public boolean hasPoweredParent(Level level) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public void tickFlower() {
if (!getLevel().isClientSide) {
if (getLevel().getGameTime() % SPEED == 0 && getLevel().hasNeighborSignal(getBlockPos())) {
runSimulation();
} else if (getLevel().getGameTime()+1 % SPEED == 0) {
diameter = radius * 2 + 1;
} else if ((getLevel().getGameTime()+1) % SPEED == 0) {
int diameter = radius * 2;

for (int i = -1; i <= diameter; i++) {
for (int j = -1; j <= diameter; j++) {
BlockPos pos = getEffectivePosition().offset(-range + i, 0, -range + j);
BlockEntity tile = dandie.getLevel().getBlockEntity(pos);
for (int i = 0; i <= diameter; i++) {
for (int j = 0; j <= diameter; j++) {
BlockPos pos = getEffectivePos().offset(-radius + i, 0, -radius + j);
BlockEntity tile = getLevel().getBlockEntity(pos);
if (tile instanceof CellularBlockEntity) {
tile.claim();
((CellularBlockEntity)(tile)).claim(this);
}
}
}
Expand Down

0 comments on commit 7eeb927

Please sign in to comment.