Merge remote-tracking branch 'refs/remotes/isfawe/new-vector-system' into new-vector-system

This commit is contained in:
IronApollo 2019-01-13 02:00:14 -05:00
commit f74381b93f
214 changed files with 1720 additions and 2063 deletions

1
.gitignore vendored
View File

@ -10,7 +10,6 @@ eclipse
bin bin
build build
target target
gradle
.gradle .gradle
forge-download forge-download
out out

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
Compiling Compiling
========= =========
You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 7 or newer. You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 8 or newer.
You only need one version of the JDK installed. You only need one version of the JDK installed.
The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with four modules: The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with four modules:

View File

@ -1,69 +0,0 @@
Contributing
============
Thank you for your interest in contributing to WorldEdit! We appreciate your
effort, but to make sure that the inclusion of your patch is a smooth process, we
ask that you make note of the following guidelines.
* **Follow the [Oracle coding conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html).**
We can't stress this enough; if your code has notable issues, it may delay
the process significantly.
* **Target Java 7 for source and compilation.** Make sure to mark methods with
` @Override` that override methods of parent classes, or that implement
methods of interfaces.
* **Use only spaces for indentation.** Our indents are 4-spaces long, and tabs
are unacceptable.
* **Wrap code to a 120 column limit.** We do this to make side by side diffs
and other such tasks easier. Ignore this guideline if it makes the code
too unreadable.
* **Write complete Javadocs.** Do so only for public methods, and make sure
that your `@param` and `@return` fields are not just blank.
* **Don't tag classes with @author.** Some legacy classes may have this tag,
but we are phasing it out.
* **Make sure the code is efficient.** One way you can achieve this is to spend
around ten minutes to think about what the code is doing and whether it
seems awfully roundabout. If you had to copy the same large piece of
code in several places, that's bad.
* **Keep commit summaries under 70 characters.** For more details, place two
new lines after the summary line and write away!
* **Test your code.** We're not interested in broken code, for the obvious reasons.
* **Write unit tests.** While this is strictly optional, we recommend it for
complicated algorithms.
Checklist
---------
Ready to submit? Perform the checklist below:
1. Have all tabs been replaced into four spaces? Are indentations 4-space wide?
2. Have I written proper Javadocs for my public methods? Are the @param and
@return fields actually filled out?
3. Have I `git rebase`d my pull request to the latest commit of the target
branch?
4. Have I combined my commits into a reasonably small number (if not one)
commit using `git rebase`?
5. Have I made my pull request too large? Pull requests should introduce
small sets of changes at a time. Major changes should be discussed with
the team prior to starting work.
6. Are my commit messages descriptive?
You should be aware of [`git rebase`](http://learn.github.com/p/rebasing.html).
It allows you to modify existing commit messages, and combine, break apart, or
adjust past changes.
Example
-------
This is **GOOD:**
if (var.func(param1, param2)) {
// do things
}
This is **EXTREMELY BAD:**
if(var.func( param1, param2 ))
{
// do things
}

16
HEADER.txt Normal file
View File

@ -0,0 +1,16 @@
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/>.

View File

@ -1,197 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>${project.name} ${version}</title>
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Ropa+Sans" rel="stylesheet" type="text/css">
<style>
body {
margin: 0;
padding: 3em 1em;
background: #efefef;
color: #333;
line-height: 1.5;
}
#wrapper {
width: 600px;
margin: auto;
}
body, th, td, input {
font: 14px 'Source Sans Pro', Arial, sans-serifsans-serif;
}
.section {
background: #fff;
position: relative;
padding: 2em 2.4em;
margin: 3em auto 4em auto;
width: 80%;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.section:before, .section:after {
content: "";
position: absolute;
z-index: -2;
}
.section {
-moz-border-radius: 4px;
border-radius: 4px;
}
.section:before, .section:after {
bottom: 15px;
left: 10px;
width: 50%;
height: 20%;
max-width: 300px;
max-height: 100px;
-webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
-webkit-transform: rotate(-1deg);
-moz-transform: rotate(-1deg);
-ms-transform: rotate(-1deg);
-o-transform: rotate(-1deg);
transform: rotate(-1deg);
}
.section:after {
right: 10px;
left: auto;
-webkit-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);
-o-transform: rotate(1deg);
transform: rotate(1deg);
}
a:link, a:visited {
color: #0004b2;
text-decoration: none;
}
a:hover {
color: #ac0000;
text-decoration: none;
border-bottom: 1px solid #999;
}
h1 {
font: 2.7em 'Ropa Sans', 'Trebuchet MS', Helvetica, Arial, sans-serif;
color: #000;
margin: 0 0;
padding: 0 0 0.2em 0;
font-weight: normal;
text-align: center;
text-shadow: 2px 2px #FFF;
}
h2 {
font-size: 1.3em;
color: #FFF;
margin: -2.5em 0 0.8em 0;
float: left;
background: #FF6900;
padding: 0.4em 0.8em;
border-radius: 0.2em;
font-weight: normal;
text-align: center;
}
h3 {
text-transform: uppercase;
font-weight: bold;
}
h2 + * {
clear: both;
}
@media (max-width: 650px) {
#wrapper {
width: 100%;
}
}
</style>
</head>
<body>
<div id="wrapper">
<h1>${project.name} ${version}</h1>
<div class="section">
<h2>Getting Started</h2>
<p>
Thanks for choosing ${project.name}! When you first install ${project.name},
no one will be able to do anything until you give permissions (unless everyone is an op).
Because ${project.name} is largely command-driven, it has no effect until
someone uses its commands, you can install WorldEdit and deal with
configuration whenever you are ready.
</p>
<ul>
<li><a href="http://wiki.sk89q.com/wiki/${project.name}/Installation">How do I install ${project.name}?</a></li>
<li><a href="http://wiki.sk89q.com/wiki/${project.name}/Upgrading">How do I update ${project.name}?</a></li>
<li><a href="http://wiki.sk89q.com/wiki/${project.name}#Usage">How do I use ${project.name}?</a></li>
</ul>
<p>
Need help?
<a href="http://wiki.sk89q.com/wiki/${project.name}/Support">See the ways that you can get assistance</a>.
</p>
</div>
<div class="section">
<h2>Common Issues</h2>
<h3>I or others don't have permission to build.</h3>
<p>
This is not a problem caused by ${project.name}.
${project.name} doesn't deny build permissions as it is merely
a world editing program.
</p>
<h3>${project.name} doesn't seem to work.</h3>
<p>
A common mistake is making
a syntax error in one of ${project.name}'s configuration files (this is very
fatal unfortunately, and can be caused by a single character typed in the wrong place). Try
<a href="http://wiki.sk89q.com/wiki/${project.name}/Support">asking in IRC</a>
to see whether anyone can help you.
</p>
<h3>Can I use this with mod blocks?</h3>
<p>
Yes, <a href="http://wiki.sk89q.com/wiki/WorldEdit/Introduction#Block_support">depending on what you are using WorldEdit with</a>
(Bukkit, Single Player Commands, MinecraftEdu, etc.). We don't guarantee
100% compatibility with all known custom blocks,
<a href="http://www.youtube.com/watch?v=FkCtjBL-7vs">but we have pretty
decent support</a>. Please be aware that support for these mods is
considered 'experimental,' and will likely be for the far forseeable
future.
</p>
<h3>How do I protect my spawn?</h3>
<p>
You'll have to install our accompanying WorldGuard plugin, which works
in conjunction with ${project.name} in order to protect areas. With it,
you can make a selection with WorldEdit and then 'define' a region
that prevents other from building in it.
</p>
<h3>Can I use ${project.name}'s selections in my Bukkit plugin?</h3>
<p>
Absolutely! We haven't documented how to yet, but you can try
looking at the <a href="http://docs.sk89q.com/worldedit/apidocs/com/sk89q/worldedit/bukkit/WorldEditPlugin.html">Javadocs</a>
for the plugin's main class. You'll have to get a reference to WorldEdit
from Bukkit's plugin manager (don't try to create WorldEditPlugin), and then
call one of its selection methods.
</p>
<p>
Still need help?
<a href="http://wiki.sk89q.com/wiki/${project.name}/Support">See the ways that you can get assistance</a>.
</p>
</div>
<div class="section">
<h2>Contributing</h2>
<p>
Did you know that ${project.name} is open source? That means that you can
read the code and learn from it, as well as modify it and submit back
changes to help the community!
</p>
<ul>
<li><a href="https://github.com/sk89q/worldedit">View the source code</a></li>
<li><a href="http://wiki.sk89q.com/wiki/${project.name}/Development">More information</a></li>
</ul>
</div>
</div>
</body>
</html>

View File

