mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-09-19 13:58:22 +00:00
88014b18a3
* `//set ##*tag` sets all states in the tag (not just default state per type) * `//set ^type` is a pattern changing block type but copying all valid existing states * `//set ^[prop=val,...]` sets the property `prop` to `val` wherever the existing block has that property * `//set ^type[prop=val,...]` does both of the above Those work anywhere a pattern is taken, of course. * The mask syntax `^[prop=val]` matches blocks with the property `prop` set to `val`, or blocks that don't have the property at all. * The mask syntax `^=[prop=val]` only matches blocks that have the property. Those work anywhere a mask is taken, of course. (`//mask`, `//gmask`, `//replace`, etc) The `//drain` command now takes `-w` flag that removes the waterlogged state from blocks (in addition to removing water, as before).
61 lines
2.3 KiB
Java
61 lines
2.3 KiB
Java
/*
|
|
* WorldEdit, a Minecraft world manipulation toolkit
|
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
* Copyright (C) WorldEdit team and contributors
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU Lesser General Public License as published by the
|
|
* Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
* for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package com.sk89q.worldedit.extension.factory;
|
|
|
|
import com.sk89q.worldedit.WorldEdit;
|
|
import com.sk89q.worldedit.extension.factory.parser.pattern.BlockCategoryPatternParser;
|
|
import com.sk89q.worldedit.extension.factory.parser.pattern.ClipboardPatternParser;
|
|
import com.sk89q.worldedit.extension.factory.parser.pattern.RandomPatternParser;
|
|
import com.sk89q.worldedit.extension.factory.parser.pattern.SingleBlockPatternParser;
|
|
import com.sk89q.worldedit.extension.factory.parser.pattern.TypeOrStateApplyingPatternParser;
|
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
|
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
|
|
|
/**
|
|
* A registry of known {@link Pattern}s. Provides methods to instantiate
|
|
* new patterns from input.
|
|
*
|
|
* <p>Instances of this class can be taken from
|
|
* {@link WorldEdit#getPatternFactory()}.</p>
|
|
*/
|
|
public final class PatternFactory extends AbstractFactory<Pattern> {
|
|
|
|
/**
|
|
* Create a new instance.
|
|
*
|
|
* @param worldEdit the WorldEdit instance
|
|
*/
|
|
public PatternFactory(WorldEdit worldEdit) {
|
|
super(worldEdit);
|
|
|
|
// split and parse each sub-pattern
|
|
register(new RandomPatternParser(worldEdit));
|
|
|
|
// individual patterns
|
|
register(new BlockCategoryPatternParser(worldEdit));
|
|
register(new ClipboardPatternParser(worldEdit));
|
|
register(new TypeOrStateApplyingPatternParser(worldEdit));
|
|
|
|
// inner-most pattern: just one block
|
|
register(new SingleBlockPatternParser(worldEdit));
|
|
}
|
|
|
|
}
|