Search in sources :

Example 6 with Property

use of com.sk89q.worldedit.registry.state.Property in project FastAsyncWorldEdit by IntellectualSites.

the class PaperweightAdapter method getProperties.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Map<String, ? extends Property<?>> getProperties(BlockType blockType) {
    Map<String, Property<?>> properties = Maps.newTreeMap(String::compareTo);
    Block block = getBlockFromType(blockType);
    StateDefinition<Block, net.minecraft.world.level.block.state.BlockState> blockStateList = block.getStateDefinition();
    for (net.minecraft.world.level.block.state.properties.Property state : blockStateList.getProperties()) {
        Property property;
        if (state instanceof net.minecraft.world.level.block.state.properties.BooleanProperty) {
            property = new BooleanProperty(state.getName(), ImmutableList.copyOf(state.getPossibleValues()));
        } else if (state instanceof DirectionProperty) {
            property = new DirectionalProperty(state.getName(), (List<Direction>) state.getPossibleValues().stream().map(e -> Direction.valueOf(((StringRepresentable) e).getSerializedName().toUpperCase(Locale.ROOT))).collect(Collectors.toList()));
        } else if (state instanceof net.minecraft.world.level.block.state.properties.EnumProperty) {
            property = new EnumProperty(state.getName(), (List<String>) state.getPossibleValues().stream().map(e -> ((StringRepresentable) e).getSerializedName()).collect(Collectors.toList()));
        } else if (state instanceof net.minecraft.world.level.block.state.properties.IntegerProperty) {
            property = new IntegerProperty(state.getName(), ImmutableList.copyOf(state.getPossibleValues()));
        } else {
            throw new IllegalArgumentException("FastAsyncWorldEdit needs an update to support " + state.getClass().getSimpleName());
        }
        properties.put(property.getName(), property);
    }
    return properties;
}
Also used : Property(com.sk89q.worldedit.registry.state.Property) LoadingCache(com.google.common.cache.LoadingCache) DirectionalProperty(com.sk89q.worldedit.registry.state.DirectionalProperty) StringRepresentable(net.minecraft.util.StringRepresentable) Item(net.minecraft.world.item.Item) CraftItemStack(org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack) BaseItemStack(com.sk89q.worldedit.blocks.BaseItemStack) BiomeTypes(com.sk89q.worldedit.world.biome.BiomeTypes) Constants(com.sk89q.worldedit.internal.Constants) Component(com.sk89q.worldedit.util.formatting.text.Component) MinecraftServer(net.minecraft.server.MinecraftServer) Location(org.bukkit.Location) SideEffect(com.sk89q.worldedit.util.SideEffect) LongArrayBinaryTag(com.sk89q.worldedit.util.nbt.LongArrayBinaryTag) Map(java.util.Map) Path(java.nio.file.Path) BlockStateHolder(com.sk89q.worldedit.world.block.BlockStateHolder) BlockStateIdAccess(com.sk89q.worldedit.internal.block.BlockStateIdAccess) BlockData(org.bukkit.block.data.BlockData) LongBinaryTag(com.sk89q.worldedit.util.nbt.LongBinaryTag) Set(java.util.Set) InteractionResult(net.minecraft.world.InteractionResult) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity) InvocationTargetException(java.lang.reflect.InvocationTargetException) BinaryTag(com.sk89q.worldedit.util.nbt.BinaryTag) WorldEditPlugin(com.sk89q.worldedit.bukkit.WorldEditPlugin) CraftBlockData(org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData) StringBinaryTag(com.sk89q.worldedit.util.nbt.StringBinaryTag) BaseBlock(com.sk89q.worldedit.world.block.BaseBlock) ItemStack(net.minecraft.world.item.ItemStack) Extent(com.sk89q.worldedit.extent.Extent) BiomeType(com.sk89q.worldedit.world.biome.BiomeType) IntBinaryTag(com.sk89q.worldedit.util.nbt.IntBinaryTag) LevelChunk(net.minecraft.world.level.chunk.LevelChunk) ChunkHolder(net.minecraft.server.level.ChunkHolder) EntityType(net.minecraft.world.entity.EntityType) WorldGenSettings(net.minecraft.world.level.levelgen.WorldGenSettings) CraftServer(org.bukkit.craftbukkit.v1_18_R1.CraftServer) IntArrayBinaryTag(com.sk89q.worldedit.util.nbt.IntArrayBinaryTag) LazyReference(com.sk89q.worldedit.util.concurrency.LazyReference) SpigotConfig(org.spigotmc.SpigotConfig) Biome(net.minecraft.world.level.biome.Biome) TranslatableComponent(com.sk89q.worldedit.util.formatting.text.TranslatableComponent) ArrayList(java.util.ArrayList) OptionalLong(java.util.OptionalLong) WorldEditException(com.sk89q.worldedit.WorldEditException) CraftMagicNumbers(org.bukkit.craftbukkit.v1_18_R1.util.CraftMagicNumbers) RegenOptions(com.sk89q.worldedit.world.RegenOptions) ShortBinaryTag(com.sk89q.worldedit.util.nbt.ShortBinaryTag) UseOnContext(net.minecraft.world.item.context.UseOnContext) Nullable(javax.annotation.Nullable) WorldNativeAccess(com.sk89q.worldedit.internal.wna.WorldNativeAccess) DataFixer(com.sk89q.worldedit.world.DataFixer) Files(java.nio.file.Files) Lifecycle(com.mojang.serialization.Lifecycle) Field(java.lang.reflect.Field) ChunkPos(net.minecraft.world.level.ChunkPos) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) ForkJoinPool(java.util.concurrent.ForkJoinPool) ByteArrayBinaryTag(com.sk89q.worldedit.util.nbt.ByteArrayBinaryTag) LevelStem(net.minecraft.world.level.dimension.LevelStem) BlockState(com.sk89q.worldedit.world.block.BlockState) InteractionHand(net.minecraft.world.InteractionHand) ChunkStatus(net.minecraft.world.level.chunk.ChunkStatus) ListBinaryTag(com.sk89q.worldedit.util.nbt.ListBinaryTag) Watchdog(com.sk89q.worldedit.extension.platform.Watchdog) ResourceLocation(net.minecraft.resources.ResourceLocation) Either(com.mojang.datafixers.util.Either) BlockVector2(com.sk89q.worldedit.math.BlockVector2) BlockTypes(com.sk89q.worldedit.world.block.BlockTypes) BlockVector3(com.sk89q.worldedit.math.BlockVector3) ClientboundEntityEventPacket(net.minecraft.network.protocol.game.ClientboundEntityEventPacket) Player(org.bukkit.entity.Player) ChunkGenerator(org.bukkit.generator.ChunkGenerator) Registry(net.minecraft.core.Registry) CraftPlayer(org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer) BooleanProperty(com.sk89q.worldedit.registry.state.BooleanProperty) Locale(java.util.Locale) Refraction(com.sk89q.worldedit.bukkit.adapter.Refraction) DedicatedServer(net.minecraft.server.dedicated.DedicatedServer) CompoundBinaryTag(com.sk89q.worldedit.util.nbt.CompoundBinaryTag) Method(java.lang.reflect.Method) Bukkit(org.bukkit.Bukkit) StateDefinition(net.minecraft.world.level.block.state.StateDefinition) SafeFiles(com.sk89q.worldedit.util.io.file.SafeFiles) BlockType(com.sk89q.worldedit.world.block.BlockType) ChunkProgressListener(net.minecraft.server.level.progress.ChunkProgressListener) PrimaryLevelData(net.minecraft.world.level.storage.PrimaryLevelData) BaseItem(com.sk89q.worldedit.blocks.BaseItem) BlockHitResult(net.minecraft.world.phys.BlockHitResult) ClientboundBlockEntityDataPacket(net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket) BlockableEventLoop(net.minecraft.util.thread.BlockableEventLoop) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) BukkitImplAdapter(com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter) Blocks(net.minecraft.world.level.block.Blocks) ChunkAccess(net.minecraft.world.level.chunk.ChunkAccess) Preconditions.checkState(com.google.common.base.Preconditions.checkState) CacheLoader(com.google.common.cache.CacheLoader) Objects(java.util.Objects) Util(net.minecraft.Util) List(java.util.List) EnumProperty(com.sk89q.worldedit.registry.state.EnumProperty) BlockPos(net.minecraft.core.BlockPos) BukkitAdapter(com.sk89q.worldedit.bukkit.BukkitAdapter) CacheBuilder(com.google.common.cache.CacheBuilder) ServerChunkCache(net.minecraft.server.level.ServerChunkCache) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ServerLevel(net.minecraft.server.level.ServerLevel) OptionalInt(java.util.OptionalInt) Level(java.util.logging.Level) EndBinaryTag(com.sk89q.worldedit.util.nbt.EndBinaryTag) Environment(org.bukkit.World.Environment) ImmutableList(com.google.common.collect.ImmutableList) DoubleBinaryTag(com.sk89q.worldedit.util.nbt.DoubleBinaryTag) FloatBinaryTag(com.sk89q.worldedit.util.nbt.FloatBinaryTag) ByteBinaryTag(com.sk89q.worldedit.util.nbt.ByteBinaryTag) Direction(com.sk89q.worldedit.util.Direction) SpawnReason(org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason) WeakReference(java.lang.ref.WeakReference) BaseEntity(com.sk89q.worldedit.entity.BaseEntity) LevelStorageSource(net.minecraft.world.level.storage.LevelStorageSource) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld) Region(com.sk89q.worldedit.regions.Region) PaperweightFaweAdapter(com.sk89q.worldedit.bukkit.adapter.impl.fawe.v1_18_R1.PaperweightFaweAdapter) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) Maps(com.google.common.collect.Maps) ResourceKey(net.minecraft.resources.ResourceKey) StructureBlockEntity(net.minecraft.world.level.block.entity.StructureBlockEntity) LevelSettings(net.minecraft.world.level.LevelSettings) Entity(net.minecraft.world.entity.Entity) CraftEntity(org.bukkit.craftbukkit.v1_18_R1.entity.CraftEntity) Vec3(net.minecraft.world.phys.Vec3) IntegerProperty(com.sk89q.worldedit.registry.state.IntegerProperty) DirectionProperty(net.minecraft.world.level.block.state.properties.DirectionProperty) WatchdogThread(org.spigotmc.WatchdogThread) Block(net.minecraft.world.level.block.Block) ItemType(com.sk89q.worldedit.world.item.ItemType) Clearable(net.minecraft.world.Clearable) Direction(com.sk89q.worldedit.util.Direction) EnumProperty(com.sk89q.worldedit.registry.state.EnumProperty) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) DirectionProperty(net.minecraft.world.level.block.state.properties.DirectionProperty) Property(com.sk89q.worldedit.registry.state.Property) DirectionalProperty(com.sk89q.worldedit.registry.state.DirectionalProperty) BooleanProperty(com.sk89q.worldedit.registry.state.BooleanProperty) EnumProperty(com.sk89q.worldedit.registry.state.EnumProperty) IntegerProperty(com.sk89q.worldedit.registry.state.IntegerProperty) DirectionProperty(net.minecraft.world.level.block.state.properties.DirectionProperty) IntegerProperty(com.sk89q.worldedit.registry.state.IntegerProperty) BooleanProperty(com.sk89q.worldedit.registry.state.BooleanProperty) BlockState(com.sk89q.worldedit.world.block.BlockState) StringRepresentable(net.minecraft.util.StringRepresentable) BaseBlock(com.sk89q.worldedit.world.block.BaseBlock) Block(net.minecraft.world.level.block.Block) DirectionalProperty(com.sk89q.worldedit.registry.state.DirectionalProperty)

