Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-03 01:50:07 +01:00
Merge remote-tracking branch 'refs/remotes/isfawe/new-vector-system' into new-vector-system
Dieser Commit ist enthalten in:
Commit
f74381b93f
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,7 +10,6 @@ eclipse
|
||||
bin
|
||||
build
|
||||
target
|
||||
gradle
|
||||
.gradle
|
||||
forge-download
|
||||
out
|
||||
|
1076
CHANGELOG.txt
1076
CHANGELOG.txt
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -1,7 +1,7 @@
|
||||
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.
|
||||
|
||||
The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with four modules:
|
||||
|
@ -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
Normale Datei
16
HEADER.txt
Normale Datei
@ -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/>.
|
197
README.html
197
README.html
@ -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>
|
26
README.md
26
README.md
@ -6,15 +6,23 @@
|
||||
|
||||
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
|
||||
### - **`> `**[`Discord`](https://discord.gg/ngZCzbU)`|`[`IRC`](http://webchat.esper.net/?nick=&channels=IntellectualCrafters)` | `[`Spigot Forums`](https://www.spigotmc.org/threads/fast-async-worldedit.100104/)**` <`**
|
||||
* [Spigot Page](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
|
||||
FAWE uses gradle to build
|
||||
@ -26,6 +34,6 @@ $ gradlew build
|
||||
|
||||
## Contributing
|
||||
Have an idea for an optimization, or a cool feature?
|
||||
- I'll accept most PR's
|
||||
- Let me know what you've tested / what may need further testing
|
||||
- If you need any help, create a ticket or discuss on Discord
|
||||
- We will accept most PR's
|
||||
- Let us know what you've tested / what may need further testing
|
||||
- If you need any help, create a ticket or discuss on [Discord](https://discord.gg/ngZCzbU)
|
||||
|
46
build.gradle
46
build.gradle
@ -1,7 +1,6 @@
|
||||
print new File('splash.txt').text
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
jcenter()
|
||||
@ -15,16 +14,24 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
|
||||
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0'
|
||||
classpath 'org.ajoberstar:gradle-git:1.5.1'
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
|
||||
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
|
||||
classpath 'org.ajoberstar:gradle-git:1.7.2'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'net.minecrell.licenser' version '0.4.1' apply false
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
clean { delete "target" }
|
||||
|
||||
print new File('splash.txt').text
|
||||
|
||||
group = 'com.boydti.fawe'
|
||||
|
||||
def rootVersion = "1.13"
|
||||
def revision = ""
|
||||
def buildNumber = ""
|
||||
def date = ""
|
||||
@ -33,13 +40,13 @@ ext {
|
||||
git = org.ajoberstar.grgit.Grgit.open(file(".git"))
|
||||
date = git.head().date.format("yy.MM.dd")
|
||||
revision = "-${git.head().abbreviatedId}"
|
||||
index = 0; // Offset to match CI
|
||||
index = -1960; // Offset to match CI
|
||||
parents = git.head().parentIds;
|
||||
for (; parents != null && !parents.isEmpty(); index++) {
|
||||
commit = git.getResolve().toCommit(parents.get(0));
|
||||
parents = commit.getParentIds()
|
||||
}
|
||||
buildNumber = "-${index}"
|
||||
buildNumber = "${index}"
|
||||
} catch (Throwable ignore) {
|
||||
revision = "-unknown"
|
||||
}
|
||||
@ -48,7 +55,7 @@ ext {
|
||||
if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion
|
||||
version = "unknown"
|
||||
} else {
|
||||
version = date + revision + buildNumber
|
||||
version = String.format("%s.%s", rootVersion, buildNumber)
|
||||
}
|
||||
description = """FastAsyncWorldEdit"""
|
||||
|
||||
@ -56,9 +63,8 @@ subprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
// Enable this requires putting license header files in many, many FAWE files
|
||||
//apply plugin: 'net.minecrell.licenser'
|
||||
|
||||
ext.internalVersion = version
|
||||
|
||||
@ -69,25 +75,32 @@ subprojects {
|
||||
|
||||
repositories {
|
||||
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://maven.sk89q.com/repo/" }
|
||||
maven { url "http://repo.maven.apache.org/maven2" }
|
||||
// Fawe
|
||||
maven {url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/"}
|
||||
maven {url "https://mvnrepository.com/artifact/"}
|
||||
maven {url "http://repo.dmulloy2.net/content/groups/public/"}
|
||||
maven {url "https://repo.destroystokyo.com/repository/maven-public//"}
|
||||
maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"}
|
||||
mavenLocal()
|
||||
maven {url "http://empcraft.com/maven2"}
|
||||
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
|
||||
maven {url "http://ci.frostcast.net/plugin/repository/everything"}
|
||||
maven {url "http://maven.sk89q.com/artifactory/repo"}
|
||||
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://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) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
@ -95,6 +108,7 @@ subprojects {
|
||||
|
||||
artifacts {
|
||||
archives jar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
|
||||
@ -122,4 +136,10 @@ subprojects {
|
||||
exclude '.cache'
|
||||
exclude 'LICENSE*'
|
||||
}
|
||||
|
||||
// Enable this requires putting license header files in many, many FAWE files
|
||||
//license {
|
||||
// header = rootProject.file("HEADER.txt")
|
||||
// include '**/*.java'
|
||||
//}
|
||||
}
|
||||
|
@ -53,11 +53,4 @@
|
||||
<module name="ParameterName"/>
|
||||
<!-- <module name="TypeName"/> Unlikely that we would miss this in a PR -->
|
||||
</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>
|
||||
|
@ -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/>.
|
||||
*/
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binäre Datei nicht angezeigt.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,5 @@
|
||||
#Thu Jul 26 14:29:48 AEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
============= You are compiling: =============
|
||||
_______ ___ ____ __ ____ _______
|
||||
| ____| / \ \ \ / \ / / | ____|
|
||||
@ -15,7 +15,6 @@ If you encounter trouble:
|
||||
- Use gradlew and not gradle
|
||||
- Ask us!
|
||||
- https://discord.gg/ngZCzbU (Discord)
|
||||
- https://goo.gl/Zwvv8J (IRC)
|
||||
|
||||
Files will be output to `/target`
|
||||
|
||||
|
@ -4,13 +4,14 @@ apply plugin: 'maven'
|
||||
|
||||
repositories {
|
||||
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 {
|
||||
compile project(':worldedit-core')
|
||||
compile 'com.sk89q:dummypermscompat:1.8'
|
||||
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'
|
||||
compile 'net.milkbowl.vault:VaultAPI:1.5.6'
|
||||
compile 'com.massivecraft:factions:2.8.0'
|
||||
@ -28,9 +29,6 @@ dependencies {
|
||||
compile 'com.wasteofplastic:askyblock:3.0.8.2'
|
||||
compile 'com.sk89q:worldguard-core:latest'
|
||||
compile 'com.sk89q:worldguard-legacy:latest'
|
||||
compile('org.inventivetalent:mapmanager:1.4.0-SNAPSHOT') {
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -91,7 +91,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
}
|
||||
if (Bukkit.getVersion().contains("git-Spigot")) {
|
||||
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(" - This is only a recommendation");
|
||||
debug("==============================");
|
||||
@ -124,13 +124,13 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
new ChunkListener_9();
|
||||
}
|
||||
|
||||
try {
|
||||
/*try {
|
||||
Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent");
|
||||
new AsyncTabCompleteListener(WorldEditPlugin.getInstance());
|
||||
} catch (Throwable ignore)
|
||||
{
|
||||
Bukkit.getPluginManager().registerEvents(new SyncTabCompleteListener(WorldEditPlugin.getInstance()), plugin);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
|
||||
} else if (foreign instanceof NBTTagDouble) {
|
||||
return new DoubleTag(((NBTTagDouble) foreign).asDouble()); // getDouble
|
||||
} else if (foreign instanceof NBTTagFloat) {
|
||||
return new FloatTag(((NBTTagFloat) foreign).asByte()); // getFloat
|
||||
return new FloatTag(((NBTTagFloat) foreign).asFloat()); // getFloat
|
||||
} else if (foreign instanceof NBTTagInt) {
|
||||
return new IntTag(((NBTTagInt) foreign).asInt()); // getInt
|
||||
} else if (foreign instanceof NBTTagIntArray) {
|
||||
|
@ -38,4 +38,5 @@ public class FallbackRegistrationListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,16 +19,16 @@
|
||||
|
||||
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.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
private YAMLProcessor config;
|
||||
private Map<String, Set<String>> userPermissionsCache;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.wepif;
|
||||
|
||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
import com.sk89q.util.yaml.YAMLProcessor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@ -27,7 +28,6 @@ import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.wepif;
|
||||
|
||||
import com.sk89q.util.yaml.YAMLFormat;
|
||||
import com.sk89q.util.yaml.YAMLProcessor;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -103,6 +102,7 @@ public class PermissionsResolverManager implements PermissionsResolver {
|
||||
protected PermissionsResolverManager(Plugin plugin) {
|
||||
this.server = plugin.getServer();
|
||||
(new ServerListener()).register(plugin); // Register the events
|
||||
|
||||
loadConfig(new File("wepif.yml"));
|
||||
findResolver();
|
||||
}
|
||||
|
@ -25,11 +25,12 @@ import com.sk89q.worldedit.world.biome.BiomeData;
|
||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* A biome registry for Bukkit.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.bukkit.util.CommandInspector;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -30,8 +32,6 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
class BukkitCommandInspector implements CommandInspector {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName());
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
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.world.NullWorld;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
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.
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.metadata.EntityProperties;
|
||||
import org.bukkit.entity.Ambient;
|
||||
import org.bukkit.entity.Animals;
|
||||
@ -42,8 +44,6 @@ import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.entity.minecart.ExplosiveMinecart;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
class BukkitEntityProperties implements EntityProperties {
|
||||
|
||||
private final Entity entity;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -21,7 +21,11 @@ package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
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.world.block.BlockState;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -177,6 +177,9 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter
|
||||
// platforms to be worried about... at the current time of writing
|
||||
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
|
||||
|
||||
// Setup the BukkitImplementationTester.
|
||||
BukkitImplementationTester.getImplementation();
|
||||
|
||||
{ // Register 1.13 Material ids with LegacyMapper
|
||||
LegacyMapper legacyMapper = LegacyMapper.getInstance();
|
||||
for (Material m : Material.values()) {
|
||||
|
@ -99,7 +99,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
|
||||
Entity createEntity(Location location, BaseEntity state);
|
||||
|
||||
/**
|
||||
* Get a map of string -> properties
|
||||
* Get a map of {@code string -> property}.
|
||||
*
|
||||
* @param blockType The block type
|
||||
* @return The properties map
|
||||
|
@ -19,13 +19,15 @@
|
||||
|
||||
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.plugin.PluginManager;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
public class DinnerPermsResolverTest {
|
||||
private DinnerPermsResolver resolver;
|
||||
|
@ -28,7 +28,11 @@ import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
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 {
|
||||
private boolean op;
|
||||
|
@ -1,6 +1,8 @@
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
repositories {
|
||||
maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"}
|
||||
}
|
||||
dependencies {
|
||||
compile 'de.schlichtherle:truezip:6.8.3'
|
||||
compile 'rhino:js:1.7R2'
|
||||
|
@ -27,7 +27,6 @@ import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -25,9 +25,6 @@ import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.util.gson.GsonUtil;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.util.gson.GsonUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -24,7 +24,6 @@ import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -115,4 +114,4 @@ public class SkullBlock extends BaseBlock {
|
||||
owner = ((StringTag) t).getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,6 +362,8 @@ public class Fawe {
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "fr/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "cn/message.yml", null);
|
||||
MainUtil.copyFile(MainUtil.getJarFile(), "it/message.yml", null);
|
||||
// Setting up config.yml
|
||||
File file = new File(this.IMP.getDirectory(), "config.yml");
|
||||
Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", "");
|
||||
|
@ -118,7 +118,7 @@ public enum BBC {
|
||||
BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"),
|
||||
BRUSH_NONE("You aren't holding a brush!", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_SET("Set scroll action to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_UNSET("Removed scrol action", "WorldEdit.Brush"),
|
||||
BRUSH_SCROLL_ACTION_UNSET("Removed scroll action", "WorldEdit.Brush"),
|
||||
BRUSH_VISUAL_MODE_SET("Set visual mode to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_TARGET_MODE_SET("Set target mode to %s0", "WorldEdit.Brush"),
|
||||
BRUSH_TARGET_MASK_SET("Set target mask to %s0", "WorldEdit.Brush"),
|
||||
|
@ -23,7 +23,7 @@ public class Settings extends Config {
|
||||
@Final
|
||||
public String PLATFORM; // These values are set from FAWE before loading
|
||||
|
||||
@Comment({"Options: de, es, fr, nl, ru, tr",
|
||||
@Comment({"Options: cn, de, es, fr, it, nl, ru, tr",
|
||||
"Create a PR to contribute a translation: https://github.com/boy0001/FastAsyncWorldedit/new/master/core/src/main/resources",})
|
||||
public String LANGUAGE = "";
|
||||
@Comment({"Enable or disable automatic updates",
|
||||
@ -325,7 +325,7 @@ public class Settings extends Config {
|
||||
public boolean ANVIL_QUEUE_MODE = false;
|
||||
@Comment({
|
||||
"[SAFE] Dynamically increase the number of chunks rendered",
|
||||
" - Requires Paper: ci.destroystokyo.com/job/PaperSpigot/",
|
||||
" - Requires Paper: ci.destroystokyo.com/job/Paper-1.13/",
|
||||
" - Set your server view distance to 1 (spigot.yml, server.properties)",
|
||||
" - Based on tps and player movement",
|
||||
" - Note: If entities become hidden, increase the server view distance to 3",
|
||||
|
@ -160,7 +160,7 @@ public class InstallerFrame extends JFrame {
|
||||
} catch (Throwable ignore) {
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
URL chat = new URL("http://webchat.esper.net/?nick=&channels=IntellectualCrafters&fg_color=000&fg_sec_color=000&bg_color=FFF");
|
||||
URL chat = new URL("https://discord.gg/ngZCzbU");
|
||||
URLButton chatButton = new URLButton(chat, "Chat");
|
||||
bottomBar.add(chatButton);
|
||||
URL wiki = new URL("https://github.com/boy0001/FastAsyncWorldedit/wiki");
|
||||
|
@ -276,6 +276,10 @@ public class Schematic {
|
||||
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ();
|
||||
// entities
|
||||
for (Entity entity : clipboard.getEntities()) {
|
||||
// skip players on pasting schematic
|
||||
if (entity.getState() != null && entity.getState().getType().getId().equals("minecraft:player")) {
|
||||
continue;
|
||||
}
|
||||
Location pos = entity.getLocation();
|
||||
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.getPitch());
|
||||
extent.createEntity(newPos, entity.getState());
|
||||
|
@ -1,6 +1,24 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import com.sk89q.worldedit.function.entity.ExtentEntityCopy;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -12,6 +30,7 @@ import java.util.Map;
|
||||
public final class CompoundTag extends Tag {
|
||||
|
||||
private final Map<String, Tag> value;
|
||||
|
||||
/**
|
||||
* Creates the tag with an empty name.
|
||||
*
|
||||
@ -425,5 +444,4 @@ public final class CompoundTag extends Tag {
|
||||
return bldr.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -19,11 +19,11 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Helps create compound tags.
|
||||
*/
|
||||
@ -145,14 +145,14 @@ public class CompoundTagBuilder {
|
||||
return put(key, new LongArrayTag(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Put the given key and value into the compound tag as a
|
||||
* {@code LongTag}.
|
||||
*
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
* @return this object
|
||||
*/
|
||||
/**
|
||||
* Put the given key and value into the compound tag as a
|
||||
* {@code LongTag}.
|
||||
*
|
||||
* @param key they key
|
||||
* @param value the value
|
||||
* @return this object
|
||||
*/
|
||||
public CompoundTagBuilder putLong(String key, long value) {
|
||||
return put(key, new LongTag(value));
|
||||
}
|
||||
@ -213,5 +213,4 @@ public class CompoundTagBuilder {
|
||||
return new CompoundTagBuilder();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The {@code TAG_List} tag.
|
||||
@ -64,7 +65,7 @@ public final class ListTag<T extends Tag> extends Tag {
|
||||
|
||||
/**
|
||||
* Get the tag if it exists at the given index.
|
||||
*
|
||||
*
|
||||
* @param index the index
|
||||
* @return the tag or null
|
||||
*/
|
||||
@ -419,6 +420,4 @@ public final class ListTag<T extends Tag> extends Tag {
|
||||
return bldr.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Helps create list tags.
|
||||
*/
|
||||
|
@ -16,13 +16,18 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Long_Array} tag.
|
||||
*/
|
||||
public class LongArrayTag extends Tag {
|
||||
|
||||
private final long[] value;
|
||||
|
||||
/**
|
||||
* Creates the tag with an empty name.
|
||||
*
|
||||
@ -33,10 +38,12 @@ public class LongArrayTag extends Tag {
|
||||
checkNotNull(value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long[] getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder hex = new StringBuilder();
|
||||
@ -49,4 +56,5 @@ public class LongArrayTag extends Tag {
|
||||
}
|
||||
return "TAG_Long_Array(" + hex + ")";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import java.util.function.Function;
|
||||
* This class reads <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
|
||||
* streams, and produces an object graph of subclasses of the {@code Tag}
|
||||
* object.
|
||||
* <p>
|
||||
*
|
||||
* <p>The NBT format was created by Markus Persson, and the specification may be
|
||||
* found at <a href="http://www.minecraft.net/docs/NBT.txt">
|
||||
* http://www.minecraft.net/docs/NBT.txt</a>.</p>
|
||||
@ -49,7 +49,7 @@ public final class NBTInputStream implements Closeable {
|
||||
/**
|
||||
* Creates a new {@code NBTInputStream}, which will source its data
|
||||
* from the specified input stream.
|
||||
*
|
||||
*
|
||||
* @param is the input stream
|
||||
* @throws IOException if an I/O error occurs
|
||||
*/
|
||||
@ -67,7 +67,7 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads an NBT tag from the stream.
|
||||
*
|
||||
*
|
||||
* @return The tag that was read.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*/
|
||||
@ -87,7 +87,7 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads an NBT from the stream.
|
||||
*
|
||||
*
|
||||
* @param depth the depth of this tag
|
||||
* @return The tag that was read.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
@ -519,8 +519,8 @@ public final class NBTInputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Reads the payload of a tag given the type.
|
||||
*
|
||||
* @param type the type
|
||||
*
|
||||
* @param type the type
|
||||
* @param depth the depth
|
||||
* @return the tag
|
||||
* @throws IOException if an I/O error occurs.
|
||||
@ -617,5 +617,4 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.jnbt;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.object.io.LittleEndianOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.DataOutput;
|
||||
@ -29,13 +31,10 @@ import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
|
||||
* {@code Tag} objects to an underlying {@code OutputStream}.
|
||||
* <p>
|
||||
*
|
||||
* <p>The NBT format was created by Markus Persson, and the specification may be
|
||||
* found at <a href="http://www.minecraft.net/docs/NBT.txt">
|
||||
* http://www.minecraft.net/docs/NBT.txt</a>.</p>
|
||||
@ -50,9 +49,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
/**
|
||||
* Creates a new {@code NBTOutputStream}, which will write data to the
|
||||
* specified underlying output stream.
|
||||
*
|
||||
* @param os The output stream.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param os
|
||||
* The output stream.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public NBTOutputStream(OutputStream os) throws IOException {
|
||||
this.os = new DataOutputStream(os);
|
||||
@ -74,13 +75,16 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a tag.
|
||||
*
|
||||
* @param tag The tag to write.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag to write.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public void writeNamedTag(String name, Tag tag) throws IOException {
|
||||
checkNotNull(name);
|
||||
checkNotNull(tag);
|
||||
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
writeNamedTagName(name, type);
|
||||
if (type == NBTConstants.TYPE_END) {
|
||||
@ -197,62 +201,66 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes tag payload.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public void writeTagPayload(Tag tag) throws IOException {
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
switch (type) {
|
||||
case NBTConstants.TYPE_END:
|
||||
writeEndTagPayload((EndTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE:
|
||||
writeByteTagPayload((ByteTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_SHORT:
|
||||
writeShortTagPayload((ShortTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT:
|
||||
writeIntTagPayload((IntTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG:
|
||||
writeLongTagPayload((LongTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_FLOAT:
|
||||
writeFloatTagPayload((FloatTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_DOUBLE:
|
||||
writeDoubleTagPayload((DoubleTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE_ARRAY:
|
||||
writeByteArrayTagPayload((ByteArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_STRING:
|
||||
writeStringTagPayload((StringTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LIST:
|
||||
writeListTagPayload((ListTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_COMPOUND:
|
||||
writeCompoundTagPayload((CompoundTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT_ARRAY:
|
||||
writeIntArrayTagPayload((IntArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG_ARRAY:
|
||||
writeLongArrayTagPayload((LongArrayTag) tag);
|
||||
break;
|
||||
default:
|
||||
throw new IOException("Invalid tag type: " + type + ".");
|
||||
case NBTConstants.TYPE_END:
|
||||
writeEndTagPayload((EndTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE:
|
||||
writeByteTagPayload((ByteTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_SHORT:
|
||||
writeShortTagPayload((ShortTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT:
|
||||
writeIntTagPayload((IntTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG:
|
||||
writeLongTagPayload((LongTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_FLOAT:
|
||||
writeFloatTagPayload((FloatTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_DOUBLE:
|
||||
writeDoubleTagPayload((DoubleTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_BYTE_ARRAY:
|
||||
writeByteArrayTagPayload((ByteArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_STRING:
|
||||
writeStringTagPayload((StringTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LIST:
|
||||
writeListTagPayload((ListTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_COMPOUND:
|
||||
writeCompoundTagPayload((CompoundTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_INT_ARRAY:
|
||||
writeIntArrayTagPayload((IntArrayTag) tag);
|
||||
break;
|
||||
case NBTConstants.TYPE_LONG_ARRAY:
|
||||
writeLongArrayTagPayload((LongArrayTag) tag);
|
||||
break;
|
||||
default:
|
||||
throw new IOException("Invalid tag type: " + type + ".");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Byte} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeByteTagPayload(ByteTag tag) throws IOException {
|
||||
os.writeByte(tag.getValue());
|
||||
@ -260,9 +268,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Byte_Array} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException {
|
||||
byte[] bytes = tag.getValue();
|
||||
@ -272,9 +282,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Compound} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeCompoundTagPayload(CompoundTag tag) throws IOException {
|
||||
for (Map.Entry<String, Tag> entry : tag.getValue().entrySet()) {
|
||||
@ -285,9 +297,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_List} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeListTagPayload(ListTag tag) throws IOException {
|
||||
Class<? extends Tag> clazz = tag.getType();
|
||||
@ -310,9 +324,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_String} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeStringTagPayload(StringTag tag) throws IOException {
|
||||
byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET);
|
||||
@ -322,9 +338,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Double} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeDoubleTagPayload(DoubleTag tag) throws IOException {
|
||||
os.writeDouble(tag.getValue());
|
||||
@ -332,9 +350,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Float} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeFloatTagPayload(FloatTag tag) throws IOException {
|
||||
os.writeFloat(tag.getValue());
|
||||
@ -342,9 +362,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Long} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeLongTagPayload(LongTag tag) throws IOException {
|
||||
os.writeLong(tag.getValue());
|
||||
@ -352,9 +374,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Int} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeIntTagPayload(IntTag tag) throws IOException {
|
||||
os.writeInt(tag.getValue());
|
||||
@ -362,9 +386,11 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Short} tag.
|
||||
*
|
||||
* @param tag The tag.
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @param tag
|
||||
* The tag.
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
private void writeShortTagPayload(ShortTag tag) throws IOException {
|
||||
os.writeShort(tag.getValue());
|
||||
@ -372,19 +398,19 @@ public final class NBTOutputStream implements Closeable {
|
||||
|
||||
/**
|
||||
* Writes a {@code TAG_Empty} tag.
|
||||
*
|
||||
*
|
||||
* @param tag the tag
|
||||
*/
|
||||
private void writeEndTagPayload(EndTag tag) {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
|
||||
private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
|
||||
int[] data = tag.getValue();
|
||||
os.writeInt(data.length);
|
||||
for (int aData : data) {
|
||||
os.writeInt(aData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeLongArrayTagPayload(LongArrayTag tag) throws IOException {
|
||||
|
@ -26,8 +26,6 @@ import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A class which contains NBT-related utility methods.
|
||||
*
|
||||
|
@ -26,7 +26,7 @@ public abstract class Tag {
|
||||
|
||||
/**
|
||||
* Gets the value of this tag.
|
||||
*
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
public abstract Object getValue();
|
||||
@ -34,8 +34,4 @@ public abstract class Tag {
|
||||
public Object getRaw() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -19,12 +19,13 @@
|
||||
|
||||
package com.sk89q.minecraft.util.commands;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class CommandException extends Exception {
|
||||
|
||||
|
@ -28,7 +28,8 @@ import java.util.*;
|
||||
|
||||
public final class ReflectionUtil {
|
||||
|
||||
private ReflectionUtil() {}
|
||||
private ReflectionUtil() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getField(Object from, String name) {
|
||||
@ -50,4 +51,5 @@ public final class ReflectionUtil {
|
||||
} while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Trim a string if it is longer than a certain length.
|
||||
*
|
||||
*
|
||||
* @param str the stirng
|
||||
* @param len the length to trim to
|
||||
* @return a new string
|
||||
@ -49,7 +49,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -68,7 +68,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -76,7 +76,7 @@ public final class StringUtil {
|
||||
* @return a new string
|
||||
*/
|
||||
public static String joinQuotedString(String[] str, String delimiter,
|
||||
int initialIndex, String quote) {
|
||||
int initialIndex, String quote) {
|
||||
if (str.length == 0) {
|
||||
return "";
|
||||
}
|
||||
@ -92,7 +92,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str the string array
|
||||
* @param delimiter the delimiter
|
||||
* @return a new string
|
||||
@ -103,7 +103,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str an array of objects
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -122,7 +122,7 @@ public final class StringUtil {
|
||||
|
||||
/**
|
||||
* Join an array of strings into a string.
|
||||
*
|
||||
*
|
||||
* @param str a list of integers
|
||||
* @param delimiter the delimiter
|
||||
* @param initialIndex the initial index to start form
|
||||
@ -219,7 +219,7 @@ public final class StringUtil {
|
||||
* calculated). (Note that the arrays aren't really copied anymore, just
|
||||
* switched...this is clearly much better than cloning an array or doing
|
||||
* a System.arraycopy() each time through the outer loop.)
|
||||
*
|
||||
*
|
||||
* Effectively, the difference between the two implementations is this
|
||||
* one does not cause an out of memory condition when calculating the LD
|
||||
* over two very large strings.
|
||||
@ -323,4 +323,4 @@ public final class StringUtil {
|
||||
|
||||
return parsableBlocks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,13 @@ import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a configuration node.
|
||||
*/
|
||||
|
@ -27,7 +27,13 @@ import org.yaml.snakeyaml.nodes.Tag;
|
||||
import org.yaml.snakeyaml.reader.UnicodeReader;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -294,4 +300,5 @@ public class YAMLProcessor extends YAMLNode {
|
||||
this.nullRepresenter = o -> representScalar(Tag.NULL, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
|
||||
/**
|
||||
* Return fast mode status.
|
||||
* <p>
|
||||
*
|
||||
* <p>Fast mode may skip lighting checks or adjacent block
|
||||
* notification.</p>
|
||||
*
|
||||
@ -1020,8 +1020,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Set a block, bypassing both history and block re-ordering.
|
||||
*
|
||||
* @param position the position to set the block at
|
||||
* @param block the block
|
||||
* @param stage the level
|
||||
* @param block the block
|
||||
* @param stage the level
|
||||
* @return whether the block changed
|
||||
* @throws WorldEditException thrown on a set error
|
||||
*/
|
||||
@ -1637,7 +1637,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Sets all the blocks inside a region to a given pattern.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern that provides the replacement block
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1691,8 +1691,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Replaces all the blocks matching a given mask, within a given region, to a block
|
||||
* returned by a given pattern.
|
||||
*
|
||||
* @param region the region to replace the blocks within
|
||||
* @param mask the mask that blocks must match
|
||||
* @param region the region to replace the blocks within
|
||||
* @param mask the mask that blocks must match
|
||||
* @param pattern the pattern that provides the new blocks
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1714,7 +1714,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* If the center sits between two blocks on a certain axis, then two blocks
|
||||
* will be placed to mark the center.
|
||||
*
|
||||
* @param region the region to find the center of
|
||||
* @param region the region to find the center of
|
||||
* @param pattern the replacement pattern
|
||||
* @return the number of blocks placed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1741,7 +1741,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the block to place
|
||||
* @param block the block to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1753,7 +1753,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1773,7 +1773,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* may be inefficient, because there may not be an efficient implementation supported
|
||||
* for that specific shape.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1790,12 +1790,13 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make the walls (all faces but those parallel to the X-Z plane) of the given region
|
||||
* as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the block to place
|
||||
* @param block the block to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1808,7 +1809,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make the walls (all faces but those parallel to the X-Z plane) of the given region
|
||||
* as if it was a {@link CuboidRegion}.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1828,7 +1829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* may be inefficient, because there may not be an efficient implementation supported
|
||||
* for that specific shape.
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the pattern to place
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1858,7 +1859,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* (as if it were a cuboid).
|
||||
*
|
||||
* @param region the region
|
||||
* @param block the placed block
|
||||
* @param block the placed block
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -1871,7 +1872,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Places a layer of blocks on top of ground blocks in the given region
|
||||
* (as if it were a cuboid).
|
||||
*
|
||||
* @param region the region
|
||||
* @param region the region
|
||||
* @param pattern the placed block pattern
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1920,9 +1921,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Stack a cuboid region.
|
||||
*
|
||||
* @param region the region to stack
|
||||
* @param dir the direction to stack
|
||||
* @param count the number of times to stack
|
||||
* @param region the region to stack
|
||||
* @param dir the direction to stack
|
||||
* @param count the number of times to stack
|
||||
* @param copyAir true to also copy air blocks
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -1962,10 +1963,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Move the blocks in a region a certain direction.
|
||||
*
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
||||
* @return number of blocks moved
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -2019,10 +2020,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Move the blocks in a region a certain direction.
|
||||
*
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param region the region to move
|
||||
* @param dir the direction
|
||||
* @param distance the distance to move
|
||||
* @param copyAir true to copy air blocks
|
||||
* @param replacement the replacement block to fill in after moving, or null to use air
|
||||
* @return number of blocks moved
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
@ -2088,8 +2089,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Fix liquids so that they turn into stationary blocks and extend outward.
|
||||
*
|
||||
* @param origin the original position
|
||||
* @param radius the radius to fix
|
||||
* @param origin the original position
|
||||
* @param radius the radius to fix
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2120,8 +2121,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Makes a cylinder.
|
||||
*
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param radius The cylinder's radius
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
@ -2135,12 +2136,12 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Makes a cylinder.
|
||||
*
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the cylinder
|
||||
* @param block The block pattern to use
|
||||
* @param radiusX The cylinder's largest north/south extent
|
||||
* @param radiusZ The cylinder's largest east/west extent
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param height The cylinder's up/down extent. If negative, extend downward.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2349,28 +2350,28 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a sphere.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radius The sphere's radius
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
* Makes a sphere.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radius The sphere's radius
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public int makeSphere(final BlockVector3 pos, final Pattern block, final double radius, final boolean filled) {
|
||||
return this.makeSphere(pos, block, radius, radius, radius, filled);
|
||||
return makeSphere(pos, block, radius, radius, radius, filled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a sphere or ellipsoid.
|
||||
*
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param pos Center of the sphere or ellipsoid
|
||||
* @param block The block pattern to use
|
||||
* @param radiusX The sphere/ellipsoid's largest north/south extent
|
||||
* @param radiusY The sphere/ellipsoid's largest up/down extent
|
||||
* @param radiusZ The sphere/ellipsoid's largest east/west extent
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2447,9 +2448,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Makes a pyramid.
|
||||
*
|
||||
* @param position a position
|
||||
* @param block a block
|
||||
* @param size size of pyramid
|
||||
* @param filled true if filled
|
||||
* @param block a block
|
||||
* @param size size of pyramid
|
||||
* @param filled true if filled
|
||||
* @return number of blocks changed
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2477,7 +2478,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Thaw blocks in a radius.
|
||||
*
|
||||
* @param position the position
|
||||
* @param radius the radius
|
||||
* @param radius the radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2548,7 +2549,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make snow in a radius.
|
||||
*
|
||||
* @param position a position
|
||||
* @param radius a radius
|
||||
* @param radius a radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2640,7 +2641,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Make dirt green.
|
||||
*
|
||||
* @param position a position
|
||||
* @param radius a radius
|
||||
* @param radius a radius
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -2724,7 +2725,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Makes pumpkin patches randomly in an area around the given position.
|
||||
*
|
||||
* @param position the base position
|
||||
* @param apothem the apothem of the (square) area
|
||||
* @param apothem the apothem of the (square) area
|
||||
* @return number of patches created
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3036,9 +3037,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Hollows out the region (Semi-well-defined for non-cuboid selections).
|
||||
*
|
||||
* @param region the region to hollow out.
|
||||
* @param region the region to hollow out.
|
||||
* @param thickness the thickness of the shell to leave (manhattan distance)
|
||||
* @param pattern The block pattern to use
|
||||
* @param pattern The block pattern to use
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3116,10 +3117,11 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
* Draws a line (out of blocks) between two vectors.
|
||||
*
|
||||
* @param pattern The block pattern used to draw the line.
|
||||
* @param pos1 One of the points that define the line.
|
||||
* @param pos2 The other point that defines the line.
|
||||
* @param radius The radius (thickness) of the line.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param pos1 One of the points that define the line.
|
||||
* @param pos2 The other point that defines the line.
|
||||
* @param radius The radius (thickness) of the line.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
*
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3185,14 +3187,15 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
/**
|
||||
* Draws a spline (out of blocks) between specified vectors.
|
||||
*
|
||||
* @param pattern The block pattern used to draw the spline.
|
||||
* @param pattern The block pattern used to draw the spline.
|
||||
* @param nodevectors The list of vectors to draw through.
|
||||
* @param tension The tension of every node.
|
||||
* @param bias The bias of every node.
|
||||
* @param continuity The continuity of every node.
|
||||
* @param quality The quality of the spline. Must be greater than 0.
|
||||
* @param radius The radius (thickness) of the spline.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
* @param tension The tension of every node.
|
||||
* @param bias The bias of every node.
|
||||
* @param continuity The continuity of every node.
|
||||
* @param quality The quality of the spline. Must be greater than 0.
|
||||
* @param radius The radius (thickness) of the spline.
|
||||
* @param filled If false, only a shell will be generated.
|
||||
*
|
||||
* @return number of blocks affected
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
@ -3324,7 +3327,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
||||
for (BlockVector3 recurseDirection : recurseDirections) {
|
||||
queue.addLast(current.add(recurseDirection));
|
||||
}
|
||||
}
|
||||
} // while
|
||||
}
|
||||
|
||||
public int makeBiomeShape(final Region region, final Vector3 zero, final Vector3 unit, final BaseBiome biomeType, final String expressionString, final boolean hollow) throws ExpressionException, MaxChangedBlocksException {
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.util.eventbus.EventBus;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Creates new {@link EditSession}s. To get an instance of this factory,
|
||||
* use {@link WorldEdit#getEditSessionFactory()}.
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class LocalSession implements TextureHolder {
|
||||
|
||||
/**
|
||||
* Construct the object.
|
||||
* <p>
|
||||
*
|
||||
* <p>{@link #setConfiguration(LocalConfiguration)} should be called
|
||||
* later with configuration.</p>
|
||||
*/
|
||||
@ -500,7 +500,7 @@ public class LocalSession implements TextureHolder {
|
||||
* Performs an undo.
|
||||
*
|
||||
* @param newBlockBag a new block bag
|
||||
* @param player the player
|
||||
* @param player the player
|
||||
* @return whether anything was undone
|
||||
*/
|
||||
public EditSession undo(@Nullable BlockBag newBlockBag, Player player) {
|
||||
@ -536,7 +536,7 @@ public class LocalSession implements TextureHolder {
|
||||
* Performs a redo
|
||||
*
|
||||
* @param newBlockBag a new block bag
|
||||
* @param player the player
|
||||
* @param player the player
|
||||
* @return whether anything was redone
|
||||
*/
|
||||
public EditSession redo(@Nullable BlockBag newBlockBag, Player player) {
|
||||
@ -625,7 +625,7 @@ public class LocalSession implements TextureHolder {
|
||||
/**
|
||||
* Set the region selector.
|
||||
*
|
||||
* @param world the world
|
||||
* @param world the world
|
||||
* @param selector the selector
|
||||
*/
|
||||
public void setRegionSelector(World world, RegionSelector selector) {
|
||||
@ -782,7 +782,7 @@ public class LocalSession implements TextureHolder {
|
||||
|
||||
/**
|
||||
* Sets the clipboard.
|
||||
* <p>
|
||||
*
|
||||
* <p>Pass {@code null} to clear the clipboard.</p>
|
||||
*
|
||||
* @param clipboard the clipboard, or null if the clipboard is to be cleared
|
||||
@ -974,7 +974,7 @@ public class LocalSession implements TextureHolder {
|
||||
* or the tool is not assigned, the slot will be replaced with the
|
||||
* brush tool.
|
||||
*
|
||||
* @param item the item type ID
|
||||
* @param item the item type
|
||||
* @return the tool, or {@code null}
|
||||
* @throws InvalidToolBindException if the item can't be bound to that item
|
||||
*/
|
||||
@ -1015,7 +1015,7 @@ public class LocalSession implements TextureHolder {
|
||||
/**
|
||||
* Set the tool.
|
||||
*
|
||||
* @param item the item type ID
|
||||
* @param item the item type
|
||||
* @param tool the tool to set, which can be {@code null}
|
||||
* @throws InvalidToolBindException if the item can't be bound to that item
|
||||
*/
|
||||
|
@ -56,4 +56,4 @@ public enum PlayerDirection {
|
||||
return isOrthogonal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
@ -59,7 +62,6 @@ import com.sk89q.worldedit.world.registry.BundledBlockData;
|
||||
import com.sk89q.worldedit.world.registry.BundledItemData;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.script.ScriptException;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -72,8 +74,7 @@ import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
||||
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
/**
|
||||
* The entry point and container for a working implementation of WorldEdit.
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.blocks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The colors for wool.
|
||||
|
@ -401,6 +401,7 @@ public class UtilityCommands extends MethodCommands {
|
||||
@Logging(PLACEMENT)
|
||||
public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException {
|
||||
worldEdit.checkMaxRadius(size);
|
||||
size = Math.max(1, size);
|
||||
int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size);
|
||||
player.print(BBC.getPrefix() + affected + " block(s) have been removed.");
|
||||
}
|
||||
|
@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
public class ItemParser extends SimpleCommand<BaseItem> {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.argument;
|
||||
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.extent.NullExtent;
|
||||
@ -26,13 +28,9 @@ import com.sk89q.worldedit.function.Contextual;
|
||||
import com.sk89q.worldedit.function.EditContext;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.block.BlockReplace;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull;
|
||||
|
||||
|
||||
public class ReplaceParser extends SimpleCommand<Contextual<? extends RegionFunction>> {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.composition;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.command.argument.RegionFunctionParser;
|
||||
@ -30,8 +32,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.CommandExecutor;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ApplyCommand extends SimpleCommand<Contextual<? extends Operation>> {
|
||||
|
||||
private final CommandExecutor<Contextual<? extends RegionFunction>> functionParser;
|
||||
|
@ -20,6 +20,9 @@
|
||||
package com.sk89q.worldedit.command.composition;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissionsException;
|
||||
@ -41,8 +44,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs;
|
||||
import com.sk89q.worldedit.util.command.composition.CommandExecutor;
|
||||
import com.sk89q.worldedit.util.command.composition.SimpleCommand;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ShapedBrushCommand extends SimpleCommand<Object> {
|
||||
|
||||
private final CommandExecutor<? extends Contextual<? extends Operation>> delegate;
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
|
@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* Looks up information about a block.
|
||||
|
@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
|
||||
public class CylinderBrush implements Brush {
|
||||
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class HollowCylinderBrush implements Brush {
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class HollowSphereBrush implements Brush {
|
||||
|
@ -20,13 +20,12 @@
|
||||
package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMap;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.convolution.GaussianKernel;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMap;
|
||||
import com.sk89q.worldedit.math.convolution.HeightMapFilter;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
|
@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
public class SphereBrush implements Brush {
|
||||
|
@ -21,14 +21,11 @@ package com.sk89q.worldedit.command.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.util.SetQueue;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.worldedit.entity.metadata.EntityProperties;
|
||||
import com.sk89q.worldedit.function.EntityFunction;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -151,6 +148,7 @@ public class EntityRemover {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
@ -19,16 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.entity;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.world.NbtValued;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Represents a mutable "snapshot" of an entity.
|
||||
*
|
||||
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Called when a block is interacted with.
|
||||
*/
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Posted when suggestions for auto-completion are requested for command input.
|
||||
*/
|
||||
|
@ -19,11 +19,11 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised when the configuration has been loaded or re-loaded.
|
||||
*/
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.event.platform;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.Cancellable;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Raised whenever a player sends input.
|
||||
*/
|
||||
|
@ -21,16 +21,11 @@ package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -39,6 +39,7 @@ public final class MaskFactory extends AbstractFactory<Mask> {
|
||||
*/
|
||||
public MaskFactory(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
|
||||
parsers.add(new DefaultMaskParser(worldEdit));
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ public final class PatternFactory extends AbstractFactory<Pattern> {
|
||||
*/
|
||||
public PatternFactory(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
|
||||
parsers.add(new HashTagPatternParser(worldEdit));
|
||||
}
|
||||
|
||||
|
@ -21,14 +21,13 @@ package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
class RandomPatternParser extends InputParser<Pattern> {
|
||||
|
||||
|
@ -20,11 +20,11 @@
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
|
||||
class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.sk89q.worldedit.entity.metadata.Metadatable;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionOwner;
|
||||
import com.sk89q.worldedit.util.Identifiable;
|
||||
|
@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.registry.Registries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a platform that WorldEdit has been implemented for.
|
||||
*
|
||||
|
@ -20,12 +20,11 @@
|
||||
package com.sk89q.worldedit.extent;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -36,8 +35,8 @@ public interface OutputExtent {
|
||||
|
||||
/**
|
||||
* Change the block at the given location to the given block. The operation may
|
||||
* not tie the given {@link BlockState} to the world, so future changes to the
|
||||
* {@link BlockState} do not affect the world until this method is called again.
|
||||
* not tie the given {@link BlockStateHolder} to the world, so future changes to the
|
||||
* {@link BlockStateHolder} do not affect the world until this method is called again.
|
||||
*
|
||||
* <p>The return value of this method indicates whether the change was probably
|
||||
* successful. It may not be successful if, for example, the location is out
|
||||
|
@ -22,9 +22,6 @@ package com.sk89q.worldedit.extent.buffer;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
@ -34,6 +31,8 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.AbstractRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -63,4 +63,4 @@ public class LastAccessExtentCache extends AbstractDelegateExtent {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.clipboard;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* An implementation of {@link Entity} that stores a {@link BaseEntity} with it.
|
||||
*
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.world.registry.Registries;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -60,4 +60,4 @@ public abstract class NBTSchematicReader implements ClipboardReader {
|
||||
|
||||
return expected.cast(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldedit.extent.clipboard.io.legacycompat;
|
||||
|
||||
import com.sk89q.jnbt.Tag;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
|
@ -26,7 +26,6 @@ import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
@ -35,8 +35,8 @@ import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.LocatedBlock;
|
||||
import com.sk89q.worldedit.util.collection.TupleArrayList;
|
||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.Deque;
|
||||
|
@ -19,15 +19,13 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.validation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
@ -43,7 +41,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param extent the extent
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public BlockChangeLimiter(Extent extent, int limit) {
|
||||
super(extent);
|
||||
@ -53,7 +51,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
/**
|
||||
* Get the limit.
|
||||
*
|
||||
* @return the limit (>= 0) or -1 for no limit
|
||||
* @return the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
@ -62,7 +60,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent {
|
||||
/**
|
||||
* Set the limit.
|
||||
*
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
* @param limit the limit (>= 0) or -1 for no limit
|
||||
*/
|
||||
public void setLimit(int limit) {
|
||||
checkArgument(limit >= -1, "limit >= -1 required");
|
||||
|
@ -21,16 +21,13 @@ package com.sk89q.worldedit.extent.validation;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
/**
|
||||
* Validates set data to prevent creating invalid blocks and such.
|
||||
|
@ -21,18 +21,14 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
/**
|
||||
* Handles various quirks when setting blocks, such as ice turning
|
||||
|
@ -21,15 +21,12 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* Automatically loads chunks when blocks are accessed.
|
||||
|
@ -21,22 +21,19 @@ package com.sk89q.worldedit.extent.world;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.RunContext;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* Implements "fast mode" which may skip physics, lighting, etc.
|
||||
*/
|
||||
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren