Fix legacy converter.

This commit is contained in:
Alexander Söderberg
2020-02-23 21:10:01 +01:00
parent 8956aedd20
commit e39c7dfcde
3 changed files with 7 additions and 3 deletions

View File

@ -78,7 +78,7 @@ public final class BlockBucket implements ConfigurationSerializable {
private void addBlock(@NonNull final BlockState block, double chance) {
if (chance == -1) chance = 1;
String prefix = input.length() == 0 ? "" : ",";
input.append(prefix).append(chance).append("%").append(prefix);
input.append(prefix).append(chance).append("%").append(block.toString());
this.compiled = false;
}

View File

@ -3,6 +3,7 @@ package com.github.intellectualsites.plotsquared.plot.util.world;
import com.github.intellectualsites.plotsquared.commands.Command;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.input.InputParseException;
@ -18,7 +19,9 @@ import com.sk89q.worldedit.world.block.BlockType;
import org.jetbrains.annotations.NotNull;
public class PatternUtil {
public static BaseBlock apply(@NotNull Pattern pattern, int x, int y, int z) {
Preconditions.checkNotNull(pattern, "Pattern may not be null");
if (pattern instanceof BlockPattern
|| pattern instanceof RandomPattern
|| pattern instanceof BlockState