Example 7 with Property

use of com.sk89q.worldedit.registry.state.Property in project FastAsyncWorldEdit by IntellectualSites.

the class SnowSimulator method apply.

@Override
public boolean apply(BlockVector3 position, int depth) throws WorldEditException {
    if (depth > 0) {
        // We only care about the first layer.
        return false;
    }
    BlockState block = this.extent.getBlock(position);
    if (block.getBlockType() == BlockTypes.WATER) {
        if (block.getState(waterLevelProperty) == 0) {
            if (this.extent.setBlock(position, ice)) {
                affected++;
            }
        }
        return false;
    }
    // Can't put snow this far up
    if (position.getBlockY() == this.extent.getMaximumPoint().getBlockY()) {
        return false;
    }
    BlockVector3 abovePosition = position.add(0, 1, 0);
    BlockState above = this.extent.getBlock(abovePosition);
    // Can only replace air (or snow in stack mode)
    if (!above.getBlockType().getMaterial().isAir() && (!stack || above.getBlockType() != BlockTypes.SNOW)) {
        return false;
    // FAWE start
    } else if (!block.getBlockType().getId().toLowerCase(Locale.ROOT).contains("ice") && this.extent.getEmittedLight(abovePosition) > 10) {
        return false;
    } else if (!block.getBlockType().getMaterial().isFullCube()) {
        Map<Property<?>, Object> states = block.getStates();
        if (states.containsKey(slab) && block.getState(slab).equalsIgnoreCase("bottom")) {
            return false;
        } else if (states.containsKey(trapdoorOpen) && states.containsKey(trapdoor) && (block.getState(trapdoorOpen) || block.getState(trapdoor).equalsIgnoreCase("bottom"))) {
            return false;
        } else if (states.containsKey(stair) && block.getState(stair).equalsIgnoreCase("bottom")) {
            return false;
        } else {
            return false;
        }
    // FAWE end
    } else if (!block.getBlockType().getId().toLowerCase(Locale.ROOT).contains("ice") && block.getBlockType().getMaterial().isTranslucent()) {
        return false;
    }
    if (stack && above.getBlockType() == BlockTypes.SNOW) {
        int currentHeight = above.getState(snowLayersProperty);
        // We've hit the highest layer (If it doesn't contain current + 2 it means it's 1 away from full)
        if (!snowLayersProperty.getValues().contains(currentHeight + 2)) {
            if (this.extent.setBlock(abovePosition, snowBlock)) {
                if (block.getStates().containsKey(snowy)) {
                    this.extent.setBlock(position, block.with(snowy, true));
                }
                this.affected++;
            }
        } else {
            if (this.extent.setBlock(abovePosition, above.with(snowLayersProperty, currentHeight + 1))) {
                if (block.getStates().containsKey(snowy)) {
                    this.extent.setBlock(position, block.with(snowy, true));
                }
                this.affected++;
            }
        }
        return false;
    }
    if (this.extent.setBlock(abovePosition, snow)) {
        if (block.getStates().containsKey(snowy)) {
            this.extent.setBlock(position, block.with(snowy, true));
        }
        this.affected++;
    }
    return false;
}
Also used : BlockState(com.sk89q.worldedit.world.block.BlockState) BlockVector3(com.sk89q.worldedit.math.BlockVector3) BooleanProperty(com.sk89q.worldedit.registry.state.BooleanProperty) Property(com.sk89q.worldedit.registry.state.Property) EnumProperty(com.sk89q.worldedit.registry.state.EnumProperty)

