Simplified randomizeFloor to be more performant
This commit is contained in:
parent
4c05c5d2d3
commit
31833b974a
@ -337,9 +337,10 @@ public class DiscoParty {
|
||||
sheep.setColor(discoColours[(r.nextInt(discoColours.length))]);
|
||||
}
|
||||
|
||||
void randomizeFloor(Block block) {
|
||||
void randomizeFloor(Block block, int index) {
|
||||
int to_color = (index + state) % disocColors.length;
|
||||
block.setType(Material.WOOL);
|
||||
block.setData(discoColours[(r.nextInt(discoColours.length))].getData());
|
||||
block.setData(discoColours[to_color].getData());
|
||||
}
|
||||
|
||||
void jump(Entity entity) {
|
||||
@ -433,9 +434,8 @@ public class DiscoParty {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Block block : this.floorBlocks) {
|
||||
this.randomizeFloor(block);
|
||||
for(int i = 0; i < this.floorBlocks.length;i++){
|
||||
this.randomizeFloor(block,i);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user