mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 04:26:42 +00:00
Upstream, generics, formatting
This commit is contained in:
@ -69,10 +69,10 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
|
||||
if (anyState) {
|
||||
blocks.stream().flatMap(blockType -> blockType.getAllStates().stream()).forEach(state ->
|
||||
randomPattern.add((state), 1.0));
|
||||
randomPattern.add(new BlockPattern(state), 1.0));
|
||||
} else {
|
||||
for (BlockType blockType : blocks) {
|
||||
randomPattern.add((blockType.getDefaultState()), 1.0);
|
||||
randomPattern.add(new BlockPattern(blockType.getDefaultState()), 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,4 +83,5 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
throw new InputParseException("No session is available, so no clipboard is available");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.factory.BlockFactory;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
|
@ -44,9 +44,9 @@ public class RandomStatePatternParser extends InputParser<Pattern> {
|
||||
context.setPreferringWildcard(wasFuzzy);
|
||||
if (block.getStates().size() == block.getBlockType().getPropertyMap().size()) {
|
||||
// they requested random with *, but didn't leave any states empty - simplify
|
||||
return (block);
|
||||
return new BlockPattern(block);
|
||||
} else {
|
||||
return null; // only should happen if parseLogic changes
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
@Override
|
||||
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
return (worldEdit.getBlockFactory().parseFromInput(input, context));
|
||||
return new BlockPattern(worldEdit.getBlockFactory().parseFromInput(input, context));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user