@ -6,15 +6,23 @@
FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features
It is available for Bukkit, Forge, Sponge and Nukkit. ## Links
## Chat * [Spigot Page](https://www.spigotmc.org/threads/fast-async-worldedit.100104/)
### - **`> `**[`Discord`](https://discord.gg/ngZCzbU)`|`[`IRC`](http://webchat.esper.net/?nick=&channels=IntellectualCrafters)` | `[`Spigot Forums`](https://www.spigotmc.org/threads/fast-async-worldedit.100104/)**` <`** * [Discord](https://discord.gg/ngZCzbU)
* [Wiki](https://github.com/boy0001/FastAsyncWorldedit/wiki)
* [Report Issue](https://github.com/boy0001/FastAsyncWorldedit/issues/new)
## Releases ## Downloads
### 1.13+
* [Download](https://empcraft.com/fawe/download/?bukkit113)
* [Jenkins](https://ci.athion.net/job/FAWE-1.13/)
### <1.12.2
* [Download](https://empcraft.com/fawe/download/?bukkit)
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit/)
* [Repository](https://github.com/boy0001/FastAsyncWorldedit)
### - [**`> Download <`**](https://empcraft.com/fawe/download/)
### - [**`> Jenkins <`**](https://ci.athion.net/job/FAWE-1.13/)
## Building ## Building
FAWE uses gradle to build FAWE uses gradle to build
@ -26,6 +34,6 @@ $ gradlew build
## Contributing ## Contributing
Have an idea for an optimization, or a cool feature? Have an idea for an optimization, or a cool feature?
- I'll accept most PR's - We will accept most PR's
- Let me know what you've tested / what may need further testing - Let us know what you've tested / what may need further testing
- If you need any help, create a ticket or discuss on Discord - If you need any help, create a ticket or discuss on [Discord](https://discord.gg/ngZCzbU)

View File

@ -1,7 +1,6 @@
print new File('splash.txt').text
buildscript { buildscript {
repositories { repositories {
mavenLocal()
mavenCentral() mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter() jcenter()
@ -15,16 +14,24 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
classpath 'org.ajoberstar:gradle-git:1.5.1' classpath 'org.ajoberstar:gradle-git:1.7.2'
} }
} }
plugins {
id 'net.minecrell.licenser' version '0.4.1' apply false
}
apply plugin: 'java' apply plugin: 'java'
clean { delete "target" } clean { delete "target" }
print new File('splash.txt').text
group = 'com.boydti.fawe' group = 'com.boydti.fawe'
def rootVersion = "1.13"
def revision = "" def revision = ""
def buildNumber = "" def buildNumber = ""
def date = "" def date = ""
@ -33,13 +40,13 @@ ext {
git = org.ajoberstar.grgit.Grgit.open(file(".git")) git = org.ajoberstar.grgit.Grgit.open(file(".git"))
date = git.head().date.format("yy.MM.dd") date = git.head().date.format("yy.MM.dd")
revision = "-${git.head().abbreviatedId}" revision = "-${git.head().abbreviatedId}"
index = 0; // Offset to match CI index = -1960; // Offset to match CI
parents = git.head().parentIds; parents = git.head().parentIds;
for (; parents != null && !parents.isEmpty(); index++) { for (; parents != null && !parents.isEmpty(); index++) {
commit = git.getResolve().toCommit(parents.get(0)); commit = git.getResolve().toCommit(parents.get(0));
parents = commit.getParentIds() parents = commit.getParentIds()
} }
buildNumber = "-${index}" buildNumber = "${index}"
} catch (Throwable ignore) { } catch (Throwable ignore) {
revision = "-unknown" revision = "-unknown"
} }
@ -48,7 +55,7 @@ ext {
if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion
version = "unknown" version = "unknown"
} else { } else {
version = date + revision + buildNumber version = String.format("%s.%s", rootVersion, buildNumber)
} }
description = """FastAsyncWorldEdit""" description = """FastAsyncWorldEdit"""
@ -56,9 +63,8 @@ subprojects {
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'com.github.johnrengelman.shadow'
// Enable this requires putting license header files in many, many FAWE files
sourceCompatibility = 1.8 //apply plugin: 'net.minecrell.licenser'
targetCompatibility = 1.8
ext.internalVersion = version ext.internalVersion = version
@ -69,25 +75,32 @@ subprojects {
repositories { repositories {
mavenCentral() mavenCentral()
maven { url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/" }
maven { url "http://repo.bukkit.org/content/groups/public" } maven { url "http://repo.bukkit.org/content/groups/public" }
maven { url "http://maven.sk89q.com/repo/" } maven { url "http://maven.sk89q.com/repo/" }
maven { url "http://repo.maven.apache.org/maven2" } maven { url "http://repo.maven.apache.org/maven2" }
// Fawe // Fawe
maven {url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/"}
maven {url "https://mvnrepository.com/artifact/"} maven {url "https://mvnrepository.com/artifact/"}
maven {url "http://repo.dmulloy2.net/content/groups/public/"} maven {url "http://repo.dmulloy2.net/content/groups/public/"}
maven {url "https://repo.destroystokyo.com/repository/maven-public//"} maven {url "https://repo.destroystokyo.com/repository/maven-public//"}
maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"} maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"}
mavenLocal()
maven {url "http://empcraft.com/maven2"} maven {url "http://empcraft.com/maven2"}
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"} maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
maven {url "http://ci.frostcast.net/plugin/repository/everything"} maven {url "http://ci.frostcast.net/plugin/repository/everything"}
maven {url "http://maven.sk89q.com/artifactory/repo"} maven {url "http://maven.sk89q.com/artifactory/repo"}
maven {url "http://repo.spongepowered.org/maven"} maven {url "http://repo.spongepowered.org/maven"}
maven {url "https://repo.inventivetalent.org/content/groups/public/"}
maven {url "http://dl.bintray.com/tastybento/maven-repo"} maven {url "http://dl.bintray.com/tastybento/maven-repo"}
maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" } maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" }
} }
if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task javadocJar(type: Jar, dependsOn: javadoc) { task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc' classifier = 'javadoc'
from javadoc.destinationDir from javadoc.destinationDir
@ -95,6 +108,7 @@ subprojects {
artifacts { artifacts {
archives jar archives jar
archives javadocJar
} }
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) { if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
@ -122,4 +136,10 @@ subprojects {
exclude '.cache' exclude '.cache'
exclude 'LICENSE*' exclude 'LICENSE*'
} }
// Enable this requires putting license header files in many, many FAWE files
//license {
// header = rootProject.file("HEADER.txt")
// include '**/*.java'
//}
} }

View File

@ -53,11 +53,4 @@
<module name="ParameterName"/> <module name="ParameterName"/>
<!-- <module name="TypeName"/> Unlikely that we would miss this in a PR --> <!-- <module name="TypeName"/> Unlikely that we would miss this in a PR -->
</module> </module>
<!-- Require the header, something that many people forget and we hate to fix -->
<!-- You should configure the header in your IDE -->
<module name="Header">
<property name="headerFile" value="${basedir}/config/checkstyle/header.txt"/>
<property name="fileExtensions" value="java"/>
</module>
</module> </module>

View File

@ -1,18 +0,0 @@
/*
* 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/>.
*/

View File

@ -1,5 +1,5 @@
repositories { repositories {
maven {url "http://vault.voxelmodpack.com/content/repositories/central/"} maven {url "https://ci.athion.net/job/FAWE-WorldGuard-1.13/lastSuccessfulBuild/artifact/mvn"}
} }
dependencies { dependencies {

Binary file not shown.

View File

@ -1,6 +1,5 @@
#Thu Jul 26 14:29:48 AEST 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

View File

@ -1,4 +1,4 @@
============= You are compiling: ============= ============= You are compiling: =============
_______ ___ ____ __ ____ _______ _______ ___ ____ __ ____ _______
| ____| / \ \ \ / \ / / | ____| | ____| / \ \ \ / \ / / | ____|
@ -15,7 +15,6 @@ If you encounter trouble:
- Use gradlew and not gradle - Use gradlew and not gradle
- Ask us! - Ask us!
- https://discord.gg/ngZCzbU (Discord) - https://discord.gg/ngZCzbU (Discord)
- https://goo.gl/Zwvv8J (IRC)
Files will be output to `/target` Files will be output to `/target`

View File

@ -4,13 +4,14 @@ apply plugin: 'maven'
repositories { repositories {
maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } maven { url "https://hub.spigotmc.org/nexus/content/groups/public" }
maven { url "https://ci.athion.net/job/FAWE-WorldGuard-1.13/lastSuccessfulBuild/artifact/mvn" }
} }
dependencies { dependencies {
compile project(':worldedit-core') compile project(':worldedit-core')
compile 'com.sk89q:dummypermscompat:1.8' compile 'com.sk89q:dummypermscompat:1.8'
compile 'com.destroystokyo.paper:paper-api:1.13-R0.1-SNAPSHOT' compile 'com.destroystokyo.paper:paper-api:1.13-R0.1-SNAPSHOT'
compile "org.spigotmc:spigot-1.13:SNAPSHOT" compile 'org.spigotmc:spigot:1.13.2-R0.1-SNAPSHOT'
testCompile 'org.mockito:mockito-core:1.9.0-rc1' testCompile 'org.mockito:mockito-core:1.9.0-rc1'
compile 'net.milkbowl.vault:VaultAPI:1.5.6' compile 'net.milkbowl.vault:VaultAPI:1.5.6'
compile 'com.massivecraft:factions:2.8.0' compile 'com.massivecraft:factions:2.8.0'
@ -28,9 +29,6 @@ dependencies {
compile 'com.wasteofplastic:askyblock:3.0.8.2' compile 'com.wasteofplastic:askyblock:3.0.8.2'
compile 'com.sk89q:worldguard-core:latest' compile 'com.sk89q:worldguard-core:latest'
compile 'com.sk89q:worldguard-legacy:latest' compile 'com.sk89q:worldguard-legacy:latest'
compile('org.inventivetalent:mapmanager:1.4.0-SNAPSHOT') {
transitive = false
}
} }
processResources { processResources {

View File

@ -91,7 +91,7 @@ public class FaweBukkit implements IFawe, Listener {
} }
if (Bukkit.getVersion().contains("git-Spigot")) { if (Bukkit.getVersion().contains("git-Spigot")) {
debug("====== USE PAPER ======"); debug("====== USE PAPER ======");
debug("DOWNLOAD: https://ci.destroystokyo.com/job/PaperSpigot/"); debug("DOWNLOAD: https://ci.destroystokyo.com/job/Paper-1.13/");
debug("GUIDE: https://www.spigotmc.org/threads/21726/"); debug("GUIDE: https://www.spigotmc.org/threads/21726/");
debug(" - This is only a recommendation"); debug(" - This is only a recommendation");
debug("=============================="); debug("==============================");
@ -124,13 +124,13 @@ public class FaweBukkit implements IFawe, Listener {
new ChunkListener_9(); new ChunkListener_9();
} }
try { /*try {
Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"); Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent");
new AsyncTabCompleteListener(WorldEditPlugin.getInstance()); new AsyncTabCompleteListener(WorldEditPlugin.getInstance());
} catch (Throwable ignore) } catch (Throwable ignore)
{ {
Bukkit.getPluginManager().registerEvents(new SyncTabCompleteListener(WorldEditPlugin.getInstance()), plugin); Bukkit.getPluginManager().registerEvents(new SyncTabCompleteListener(WorldEditPlugin.getInstance()), plugin);
} }*/
} }
}); });
} }

View File

@ -420,7 +420,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
} else if (foreign instanceof NBTTagDouble) { } else if (foreign instanceof NBTTagDouble) {
return new DoubleTag(((NBTTagDouble) foreign).asDouble()); // getDouble return new DoubleTag(((NBTTagDouble) foreign).asDouble()); // getDouble
} else if (foreign instanceof NBTTagFloat) { } else if (foreign instanceof NBTTagFloat) {
return new FloatTag(((NBTTagFloat) foreign).asByte()); // getFloat return new FloatTag(((NBTTagFloat) foreign).asFloat()); // getFloat
} else if (foreign instanceof NBTTagInt) { } else if (foreign instanceof NBTTagInt) {
return new IntTag(((NBTTagInt) foreign).asInt()); // getInt return new IntTag(((NBTTagInt) foreign).asInt()); // getInt
} else if (foreign instanceof NBTTagIntArray) { } else if (foreign instanceof NBTTagIntArray) {

View File

@ -38,4 +38,5 @@ public class FallbackRegistrationListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
} }
}
}

