mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Merge remote-tracking branch 'refs/remotes/isfawe/new-vector-system' into new-vector-system
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
repositories {
|
||||
maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"}
|
||||
}
|
||||
dependencies {
|
||||
compile 'de.schlichtherle:truezip:6.8.3'
|
||||
compile 'rhino:js:1.7R2'
|
||||
|
@ -27,7 +27,6 @@ import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -25,9 +25,6 @@ import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.util.gson.GsonUtil;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.util.gson.GsonUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -24,7 +24,6 @@ import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -115,4 +114,4 @@ public class SkullBlock extends BaseBlock {
|
||||
owner = ((StringTag) t).getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,6 +362,8 @@ public class Fawe {
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "fr/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "cn/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "it/message.yml", null);
|
||||
// Setting up config.yml
|
||||
File file = new File(this.IMP.getDirectory(), "config.yml");
|
||||
Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", "");
|
||||
|
@ -118,7 +118,7 @@ public enum BBC {
|
||||
BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"),
|
||||
BRUSH_NONE("You aren't holding a brush!", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_SET("Set scroll action to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_UNSET("Removed scrol action", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_UNSET("Removed scroll action", "WorldEdit.Brush"),
|
||||
BRUSH_VISUAL_MODE_SET("Set visual mode to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_TARGET_MODE_SET("Set target mode to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_TARGET_MASK_SET("Set target mask to %s0", "WorldEdit.Brush"),
|
||||
|
@ -23,7 +23,7 @@ public class Settings extends Config {
|
||||
@Final
|
||||
public String PLATFORM; // These values are set from FAWE before loading
|
||||
|
||||
@Comment({"Options: de, es, fr, nl, ru, tr",
|
||||
@Comment({"Options: cn, de, es, fr, it, nl, ru, tr",
|
||||
"Create a PR to contribute a translation: https://github.com/boy0001/FastAsyncWorldedit/new/master/core/src/main/resources",})
|
||||
public String LANGUAGE = "";
|
||||
@Comment({"Enable or disable automatic updates",
|
||||
@ -325,7 +325,7 @@ public class Settings extends Config {
|
||||
public boolean ANVIL_QUEUE_MODE = false;
|
||||
@Comment({
|
||||
"[SAFE] Dynamically increase the number of chunks rendered",
|
||||
" - Requires Paper: ci.destroystokyo.com/job/PaperSpigot/",
|
||||
" - Requires Paper: ci.destroystokyo.com/job/Paper-1.13/",
|
||||
" - Set your server view distance to 1 (spigot.yml, server.properties)",
|
||||
" - Based on tps and player movement",
|
||||
" - Note: If entities become hidden, increase the server view distance to 3",
|
||||
|
@ -160,7 +160,7 @@ public class InstallerFrame extends JFrame {
|
||||
} catch (Throwable ignore) {
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
URL chat = new URL("http://webchat.esper.net/?nick=&channels=IntellectualCrafters&fg_color=000&fg_sec_color=000&bg_color=FFF");
|
||||
URL chat = new URL("https://discord.gg/ngZCzbU");
|
||||
URLButton chatButton = new URLButton(chat, "Chat");
|
||||
bottomBar.add(chatButton);
|
||||
URL wiki = new URL("https://github.com/boy0001/FastAsyncWorldedit/wiki");
|
||||
|
@ -276,6 +276,10 @@ public class Schematic {
|
||||
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ();
|
||||
// entities
|
||||
for (Entity entity : clipboard.getEntities()) {
|
||||
// skip players on pasting schematic
|
||||
if (entity.getState() != null && entity.getState().getType().getId().equals("minecraft:player")) {
|
||||
continue;
|
||||
}
|
||||
Location pos = entity.getLocation();
|
||||
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.getPitch());
|
||||
extent.createEntity(newPos, entity.getState());
|
||||
|
@ -1,6 +1,24 @@
|
||||
/*
|
||||
* 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.jnbt;
|
||||
|
||||
import com.sk89q.worldedit.function.entity.ExtentEntityCopy;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -12,6 +30,7 @@ import java.util.Map;
|
||||
public final class CompoundTag extends Tag {
|
||||
|
||||
private final Map<String, Tag> value;
|
||||
|
||||
/**
|
||||
* Creates the tag with an empty name.
|
||||
*
|
||||
@ -425,5 +444,4 @@ public final class CompoundTag extends Tag {
|
||||
return bldr.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -19,11 +19,11 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Helps create compound tags.
|
||||
*/
|
||||
@ -145,14 +145,14 @@ public class CompoundTagBuilder {
|
||||
return put(key, new LongArrayTag(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Put the given key and value into the compound tag as a
|
||||
* {@code LongTag}.
|
||||
*
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
* @return this object
|
||||
*/
|
||||
/**
|
||||
* Put the given key and value into the compound tag as a
|
||||
* {@code LongTag}.
|
||||
*
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
* @return this object
|
||||
*/
|
||||
public CompoundTagBuilder putLong(String key, long value) {
|
||||
return put(key, new LongTag(value));
|
||||
}
|
||||
@ -213,5 +213,4 @@ public class CompoundTagBuilder {
|
||||
return new CompoundTagBuilder();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The {@code TAG_List} tag.
|
||||
@ -64,7 +65,7 @@ public final class ListTag<T extends Tag> extends Tag {
|
||||
|
||||
/**
|
||||
* Get the tag if it exists at the given index.
|
||||
*
|
||||
*
|
||||
* @param index the index
|
||||
* @return the tag or null
|
||||
*/
|
||||
@ -419,6 +420,4 @@ public final class ListTag<T extends Tag> extends Tag {
|
||||
return bldr.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Helps create list tags.
|
||||
*/
|
||||
|
@ -16,13 +16,18 @@
|
||||
* 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.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Long_Array} tag.
|
||||
*/
|
||||
public class LongArrayTag extends Tag {
|
||||
|
||||
private final long[] value;
|
||||
|
||||
/**
|
||||
* Creates the tag with an empty name.
|
||||
*
|
||||
@ -33,10 +38,12 @@ public class LongArrayTag extends Tag {
|
||||
checkNotNull(value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long[] getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder hex = new StringBuilder();
|
||||
@ -49,4 +56,5 @@ public class LongArrayTag extends Tag {
|
||||
}
|
||||
return "TAG_Long_Array(" + hex + ")";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import java.util.function.Function;
|
||||
* This class reads <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
|
||||
* streams, and produces an object graph of subclasses of the {@code Tag}
|
||||
* object.
|
||||
* <p>
|
||||
*
|
||||
* <p>The NBT format was created by Markus Persson, and the specification may be
|
||||
* found at <a href="http://www.minecraft.net/docs/NBT.txt">
|
||||
* http://www.minecraft.net/docs/NBT.txt</a>.</p>
|
||||
@ -49,7 +49,7 @@ public final class NBTInputStream implements Closeable {
|
||||
/**
|
||||
* Creates a new {@code NBTInputStream}, which will source its data
|
||||
* from the specified input stream.
|
||||
*
|
||||
*
|
||||
* @param is the input stream
|
||||
* @throws IOException if an I/O error occurs
|
||||
*/
|
||||
@ -67,7 +67,7 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads an NBT tag from the stream.
|
||||
*
|
||||
*
|
||||
* @return The tag that was read.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*/
|
||||
@ -87,7 +87,7 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads an NBT from the stream.
|
||||
*
|
||||
*
|
||||
* @param depth the depth of this tag
|
||||
* @return The tag that was read.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
@ -519,8 +519,8 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads the payload of a tag given the type.
|
||||
*
|
||||
* @param type the type
|
||||
*
|
||||
* @param type the type
|
||||
* @param depth the depth
|
||||
* @return the tag
|
||||
* @throws IOException if an I/O error occurs.
|
||||
@ -617,5 +617,4 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.object.io.LittleEndianOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.DataOutput;
|
||||
@ -29,13 +31,10 @@ import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
|
||||
* {@code Tag} objects to an underlying {@code OutputStream}.
|
||||
* <p>
|
||||
*
|
||||
* <p>The NBT format was created by Markus Persson, and the specification may be
|
||||
* found at <a href="http://www.minecraft.net/docs/NBT.txt">
|
||||
* http://www.minecraft.net/docs/NBT.txt</a>.</p>
|
||||
@ -50,9 +49,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
/**
|
||||
* Creates a new {@code NBTOutputStream}, which will write data to the
|
||||
* specified underlying output stream.
|
||||
*
|
||||
* @param os The output stream.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param os
|
||||
* The output stream.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public NBTOutputStream(OutputStream os) throws IOException {
|
||||
this.os = new DataOutputStream(os);
|
||||
@ -74,13 +75,16 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a tag.
|
||||
*
|
||||
* @param tag The tag to write.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag to write.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public void writeNamedTag(String name, Tag tag) throws IOException {
|
||||
checkNotNull(name);
|
||||
checkNotNull(tag);
|
||||
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
writeNamedTagName(name, type);
|
||||
if (type == NBTConstants.TYPE_END) {
|
||||
@ -197,62 +201,66 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes tag payload.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public void writeTagPayload(Tag tag) throws IOException {
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
switch (type) {
|
||||
case NBTConstants.TYPE_END:
|
||||
writeEndTagPayload((EndTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE:
|
||||
writeByteTagPayload((ByteTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_SHORT:
|
||||
writeShortTagPayload((ShortTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT:
|
||||
writeIntTagPayload((IntTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG:
|
||||
writeLongTagPayload((LongTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_FLOAT:
|
||||
writeFloatTagPayload((FloatTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_DOUBLE:
|
||||
writeDoubleTagPayload((DoubleTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE_ARRAY:
|
||||
writeByteArrayTagPayload((ByteArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_STRING:
|
||||
writeStringTagPayload((StringTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LIST:
|
||||
writeListTagPayload((ListTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_COMPOUND:
|
||||
writeCompoundTagPayload((CompoundTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT_ARRAY:
|
||||
writeIntArrayTagPayload((IntArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG_ARRAY:
|
||||
writeLongArrayTagPayload((LongArrayTag) tag);
|
||||
break;
|
||||
default:
|
||||
throw new IOException("Invalid tag type: " + type + ".");
|
||||
case NBTConstants.TYPE_END:
|
||||
writeEndTagPayload((EndTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE:
|
||||
writeByteTagPayload((ByteTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_SHORT:
|
||||
writeShortTagPayload((ShortTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT:
|
||||
writeIntTagPayload((IntTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG:
|
||||
writeLongTagPayload((LongTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_FLOAT:
|
||||
writeFloatTagPayload((FloatTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_DOUBLE:
|
||||
writeDoubleTagPayload((DoubleTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE_ARRAY:
|
||||
writeByteArrayTagPayload((ByteArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_STRING:
|
||||
writeStringTagPayload((StringTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LIST:
|
||||
writeListTagPayload((ListTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_COMPOUND:
|
||||
writeCompoundTagPayload((CompoundTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT_ARRAY:
|
||||
writeIntArrayTagPayload((IntArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG_ARRAY:
|
||||
writeLongArrayTagPayload((LongArrayTag) tag);
|
||||
break;
|
||||
default:
|
||||
throw new IOException("Invalid tag type: " + type + ".");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Byte} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeByteTagPayload(ByteTag tag) throws IOException {
|
||||
os.writeByte(tag.getValue());
|
||||
@ -260,9 +268,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Byte_Array} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException {
|
||||
byte[] bytes = tag.getValue();
|
||||
@ -272,9 +282,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Compound} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeCompoundTagPayload(CompoundTag tag) throws IOException {
|
||||
for (Map.Entry<String, Tag> entry : tag.getValue().entrySet()) {
|
||||
@ -285,9 +297,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_List} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeListTagPayload(ListTag tag) throws IOException {
|
||||
Class<? extends Tag> clazz = tag.getType();
|
||||
@ -310,9 +324,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_String} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeStringTagPayload(StringTag tag) throws IOException {
|
||||
byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET);
|
||||
@ -322,9 +338,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Double} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeDoubleTagPayload(DoubleTag tag) throws IOException {
|
||||
os.writeDouble(tag.getValue());
|
||||
@ -332,9 +350,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Float} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeFloatTagPayload(FloatTag tag) throws IOException {
|
||||
os.writeFloat(tag.getValue());
|
||||
@ -342,9 +362,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Long} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeLongTagPayload(LongTag tag) throws IOException {
|
||||
os.writeLong(tag.getValue());
|
||||
@ -352,9 +374,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Int} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeIntTagPayload(IntTag tag) throws IOException {
|
||||
os.writeInt(tag.getValue());
|
||||
@ -362,9 +386,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Short} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeShortTagPayload(ShortTag tag) throws IOException {
|
||||
os.writeShort(tag.getValue());
|
||||
@ -372,19 +398,19 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Empty} tag.
|
||||
*
|
||||
*
|
||||
* @param tag the tag
|
||||
*/
|
||||
private void writeEndTagPayload(EndTag tag) {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
|
||||
private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
|
||||
int[] data = tag.getValue();
|
||||
os.writeInt(data.length);
|
||||
for (int aData : data) {
|
||||
os.writeInt(aData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeLongArrayTagPayload(LongArrayTag tag) throws IOException {
|
||||
|
@ -26,8 +26,6 @@ import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A class which contains NBT-related utility methods.
|
||||
*
|
||||
|
@ -26,7 +26,7 @@ public abstract class Tag {
|
||||
|
||||
/**
|
||||
* Gets the value of this tag.
|
||||
*
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
public abstract Object getValue();
|
||||
@ -34,8 +34,4 @@ public abstract class Tag {
|
||||
public Object getRaw() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -19,12 +19,13 @@
|
||||
|
||||
package com.sk89q.minecraft.util.commands;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class CommandException extends Exception {
|
||||
|
||||
|
@ -28,7 +28,8 @@ import java.util.*;
|
||||
|
||||
public final class ReflectionUtil {
|
||||
|
||||
private ReflectionUtil() {}
|
||||
private ReflectionUtil() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getField(Object from, String name) {
|
||||
@ -50,4 +51,5 @@ public final class ReflectionUtil {
|
||||
} while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Trim a string if it is longer than a certain length.
|
||||
*
|
||||
*
|
||||
* @param str the stirng
|
||||
* @param len the length to trim to
|
||||
* @return a new string
|
||||
@ -49,7 +49,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -68,7 +68,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -76,7 +76,7 @@ public final class StringUtil {
|
||||
* @return a new string
|
||||
*/
|
||||
public static String joinQuotedString(String[] str, String delimiter,
|
||||
int initialIndex, String quote) {
|
||||
int initialIndex, String quote) {
|
||||
if (str.length == 0) {
|
||||
return "";
|
||||
}
|
||||
@ -92,7 +92,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @return a new string
|
||||
@ -103,7 +103,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str an array of objects
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -122,7 +122,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str a list of integers
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -219,7 +219,7 @@ public final class StringUtil {
|
||||
* calculated). (Note that the arrays aren't really copied anymore, just
|
||||
* switched...this is clearly much better than cloning an array or doing
|
||||
* a System.arraycopy() each time through the outer loop.)
|
||||
*
|
||||
*
|
||||
* Effectively, the difference between the two implementations is this
|
||||
* one does not cause an out of memory condition when calculating the LD
|
||||
* over two very large strings.
|
||||
@ -323,4 +323,4 @@ public final class StringUtil {
|
||||
|
||||
return parsableBlocks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,13 @@ import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a configuration node.
|
||||
*/
|
||||
|
@ -27,7 +27,13 @@ import org.yaml.snakeyaml.nodes.Tag;
|
||||
import org.yaml.snakeyaml.reader.UnicodeReader;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -294,4 +300,5 @@ public class YAMLProcessor extends YAMLNode {
|
||||
this.nullRepresenter = o -> representScalar(Tag.NULL, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
|
||||
/**
|
||||
* Return fast mode status.
|
||||
* <p>
|
||||
*
|
||||
* <p>Fast mode may skip lighting checks or adjacent block
|
||||
* notification.</p>
|
||||
*
|
||||
@ -1020,8 +1020,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Set a block, bypassing both history and block re-ordering.
|
||||
*
|
||||
* @param position the position to set the block at
|
||||
* @param block the block
|
||||
* @param stage the level
|
||||
* @param block the block
|
||||
* @param stage the level
|
||||
* @return whether the block changed
|
||||
* @throws WorldEditException thrown on a set error
|
||||
*/
|
||||
@ -1637,7 +1637,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Sets all the blocks inside a region to a given pattern.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern that provides the replacement block
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1691,8 +1691,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Replaces all the blocks matching a given mask, within a given region, to a block
|
||||
* returned by a given pattern.
|
||||
*
|
||||
* @param region the region to replace the blocks within
|
||||
* @param mask the mask that blocks must match
|
||||
* @param region the region to replace the blocks within
|
||||
* @param mask the mask that blocks must match
|
||||
* @param pattern the pattern that provides the new blocks
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1714,7 +1714,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* If the center sits between two blocks on a certain axis, then two blocks
|
||||
* will be placed to mark the center.
|
||||
*
|
||||
* @param region the region to find the center of
|
||||
* @param region the region to find the center of
|
||||
* @param pattern the replacement pattern
|
||||
* @return the number of blocks placed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1741,7 +1741,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the block to place
|
||||
* @param block the block to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1753,7 +1753,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1773,7 +1773,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* may be inefficient, because there may not be an efficient implementation supported
|
||||
* for that specific shape.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1790,12 +1790,13 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make the walls (all faces but those parallel to the X-Z plane) of the given region
|
||||
* as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the block to place
|
||||
* @param block the block to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1808,7 +1809,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make the walls (all faces but those parallel to the X-Z plane) of the given region
|
||||
* as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1828,7 +1829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* may be inefficient, because there may not be an efficient implementation supported
|
||||
* for that specific shape.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1858,7 +1859,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* (as if it were a cuboid).
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the placed block
|
||||
* @param block the placed block
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1871,7 +1872,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Places a layer of blocks on top of ground blocks in the given region
|
||||
* (as if it were a cuboid).
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the placed block pattern
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1920,9 +1921,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Stack a cuboid region.
|
||||
*
|
||||
* @param region the region to stack
|
||||
* @param dir the direction to stack
|
||||
* @param count the number of times to stack
|
||||
* @param region the region to stack
|
||||
* @param dir the direction to stack
|
||||
* @param count the number of times to stack
|
||||
* @param copyAir true to also copy air blocks
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1962,10 +1963,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Move the blocks in a region a certain direction.
|
||||
*
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
||||
* @return number of blocks moved
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -2019,10 +2020,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Move the blocks in a region a certain direction.
|
||||
*
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
||||
* @return number of blocks moved
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -2088,8 +2089,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Fix liquids so that they turn into stationary blocks and extend outward.
|
||||
*
|
||||
* @param origin the original position
|
||||
* @param radius the radius to fix
|
||||
* @param origin the original position
|
||||
* @param radius the radius to fix
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2120,8 +2121,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Makes a cylinder.
|
||||
*
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param radius The cylinder's radius
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
@ -2135,12 +2136,12 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Makes a cylinder.
|
||||
*
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param radiusX The cylinder's largest north/south extent
|
||||
* @param radiusZ The cylinder's largest east/west extent
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2349,28 +2350,28 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a sphere.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radius The sphere's radius
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
* Makes a sphere.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radius The sphere's radius
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public int makeSphere(final BlockVector3 pos, final Pattern block, final double radius, final boolean filled) {
|
||||
return this.makeSphere(pos, block, radius, radius, radius, filled);
|
||||
return makeSphere(pos, block, radius, radius, radius, filled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a sphere or ellipsoid.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radiusX The sphere/ellipsoid's largest north/south extent
|
||||
* @param radiusY The sphere/ellipsoid's largest up/down extent
|
||||
* @param radiusZ The sphere/ellipsoid's largest east/west extent
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2447,9 +2448,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Makes a pyramid.
|
||||
*
|
||||
* @param position a position
|
||||
* @param block a block
|
||||
* @param size size of pyramid
|
||||
* @param filled true if filled
|
||||
* @param block a block
|
||||
* @param size size of pyramid
|
||||
* @param filled true if filled
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2477,7 +2478,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Thaw blocks in a radius.
|
||||
*
|
||||
* @param position the position
|
||||
* @param radius the radius
|
||||
* @param radius the radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2548,7 +2549,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make snow in a radius.
|
||||
*
|
||||
* @param position a position
|
||||
* @param radius a radius
|
||||
* @param radius a radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2640,7 +2641,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make dirt green.
|
||||
*
|
||||
* @param position a position
|
||||
* @param radius a radius
|
||||
* @param radius a radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2724,7 +2725,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Makes pumpkin patches randomly in an area around the given position.
|
||||
*
|
||||
* @param position the base position
|
||||
* @param apothem the apothem of the (square) area
|
||||
* @param apothem the apothem of the (square) area
|
||||
* @return number of patches created
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3036,9 +3037,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Hollows out the region (Semi-well-defined for non-cuboid selections).
|
||||
*
|
||||
* @param region the region to hollow out.
|
||||
* @param region the region to hollow out.
|
||||
* @param thickness the thickness of the shell to leave (manhattan distance)
|
||||
* @param pattern The block pattern to use
|
||||
* @param pattern The block pattern to use
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3116,10 +3117,11 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Draws a line (out of blocks) between two vectors.
|
||||
*
|
||||
* @param pattern The block pattern used to draw the line.
|
||||
* @param pos1 One of the points that define the line.
|
||||
* @param pos2 The other point that defines the line.
|
||||
* @param radius The radius (thickness) of the line.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param pos1 One of the points that define the line.
|
||||
* @param pos2 The other point that defines the line.
|
||||
* @param radius The radius (thickness) of the line.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
*
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3185,14 +3187,15 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Draws a spline (out of blocks) between specified vectors.
|
||||
*
|
||||
* @param pattern The block pattern used to draw the spline.
|
||||
* @param pattern The block pattern used to draw the spline.
|
||||
* @param nodevectors The list of vectors to draw through.
|
||||
* @param tension The tension of every node.
|
||||
* @param bias The bias of every node.
|
||||
* @param continuity The continuity of every node.
|
||||
* @param quality The quality of the spline. Must be greater than 0.
|
||||
* @param radius The radius (thickness) of the spline.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param tension The tension of every node.
|
||||
* @param bias The bias of every node.
|
||||
* @param continuity The continuity of every node.
|
||||
* @param quality The quality of the spline. Must be greater than 0.
|
||||
* @param radius The radius (thickness) of the spline.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
*
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3324,7 +3327,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
for (BlockVector3 recurseDirection : recurseDirections) {
|
||||
queue.addLast(current.add(recurseDirection));
|
||||
}
|
||||
}
|
||||
} // while
|
||||
}
|
||||
|
||||
public int makeBiomeShape(final Region region, final Vector3 zero, final Vector3 unit, final BaseBiome biomeType, final String expressionString, final boolean hollow) throws ExpressionException, MaxChangedBlocksException {
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.util.eventbus.EventBus;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Creates new {@link EditSession}s. To get an instance of this factory,
|
||||
* use {@link WorldEdit#getEditSessionFactory()}.
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class LocalSession implements TextureHolder {
|
||||
|
||||
/**
|
||||
* Construct the object.
|
||||
* <p>
|
||||
*
|
||||
* <p>{@link #setConfiguration(LocalConfiguration)} should be called
|
||||
* later with configuration.</p>
|
||||
*/
|
||||
@ -500,7 +500,7 @@ public class LocalSession implements TextureHolder {
|
||||
* Performs an undo.
|
||||
*
|
||||
* @param newBlockBag a new block bag
|
||||
* @param player the player
|
||||
* @param player the player
|
||||
* @return whether anything was undone
|
||||
*/
|
||||
public EditSession undo(@Nullable BlockBag newBlockBag, Player player) {
|
||||
@ -536,7 +536,7 @@ public class LocalSession implements TextureHolder {
|
||||
* Performs a redo
|
||||
*
|
||||
* @param newBlockBag a new block bag
|
||||
* @param player the player
|
||||
* @param player the player
|
||||
* @return whether anything was redone
|
||||
*/
|
||||
public EditSession redo(@Nullable BlockBag newBlockBag, Player player) {
|
||||
@ -625,7 +625,7 @@ public class LocalSession implements TextureHolder {
|
||||
/**
|
||||
* Set the region selector.
|
||||
*
|
||||
* @param world the world
|
||||
* @param world the world
|
||||
* @param selector the selector
|
||||
*/
|
||||
public void setRegionSelector(World world, RegionSelector selector) {
|
||||
@ -782,7 +782,7 @@ public class LocalSession implements TextureHolder {
|
||||
|
||||
/**
|
||||
* Sets the clipboard.
|
||||
* <p>
|
||||
*
|
||||
* <p>Pass {@code null} to clear the clipboard.</p>
|
||||
*
|
||||
* @param clipboard the clipboard, or null if the clipboard is to be cleared
|
||||
@ -974,7 +974,7 @@ public class LocalSession implements TextureHolder {
|
||||
* or the tool is not assigned, the slot will be replaced with the
|
||||
* brush tool.
|
||||
*
|
||||
* @param item the item type ID
|
||||
* @param item the item type
|
||||
* @return the tool, or {@code null}
|
||||
* @throws InvalidToolBindException if the item can't be bound to that item
|
||||
*/
|
||||
@ -1015,7 +1015,7 @@ public class LocalSession implements TextureHolder {
|
||||
/**
|
||||
* Set the tool.
|
||||
*
|
||||
* @param item the item type ID
|
||||
* @param item the item type
|
||||
* @param tool the tool to set, which can be {@code null}
|
||||
* @throws InvalidToolBindException if the item can't be bound to that item
|
||||
*/
|
||||
|
@ -56,4 +56,4 @@ public enum PlayerDirection {
|
||||
return isOrthogonal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
@ -59,7 +62,6 @@ import com.sk89q.worldedit.world.registry.BundledBlockData;
|
||||
import com.sk89q.worldedit.world.registry.BundledItemData;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.script.ScriptException;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -72,8 +74,7 @@ import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
/**
|
||||
* The entry point and container for a working implementation of WorldEdit.
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.blocks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The colors for wool.
|
||||
|
@ -401,6 +401,7 @@ public class UtilityCommands extends MethodCommands {
|
||||
@Logging(PLACEMENT)
|
||||
public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException {
|
||||
worldEdit.checkMaxRadius(size);
|
||||
size = Math.max(1, size);
|
||||
int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size);
|
||||
player.print(BBC.getPrefix() + affected + " block(s) have been removed.");
|
||||
}
|
||||
|
@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
public class ItemParser extends SimpleCommand<BaseItem> {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.argument;
|
||||
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.extent.NullExtent;
|
||||
@ -26,13 +28,9 @@ import com.sk89q.worldedit.function.Contextual;
|
||||
import com.sk89q.worldedit.function.EditContext;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.block.BlockReplace;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
|
||||
public class ReplaceParser extends SimpleCommand<Contextual<? extends RegionFunction>> {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.composition;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.command.argument.RegionFunctionParser;
|
||||
@ -30,8 +32,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.CommandExecutor;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ApplyCommand extends SimpleCommand<Contextual<? extends Operation>> {
|
||||
|
||||
private final CommandExecutor<Contextual<? extends RegionFunction>> functionParser;
|
||||
|
@ -20,6 +20,9 @@
|
||||
package com.sk89q.worldedit.command.composition;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissionsException;
|
||||
@ -41,8 +44,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.CommandExecutor;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ShapedBrushCommand extends SimpleCommand<Object> {
|
||||
|
||||
private final CommandExecutor<? extends Contextual<? extends Operation>> delegate;
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
|
@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* Looks up information about a block.
|
||||
|
@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
|
||||
public class CylinderBrush implements Brush {
|
||||
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class HollowCylinderBrush implements Brush {
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class HollowSphereBrush implements Brush {
|
||||
|
@ -20,13 +20,12 @@
|
||||
package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMap;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.convolution.GaussianKernel;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMap;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMapFilter;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class SphereBrush implements Brush {
|
||||
|
@ -21,14 +21,11 @@ package com.sk89q.worldedit.command.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.util.SetQueue;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.worldedit.entity.metadata.EntityProperties;
|
||||
import com.sk89q.worldedit.function.EntityFunction;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -151,6 +148,7 @@ public class EntityRemover {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
@ -19,16 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.entity;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.world.NbtValued;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Represents a mutable "snapshot" of an entity.
|
||||
*
|
||||
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Called when a block is interacted with.
|
||||
*/
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Posted when suggestions for auto-completion are requested for command input.
|
||||
*/
|
||||
|
@ -19,11 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised when the configuration has been loaded or re-loaded.
|
||||
*/
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised whenever a player sends input.
|
||||
*/
|
||||
|
@ -21,16 +21,11 @@ package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -39,6 +39,7 @@ public final class MaskFactory extends AbstractFactory<Mask> {
|
||||
*/
|
||||
public MaskFactory(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
|
||||
parsers.add(new DefaultMaskParser(worldEdit));
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ public final class PatternFactory extends AbstractFactory<Pattern> {
|
||||
*/
|
||||
public PatternFactory(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
|
||||
parsers.add(new HashTagPatternParser(worldEdit));
|
||||
}
|
||||
|
||||
|
@ -21,14 +21,13 @@ package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
class RandomPatternParser extends InputParser<Pattern> {
|
||||
|
||||
|
@ -20,11 +20,11 @@
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
|
||||
class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.sk89q.worldedit.entity.metadata.Metadatable;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionOwner;
|
||||
import com.sk89q.worldedit.util.Identifiable;
|
||||
|
@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.registry.Registries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a platform that WorldEdit has been implemented for.
|
||||
*
|
||||
|
@ -20,12 +20,11 @@
|
||||
package com.sk89q.worldedit.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -36,8 +35,8 @@ public interface OutputExtent {
|
||||
|
||||
/**
|
||||
* Change the block at the given location to the given block. The operation may
|
||||
* not tie the given {@link BlockState} to the world, so future changes to the
|
||||
* {@link BlockState} do not affect the world until this method is called again.
|
||||
* not tie the given {@link BlockStateHolder} to the world, so future changes to the
|
||||
* {@link BlockStateHolder} do not affect the world until this method is called again.
|
||||
*
|
||||
* <p>The return value of this method indicates whether the change was probably
|
||||
* successful. It may not be successful if, for example, the location is out
|
||||
|
@ -22,9 +22,6 @@ package com.sk89q.worldedit.extent.buffer;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
@ -34,6 +31,8 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.AbstractRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -63,4 +63,4 @@ public class LastAccessExtentCache extends AbstractDelegateExtent {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.clipboard;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* An implementation of {@link Entity} that stores a {@link BaseEntity} with it.
|
||||
*
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.world.registry.Registries;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -60,4 +60,4 @@ public abstract class NBTSchematicReader implements ClipboardReader {
|
||||
|
||||
return expected.cast(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldedit.extent.clipboard.io.legacycompat;
|
||||
|
||||
import com.sk89q.jnbt.Tag;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
|
@ -26,7 +26,6 @@ import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
@ -35,8 +35,8 @@ import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.LocatedBlock;
|
||||
import com.sk89q.worldedit.util.collection.TupleArrayList;
|
||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.Deque;
|
||||
|
@ -19,15 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.validation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
@ -43,7 +41,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param extent the extent
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public BlockChangeLimiter(Extent extent, int limit) {
|
||||
super(extent);
|
||||
@ -53,7 +51,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
/**
|
||||
* Get the limit.
|
||||
*
|
||||
* @return the limit (>= 0) or -1 for no limit
|
||||
* @return the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
@ -62,7 +60,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
/**
|
||||
* Set the limit.
|
||||
*
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public void setLimit(int limit) {
|
||||
checkArgument(limit >= -1, "limit >= -1 required");
|
||||
|
@ -21,16 +21,13 @@ package com.sk89q.worldedit.extent.validation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
/**
|
||||
* Validates set data to prevent creating invalid blocks and such.
|
||||
|
@ -21,18 +21,14 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
/**
|
||||
* Handles various quirks when setting blocks, such as ice turning
|
||||
|
@ -21,15 +21,12 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* Automatically loads chunks when blocks are accessed.
|
||||
|
@ -21,22 +21,19 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.RunContext;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Implements "fast mode" which may skip physics, lighting, etc.
|
||||
*/
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.function;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class EditContext {
|
||||
|
||||
private Extent destination;
|
||||
|
@ -21,11 +21,9 @@ package com.sk89q.worldedit.function;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.mask.Mask2D;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Passes calls to {@link #apply(BlockVector2)} to the
|
||||
|
@ -21,12 +21,9 @@ package com.sk89q.worldedit.function;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Applies a {@link RegionFunction} to the first ground block.
|
||||
@ -40,7 +37,7 @@ public class GroundFunction implements LayerFunction {
|
||||
/**
|
||||
* Create a new ground function.
|
||||
*
|
||||
* @param mask a mask
|
||||
* @param mask a mask
|
||||
* @param function the function to apply
|
||||
*/
|
||||
public GroundFunction(Mask mask, RegionFunction function) {
|
||||
@ -90,6 +87,7 @@ public class GroundFunction implements LayerFunction {
|
||||
affected++;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,9 @@ package com.sk89q.worldedit.function;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Passes calls to {@link #apply(BlockVector3)} to the
|
||||
|
@ -21,14 +21,12 @@ package com.sk89q.worldedit.function.biome;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.FlatRegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Replaces the biome at the locations that this function is applied to.
|
||||
*/
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.function.factory;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
import com.sk89q.worldedit.function.Contextual;
|
||||
import com.sk89q.worldedit.function.EditContext;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
@ -27,9 +30,6 @@ import com.sk89q.worldedit.function.visitor.RegionVisitor;
|
||||
import com.sk89q.worldedit.regions.NullRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
public class Apply implements Contextual<Operation> {
|
||||
|
||||
private final Region region;
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.function.factory;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
@ -34,9 +37,6 @@ import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
public class Deform implements Contextual<Operation> {
|
||||
|
||||
private Extent destination;
|
||||
|
@ -20,14 +20,12 @@
|
||||
package com.sk89q.worldedit.function.generator;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
|
@ -20,15 +20,13 @@
|
||||
package com.sk89q.worldedit.function.generator;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
|
||||
/**
|
||||
* Generates forests by searching for the ground starting from the given upper Y
|
||||
|
@ -21,14 +21,13 @@ package com.sk89q.worldedit.function.generator;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.Random;
|
||||
|
@ -58,4 +58,4 @@ public abstract class AbstractExtentMask extends AbstractMask {
|
||||
this.extent = extent;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -30,8 +30,6 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Tests true if the biome at applied points is the same as the one given.
|
||||
*/
|
||||
|
@ -25,8 +25,6 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
/**
|
||||
* Has the criteria where the Y value of passed positions must be within
|
||||
* a certain range of Y values (inclusive).
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -21,16 +21,14 @@ package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.internal.expression.runtime.EvaluationException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A mask that evaluates an expression.
|
||||
*
|
||||
|
@ -21,12 +21,10 @@ package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.internal.expression.runtime.EvaluationException;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ExpressionMask2D extends AbstractMask2D {
|
||||
|
||||
|
@ -28,8 +28,6 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Tests true if all contained masks test true.
|
||||
*/
|
||||
|
@ -27,9 +27,6 @@ import com.sk89q.worldedit.math.noise.NoiseGenerator;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A mask that uses a noise generator and returns true whenever the noise
|
||||
* generator returns a value above the given density.
|
||||
|
@ -25,9 +25,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.noise.NoiseGenerator;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A mask that uses a noise generator and returns true whenever the noise
|
||||
* generator returns a value above the given density.
|
||||
|
@ -23,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Checks whether another mask tests true for a position that is offset
|
||||
* a given vector.
|
||||
|
@ -26,8 +26,6 @@ import com.sk89q.worldedit.regions.Region;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A mask that tests whether given positions are contained within a region.
|
||||
*/
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.function.operation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Executes a delegete operation, but returns to another operation upon
|
||||
* completing the delegate.
|
||||
|
@ -53,7 +53,7 @@ import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@ -354,7 +354,18 @@ public class ForwardExtentCopy implements Operation {
|
||||
blockCopy = new RegionVisitor(region, copy, queue instanceof MappedFaweQueue ? (MappedFaweQueue) queue : null);
|
||||
}
|
||||
|
||||
List<? extends Entity> entities = isCopyingEntities() ? source.getEntities(region) : new ArrayList<>();
|
||||
List<? extends Entity> entities;
|
||||
if (isCopyingEntities()) {
|
||||
// filter players since they can't be copied
|
||||
entities = source.getEntities()
|
||||
.stream()
|
||||
.filter(entity -> entity.getState() != null &&
|
||||
entity.getState().getType().getId().equals("minecraft:player"))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
entities = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < repetitions; i++) {
|
||||
Operations.completeBlindly(blockCopy);
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.function.operation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
|
||||
@ -27,8 +29,6 @@ import java.util.Collection;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Executes multiple queues in order.
|
||||
*/
|
||||
|
@ -21,11 +21,9 @@ package com.sk89q.worldedit.function.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.FlatRegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Offsets the position parameter by adding a given offset vector.
|
||||
|
@ -21,11 +21,9 @@ package com.sk89q.worldedit.function.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Offsets the position parameter by adding a given offset vector.
|
||||
|
@ -21,12 +21,10 @@ package com.sk89q.worldedit.history.change;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.history.UndoContext;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
|
@ -20,8 +20,8 @@
|
||||
package com.sk89q.worldedit.history.change;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.history.changeset.ChangeSet;
|
||||
import com.sk89q.worldedit.history.UndoContext;
|
||||
import com.sk89q.worldedit.history.changeset.ChangeSet;
|
||||
|
||||
/**
|
||||
* Describes a change that can be undone or re-applied.
|
||||
|
@ -17,7 +17,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
package com.sk89q.worldedit.internal.annotation;
|
||||
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
@ -19,15 +19,17 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.command;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.Logging;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.util.command.parametric.AbstractInvokeListener;
|
||||
import com.sk89q.worldedit.util.command.parametric.InvokeHandler;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParameterData;
|
||||
@ -38,8 +40,6 @@ import java.lang.reflect.Method;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Logs called commands to a logger.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.command;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -33,8 +35,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Provides the names of connected users as suggestions.
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user