Example 8 with Property

use of com.sk89q.worldedit.registry.state.Property in project FastAsyncWorldEdit by IntellectualSites.

the class BlockState method get.

/**
 * Returns a temporary BlockState for a given type and string.
 *
 * <p>It's faster if a BlockType is provided compared to parsing the string.</p>
 *
 * @param type  BlockType e.g., BlockTypes.STONE (or null)
 * @param state String e.g., minecraft:water[level=4]
 * @return BlockState
 */
public static BlockState get(@Nullable BlockType type, String state, BlockState defaultState) throws InputParseException {
    int propStrStart = state.indexOf('[');
    if (type == null) {
        CharSequence key;
        if (propStrStart == -1) {
            key = state;
        } else {
            MutableCharSequence charSequence = MutableCharSequence.getTemporal();
            charSequence.setString(state);
            charSequence.setSubstring(0, propStrStart);
            key = charSequence;
        }
        type = BlockTypes.get(key);
        if (type == null) {
            String input = key.toString();
            throw new SuggestInputParseException("Does not match a valid block type: " + input, input, () -> Stream.of(BlockTypesCache.values).map(BlockType::getId).filter(id -> StringMan.blockStateMatches(input, id)).sorted(StringMan.blockStateComparator(input)).collect(Collectors.toList()));
        }
    }
    if (propStrStart == -1) {
        return type.getDefaultState();
    }
    List<? extends Property<?>> propList = type.getProperties();
    if (state.charAt(state.length() - 1) != ']') {
        state = state + "]";
    }
    MutableCharSequence charSequence = MutableCharSequence.getTemporal();
    charSequence.setString(state);
    if (propList.size() == 1) {
        AbstractProperty<?> property = (AbstractProperty<?>) propList.get(0);
        String name = property.getName();
        charSequence.setSubstring(propStrStart + name.length() + 2, state.length() - 1);
        int index = charSequence.length() <= 0 ? -1 : property.getIndexFor(charSequence);
        if (index != -1) {
            return type.withPropertyId(index);
        }
    }
    int stateId;
    if (defaultState != null) {
        stateId = defaultState.getInternalId();
    } else {
        stateId = type.getDefaultState().getInternalId();
    }
    int length = state.length();
    AbstractProperty<?> property = null;
    int last = propStrStart + 1;
    for (int i = last; i < length; i++) {
        char c = state.charAt(i);
        switch(c) {
            case ']':
            case ',':
                {
                    charSequence.setSubstring(last, i);
                    if (property != null) {
                        int index = property.getIndexFor(charSequence);
                        if (index == -1) {
                            throw SuggestInputParseException.of(charSequence.toString(), (List<Object>) property.getValues());
                        }
                        stateId = property.modifyIndex(stateId, index);
                    } else {
                        // suggest
                        PropertyKey key = PropertyKey.getByName(charSequence);
                        if (key == null || !type.hasProperty(key)) {
                            // Suggest property
                            String input = charSequence.toString();
                            BlockType finalType = type;
                            throw new SuggestInputParseException("Invalid property " + key + ":" + input + " for type " + type, input, () -> finalType.getProperties().stream().map(Property::getName).filter(p -> StringMan.blockStateMatches(input, p)).sorted(StringMan.blockStateComparator(input)).collect(Collectors.toList()));
                        } else {
                            throw new SuggestInputParseException("No operator for " + state, "", () -> Collections.singletonList("="));
                        }
                    }
                    property = null;
                    last = i + 1;
                    break;
                }
            case '=':
                {
                    charSequence.setSubstring(last, i);
                    property = (AbstractProperty) type.getPropertyMap().get(charSequence);
                    last = i + 1;
                    break;
                }
            default:
                continue;
        }
    }
    return type.withPropertyId(stateId >> BlockTypesCache.BIT_OFFSET);
}
Also used : SuggestInputParseException(com.fastasyncworldedit.core.command.SuggestInputParseException) Property(com.sk89q.worldedit.registry.state.Property) BlockVector3(com.sk89q.worldedit.math.BlockVector3) SingleBlockStateMask(com.fastasyncworldedit.core.function.mask.SingleBlockStateMask) BlanketBaseBlock(com.fastasyncworldedit.core.world.block.BlanketBaseBlock) LazyReference(com.sk89q.worldedit.util.concurrency.LazyReference) StringMan(com.fastasyncworldedit.core.util.StringMan) WorldEditException(com.sk89q.worldedit.WorldEditException) InputParseException(com.sk89q.worldedit.extension.input.InputParseException) Map(java.util.Map) PropertyKey(com.fastasyncworldedit.core.registry.state.PropertyKey) WorldEdit(com.sk89q.worldedit.WorldEdit) CompoundBinaryTag(com.sk89q.worldedit.util.nbt.CompoundBinaryTag) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) Function(com.google.common.base.Function) NullExtent(com.sk89q.worldedit.extent.NullExtent) MutableCharSequence(com.fastasyncworldedit.core.util.MutableCharSequence) OutputExtent(com.sk89q.worldedit.extent.OutputExtent) AbstractProperty(com.sk89q.worldedit.registry.state.AbstractProperty) Maps(com.google.common.collect.Maps) Collectors(java.util.stream.Collectors) List(java.util.List) Stream(java.util.stream.Stream) Capability(com.sk89q.worldedit.extension.platform.Capability) CompoundInput(com.fastasyncworldedit.core.world.block.CompoundInput) CompoundTag(com.sk89q.jnbt.CompoundTag) Mask(com.sk89q.worldedit.function.mask.Mask) ITileInput(com.fastasyncworldedit.core.queue.ITileInput) Pattern(com.sk89q.worldedit.function.pattern.Pattern) Collections(java.util.Collections) Extent(com.sk89q.worldedit.extent.Extent) BlockMaterial(com.sk89q.worldedit.world.registry.BlockMaterial) SuggestInputParseException(com.fastasyncworldedit.core.command.SuggestInputParseException) MutableCharSequence(com.fastasyncworldedit.core.util.MutableCharSequence) AbstractProperty(com.sk89q.worldedit.registry.state.AbstractProperty) MutableCharSequence(com.fastasyncworldedit.core.util.MutableCharSequence) List(java.util.List) PropertyKey(com.fastasyncworldedit.core.registry.state.PropertyKey)