View File

@ -19,16 +19,16 @@
package com.sk89q.wepif; package com.sk89q.wepif;
import com.sk89q.util.yaml.YAMLNode;
import com.sk89q.util.yaml.YAMLProcessor;
import org.bukkit.OfflinePlayer;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import com.sk89q.util.yaml.YAMLNode;
import com.sk89q.util.yaml.YAMLProcessor;
import org.bukkit.OfflinePlayer;
public class ConfigurationPermissionsResolver implements PermissionsResolver { public class ConfigurationPermissionsResolver implements PermissionsResolver {
private YAMLProcessor config; private YAMLProcessor config;
private Map<String, Set<String>> userPermissionsCache; private Map<String, Set<String>> userPermissionsCache;

View File

@ -19,6 +19,7 @@
package com.sk89q.wepif; package com.sk89q.wepif;
import com.nijikokun.bukkit.Permissions.Permissions;
import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.util.yaml.YAMLProcessor;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -27,7 +28,6 @@ import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import com.nijikokun.bukkit.Permissions.Permissions;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;

View File

@ -21,7 +21,6 @@ package com.sk89q.wepif;
import com.sk89q.util.yaml.YAMLFormat; import com.sk89q.util.yaml.YAMLFormat;
import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -103,6 +102,7 @@ public class PermissionsResolverManager implements PermissionsResolver {
protected PermissionsResolverManager(Plugin plugin) { protected PermissionsResolverManager(Plugin plugin) {
this.server = plugin.getServer(); this.server = plugin.getServer();
(new ServerListener()).register(plugin); // Register the events (new ServerListener()).register(plugin); // Register the events
loadConfig(new File("wepif.yml")); loadConfig(new File("wepif.yml"));
findResolver(); findResolver();
} }

View File

@ -25,11 +25,12 @@ import com.sk89q.worldedit.world.biome.BiomeData;
import com.sk89q.worldedit.world.registry.BiomeRegistry; import com.sk89q.worldedit.world.registry.BiomeRegistry;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import javax.annotation.Nullable;
/** /**
* A biome registry for Bukkit. * A biome registry for Bukkit.
*/ */

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.bukkit.util.CommandInspector; import com.sk89q.bukkit.util.CommandInspector;
import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
@ -30,8 +32,6 @@ import org.bukkit.command.CommandSender;
import java.util.logging.Logger; import java.util.logging.Logger;
import static com.google.common.base.Preconditions.checkNotNull;
class BukkitCommandInspector implements CommandInspector { class BukkitCommandInspector implements CommandInspector {
private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName()); private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName());

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
@ -28,10 +30,9 @@ import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.NullWorld;
import javax.annotation.Nullable;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import static com.google.common.base.Preconditions.checkNotNull; import javax.annotation.Nullable;
/** /**
* An adapter to adapt a Bukkit entity into a WorldEdit one. * An adapter to adapt a Bukkit entity into a WorldEdit one.

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.entity.metadata.EntityProperties;
import org.bukkit.entity.Ambient; import org.bukkit.entity.Ambient;
import org.bukkit.entity.Animals; import org.bukkit.entity.Animals;
@ -42,8 +44,6 @@ import org.bukkit.entity.Tameable;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.bukkit.entity.minecart.ExplosiveMinecart; import org.bukkit.entity.minecart.ExplosiveMinecart;
import static com.google.common.base.Preconditions.checkNotNull;
class BukkitEntityProperties implements EntityProperties { class BukkitEntityProperties implements EntityProperties {
private final Entity entity; private final Entity entity;

View File

@ -0,0 +1,91 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldEdit team and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.bukkit;
/**
* Adds methods to test if different API methods are possible based on implementation.
*/
public class BukkitImplementationTester {
private BukkitImplementationTester() {
}
/**
* Known Bukkit implementations
*/
public enum BukkitImplementation {
CRAFTBUKKIT,
SPIGOT,
PAPER,
}
private static final String implementationMessage = "************************************************" +
"* Note: PaperMC (https://papermc.io/) is *" +
"* recommended for optimal performance with *" +
"* WorldEdit, WorldGuard, or CraftBook. *" +
"************************************************";
private static BukkitImplementation implementation;
/**
* Gets the implementation currently in use on the server.
*
* @return The server implementation
*/
public static BukkitImplementation getImplementation() {
if (implementation == null) {
try {
Class.forName("com.destroystokyo.paper.PaperConfig");
implementation = BukkitImplementation.PAPER;
} catch (Exception e) {
try {
Class.forName("org.spigotmc.SpigotConfig");
implementation = BukkitImplementation.SPIGOT;
} catch (Exception e2) {
implementation = BukkitImplementation.CRAFTBUKKIT;
}
}
if (implementation != BukkitImplementation.PAPER) {
// Bukkit.getServer().getConsoleSender().sendMessage(implementationMessage); // TODO Decide if good idea.
}
}
return implementation;
}
/**
* Check if this implementation is compatible with Spigot APIs
*
* @return If compatible with Spigot APIs
*/
public static boolean isSpigotCompatible() {
return getImplementation() == BukkitImplementation.SPIGOT || getImplementation() == BukkitImplementation.PAPER;
}
/**
* Check if this implementation is compatible with Paper APIs
*
* @return If compatible with Paper APIs
*/
public static boolean isPaperCompatible() {
return getImplementation() == BukkitImplementation.PAPER;
}
}

View File

@ -21,7 +21,11 @@ package com.sk89q.worldedit.bukkit;
import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.extent.inventory.*; import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.extent.inventory.BlockBagException;
import com.sk89q.worldedit.extent.inventory.OutOfBlocksException;
import com.sk89q.worldedit.extent.inventory.OutOfSpaceException;
import com.sk89q.worldedit.extent.inventory.SlottableBlockBag;
import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -177,6 +177,9 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter
// platforms to be worried about... at the current time of writing // platforms to be worried about... at the current time of writing
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
// Setup the BukkitImplementationTester.
BukkitImplementationTester.getImplementation();
{ // Register 1.13 Material ids with LegacyMapper { // Register 1.13 Material ids with LegacyMapper
LegacyMapper legacyMapper = LegacyMapper.getInstance(); LegacyMapper legacyMapper = LegacyMapper.getInstance();
for (Material m : Material.values()) { for (Material m : Material.values()) {

View File

@ -99,7 +99,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
Entity createEntity(Location location, BaseEntity state); Entity createEntity(Location location, BaseEntity state);
/** /**
* Get a map of string -> properties * Get a map of {@code string -> property}.
* *
* @param blockType The block type * @param blockType The block type
* @return The properties map * @return The properties map

View File

@ -19,13 +19,15 @@
package com.sk89q.wepif; package com.sk89q.wepif;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
public class DinnerPermsResolverTest { public class DinnerPermsResolverTest {
private DinnerPermsResolver resolver; private DinnerPermsResolver resolver;

View File

@ -28,7 +28,11 @@ import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import java.util.*; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
public class TestOfflinePermissible implements OfflinePlayer, Permissible { public class TestOfflinePermissible implements OfflinePlayer, Permissible {
private boolean op; private boolean op;

View File

@ -1,6 +1,8 @@
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
repositories {
maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"}
}
dependencies { dependencies {
compile 'de.schlichtherle:truezip:6.8.3' compile 'de.schlichtherle:truezip:6.8.3'
compile 'rhino:js:1.7R2' compile 'rhino:js:1.7R2'

View File

@ -27,7 +27,6 @@ import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
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.storage.InvalidFormatException; import com.sk89q.worldedit.world.storage.InvalidFormatException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -25,9 +25,6 @@ import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.util.gson.GsonUtil; import com.sk89q.worldedit.util.gson.GsonUtil;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
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.util.gson.GsonUtil;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@ -24,7 +24,6 @@ import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -115,4 +114,4 @@ public class SkullBlock extends BaseBlock {
owner = ((StringTag) t).getValue(); owner = ((StringTag) t).getValue();
} }
} }
} }

View File

@ -362,6 +362,8 @@ public class Fawe {
MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null); MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null);
MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null); MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null);
MainUtil.copyFile(MainUtil.getJarFile(), "fr/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 // Setting up config.yml
File file = new File(this.IMP.getDirectory(), "config.yml"); File file = new File(this.IMP.getDirectory(), "config.yml");
Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", ""); Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", "");

View File

@ -118,7 +118,7 @@ public enum BBC {
BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"), BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"),
BRUSH_NONE("You aren't holding a brush!", "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_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_VISUAL_MODE_SET("Set visual mode to %s0", "WorldEdit.Brush"),
BRUSH_TARGET_MODE_SET("Set target 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"), BRUSH_TARGET_MASK_SET("Set target mask to %s0", "WorldEdit.Brush"),

View File

@ -23,7 +23,7 @@ public class Settings extends Config {
@Final @Final
public String PLATFORM; // These values are set from FAWE before loading 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",}) "Create a PR to contribute a translation: https://github.com/boy0001/FastAsyncWorldedit/new/master/core/src/main/resources",})
public String LANGUAGE = ""; public String LANGUAGE = "";
@Comment({"Enable or disable automatic updates", @Comment({"Enable or disable automatic updates",
@ -325,7 +325,7 @@ public class Settings extends Config {
public boolean ANVIL_QUEUE_MODE = false; public boolean ANVIL_QUEUE_MODE = false;
@Comment({ @Comment({
"[SAFE] Dynamically increase the number of chunks rendered", "[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)", " - Set your server view distance to 1 (spigot.yml, server.properties)",
" - Based on tps and player movement", " - Based on tps and player movement",
" - Note: If entities become hidden, increase the server view distance to 3", " - Note: If entities become hidden, increase the server view distance to 3",

View File

@ -160,7 +160,7 @@ public class InstallerFrame extends JFrame {
} catch (Throwable ignore) { } catch (Throwable ignore) {
ignore.printStackTrace(); 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"); URLButton chatButton = new URLButton(chat, "Chat");
bottomBar.add(chatButton); bottomBar.add(chatButton);
URL wiki = new URL("https://github.com/boy0001/FastAsyncWorldedit/wiki"); URL wiki = new URL("https://github.com/boy0001/FastAsyncWorldedit/wiki");

View File

@ -276,6 +276,10 @@ public class Schematic {
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ(); final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ();
// entities // entities
for (Entity entity : clipboard.getEntities()) { 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 pos = entity.getLocation();
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.getPitch()); Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.getPitch());
extent.createEntity(newPos, entity.getState()); extent.createEntity(newPos, entity.getState());

View File

@ -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; package com.sk89q.jnbt;
import com.sk89q.worldedit.function.entity.ExtentEntityCopy;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -12,6 +30,7 @@ import java.util.Map;
public final class CompoundTag extends Tag { public final class CompoundTag extends Tag {
private final Map<String, Tag> value; private final Map<String, Tag> value;
/** /**
* Creates the tag with an empty name. * Creates the tag with an empty name.
* *
@ -425,5 +444,4 @@ public final class CompoundTag extends Tag {
return bldr.toString(); return bldr.toString();
} }
} }

View File

@ -19,11 +19,11 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Helps create compound tags. * Helps create compound tags.
*/ */
@ -145,14 +145,14 @@ public class CompoundTagBuilder {
return put(key, new LongArrayTag(value)); return put(key, new LongArrayTag(value));
} }
/** /**
* Put the given key and value into the compound tag as a * Put the given key and value into the compound tag as a
* {@code LongTag}. * {@code LongTag}.
* *
* @param key they key * @param key they key
* @param value the value * @param value the value
* @return this object * @return this object
*/ */
public CompoundTagBuilder putLong(String key, long value) { public CompoundTagBuilder putLong(String key, long value) {
return put(key, new LongTag(value)); return put(key, new LongTag(value));
} }
@ -213,5 +213,4 @@ public class CompoundTagBuilder {
return new CompoundTagBuilder(); return new CompoundTagBuilder();
} }
} }

View File

@ -1,12 +1,13 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList; import java.util.ArrayList;
import javax.annotation.Nullable;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import static com.google.common.base.Preconditions.checkNotNull; import javax.annotation.Nullable;
/** /**
* The {@code TAG_List} tag. * 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. * Get the tag if it exists at the given index.
* *
* @param index the index * @param index the index
* @return the tag or null * @return the tag or null
*/ */
@ -419,6 +420,4 @@ public final class ListTag<T extends Tag> extends Tag {
return bldr.toString(); return bldr.toString();
} }
} }

