mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-13 14:49:03 +00:00
Various bug fixes
This commit is contained in:
@@ -6,7 +6,6 @@ import net.simon987.server.event.GameEvent;
|
||||
import net.simon987.server.event.GameEventListener;
|
||||
import net.simon987.server.event.WorldGenerationEvent;
|
||||
import net.simon987.server.game.World;
|
||||
import net.simon987.server.game.WorldGenerator;
|
||||
import net.simon987.server.logging.LogManager;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -62,9 +61,13 @@ public class WorldCreationListener implements GameEventListener {
|
||||
for (int i = 0; i < treeCount; i++) {
|
||||
|
||||
Point p = world.getTileMap().getRandomPlainTile();
|
||||
|
||||
if (p != null) {
|
||||
|
||||
//Don't block worlds
|
||||
while (p.x == 0 || p.y == 0 || p.x == World.WORLD_SIZE - 1 || p.y == World.WORLD_SIZE - 1) {
|
||||
p = world.getTileMap().getRandomPlainTile();
|
||||
}
|
||||
|
||||
for (Plant plant : plants) {
|
||||
if (plant.getX() == p.x && plant.getY() == p.y) {
|
||||
//There is already a plant here
|
||||
|
||||
Reference in New Issue
Block a user