Merge pull request #293 from sk89q/visitor

Merge in WorldEdit 6.x branch -- contains breaking API changes
This commit is contained in:
Albert Pham 2014-04-03 19:21:17 -07:00
commit 8badc52a77
407 changed files with 31918 additions and 24199 deletions

323
pom.xml
View File

@ -1,16 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>5.7-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Project information -->
<!-- Fix encoding warnings -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!--
=====================================
Project Information
=====================================
-->
<name>WorldEdit</name>
<inceptionYear>2010</inceptionYear>
<url>http://wiki.sk89q.com/wiki/WorldEdit</url>
<description>A voxel map editor for Minecraft with tools for adventure map designers,
server administrators, and anyone who enjoys building massive structures.</description>
<description>An in-game voxel map editor for Minecraft.</description>
<licenses>
<license>
@ -33,8 +43,8 @@
</issueManagement>
<ciManagement>
<system>Jenkins</system>
<url>http://build.sk89q.com</url>
<system>TeamCity</system>
<url>http://builds.enginehub.org</url>
</ciManagement>
<scm>
@ -51,11 +61,19 @@
</mailingList>
</mailingLists>
<!--
=====================================
Distribution Management
=====================================
-->
<distributionManagement>
<site>
<id>sk89q-docs-upload</id>
<url>ftp://sk89q-maven-deploy/worldedit/</url>
</site>
<!-- The CI server uses these -->
<repository>
<id>maven.sk89q.com</id>
<url>http://maven.sk89q.com/artifactory/libs-release-local</url>
@ -66,90 +84,88 @@
</snapshotRepository>
</distributionManagement>
<properties> <!-- Fix encoding warnings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!--
=====================================
Dependencies
=====================================
-->
<repositories>
<repository>
<id>sk89q-repo</id>
<id>maven.sk89q.com</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency> <!-- Used for snapshots -->
<!-- Used for snapshots -->
<dependency>
<groupId>de.schlichtherle</groupId>
<artifactId>truezip</artifactId>
<version>6.8.3</version>
<scope>compile</scope>
<scope>compile</scope> <!-- optional runtime dependency -->
<type>jar</type>
</dependency>
<dependency> <!-- Used for CraftScripts -->
<!-- Used for scripting -->
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.7R2</version>
<scope>compile</scope>
<scope>compile</scope> <!-- optional runtime dependency -->
<type>jar</type>
</dependency>
<dependency> <!-- Time format detection -->
<groupId>com.sk89q</groupId>
<artifactId>jchronic</artifactId> <!-- not original library -->
<version>0.2.4a</version>
<scope>compile</scope>
<!-- YAML processing -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.9</version>
<type>jar</type>
<scope>compile</scope> <!-- optional runtime dependency -->
<optional>true</optional>
</dependency>
<!-- It's Guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0.1</version> <!-- Bukkit only bundles 10.0.1 -->
<scope>compile</scope> <!-- required runtime dependency -->
<type>jar</type>
</dependency>
<!-- Used for Permissions support (this version has both the legacy API
and the new Permissions API to compile against -->
<!-- Used for time operations -->
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>dummypermscompat</artifactId>
<version>1.7</version>
<scope>compile</scope>
<artifactId>jchronic</artifactId> <!-- not the original library -->
<version>0.2.4a</version>
<scope>compile</scope> <!-- shaded -->
<type>jar</type>
<optional>true</optional> <!-- Don't export -->
</dependency>
<dependency> <!-- Bukkit implementation -->
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.2-R0.2</version>
<scope>compile</scope>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency> <!-- NMS blocks -->
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.7.5-R0.1-SNAPSHOT</version>
<scope>compile</scope>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency> <!-- Unit tests -->
<!-- Unit tests -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.0-rc1</version>
<scope>test</scope>
<type>jar</type>
</dependency>
</dependencies>
<!--
=====================================
Build
=====================================
-->
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>${basedir}/src/main/java/</sourceDirectory>
<extensions> <!-- Used for uploading the docs -->
<!-- Used for uploading the docs -->
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
@ -157,34 +173,29 @@
</extension>
</extensions>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
<resource>
<targetPath>defaults/</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>config.yml</include>
</includes>
</resource>
<resource> <!-- NMS support in Bukkit -->
<targetPath>nmsblocks/</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources/nmsblocks/</directory>
<includes>
<include>*.class</include>
</includes>
</resource>
</resources>
<plugins>
<!-- Add source folder -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/legacy/java/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -195,6 +206,7 @@
</configuration>
</plugin>
<!-- JAR plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@ -216,6 +228,7 @@
</configuration>
</plugin>
<!-- Assembly builds .zip, etc. -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
@ -233,6 +246,7 @@
</executions>
</plugin>
<!-- Shades -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
@ -254,6 +268,7 @@
</executions>
</plugin>
<!-- Release plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
@ -265,6 +280,7 @@
</configuration>
</plugin>
<!-- Test runner -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@ -276,12 +292,14 @@
</configuration>
</plugin>
<!-- Site builder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<configuration>
<reportPlugins>
<!-- Project information -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
@ -296,6 +314,7 @@
</reportSets>
</plugin>
<!-- Javadocs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@ -307,8 +326,140 @@
</plugins>
</build>
<!--
=====================================
Profiles
=====================================
-->
<profiles>
<!-- Build WorldEdit for MC-Forge -->
<!--
=====================================
Bukkit
=====================================
-->
<profile>
<id>bukkit</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<!-- Used for Permissions support (this version has both the legacy API
and the new Permissions API to compile against -->
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>dummypermscompat</artifactId>
<version>1.7</version>
<scope>compile</scope>
<type>jar</type>
<optional>true</optional>
</dependency>
<!-- Bukkit implementation -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.2-R0.2</version>
<scope>compile</scope>
<type>jar</type>
<optional>true</optional>
</dependency>
<!-- NMS blocks -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.7.5-R0.1-SNAPSHOT</version>
<scope>compile</scope>
<type>jar</type>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<resources>
<!-- Bukkit plugin.yml -->
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/bukkit/resources/</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
<!-- Default files -->
<resource>
<targetPath>defaults/</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/bukkit/resources/</directory>
<includes>
<include>config.yml</include>
</includes>
</resource>
<!-- NMS support in Bukkit -->
<resource>
<targetPath>nmsblocks/</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/bukkit/resources/nmsblocks/</directory>
<includes>
<include>*.class</include>
</includes>
</resource>
</resources>
<plugins>
<!-- Add source folder -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-bukkit-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/bukkit/java/</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-bukkit-test-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/bukkit-test/java/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
=====================================
Forge
=====================================
-->
<profile>
<id>forge</id>
<build>
@ -341,7 +492,11 @@
</build>
</profile>
<!-- Attach javadocs and source .jars -->
<!--
=====================================
Attach docs and source
=====================================
-->
<profile>
<id>attach-docs</id>
@ -378,7 +533,11 @@
</build>
</profile>
<!-- Build Spout, disabled by default because it always breaks -->
<!--
=====================================
Spout (BROKEN)
=====================================
-->
<profile>
<id>spout</id>
@ -422,7 +581,7 @@
<version>1.5</version>
<executions>
<execution>
<id>add-sources</id>
<id>add-spout-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>

View File

@ -28,7 +28,7 @@ import com.sk89q.worldedit.PlayerNeededException;
import com.sk89q.worldedit.ServerInterface;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.extent.inventory.BlockBag;
public class BukkitCommandSender extends LocalPlayer {
private CommandSender sender;

View File

@ -32,8 +32,8 @@ import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.ServerInterface;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.cui.CUIEvent;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.internal.cui.CUIEvent;
public class BukkitPlayer extends LocalPlayer {
private Player player;

View File

@ -22,7 +22,7 @@ package com.sk89q.worldedit.bukkit;
import com.sk89q.worldedit.WorldVector;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.sk89q.worldedit.bags.*;
import com.sk89q.worldedit.extent.inventory.*;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.BlockID;

View File

@ -19,83 +19,33 @@
package com.sk89q.worldedit.bukkit;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.EntityType;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.*;
import com.sk89q.worldedit.blocks.ContainerBlock;
import com.sk89q.worldedit.blocks.NoteBlock;
import com.sk89q.worldedit.bukkit.entity.BukkitEntity;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator;
import org.bukkit.*;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.SkullType;
import org.bukkit.TreeType;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.block.Furnace;
import org.bukkit.block.Sign;
import org.bukkit.block.Skull;
import org.bukkit.block.*;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Ambient;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Boat;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Golem;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Item;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.Villager;
import org.bukkit.entity.*;
import org.bukkit.inventory.DoubleChestInventory;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import com.sk89q.worldedit.BiomeType;
import com.sk89q.worldedit.BlockVector2D;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.EntityType;
import com.sk89q.worldedit.LocalEntity;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.Vector2D;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.ContainerBlock;
import com.sk89q.worldedit.blocks.FurnaceBlock;
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
import com.sk89q.worldedit.blocks.NoteBlock;
import com.sk89q.worldedit.blocks.SignBlock;
import com.sk89q.worldedit.blocks.SkullBlock;
import com.sk89q.worldedit.bukkit.entity.BukkitEntity;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class BukkitWorld extends LocalWorld {
@ -1355,8 +1305,15 @@ public class BukkitWorld extends LocalWorld {
return super.getBlock(pt);
}
@SuppressWarnings("deprecation")
@Override
public boolean setBlock(Vector pt, com.sk89q.worldedit.foundation.Block block, boolean notifyAdjacent) {
public BaseBlock getLazyBlock(Vector position) {
Block bukkitBlock = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
return new LazyBlock(bukkitBlock.getTypeId(), bukkitBlock.getData(), this, position);
}
@Override
public boolean setBlock(Vector pt, BaseBlock block, boolean notifyAdjacent) {
if (!skipNmsSafeSet) {
try {
return (Boolean) nmsSetSafeMethod.invoke(null, this, pt, block, notifyAdjacent);

View File

@ -22,7 +22,7 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.data.DataException;
import com.sk89q.worldedit.world.DataException;
import com.sk89q.worldedit.foundation.Block;
import net.minecraft.server.v1_7_R2.*;
import org.bukkit.World;

View File

@ -19,40 +19,29 @@
package com.sk89q.worldedit.bukkit;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Handler;
import java.util.zip.ZipEntry;
import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.wepif.PermissionsResolverManager;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import com.sk89q.worldedit.bukkit.selections.Polygonal2DSelection;
import com.sk89q.worldedit.bukkit.selections.Selection;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Polygonal2DRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.selector.RegionSelector;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.wepif.PermissionsResolverManager;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.ServerInterface;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditOperation;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import com.sk89q.worldedit.bukkit.selections.Polygonal2DSelection;
import com.sk89q.worldedit.bukkit.selections.Selection;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Polygonal2DRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import java.io.*;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Handler;
import java.util.zip.ZipEntry;
/**
* Plugin for Bukkit.

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.bukkit.selections;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
import org.bukkit.Location;
import org.bukkit.World;
import com.sk89q.worldedit.Vector;

View File

@ -23,6 +23,8 @@ import java.util.Collections;
import java.util.List;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
import org.bukkit.World;
import com.sk89q.worldedit.BlockVector2D;
import com.sk89q.worldedit.bukkit.BukkitUtil;

View File

@ -19,13 +19,14 @@
package com.sk89q.worldedit.bukkit.selections;
import static com.sk89q.worldedit.bukkit.BukkitUtil.toLocation;
import static com.sk89q.worldedit.bukkit.BukkitUtil.toVector;
import org.bukkit.Location;
import org.bukkit.World;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
import org.bukkit.Location;
import org.bukkit.World;
import static com.sk89q.worldedit.bukkit.BukkitUtil.toLocation;
import static com.sk89q.worldedit.bukkit.BukkitUtil.toVector;
public abstract class RegionSelection implements Selection {

View File

@ -22,7 +22,7 @@ package com.sk89q.worldedit.bukkit.selections;
import org.bukkit.Location;
import org.bukkit.World;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
public interface Selection {
/**

View File

@ -10,8 +10,8 @@ import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.cui.CUIEvent;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.internal.cui.CUIEvent;
public class ForgePlayer extends LocalPlayer {
private EntityPlayerMP player;

View File

@ -6,8 +6,8 @@ import com.sk89q.worldedit.Location;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.forge.WorldEditMod;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.CuboidRegionSelector;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
public class CuboidSelection extends RegionSelection {
protected CuboidRegion cuboid;

View File

@ -8,8 +8,8 @@ import net.minecraft.world.World;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.forge.WorldEditMod;
import com.sk89q.worldedit.regions.Polygonal2DRegion;
import com.sk89q.worldedit.regions.Polygonal2DRegionSelector;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
public class Polygonal2DSelection extends RegionSelection {
protected Polygonal2DRegion poly2d;

View File

@ -8,7 +8,7 @@ import com.sk89q.worldedit.Location;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.forge.WorldEditMod;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
public abstract class RegionSelection implements Selection {
private WeakReference<World> world;

View File

@ -4,7 +4,7 @@ import net.minecraft.world.World;
import com.sk89q.worldedit.Location;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
public abstract interface Selection {
public abstract Location getMinimumPoint();

View File

@ -0,0 +1,27 @@
/*
* 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.data;
/**
* @deprecated Switch to {@link com.sk89q.worldedit.world.DataException}
*/
@Deprecated
public class DataException extends com.sk89q.worldedit.world.DataException {
}

View File

@ -0,0 +1,41 @@
// $Id$
/*
* This file is a part of WorldEdit.
* Copyright (c) sk89q <http://www.sk89q.com>
* Copyright (c) the 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
* (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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.foundation;
import com.sk89q.worldedit.blocks.BaseBlock;
/**
* @deprecated Use {@link BaseBlock}
*/
@Deprecated
public abstract class Block {
public abstract int getId();
public abstract void setId(int id);
public abstract int getData();
public abstract void setData(int data);
public abstract void setIdAndData(int id, int data);
public abstract boolean hasWildcardData();
}

View File

@ -4,8 +4,13 @@ import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
/**
* @deprecated Switch to {@link com.sk89q.worldedit.function.mask.AbstractMask}
*/
@Deprecated
public abstract class AbstractMask implements Mask {
@Override
public void prepare(LocalSession session, LocalPlayer player, Vector target) {
}
}

View File

@ -1,14 +1,19 @@
package com.sk89q.worldedit.masks;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
/**
* @deprecated Use {@link com.sk89q.worldedit.function.mask.BlockMask}
*/
@Deprecated
public class BlockMask extends AbstractMask {
private final Set<BaseBlock> blocks;
public BlockMask() {
@ -19,6 +24,13 @@ public class BlockMask extends AbstractMask {
this.blocks = types;
}
public BlockMask(BaseBlock... block) {
blocks = new HashSet<BaseBlock>();
for (BaseBlock b : block) {
add(b);
}
}
public BlockMask(BaseBlock block) {
this();
add(block);
@ -35,7 +47,8 @@ public class BlockMask extends AbstractMask {
@Override
public boolean matches(EditSession editSession, Vector pos) {
BaseBlock block = editSession.getBlock(pos);
return blocks.contains(block)
return blocks.contains(block)
|| blocks.contains(new BaseBlock(block.getType(), -1));
}
}
}

View File

@ -19,13 +19,19 @@
package com.sk89q.worldedit.masks;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.function.mask.MaskIntersection;
import java.util.ArrayList;
import java.util.List;
/**
* @deprecated See {@link MaskIntersection}
*/
@Deprecated
public class CombinedMask extends AbstractMask {
private final List<Mask> masks = new ArrayList<Mask>();
@ -33,7 +39,13 @@ public class CombinedMask extends AbstractMask {
}
public CombinedMask(Mask mask) {
masks.add(mask);
add(mask);
}
public CombinedMask(Mask ...mask) {
for (Mask m : mask) {
add(m);
}
}
public CombinedMask(List<Mask> masks) {

View File

@ -1,13 +1,14 @@
package com.sk89q.worldedit.masks;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.request.RequestSelection;
public class DynamicRegionMask implements Mask {
/**
* @deprecated Use {@link RequestSelection} with {@link com.sk89q.worldedit.function.mask.RegionMask}
*/
@Deprecated
public class DynamicRegionMask extends AbstractMask {
private Region region;
@Override

View File

@ -23,6 +23,10 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BlockID;
/**
* @deprecated See {@link com.sk89q.worldedit.function.mask.ExistingBlockMask}
*/
@Deprecated
public class ExistingBlockMask extends AbstractMask {
@Override
public boolean matches(EditSession editSession, Vector pos) {

View File

@ -0,0 +1,64 @@
/*
* 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.masks;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import java.util.HashSet;
import java.util.Set;
/**
* @deprecated See {@link com.sk89q.worldedit.function.mask.FuzzyBlockMask}
*/
@Deprecated
public class FuzzyBlockMask extends AbstractMask {
private final Set<BaseBlock> filter;
/**
* Create a new fuzzy block mask.
*
* @param filter a list of block types to match
*/
public FuzzyBlockMask(Set<BaseBlock> filter) {
this.filter = filter;
}
/**
* Create a new fuzzy block mask.
*
* @param block a list of block types to match
*/
public FuzzyBlockMask(BaseBlock... block) {
Set<BaseBlock> filter = new HashSet<BaseBlock>();
for (BaseBlock b : block) {
filter.add(b);
}
this.filter = filter;
}
@Override
public boolean matches(EditSession editSession, Vector pos) {
BaseBlock compare = new BaseBlock(editSession.getBlockType(pos), editSession.getBlockData(pos));
return BaseBlock.containsFuzzy(filter, compare);
}
}

View File

@ -4,7 +4,12 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.function.mask.Masks;
/**
* @deprecated See {@link Masks#negate(com.sk89q.worldedit.function.mask.Mask)}
*/
@Deprecated
public class InvertedMask extends AbstractMask {
private final Mask mask;

View File

@ -25,13 +25,9 @@ import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
/**
* Base matcher for the block filtering framework. Implementing classes
* can be used to filter blocks to set or replace.
* <p>
* <u>Do NOT</u> implement this interface. Extend {@link AbstractMask} instead.
*
* @author sk89q
* @deprecated Use {@link com.sk89q.worldedit.function.mask.Mask}
*/
@Deprecated
public interface Mask {
/**

View File

@ -2,7 +2,12 @@ package com.sk89q.worldedit.masks;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.function.mask.NoiseFilter;
/**
* @deprecated See {@link NoiseFilter}
*/
@Deprecated
public class RandomMask extends AbstractMask {
private final double ratio;

View File

@ -23,6 +23,10 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.regions.Region;
/**
* @deprecated See {@link com.sk89q.worldedit.function.mask.RegionMask}
*/
@Deprecated
public class RegionMask extends AbstractMask {
private final Region region;

View File

@ -5,8 +5,9 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BlockType;
/**
* Works like {@link ExistingBlockMask}, except also dealing with non-solid non-air blocks the same way as with air.
* @deprecated See {@link com.sk89q.worldedit.function.mask.SolidBlockMask}
*/
@Deprecated
public class SolidBlockMask extends AbstractMask {
@Override
public boolean matches(EditSession editSession, Vector pos) {

View File

@ -19,18 +19,21 @@
package com.sk89q.worldedit.masks;
import java.util.Set;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.function.mask.MaskIntersection;
import com.sk89q.worldedit.function.mask.Masks;
import com.sk89q.worldedit.function.mask.OffsetMask;
import java.util.Set;
/**
*
* @author 1337
* @deprecated Use {@link OffsetMask} with {@link MaskIntersection} and {@link Masks#negate(com.sk89q.worldedit.function.mask.Mask)}
*/
@Deprecated
public class UnderOverlayMask extends AbstractMask {
private final int yMod;
private Mask mask;

View File

@ -22,10 +22,9 @@ package com.sk89q.worldedit.patterns;
import com.sk89q.worldedit.blocks.BaseBlock;
/**
* Gives a block a chance.
*
* @author sk89q
* @deprecated Will be removed in the future -- there is no replacement
*/
@Deprecated
public class BlockChance {
/**
* Block.

View File

@ -23,11 +23,9 @@ import com.sk89q.worldedit.*;
import com.sk89q.worldedit.blocks.BaseBlock;
/**
* Used to get the block to set. This can be used to implement a pattern
* for when setting a region with blocks.
*
* @author sk89q
* @deprecated See {@link com.sk89q.worldedit.function.pattern.Pattern}
*/
@Deprecated
public interface Pattern {
/**
* Get a block for a position. This return value of this method does

View File

@ -19,17 +19,18 @@
package com.sk89q.worldedit.patterns;
import java.util.Random;
import java.util.List;
import java.util.ArrayList;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.function.pattern.RandomPattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Pattern proportionally fills.
*
* @author sk89q
* @deprecated See {@link RandomPattern}
*/
@Deprecated
public class RandomFillPattern implements Pattern {
/**
* Random number generator.

View File

@ -21,12 +21,12 @@ package com.sk89q.worldedit.patterns;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.function.pattern.BlockPattern;
/**
* Always returns the same block type.
*
* @author sk89q
* @deprecated See {@link BlockPattern}
*/
@Deprecated
public class SingleBlockPattern implements Pattern {
/**
* Block type.

View File

@ -2,20 +2,7 @@ package com.sk89q.jnbt;
import java.util.Map;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.ByteTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.DoubleTag;
import com.sk89q.jnbt.EndTag;
import com.sk89q.jnbt.FloatTag;
import com.sk89q.jnbt.IntTag;
import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.LongTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.jnbt.ShortTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.data.InvalidFormatException;
import com.sk89q.worldedit.world.storage.InvalidFormatException;
/*
* JNBT License

View File

@ -30,9 +30,10 @@ import java.util.Map;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.data.DataException;
import com.sk89q.worldedit.world.DataException;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.schematic.SchematicFormat;
import com.sk89q.worldedit.util.Countable;
/**
* The clipboard remembers the state of a cuboid region.

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +1,75 @@
/*
* 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extent.inventory.BlockBag;
/**
* @deprecated To wrap {@link EditSession}s, please hook into {@link EditSessionEvent}
*/
@Deprecated
public class EditSessionFactory {
/**
* Construct an edit session with a maximum number of blocks.
*
* @param world
* @param maxBlocks
* @param world the world
* @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit
*/
public EditSession getEditSession(LocalWorld world, int maxBlocks) {
return new EditSession(world, maxBlocks);
throw new IllegalArgumentException("This class is being removed");
}
/**
* Construct an edit session with a maximum number of blocks.
*
* @param world
* @param maxBlocks
* @param player
* @param world the world
* @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit
* @param player the player that the {@link EditSession} is for
*/
public EditSession getEditSession(LocalWorld world, int maxBlocks, LocalPlayer player) {
return this.getEditSession(world, maxBlocks);
throw new IllegalArgumentException("This class is being removed");
}
/**
* Construct an edit session with a maximum number of blocks and a block bag.
*
* @param world
* @param maxBlocks
* @param blockBag
* @param world the world
* @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit
* @param blockBag an optional {@link BlockBag} to use, otherwise null
*/
public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag) {
return new EditSession(world, maxBlocks, blockBag);
throw new IllegalArgumentException("This class is being removed");
}
/**
* Construct an edit session with a maximum number of blocks and a block bag.
*
* @param world
* @param maxBlocks
* @param blockBag
* @param player
* @param world the world
* @param maxBlocks the maximum number of blocks that can be changed, or -1 to use no limit
* @param blockBag an optional {@link BlockBag} to use, otherwise null
* @param player the player that the {@link EditSession} is for
*/
public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag, LocalPlayer player) {
return this.getEditSession(world, maxBlocks, blockBag);
throw new IllegalArgumentException("This class is being removed");
}
}

View File

@ -25,7 +25,7 @@ import java.util.Set;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.ItemID;
import com.sk89q.worldedit.snapshots.SnapshotRepository;
import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
/**
* Represents WorldEdit's configuration.

View File

@ -21,12 +21,12 @@ package com.sk89q.worldedit;
import java.io.File;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.blocks.ItemID;
import com.sk89q.worldedit.cui.CUIEvent;
import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.util.TargetBlock;
/**

View File

@ -19,28 +19,26 @@
package com.sk89q.worldedit;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.TimeZone;
import com.sk89q.jchronic.Chronic;
import com.sk89q.jchronic.Options;
import com.sk89q.jchronic.utils.Span;
import com.sk89q.jchronic.utils.Time;
import com.sk89q.worldedit.snapshots.Snapshot;
import com.sk89q.worldedit.tools.BrushTool;
import com.sk89q.worldedit.tools.SinglePickaxe;
import com.sk89q.worldedit.tools.BlockTool;
import com.sk89q.worldedit.tools.Tool;
import com.sk89q.worldedit.bags.BlockBag;
import com.sk89q.worldedit.cui.CUIRegion;
import com.sk89q.worldedit.cui.CUIEvent;
import com.sk89q.worldedit.cui.SelectionShapeEvent;
import com.sk89q.worldedit.command.tool.BlockTool;
import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.command.tool.SinglePickaxe;
import com.sk89q.worldedit.command.tool.Tool;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.internal.cui.CUIRegion;
import com.sk89q.worldedit.internal.cui.SelectionShapeEvent;
import com.sk89q.worldedit.masks.Mask;
import com.sk89q.worldedit.regions.CuboidRegionSelector;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.RegionSelector;
import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.world.snapshot.Snapshot;
import java.util.*;
/**
* An instance of this represents the WorldEdit session of a user. A session
@ -704,6 +702,7 @@ public class LocalSession {
.getEditSession(player.isPlayer() ? player.getWorld() : null,
getBlockChangeLimit(), blockBag, player);
editSession.setFastMode(fastMode);
Request.request().setEditSession(editSession);
if (mask != null) {
mask.prepare(this, player, null);
}

View File

@ -19,31 +19,26 @@
package com.sk89q.worldedit;
import java.util.PriorityQueue;
import java.util.Random;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.blocks.ChestBlock;
import com.sk89q.worldedit.blocks.DispenserBlock;
import com.sk89q.worldedit.blocks.FurnaceBlock;
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
import com.sk89q.worldedit.blocks.NoteBlock;
import com.sk89q.worldedit.blocks.SignBlock;
import com.sk89q.worldedit.blocks.SkullBlock;
import com.sk89q.worldedit.foundation.Block;
import com.sk89q.worldedit.foundation.World;
import com.sk89q.worldedit.blocks.*;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.function.mask.BlockMask;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator;
import javax.annotation.Nullable;
import java.util.PriorityQueue;
import java.util.Random;
/**
* Represents a world.
*
* @author sk89q
*/
public abstract class LocalWorld implements World {
public abstract class LocalWorld implements World, Extent {
/**
* Named flags to use as parameters to {@link LocalWorld#killMobs(Vector, double, int)}
*/
@ -97,6 +92,7 @@ public abstract class LocalWorld implements World {
* @param pt
* @return
*/
@Deprecated
public abstract int getBlockType(Vector pt);
/**
@ -166,6 +162,7 @@ public abstract class LocalWorld implements World {
* @param pt
* @return
*/
@Deprecated
public abstract int getBlockData(Vector pt);
/**
@ -530,7 +527,12 @@ public abstract class LocalWorld implements World {
}
@Override
public boolean setBlock(Vector pt, Block block, boolean notifyAdjacent) {
public boolean setBlock(Vector pt, BaseBlock block) {
return setBlock(pt, block, true);
}
@Override
public boolean setBlock(Vector pt, BaseBlock block, boolean notifyAdjacent) {
boolean successful;
// Default implementation will call the old deprecated methods
@ -547,6 +549,11 @@ public abstract class LocalWorld implements World {
return successful;
}
@Override
public BaseBlock getLazyBlock(Vector position) {
return getBlock(position);
}
@Override
public BaseBlock getBlock(Vector pt) {
checkLoadedChunk(pt);
@ -603,4 +610,34 @@ public abstract class LocalWorld implements World {
return new BaseBlock(type, data);
}
}
/**
* Create a mask that matches all liquids.
* </p>
* Implementations should override this so that custom liquids are supported.
*
* @return a mask
*/
public Mask createLiquidMask() {
return new BlockMask(this,
new BaseBlock(BlockID.STATIONARY_LAVA, -1),
new BaseBlock(BlockID.LAVA, -1),
new BaseBlock(BlockID.STATIONARY_WATER, -1),
new BaseBlock(BlockID.WATER, -1));
}
@Override
public Vector getMaximumPoint() {
return new Vector(30000000, 30000000, 30000000);
}
@Override
public Vector getMinimumPoint() {
return new Vector(-30000000, -30000000, -30000000);
}
@Override
public @Nullable Operation commit() {
return null;
}
}

Some files were not shown because too many files have changed in this diff Show More