Example 9 with Property

use of com.sk89q.worldedit.registry.state.Property in project FastAsyncWorldEdit by IntellectualSites.

the class BlockType method getState.

/**
 * Gets a state of this BlockType with the given properties.
 *
 * @return The state, if it exists
 * @deprecated Not working. Not necessarily for removal, but WARNING DO NOT USE FOR NOW
 */
@Deprecated(forRemoval = true)
public BlockState getState(Map<Property<?>, Object> key) {
    // FAWE start - use ids & btp (block type property)
    int id = getInternalId();
    for (Map.Entry<Property<?>, Object> iter : key.entrySet()) {
        Property<?> prop = iter.getKey();
        Object value = iter.getValue();
        /*
             * TODO:
             * This is likely wrong. The only place this seems to currently (Dec 23 2018)
             * be invoked is via ForgeWorld, and value is a String when invoked there...
             */
        AbstractProperty btp = this.settings.propertiesMap.get(prop.getName());
        checkArgument(btp != null, "%s has no property named %s", this, prop.getName());
        id = btp.modify(id, btp.getValueFor((String) value));
    }
    return withStateId(id);
// FAWE end
}
Also used : AbstractProperty(com.sk89q.worldedit.registry.state.AbstractProperty) Map(java.util.Map) Property(com.sk89q.worldedit.registry.state.Property) AbstractProperty(com.sk89q.worldedit.registry.state.AbstractProperty)

