Make forest and pumpkin gens respect toggleplace. Make pumpkin gen have random faces.

This commit is contained in:
Wizjany 2013-01-27 03:03:05 -05:00
parent 60f2a4a816
commit 9bb7968358
2 changed files with 6 additions and 7 deletions

View File

@ -2508,7 +2508,6 @@ public class EditSession {
int h = prng.nextInt(3) - 1;
BaseBlock log = new BaseBlock(BlockID.LOG);
BaseBlock pumpkin = new BaseBlock(BlockID.PUMPKIN);
switch (t) {
case 0:
@ -2518,7 +2517,7 @@ public class EditSession {
if (prng.nextBoolean()) {
setBlockIfAir(pos.add(1, h, -1), log);
}
setBlockIfAir(pos.add(0, 0, -1), pumpkin);
setBlockIfAir(pos.add(0, 0, -1), new BaseBlock(BlockID.PUMPKIN, prng.nextInt(4)));
break;
case 1:
@ -2528,7 +2527,7 @@ public class EditSession {
if (prng.nextBoolean()) {
setBlockIfAir(pos.add(1, h, 0), log);
}
setBlockIfAir(pos.add(1, 0, 1), pumpkin);
setBlockIfAir(pos.add(1, 0, 1), new BaseBlock(BlockID.PUMPKIN, prng.nextInt(4)));
break;
case 2:
@ -2538,7 +2537,7 @@ public class EditSession {
if (prng.nextBoolean()) {
setBlockIfAir(pos.add(-1, h, 0), log);
}
setBlockIfAir(pos.add(-1, 0, 1), pumpkin);
setBlockIfAir(pos.add(-1, 0, 1), new BaseBlock(BlockID.PUMPKIN, prng.nextInt(4)));
break;
case 3:
@ -2548,7 +2547,7 @@ public class EditSession {
if (prng.nextBoolean()) {
setBlockIfAir(pos.add(-1, h, -1), log);
}
setBlockIfAir(pos.add(-1, 0, -1), pumpkin);
setBlockIfAir(pos.add(-1, 0, -1), new BaseBlock(BlockID.PUMPKIN, prng.nextInt(4)));
break;
}
}

View File

@ -260,7 +260,7 @@ public class GenerationCommands {
return;
}
int affected = editSession.makeForest(player.getPosition(),
int affected = editSession.makeForest(session.getPlacementPosition(player),
size, density, new TreeGenerator(type));
player.print(affected + " trees created.");
}
@ -279,7 +279,7 @@ public class GenerationCommands {
int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10;
int affected = editSession.makePumpkinPatches(player.getPosition(), size);
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(player), size);
player.print(affected + " pumpkin patches created.");
}