mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix NPE when //genbiome expression was false.
Fixes WORLDEDIT-3467.
This commit is contained in:
parent
e1bb00e665
commit
c957ffb95a
@ -2301,7 +2301,7 @@ public class EditSession implements Extent {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (expression.evaluate(scaled.getX(), scaled.getZ()) <= 0) {
|
if (expression.evaluate(scaled.getX(), scaled.getZ()) <= 0) {
|
||||||
return null;
|
return null; // TODO should return OUTSIDE? seems to cause issues otherwise, workedaround for now
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Allow biome setting via a script variable (needs BiomeType<->int mapping)
|
// TODO: Allow biome setting via a script variable (needs BiomeType<->int mapping)
|
||||||
|
@ -316,12 +316,12 @@ public class GenerationCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "/generatebiome", "/genbiome", "/gb" },
|
aliases = { "/generatebiome", "/genbiome", "/gb" },
|
||||||
usage = "<block> <expression>",
|
usage = "<biome> <expression>",
|
||||||
desc = "Sets biome according to a formula.",
|
desc = "Sets biome according to a formula.",
|
||||||
help =
|
help =
|
||||||
"Generates a shape according to a formula that is expected to\n" +
|
"Generates a shape according to a formula that is expected to\n" +
|
||||||
"return positive numbers (true) if the point is inside the shape\n" +
|
"return positive numbers (true) if the point is inside the shape\n" +
|
||||||
"Optionally set type/data to the desired block.\n" +
|
"Sets the biome of blocks in that shape.\n" +
|
||||||
"Flags:\n" +
|
"Flags:\n" +
|
||||||
" -h to generate a hollow shape\n" +
|
" -h to generate a hollow shape\n" +
|
||||||
" -r to use raw minecraft coordinates\n" +
|
" -r to use raw minecraft coordinates\n" +
|
||||||
|
@ -136,7 +136,7 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
|
|
||||||
if (!hollow) {
|
if (!hollow) {
|
||||||
final BaseBiome material = getBiome(x, z, baseBiome);
|
final BaseBiome material = getBiome(x, z, baseBiome);
|
||||||
if (material != OUTSIDE) {
|
if (material != null && material != OUTSIDE) {
|
||||||
editSession.getWorld().setBiome(position, material);
|
editSession.getWorld().setBiome(position, material);
|
||||||
++affected;
|
++affected;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user