Example 10 with Property

use of com.sk89q.worldedit.registry.state.Property in project FastAsyncWorldEdit by IntellectualSites.

the class PaperweightAdapter method applyProperties.

@SuppressWarnings({ "rawtypes", "unchecked" })
private net.minecraft.world.level.block.state.BlockState applyProperties(StateDefinition<Block, net.minecraft.world.level.block.state.BlockState> stateContainer, net.minecraft.world.level.block.state.BlockState newState, Map<Property<?>, Object> states) {
    for (Map.Entry<Property<?>, Object> state : states.entrySet()) {
        net.minecraft.world.level.block.state.properties.Property<?> property = stateContainer.getProperty(state.getKey().getName());
        Comparable<?> value = (Comparable) state.getValue();
        // we may need to adapt this value, depending on the source prop
        if (property instanceof DirectionProperty) {
            Direction dir = (Direction) value;
            value = adapt(dir);
        } else if (property instanceof net.minecraft.world.level.block.state.properties.EnumProperty) {
            String enumName = (String) value;
            value = ((net.minecraft.world.level.block.state.properties.EnumProperty<?>) property).getValue(enumName).orElseThrow(() -> new IllegalStateException("Enum property " + property.getName() + " does not contain " + enumName));
        }
        newState = newState.setValue((net.minecraft.world.level.block.state.properties.Property) property, (Comparable) value);
    }
    return newState;
}
Also used : Direction(com.sk89q.worldedit.util.Direction) DirectionProperty(net.minecraft.world.level.block.state.properties.DirectionProperty) Map(java.util.Map) HashMap(java.util.HashMap) Property(com.sk89q.worldedit.registry.state.Property) DirectionalProperty(com.sk89q.worldedit.registry.state.DirectionalProperty) BooleanProperty(com.sk89q.worldedit.registry.state.BooleanProperty) EnumProperty(com.sk89q.worldedit.registry.state.EnumProperty) IntegerProperty(com.sk89q.worldedit.registry.state.IntegerProperty) DirectionProperty(net.minecraft.world.level.block.state.properties.DirectionProperty)

Aggregations

Property (com.sk89q.worldedit.registry.state.Property)18 Map (java.util.Map)10 BooleanProperty (com.sk89q.worldedit.registry.state.BooleanProperty)8 EnumProperty (com.sk89q.worldedit.registry.state.EnumProperty)8 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)7 DirectionalProperty (com.sk89q.worldedit.registry.state.DirectionalProperty)7 IntegerProperty (com.sk89q.worldedit.registry.state.IntegerProperty)7 BaseBlock (com.sk89q.worldedit.world.block.BaseBlock)6 BlockType (com.sk89q.worldedit.world.block.BlockType)5 Collectors (java.util.stream.Collectors)5 Maps (com.google.common.collect.Maps)4 WorldEditException (com.sk89q.worldedit.WorldEditException)4 Direction (com.sk89q.worldedit.util.Direction)4 BlockState (com.sk89q.worldedit.world.block.BlockState)4 HashMap (java.util.HashMap)4 List (java.util.List)4 Locale (java.util.Locale)4 Set (java.util.Set)4 Stream (java.util.stream.Stream)4 Block (net.minecraft.block.Block)4