View File

@ -19,13 +19,13 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Helps create list tags. * Helps create list tags.
*/ */

View File

@ -16,13 +16,18 @@
* You should have received a copy of the GNU Lesser General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* The {@code TAG_Long_Array} tag. * The {@code TAG_Long_Array} tag.
*/ */
public class LongArrayTag extends Tag { public class LongArrayTag extends Tag {
private final long[] value; private final long[] value;
/** /**
* Creates the tag with an empty name. * Creates the tag with an empty name.
* *
@ -33,10 +38,12 @@ public class LongArrayTag extends Tag {
checkNotNull(value); checkNotNull(value);
this.value = value; this.value = value;
} }
@Override @Override
public long[] getValue() { public long[] getValue() {
return value; return value;
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder hex = new StringBuilder(); StringBuilder hex = new StringBuilder();
@ -49,4 +56,5 @@ public class LongArrayTag extends Tag {
} }
return "TAG_Long_Array(" + hex + ")"; return "TAG_Long_Array(" + hex + ")";
} }
}
}

View File

@ -37,7 +37,7 @@ import java.util.function.Function;
* This class reads <strong>NBT</strong>, or <strong>Named Binary Tag</strong> * This class reads <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
* streams, and produces an object graph of subclasses of the {@code Tag} * streams, and produces an object graph of subclasses of the {@code Tag}
* object. * object.
* <p> *
* <p>The NBT format was created by Markus Persson, and the specification may be * <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"> * found at <a href="http://www.minecraft.net/docs/NBT.txt">
* http://www.minecraft.net/docs/NBT.txt</a>.</p> * 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 * Creates a new {@code NBTInputStream}, which will source its data
* from the specified input stream. * from the specified input stream.
* *
* @param is the input stream * @param is the input stream
* @throws IOException if an I/O error occurs * @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. * Reads an NBT tag from the stream.
* *
* @return The tag that was read. * @return The tag that was read.
* @throws IOException if an I/O error occurs. * @throws IOException if an I/O error occurs.
*/ */
@ -87,7 +87,7 @@ public final class NBTInputStream implements Closeable {
/** /**
* Reads an NBT from the stream. * Reads an NBT from the stream.
* *
* @param depth the depth of this tag * @param depth the depth of this tag
* @return The tag that was read. * @return The tag that was read.
* @throws IOException if an I/O error occurs. * @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. * Reads the payload of a tag given the type.
* *
* @param type the type * @param type the type
* @param depth the depth * @param depth the depth
* @return the tag * @return the tag
* @throws IOException if an I/O error occurs. * @throws IOException if an I/O error occurs.
@ -617,5 +617,4 @@ public final class NBTInputStream implements Closeable {
} }
} }
} }

View File

@ -19,6 +19,8 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.object.io.LittleEndianOutputStream; import com.boydti.fawe.object.io.LittleEndianOutputStream;
import java.io.Closeable; import java.io.Closeable;
import java.io.DataOutput; import java.io.DataOutput;
@ -29,13 +31,10 @@ import java.io.OutputStream;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong> * This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
* {@code Tag} objects to an underlying {@code OutputStream}. * {@code Tag} objects to an underlying {@code OutputStream}.
* <p> *
* <p>The NBT format was created by Markus Persson, and the specification may be * <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"> * found at <a href="http://www.minecraft.net/docs/NBT.txt">
* http://www.minecraft.net/docs/NBT.txt</a>.</p> * 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 * Creates a new {@code NBTOutputStream}, which will write data to the
* specified underlying output stream. * specified underlying output stream.
* *
* @param os The output stream. * @param os
* @throws IOException if an I/O error occurs. * The output stream.
* @throws IOException
* if an I/O error occurs.
*/ */
public NBTOutputStream(OutputStream os) throws IOException { public NBTOutputStream(OutputStream os) throws IOException {
this.os = new DataOutputStream(os); this.os = new DataOutputStream(os);
@ -74,13 +75,16 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a tag. * Writes a tag.
* *
* @param tag The tag to write. * @param tag
* @throws IOException if an I/O error occurs. * The tag to write.
* @throws IOException
* if an I/O error occurs.
*/ */
public void writeNamedTag(String name, Tag tag) throws IOException { public void writeNamedTag(String name, Tag tag) throws IOException {
checkNotNull(name); checkNotNull(name);
checkNotNull(tag); checkNotNull(tag);
int type = NBTUtils.getTypeCode(tag.getClass()); int type = NBTUtils.getTypeCode(tag.getClass());
writeNamedTagName(name, type); writeNamedTagName(name, type);
if (type == NBTConstants.TYPE_END) { if (type == NBTConstants.TYPE_END) {
@ -197,62 +201,66 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes tag payload. * Writes tag payload.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
public void writeTagPayload(Tag tag) throws IOException { public void writeTagPayload(Tag tag) throws IOException {
int type = NBTUtils.getTypeCode(tag.getClass()); int type = NBTUtils.getTypeCode(tag.getClass());
switch (type) { switch (type) {
case NBTConstants.TYPE_END: case NBTConstants.TYPE_END:
writeEndTagPayload((EndTag) tag); writeEndTagPayload((EndTag) tag);
break; break;
case NBTConstants.TYPE_BYTE: case NBTConstants.TYPE_BYTE:
writeByteTagPayload((ByteTag) tag); writeByteTagPayload((ByteTag) tag);
break; break;
case NBTConstants.TYPE_SHORT: case NBTConstants.TYPE_SHORT:
writeShortTagPayload((ShortTag) tag); writeShortTagPayload((ShortTag) tag);
break; break;
case NBTConstants.TYPE_INT: case NBTConstants.TYPE_INT:
writeIntTagPayload((IntTag) tag); writeIntTagPayload((IntTag) tag);
break; break;
case NBTConstants.TYPE_LONG: case NBTConstants.TYPE_LONG:
writeLongTagPayload((LongTag) tag); writeLongTagPayload((LongTag) tag);
break; break;
case NBTConstants.TYPE_FLOAT: case NBTConstants.TYPE_FLOAT:
writeFloatTagPayload((FloatTag) tag); writeFloatTagPayload((FloatTag) tag);
break; break;
case NBTConstants.TYPE_DOUBLE: case NBTConstants.TYPE_DOUBLE:
writeDoubleTagPayload((DoubleTag) tag); writeDoubleTagPayload((DoubleTag) tag);
break; break;
case NBTConstants.TYPE_BYTE_ARRAY: case NBTConstants.TYPE_BYTE_ARRAY:
writeByteArrayTagPayload((ByteArrayTag) tag); writeByteArrayTagPayload((ByteArrayTag) tag);
break; break;
case NBTConstants.TYPE_STRING: case NBTConstants.TYPE_STRING:
writeStringTagPayload((StringTag) tag); writeStringTagPayload((StringTag) tag);
break; break;
case NBTConstants.TYPE_LIST: case NBTConstants.TYPE_LIST:
writeListTagPayload((ListTag) tag); writeListTagPayload((ListTag) tag);
break; break;
case NBTConstants.TYPE_COMPOUND: case NBTConstants.TYPE_COMPOUND:
writeCompoundTagPayload((CompoundTag) tag); writeCompoundTagPayload((CompoundTag) tag);
break; break;
case NBTConstants.TYPE_INT_ARRAY: case NBTConstants.TYPE_INT_ARRAY:
writeIntArrayTagPayload((IntArrayTag) tag); writeIntArrayTagPayload((IntArrayTag) tag);
break; break;
case NBTConstants.TYPE_LONG_ARRAY: case NBTConstants.TYPE_LONG_ARRAY:
writeLongArrayTagPayload((LongArrayTag) tag); writeLongArrayTagPayload((LongArrayTag) tag);
break; break;
default: default:
throw new IOException("Invalid tag type: " + type + "."); throw new IOException("Invalid tag type: " + type + ".");
} }
} }
/** /**
* Writes a {@code TAG_Byte} tag. * Writes a {@code TAG_Byte} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeByteTagPayload(ByteTag tag) throws IOException { private void writeByteTagPayload(ByteTag tag) throws IOException {
os.writeByte(tag.getValue()); os.writeByte(tag.getValue());
@ -260,9 +268,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Byte_Array} tag. * Writes a {@code TAG_Byte_Array} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException { private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException {
byte[] bytes = tag.getValue(); byte[] bytes = tag.getValue();
@ -272,9 +282,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Compound} tag. * Writes a {@code TAG_Compound} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeCompoundTagPayload(CompoundTag tag) throws IOException { private void writeCompoundTagPayload(CompoundTag tag) throws IOException {
for (Map.Entry<String, Tag> entry : tag.getValue().entrySet()) { 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. * Writes a {@code TAG_List} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeListTagPayload(ListTag tag) throws IOException { private void writeListTagPayload(ListTag tag) throws IOException {
Class<? extends Tag> clazz = tag.getType(); Class<? extends Tag> clazz = tag.getType();
@ -310,9 +324,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_String} tag. * Writes a {@code TAG_String} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeStringTagPayload(StringTag tag) throws IOException { private void writeStringTagPayload(StringTag tag) throws IOException {
byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET); byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET);
@ -322,9 +338,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Double} tag. * Writes a {@code TAG_Double} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeDoubleTagPayload(DoubleTag tag) throws IOException { private void writeDoubleTagPayload(DoubleTag tag) throws IOException {
os.writeDouble(tag.getValue()); os.writeDouble(tag.getValue());
@ -332,9 +350,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Float} tag. * Writes a {@code TAG_Float} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeFloatTagPayload(FloatTag tag) throws IOException { private void writeFloatTagPayload(FloatTag tag) throws IOException {
os.writeFloat(tag.getValue()); os.writeFloat(tag.getValue());
@ -342,9 +362,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Long} tag. * Writes a {@code TAG_Long} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeLongTagPayload(LongTag tag) throws IOException { private void writeLongTagPayload(LongTag tag) throws IOException {
os.writeLong(tag.getValue()); os.writeLong(tag.getValue());
@ -352,9 +374,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Int} tag. * Writes a {@code TAG_Int} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeIntTagPayload(IntTag tag) throws IOException { private void writeIntTagPayload(IntTag tag) throws IOException {
os.writeInt(tag.getValue()); os.writeInt(tag.getValue());
@ -362,9 +386,11 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Short} tag. * Writes a {@code TAG_Short} tag.
* *
* @param tag The tag. * @param tag
* @throws IOException if an I/O error occurs. * The tag.
* @throws IOException
* if an I/O error occurs.
*/ */
private void writeShortTagPayload(ShortTag tag) throws IOException { private void writeShortTagPayload(ShortTag tag) throws IOException {
os.writeShort(tag.getValue()); os.writeShort(tag.getValue());
@ -372,19 +398,19 @@ public final class NBTOutputStream implements Closeable {
/** /**
* Writes a {@code TAG_Empty} tag. * Writes a {@code TAG_Empty} tag.
* *
* @param tag the tag * @param tag the tag
*/ */
private void writeEndTagPayload(EndTag tag) { private void writeEndTagPayload(EndTag tag) {
/* empty */ /* empty */
} }
private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException { private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
int[] data = tag.getValue(); int[] data = tag.getValue();
os.writeInt(data.length); os.writeInt(data.length);
for (int aData : data) { for (int aData : data) {
os.writeInt(aData); os.writeInt(aData);
} }
} }
private void writeLongArrayTagPayload(LongArrayTag tag) throws IOException { private void writeLongArrayTagPayload(LongArrayTag tag) throws IOException {

View File

@ -26,8 +26,6 @@ import com.sk89q.worldedit.world.storage.InvalidFormatException;
import java.util.Map; import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* A class which contains NBT-related utility methods. * A class which contains NBT-related utility methods.
* *

View File

@ -26,7 +26,7 @@ public abstract class Tag {
/** /**
* Gets the value of this tag. * Gets the value of this tag.
* *
* @return the value * @return the value
*/ */
public abstract Object getValue(); public abstract Object getValue();
@ -34,8 +34,4 @@ public abstract class Tag {
public Object getRaw() { public Object getRaw() {
return getValue(); return getValue();
} }
} }

View File

@ -19,12 +19,13 @@
package com.sk89q.minecraft.util.commands; 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.ArrayList;
import java.util.List; import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import static com.google.common.base.Preconditions.checkNotNull; import javax.annotation.Nullable;
public class CommandException extends Exception { public class CommandException extends Exception {

View File

@ -28,7 +28,8 @@ import java.util.*;
public final class ReflectionUtil { public final class ReflectionUtil {
private ReflectionUtil() {} private ReflectionUtil() {
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T getField(Object from, String name) { 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)); } while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null));
return null; return null;
} }
} }

View File

@ -34,7 +34,7 @@ public final class StringUtil {
/** /**
* Trim a string if it is longer than a certain length. * Trim a string if it is longer than a certain length.
* *
* @param str the stirng * @param str the stirng
* @param len the length to trim to * @param len the length to trim to
* @return a new string * @return a new string
@ -49,7 +49,7 @@ public final class StringUtil {
/** /**
* Join an array of strings into a string. * Join an array of strings into a string.
* *
* @param str the string array * @param str the string array
* @param delimiter the delimiter * @param delimiter the delimiter
* @param initialIndex the initial index to start form * @param initialIndex the initial index to start form
@ -68,7 +68,7 @@ public final class StringUtil {
/** /**
* Join an array of strings into a string. * Join an array of strings into a string.
* *
* @param str the string array * @param str the string array
* @param delimiter the delimiter * @param delimiter the delimiter
* @param initialIndex the initial index to start form * @param initialIndex the initial index to start form
@ -76,7 +76,7 @@ public final class StringUtil {
* @return a new string * @return a new string
*/ */
public static String joinQuotedString(String[] str, String delimiter, public static String joinQuotedString(String[] str, String delimiter,
int initialIndex, String quote) { int initialIndex, String quote) {
if (str.length == 0) { if (str.length == 0) {
return ""; return "";
} }
@ -92,7 +92,7 @@ public final class StringUtil {
/** /**
* Join an array of strings into a string. * Join an array of strings into a string.
* *
* @param str the string array * @param str the string array
* @param delimiter the delimiter * @param delimiter the delimiter
* @return a new string * @return a new string
@ -103,7 +103,7 @@ public final class StringUtil {
/** /**
* Join an array of strings into a string. * Join an array of strings into a string.
* *
* @param str an array of objects * @param str an array of objects
* @param delimiter the delimiter * @param delimiter the delimiter
* @param initialIndex the initial index to start form * @param initialIndex the initial index to start form
@ -122,7 +122,7 @@ public final class StringUtil {
/** /**
* Join an array of strings into a string. * Join an array of strings into a string.
* *
* @param str a list of integers * @param str a list of integers
* @param delimiter the delimiter * @param delimiter the delimiter
* @param initialIndex the initial index to start form * @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 * calculated). (Note that the arrays aren't really copied anymore, just
* switched...this is clearly much better than cloning an array or doing * switched...this is clearly much better than cloning an array or doing
* a System.arraycopy() each time through the outer loop.) * a System.arraycopy() each time through the outer loop.)
* *
* Effectively, the difference between the two implementations is this * Effectively, the difference between the two implementations is this
* one does not cause an out of memory condition when calculating the LD * one does not cause an out of memory condition when calculating the LD
* over two very large strings. * over two very large strings.
@ -323,4 +323,4 @@ public final class StringUtil {
return parsableBlocks; return parsableBlocks;
} }
} }

View File

@ -23,12 +23,13 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.Vector2; import com.sk89q.worldedit.math.Vector2;
import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.Vector3;
import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable;
/** /**
* Represents a configuration node. * Represents a configuration node.
*/ */

View File

@ -27,7 +27,13 @@ import org.yaml.snakeyaml.nodes.Tag;
import org.yaml.snakeyaml.reader.UnicodeReader; import org.yaml.snakeyaml.reader.UnicodeReader;
import org.yaml.snakeyaml.representer.Representer; 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.nio.charset.StandardCharsets;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
@ -294,4 +300,5 @@ public class YAMLProcessor extends YAMLNode {
this.nullRepresenter = o -> representScalar(Tag.NULL, ""); this.nullRepresenter = o -> representScalar(Tag.NULL, "");
} }
} }
}
}

View File

@ -829,7 +829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
/** /**
* Return fast mode status. * Return fast mode status.
* <p> *
* <p>Fast mode may skip lighting checks or adjacent block * <p>Fast mode may skip lighting checks or adjacent block
* notification.</p> * notification.</p>
* *
@ -1020,8 +1020,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
* Set a block, bypassing both history and block re-ordering. * Set a block, bypassing both history and block re-ordering.
* *
* @param position the position to set the block at * @param position the position to set the block at
* @param block the block * @param block the block
* @param stage the level * @param stage the level
* @return whether the block changed * @return whether the block changed
* @throws WorldEditException thrown on a set error * @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. * 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 * @param pattern the pattern that provides the replacement block
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * Replaces all the blocks matching a given mask, within a given region, to a block
* returned by a given pattern. * returned by a given pattern.
* *
* @param region the region to replace the blocks within * @param region the region to replace the blocks within
* @param mask the mask that blocks must match * @param mask the mask that blocks must match
* @param pattern the pattern that provides the new blocks * @param pattern the pattern that provides the new blocks
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * If the center sits between two blocks on a certain axis, then two blocks
* will be placed to mark the center. * 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 * @param pattern the replacement pattern
* @return the number of blocks placed * @return the number of blocks placed
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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}. * Make the faces of the given region as if it was a {@link CuboidRegion}.
* *
* @param region the region * @param region the region
* @param block the block to place * @param block the block to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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}. * 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 * @param pattern the pattern to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * may be inefficient, because there may not be an efficient implementation supported
* for that specific shape. * for that specific shape.
* *
* @param region the region * @param region the region
* @param pattern the pattern to place * @param pattern the pattern to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * Make the walls (all faces but those parallel to the X-Z plane) of the given region
* as if it was a {@link CuboidRegion}. * as if it was a {@link CuboidRegion}.
* *
* @param region the region * @param region the region
* @param block the block to place * @param block the block to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * Make the walls (all faces but those parallel to the X-Z plane) of the given region
* as if it was a {@link CuboidRegion}. * as if it was a {@link CuboidRegion}.
* *
* @param region the region * @param region the region
* @param pattern the pattern to place * @param pattern the pattern to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * may be inefficient, because there may not be an efficient implementation supported
* for that specific shape. * for that specific shape.
* *
* @param region the region * @param region the region
* @param pattern the pattern to place * @param pattern the pattern to place
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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). * (as if it were a cuboid).
* *
* @param region the region * @param region the region
* @param block the placed block * @param block the placed block
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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 * Places a layer of blocks on top of ground blocks in the given region
* (as if it were a cuboid). * (as if it were a cuboid).
* *
* @param region the region * @param region the region
* @param pattern the placed block pattern * @param pattern the placed block pattern
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
@ -1920,9 +1921,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
/** /**
* Stack a cuboid region. * Stack a cuboid region.
* *
* @param region the region to stack * @param region the region to stack
* @param dir the direction to stack * @param dir the direction to stack
* @param count the number of times to stack * @param count the number of times to stack
* @param copyAir true to also copy air blocks * @param copyAir true to also copy air blocks
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Move the blocks in a region a certain direction.
* *
* @param region the region to move * @param region the region to move
* @param dir the direction * @param dir the direction
* @param distance the distance to move * @param distance the distance to move
* @param copyAir true to copy air blocks * @param copyAir true to copy air blocks
* @param replacement the replacement block to fill in after moving, or null to use air * @param replacement the replacement block to fill in after moving, or null to use air
* @return number of blocks moved * @return number of blocks moved
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Move the blocks in a region a certain direction.
* *
* @param region the region to move * @param region the region to move
* @param dir the direction * @param dir the direction
* @param distance the distance to move * @param distance the distance to move
* @param copyAir true to copy air blocks * @param copyAir true to copy air blocks
* @param replacement the replacement block to fill in after moving, or null to use air * @param replacement the replacement block to fill in after moving, or null to use air
* @return number of blocks moved * @return number of blocks moved
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Fix liquids so that they turn into stationary blocks and extend outward.
* *
* @param origin the original position * @param origin the original position
* @param radius the radius to fix * @param radius the radius to fix
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
*/ */
@ -2120,8 +2121,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
/** /**
* Makes a cylinder. * Makes a cylinder.
* *
* @param pos Center of the cylinder * @param pos Center of the cylinder
* @param block The block pattern to use * @param block The block pattern to use
* @param radius The cylinder's radius * @param radius The cylinder's radius
* @param height The cylinder's up/down extent. If negative, extend downward. * @param height The cylinder's up/down extent. If negative, extend downward.
* @param filled If false, only a shell will be generated. * @param filled If false, only a shell will be generated.
@ -2135,12 +2136,12 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
/** /**
* Makes a cylinder. * Makes a cylinder.
* *
* @param pos Center of the cylinder * @param pos Center of the cylinder
* @param block The block pattern to use * @param block The block pattern to use
* @param radiusX The cylinder's largest north/south extent * @param radiusX The cylinder's largest north/south extent
* @param radiusZ The cylinder's largest east/west extent * @param radiusZ The cylinder's largest east/west extent
* @param height The cylinder's up/down extent. If negative, extend downward. * @param height The cylinder's up/down extent. If negative, extend downward.
* @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 * @return number of blocks changed
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
*/ */
@ -2349,28 +2350,28 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
} }
/** /**
* Makes a sphere. * Makes a sphere.
* *
* @param pos Center of the sphere or ellipsoid * @param pos Center of the sphere or ellipsoid
* @param block The block pattern to use * @param block The block pattern to use
* @param radius The sphere's radius * @param radius The sphere's radius
* @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 * @return number of blocks changed
* @throws MaxChangedBlocksException thrown if too many blocks are 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) { 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. * Makes a sphere or ellipsoid.
* *
* @param pos Center of the sphere or ellipsoid * @param pos Center of the sphere or ellipsoid
* @param block The block pattern to use * @param block The block pattern to use
* @param radiusX The sphere/ellipsoid's largest north/south extent * @param radiusX The sphere/ellipsoid's largest north/south extent
* @param radiusY The sphere/ellipsoid's largest up/down extent * @param radiusY The sphere/ellipsoid's largest up/down extent
* @param radiusZ The sphere/ellipsoid's largest east/west 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 * @return number of blocks changed
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
*/ */
@ -2447,9 +2448,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
* Makes a pyramid. * Makes a pyramid.
* *
* @param position a position * @param position a position
* @param block a block * @param block a block
* @param size size of pyramid * @param size size of pyramid
* @param filled true if filled * @param filled true if filled
* @return number of blocks changed * @return number of blocks changed
* @throws MaxChangedBlocksException thrown if too many blocks are 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. * Thaw blocks in a radius.
* *
* @param position the position * @param position the position
* @param radius the radius * @param radius the radius
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Make snow in a radius.
* *
* @param position a position * @param position a position
* @param radius a radius * @param radius a radius
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
*/ */
@ -2640,7 +2641,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
* Make dirt green. * Make dirt green.
* *
* @param position a position * @param position a position
* @param radius a radius * @param radius a radius
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Makes pumpkin patches randomly in an area around the given position.
* *
* @param position the base 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 * @return number of patches created
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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). * 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 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 * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * Draws a line (out of blocks) between two vectors.
* *
* @param pattern The block pattern used to draw the line. * @param pattern The block pattern used to draw the line.
* @param pos1 One of the points that define the line. * @param pos1 One of the points that define the line.
* @param pos2 The other point that defines the line. * @param pos2 The other point that defines the line.
* @param radius The radius (thickness) of the line. * @param radius The radius (thickness) of the line.
* @param filled If false, only a shell will be generated. * @param filled If false, only a shell will be generated.
*
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @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. * 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 nodevectors The list of vectors to draw through.
* @param tension The tension of every node. * @param tension The tension of every node.
* @param bias The bias of every node. * @param bias The bias of every node.
* @param continuity The continuity of every node. * @param continuity The continuity of every node.
* @param quality The quality of the spline. Must be greater than 0. * @param quality The quality of the spline. Must be greater than 0.
* @param radius The radius (thickness) of the spline. * @param radius The radius (thickness) of the spline.
* @param filled If false, only a shell will be generated. * @param filled If false, only a shell will be generated.
*
* @return number of blocks affected * @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed * @throws MaxChangedBlocksException thrown if too many blocks are changed
*/ */
@ -3324,7 +3327,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
for (BlockVector3 recurseDirection : recurseDirections) { for (BlockVector3 recurseDirection : recurseDirections) {
queue.addLast(current.add(recurseDirection)); 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 { public int makeBiomeShape(final Region region, final Vector3 zero, final Vector3 unit, final BaseBiome biomeType, final String expressionString, final boolean hollow) throws ExpressionException, MaxChangedBlocksException {

View File

@ -19,14 +19,14 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.util.eventbus.EventBus;
import com.sk89q.worldedit.world.World; 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, * Creates new {@link EditSession}s. To get an instance of this factory,
* use {@link WorldEdit#getEditSessionFactory()}. * use {@link WorldEdit#getEditSessionFactory()}.

View File

@ -19,10 +19,10 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import com.sk89q.worldedit.util.logging.LogFormat;
import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.item.ItemTypes; 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.registry.LegacyMapper;
import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import com.sk89q.worldedit.world.snapshot.SnapshotRepository;

View File

@ -146,7 +146,7 @@ public class LocalSession implements TextureHolder {
/** /**
* Construct the object. * Construct the object.
* <p> *
* <p>{@link #setConfiguration(LocalConfiguration)} should be called * <p>{@link #setConfiguration(LocalConfiguration)} should be called
* later with configuration.</p> * later with configuration.</p>
*/ */
@ -500,7 +500,7 @@ public class LocalSession implements TextureHolder {
* Performs an undo. * Performs an undo.
* *
* @param newBlockBag a new block bag * @param newBlockBag a new block bag
* @param player the player * @param player the player
* @return whether anything was undone * @return whether anything was undone
*/ */
public EditSession undo(@Nullable BlockBag newBlockBag, Player player) { public EditSession undo(@Nullable BlockBag newBlockBag, Player player) {
@ -536,7 +536,7 @@ public class LocalSession implements TextureHolder {
* Performs a redo * Performs a redo
* *
* @param newBlockBag a new block bag * @param newBlockBag a new block bag
* @param player the player * @param player the player
* @return whether anything was redone * @return whether anything was redone
*/ */
public EditSession redo(@Nullable BlockBag newBlockBag, Player player) { public EditSession redo(@Nullable BlockBag newBlockBag, Player player) {
@ -625,7 +625,7 @@ public class LocalSession implements TextureHolder {
/** /**
* Set the region selector. * Set the region selector.
* *
* @param world the world * @param world the world
* @param selector the selector * @param selector the selector
*/ */
public void setRegionSelector(World world, RegionSelector selector) { public void setRegionSelector(World world, RegionSelector selector) {
@ -782,7 +782,7 @@ public class LocalSession implements TextureHolder {
/** /**
* Sets the clipboard. * Sets the clipboard.
* <p> *
* <p>Pass {@code null} to clear 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 * @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 * or the tool is not assigned, the slot will be replaced with the
* brush tool. * brush tool.
* *
* @param item the item type ID * @param item the item type
* @return the tool, or {@code null} * @return the tool, or {@code null}
* @throws InvalidToolBindException if the item can't be bound to that item * @throws InvalidToolBindException if the item can't be bound to that item
*/ */
@ -1015,7 +1015,7 @@ public class LocalSession implements TextureHolder {
/** /**
* Set the tool. * 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} * @param tool the tool to set, which can be {@code null}
* @throws InvalidToolBindException if the item can't be bound to that item * @throws InvalidToolBindException if the item can't be bound to that item
*/ */

View File

@ -56,4 +56,4 @@ public enum PlayerDirection {
return isOrthogonal; return isOrthogonal;
} }
} }

View File

@ -19,6 +19,9 @@
package com.sk89q.worldedit; 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.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sk89q.worldedit.world.block.BaseBlock; 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.BundledItemData;
import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.registry.LegacyMapper;
import javax.script.ScriptException;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -72,8 +74,7 @@ import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import static com.sk89q.worldedit.event.platform.Interaction.HIT; import javax.script.ScriptException;
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
/** /**
* The entry point and container for a working implementation of WorldEdit. * The entry point and container for a working implementation of WorldEdit.

View File

@ -19,10 +19,11 @@
package com.sk89q.worldedit.blocks; package com.sk89q.worldedit.blocks;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
/** /**
* The colors for wool. * The colors for wool.

View File

@ -401,6 +401,7 @@ public class UtilityCommands extends MethodCommands {
@Logging(PLACEMENT) @Logging(PLACEMENT)
public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException { public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException {
worldEdit.checkMaxRadius(size); worldEdit.checkMaxRadius(size);
size = Math.max(1, size);
int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size); int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size);
player.print(BBC.getPrefix() + affected + " block(s) have been removed."); player.print(BBC.getPrefix() + affected + " block(s) have been removed.");
} }

View File

@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.argument.CommandArgs;
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
public class ItemParser extends SimpleCommand<BaseItem> { public class ItemParser extends SimpleCommand<BaseItem> {

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.command.argument; 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.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.extent.NullExtent; 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.EditContext;
import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.RegionFunction;
import com.sk89q.worldedit.function.block.BlockReplace; 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.function.pattern.Pattern;
import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.argument.CommandArgs;
import com.sk89q.worldedit.util.command.composition.SimpleCommand; 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>> { public class ReplaceParser extends SimpleCommand<Contextual<? extends RegionFunction>> {

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.command.composition; 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.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.command.argument.RegionFunctionParser; 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.CommandExecutor;
import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.util.command.composition.SimpleCommand;
import static com.google.common.base.Preconditions.checkNotNull;
public class ApplyCommand extends SimpleCommand<Contextual<? extends Operation>> { public class ApplyCommand extends SimpleCommand<Contextual<? extends Operation>> {
private final CommandExecutor<Contextual<? extends RegionFunction>> functionParser; private final CommandExecutor<Contextual<? extends RegionFunction>> functionParser;

View File

@ -20,6 +20,9 @@
package com.sk89q.worldedit.command.composition; package com.sk89q.worldedit.command.composition;
import com.boydti.fawe.config.BBC; 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.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.minecraft.util.commands.CommandPermissionsException; 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.CommandExecutor;
import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.util.command.composition.SimpleCommand;
import static com.google.common.base.Preconditions.checkNotNull;
public class ShapedBrushCommand extends SimpleCommand<Object> { public class ShapedBrushCommand extends SimpleCommand<Object> {
private final CommandExecutor<? extends Contextual<? extends Operation>> delegate; private final CommandExecutor<? extends Contextual<? extends Operation>> delegate;

View File

@ -19,7 +19,8 @@
package com.sk89q.worldedit.command.tool; 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.entity.Player;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;

View File

@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.blocks.MobSpawnerBlock; import com.sk89q.worldedit.blocks.MobSpawnerBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
/** /**
* Looks up information about a block. * Looks up information about a block.

View File

@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException; 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.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockTypes; 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 { public class CylinderBrush implements Brush {

View File

@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
public class HollowCylinderBrush implements Brush { public class HollowCylinderBrush implements Brush {

View File

@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
public class HollowSphereBrush implements Brush { public class HollowSphereBrush implements Brush {

View File

@ -20,13 +20,12 @@
package com.sk89q.worldedit.command.tool.brush; package com.sk89q.worldedit.command.tool.brush;
import com.sk89q.worldedit.EditSession; 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.MaxChangedBlocksException;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3; 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.GaussianKernel;
import com.sk89q.worldedit.math.convolution.HeightMap;
import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.math.convolution.HeightMapFilter;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;

View File

@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
public class SphereBrush implements Brush { public class SphereBrush implements Brush {

View File

@ -21,14 +21,11 @@ package com.sk89q.worldedit.command.util;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.util.SetQueue;
import com.boydti.fawe.util.TaskManager; import com.boydti.fawe.util.TaskManager;
import com.google.common.base.Supplier;
import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.entity.metadata.EntityProperties;
import com.sk89q.worldedit.function.EntityFunction; import com.sk89q.worldedit.function.EntityFunction;
import java.util.concurrent.Callable;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -151,6 +148,7 @@ public class EntityRemover {
return true; return true;
} }
} }
return false; return false;
}; };
} }

View File

@ -19,16 +19,14 @@
package com.sk89q.worldedit.entity; package com.sk89q.worldedit.entity;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.world.NbtValued; import com.sk89q.worldedit.world.NbtValued;
import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityType;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.HashMap;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Represents a mutable "snapshot" of an entity. * Represents a mutable "snapshot" of an entity.
* *

View File

@ -19,13 +19,13 @@
package com.sk89q.worldedit.event.platform; 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.Cancellable;
import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.event.Event;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.Location;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Called when a block is interacted with. * Called when a block is interacted with.
*/ */

View File

@ -19,14 +19,14 @@
package com.sk89q.worldedit.event.platform; package com.sk89q.worldedit.event.platform;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.event.Event;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Posted when suggestions for auto-completion are requested for command input. * Posted when suggestions for auto-completion are requested for command input.
*/ */

View File

@ -19,11 +19,11 @@
package com.sk89q.worldedit.event.platform; package com.sk89q.worldedit.event.platform;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.event.Event;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Raised when the configuration has been loaded or re-loaded. * Raised when the configuration has been loaded or re-loaded.
*/ */

View File

@ -19,12 +19,12 @@
package com.sk89q.worldedit.event.platform; package com.sk89q.worldedit.event.platform;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Cancellable;
import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.event.Event;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Raised whenever a player sends input. * Raised whenever a player sends input.
*/ */

View File

@ -21,16 +21,11 @@ package com.sk89q.worldedit.extension.factory;
import com.sk89q.util.StringUtil; import com.sk89q.util.StringUtil;
import com.sk89q.worldedit.WorldEdit; 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.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.internal.registry.AbstractFactory; import com.sk89q.worldedit.internal.registry.AbstractFactory;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -39,6 +39,7 @@ public final class MaskFactory extends AbstractFactory<Mask> {
*/ */
public MaskFactory(WorldEdit worldEdit) { public MaskFactory(WorldEdit worldEdit) {
super(worldEdit); super(worldEdit);
parsers.add(new DefaultMaskParser(worldEdit)); parsers.add(new DefaultMaskParser(worldEdit));
} }

View File

@ -39,6 +39,7 @@ public final class PatternFactory extends AbstractFactory<Pattern> {
*/ */
public PatternFactory(WorldEdit worldEdit) { public PatternFactory(WorldEdit worldEdit) {
super(worldEdit); super(worldEdit);
parsers.add(new HashTagPatternParser(worldEdit)); parsers.add(new HashTagPatternParser(worldEdit));
} }

View File

@ -21,14 +21,13 @@ package com.sk89q.worldedit.extension.factory;
import com.sk89q.util.StringUtil; import com.sk89q.util.StringUtil;
import com.sk89q.worldedit.WorldEdit; 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.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.function.pattern.RandomPattern; import com.sk89q.worldedit.function.pattern.RandomPattern;
import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.internal.registry.InputParser;
import com.sk89q.worldedit.world.block.BlockStateHolder;
class RandomPatternParser extends InputParser<Pattern> { class RandomPatternParser extends InputParser<Pattern> {

View File

@ -20,11 +20,11 @@
package com.sk89q.worldedit.extension.factory; package com.sk89q.worldedit.extension.factory;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.internal.registry.InputParser;
import com.sk89q.worldedit.extension.input.InputParseException;
class SingleBlockPatternParser extends InputParser<Pattern> { class SingleBlockPatternParser extends InputParser<Pattern> {

View File

@ -19,7 +19,6 @@
package com.sk89q.worldedit.extension.platform; package com.sk89q.worldedit.extension.platform;
import com.sk89q.worldedit.entity.metadata.Metadatable;
import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.session.SessionOwner;
import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.Identifiable;

View File

@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.registry.Registries; import com.sk89q.worldedit.world.registry.Registries;
import javax.annotation.Nullable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable;
/** /**
* Represents a platform that WorldEdit has been implemented for. * Represents a platform that WorldEdit has been implemented for.
* *

View File

@ -20,12 +20,11 @@
package com.sk89q.worldedit.extent; package com.sk89q.worldedit.extent;
import com.sk89q.worldedit.WorldEditException; 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.function.operation.Operation;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BaseBiome;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import javax.annotation.Nullable; 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 * 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 * not tie the given {@link BlockStateHolder} to the world, so future changes to the
* {@link BlockState} do not affect the world until this method is called again. * {@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 * <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 * successful. It may not be successful if, for example, the location is out

View File

@ -22,9 +22,6 @@ package com.sk89q.worldedit.extent.buffer;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.WorldEditException; 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.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.function.mask.Mask; 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.AbstractRegion;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionOperationException; 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.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;

View File

@ -63,4 +63,4 @@ public class LastAccessExtentCache extends AbstractDelegateExtent {
} }
} }
} }

View File

@ -19,13 +19,13 @@
package com.sk89q.worldedit.extent.clipboard; 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.BaseEntity;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.Location; 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. * An implementation of {@link Entity} that stores a {@link BaseEntity} with it.
* *

View File

@ -20,7 +20,6 @@
package com.sk89q.worldedit.extent.clipboard.io; package com.sk89q.worldedit.extent.clipboard.io;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.world.registry.Registries;
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException; import java.io.IOException;

View File

@ -60,4 +60,4 @@ public abstract class NBTSchematicReader implements ClipboardReader {
return expected.cast(test); return expected.cast(test);
} }
} }

View File

@ -20,7 +20,6 @@
package com.sk89q.worldedit.extent.clipboard.io.legacycompat; package com.sk89q.worldedit.extent.clipboard.io.legacycompat;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
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.BlockStateHolder;

View File

@ -26,7 +26,6 @@ import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSyntaxException; import com.google.gson.JsonSyntaxException;
import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
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.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;

View File

@ -35,8 +35,8 @@ import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.LocatedBlock; import com.sk89q.worldedit.util.LocatedBlock;
import com.sk89q.worldedit.util.collection.TupleArrayList; import com.sk89q.worldedit.util.collection.TupleArrayList;
import com.sk89q.worldedit.world.block.BlockCategories; 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.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.Deque; import java.util.Deque;

View File

@ -19,15 +19,13 @@
package com.sk89q.worldedit.extent.validation; package com.sk89q.worldedit.extent.validation;
import static com.google.common.base.Preconditions.checkArgument;
import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.WorldEditException; 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.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent; 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; import com.sk89q.worldedit.world.block.BlockStateHolder;
/** /**
@ -43,7 +41,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
* Create a new instance. * Create a new instance.
* *
* @param extent the extent * @param extent the extent
* @param limit the limit (>= 0) or -1 for no limit * @param limit the limit (&gt;= 0) or -1 for no limit
*/ */
public BlockChangeLimiter(Extent extent, int limit) { public BlockChangeLimiter(Extent extent, int limit) {
super(extent); super(extent);
@ -53,7 +51,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
/** /**
* Get the limit. * Get the limit.
* *
* @return the limit (>= 0) or -1 for no limit * @return the limit (&gt;= 0) or -1 for no limit
*/ */
public int getLimit() { public int getLimit() {
return limit; return limit;
@ -62,7 +60,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
/** /**
* Set the limit. * Set the limit.
* *
* @param limit the limit (>= 0) or -1 for no limit * @param limit the limit (&gt;= 0) or -1 for no limit
*/ */
public void setLimit(int limit) { public void setLimit(int limit) {
checkArgument(limit >= -1, "limit >= -1 required"); checkArgument(limit >= -1, "limit >= -1 required");

View File

@ -21,16 +21,13 @@ package com.sk89q.worldedit.extent.validation;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.WorldEditException; 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.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.world.block.BlockType;
/** /**
* Validates set data to prevent creating invalid blocks and such. * Validates set data to prevent creating invalid blocks and such.

View File

@ -21,18 +21,14 @@ package com.sk89q.worldedit.extent.world;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder; 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.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; 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 * Handles various quirks when setting blocks, such as ice turning

View File

@ -21,15 +21,12 @@ package com.sk89q.worldedit.extent.world;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.WorldEditException; 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.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Automatically loads chunks when blocks are accessed. * Automatically loads chunks when blocks are accessed.

View File

@ -21,22 +21,19 @@ package com.sk89q.worldedit.extent.world;
import static com.google.common.base.Preconditions.checkNotNull; 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.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.AbstractDelegateExtent;
import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.operation.RunContext; 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.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Implements "fast mode" which may skip physics, lighting, etc. * Implements "fast mode" which may skip physics, lighting, etc.
*/ */

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