mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Merge from upstream
This commit is contained in:
commit
6a7935829b
39
.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/bug---issue-report-for-fastasyncworldedit-1-13-2.md
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
name: Bug / Issue report for FastAsyncWorldEdit 1.13.2
|
||||||
|
about: Bug / Issue report about this plugin
|
||||||
|
title: ''
|
||||||
|
labels: Requires Testing
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Bug report for FastAsyncWorldEdit 1.13.2
|
||||||
|
<!--- If you are using 1.13 or 1.13.1 consider updating to 1.13.2 before raising an issue -->
|
||||||
|
<!--- In order to create a valid issue report you have to follow this template. -->
|
||||||
|
<!--- Remove this template if making a suggestion or asking a question. -->
|
||||||
|
<!--- Incomplete reports might be marked as invalid. -->
|
||||||
|
**[REQUIRED] FastAsyncWorldEdit Version Number:**
|
||||||
|
<!--- Enter /fawe version in game or in your console and copy the full output here -->
|
||||||
|
|
||||||
|
**[REQUIRED] Spigot/Paper Version Number:**
|
||||||
|
<!--- Enter /version ingame or in your console and paste the full output here -->
|
||||||
|
|
||||||
|
**Links to config.yml and config-legacy.yml file:**
|
||||||
|
<!--- Copy and paste the information to the service of your choosing (pastebin, hasteb.in e.g) and provide the link here. -->
|
||||||
|
|
||||||
|
**[REQUIRED] Description of the problem:**
|
||||||
|
<!--- Check your console for errors while testing -->
|
||||||
|
<!--- Include relevant information like errors or a picture of the problem -->
|
||||||
|
|
||||||
|
**Plugins being used on the server:**
|
||||||
|
<!--- Optional but recommended to look further into an issue --->
|
||||||
|
|
||||||
|
**How to replicate**:
|
||||||
|
<!--- If you can reproduce the issue please tell us as detailed as possible step by step how to do that -->
|
||||||
|
|
||||||
|
**Checklist**:
|
||||||
|
<!--- Make sure you've completed the following steps (put an "X" between of brackets): -->
|
||||||
|
- [] I included all information required in the sections above
|
||||||
|
- [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||||
|
- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.13.2](https://ci.athion.net/job/FastAsyncWorldEdit-Breaking/)
|
||||||
|
- [] I made sure the bug/error is not caused by any other plugin
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: "[+] Enhancement"
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,3 +23,4 @@ lib/
|
|||||||
worldedit-bukkit/src/main/java/ignore/*
|
worldedit-bukkit/src/main/java/ignore/*
|
||||||
todo.txt
|
todo.txt
|
||||||
mvn/*
|
mvn/*
|
||||||
|
docs/
|
@ -1,19 +0,0 @@
|
|||||||
# Bug report for FastAsyncWorldEdit 1.13.x
|
|
||||||
<!--- Follow this template if reporting an issue. -->
|
|
||||||
<!--- Remove this template if making a suggestion or asking a question. -->
|
|
||||||
<!--- Please comment or react to an existing ticket if it exists -->
|
|
||||||
**Debug paste link**:
|
|
||||||
<!--- Enter /fawe debugpaste in game or in your console and copy the output here -->
|
|
||||||
|
|
||||||
**Description of the problem:**
|
|
||||||
<!--- Include relevant info like errors or a picture of the problem -->
|
|
||||||
|
|
||||||
**How to replicate**:
|
|
||||||
<!--- If you can reproduce the issue please tell us as detailed as possible step by step how to do that -->
|
|
||||||
|
|
||||||
**Checklist**:
|
|
||||||
<!--- Make sure you've completed the following steps (put an "X" between of brackets): -->
|
|
||||||
- [] I included a `/fawe debugpaste` link
|
|
||||||
- [] I made sure there aren't duplicates of this report [(Use Search)](https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
|
||||||
- [] I made sure I am using an up-to-date version of [FAWE for 1.13.x](https://ci.athion.net/job/FastAsyncWorldEdit-1.13/)
|
|
||||||
- [] I made sure the bug/error is not caused by any other plugin
|
|
10
README.md
10
README.md
@ -11,17 +11,19 @@ FAWE is a fork of WorldEdit that has huge speed and memory improvements and cons
|
|||||||
* [Spigot Page](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)
|
* [Discord](https://discord.gg/ngZCzbU)
|
||||||
* [Wiki](https://github.com/boy0001/FastAsyncWorldedit/wiki)
|
* [Wiki](https://github.com/boy0001/FastAsyncWorldedit/wiki)
|
||||||
* [Report Issue](https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues/new)
|
* [Report Issue](https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues)
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
### 1.13+
|
### 1.13+
|
||||||
* [Download](https://incendo.org/download/)
|
* [Download](https://empcraft.com/fawe/download/)
|
||||||
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit-1.13/)
|
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit-Breaking/)
|
||||||
|
* [JavaDoc](https://ci.athion.net/job/FastAsyncWorldEdit-1.13/javadoc/)
|
||||||
|
|
||||||
### < 1.12.2
|
### < 1.12.2
|
||||||
* [Download](https://incendo.org/download/)
|
* [Download](https://empcraft.com/fawe/download/?bukkit)
|
||||||
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit/)
|
* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit/)
|
||||||
* [Repository](https://github.com/boy0001/FastAsyncWorldedit)
|
* [Repository](https://github.com/boy0001/FastAsyncWorldedit)
|
||||||
|
* [JavaDoc](https://ci.athion.net/job/FastAsyncWorldEdit/javadoc/)
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
127
build.gradle
127
build.gradle
@ -2,7 +2,6 @@ import org.ajoberstar.grgit.Grgit
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
jcenter()
|
jcenter()
|
||||||
@ -10,8 +9,6 @@ buildscript {
|
|||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
force 'com.google.guava:guava:21.0'
|
|
||||||
force 'org.ow2.asm:asm:6.0_BETA'
|
|
||||||
force 'commons-io:commons-io:2.4'
|
force 'commons-io:commons-io:2.4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,14 +24,19 @@ plugins {
|
|||||||
id "org.ajoberstar.grgit" version "3.1.1"
|
id "org.ajoberstar.grgit" version "3.1.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
println """
|
||||||
clean { delete "target" }
|
*******************************************
|
||||||
|
You are building WorldEdit!
|
||||||
|
|
||||||
|
If you encounter trouble:
|
||||||
|
1) Read COMPILING.md if you haven't yet
|
||||||
|
2) Try running 'build' in a separate Gradle run
|
||||||
|
3) Use gradlew and not gradle
|
||||||
|
4) If you still need help, ask on Discord! https://discord.gg/ngZCzbU
|
||||||
|
|
||||||
def splashFile = new File('splash.txt')
|
Output files will be in /target
|
||||||
if (splashFile.exists()) {
|
*******************************************
|
||||||
print splashFile.text
|
"""
|
||||||
}
|
|
||||||
|
|
||||||
group = 'com.boydti.fawe'
|
group = 'com.boydti.fawe'
|
||||||
|
|
||||||
@ -58,42 +60,54 @@ ext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion
|
version = String.format("%s.%s", rootVersion, buildNumber)
|
||||||
version = "unknown"
|
|
||||||
} else {
|
|
||||||
version = String.format("%s.%s", rootVersion, buildNumber)
|
|
||||||
}
|
|
||||||
description = rootProject.name
|
description = rootProject.name
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url "http://maven.sk89q.com/repo/" }
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
|
maven { url "http://repo.maven.apache.org/maven2" }
|
||||||
|
// Fawe
|
||||||
|
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-Breaking/ws/mvn/" }
|
||||||
|
maven { url "https://libraries.minecraft.net" }
|
||||||
|
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 "http://dl.bintray.com/tastybento/maven-repo" }
|
||||||
|
maven { url "http://ci.emc.gs/nexus/content/groups/aikar/" }
|
||||||
|
}
|
||||||
|
configurations.all {
|
||||||
|
resolutionStrategy {
|
||||||
|
cacheChangingModulesFor 5, 'minutes'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(['worldedit-core', 'worldedit-bukkit', 'favs'].collect { project("$it") }) {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
// apply plugin: 'checkstyle'
|
||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
// Enable this requires putting license header files in many, many FAWE files
|
// Enable this requires putting license header files in many, many FAWE files
|
||||||
//apply plugin: 'net.minecrell.licenser'
|
// apply plugin: 'net.minecrell.licenser'
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
compileJava { options.compilerArgs += ["-parameters"] }
|
// checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
|
||||||
|
// checkstyle.toolVersion = '7.6.1'
|
||||||
|
|
||||||
repositories {
|
clean.doFirst {
|
||||||
mavenCentral()
|
delete "../target"
|
||||||
maven { url "http://maven.sk89q.com/repo/" }
|
|
||||||
maven { url "http://repo.maven.apache.org/maven2" }
|
|
||||||
// Fawe
|
|
||||||
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-Breaking/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 "http://dl.bintray.com/tastybento/maven-repo"}
|
|
||||||
maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JavaVersion.current().isJava8Compatible()) {
|
if (JavaVersion.current().isJava8Compatible()) {
|
||||||
@ -103,16 +117,6 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
||||||
classifier = 'javadoc'
|
|
||||||
from javadoc.destinationDir
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives jar
|
|
||||||
archives javadocJar
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
|
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
|
||||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
@ -125,12 +129,20 @@ subprojects {
|
|||||||
build.dependsOn(sourcesJar)
|
build.dependsOn(sourcesJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// build.dependsOn(checkstyleMain)
|
||||||
|
// build.dependsOn(checkstyleTest)
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly 'org.jetbrains:annotations:17.0.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(['bukkit'].collect { project(":worldedit-$it") }) {
|
||||||
shadowJar {
|
shadowJar {
|
||||||
classifier 'dist'
|
classifier 'dist'
|
||||||
dependencies {
|
dependencies {
|
||||||
include(dependency('com.sk89q:jchronic:0.2.4a'))
|
include(project(":worldedit-libs:core"))
|
||||||
include(dependency('com.thoughtworks.paranamer:paranamer:2.6'))
|
include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}"))
|
||||||
include(dependency('com.sk89q.lib:jlibnoise:1.0.0'))
|
include(project(":worldedit-core"))
|
||||||
include(dependency('com.github.luben:zstd-jni:1.1.1'))
|
include(dependency('com.github.luben:zstd-jni:1.1.1'))
|
||||||
include(dependency('co.aikar:fastutil-lite:1.0'))
|
include(dependency('co.aikar:fastutil-lite:1.0'))
|
||||||
}
|
}
|
||||||
@ -144,4 +156,25 @@ subprojects {
|
|||||||
// header = rootProject.file("HEADER.txt")
|
// header = rootProject.file("HEADER.txt")
|
||||||
// include '**/*.java'
|
// include '**/*.java'
|
||||||
//}
|
//}
|
||||||
|
}
|
||||||
|
task aggregatedJavadocs(type: Javadoc, description: 'Generate javadocs from all child projects as if it was a single project', group: 'Documentation') {
|
||||||
|
destinationDir = file("./docs/javadoc")
|
||||||
|
title = "$project.name $version API"
|
||||||
|
options.author true
|
||||||
|
options.links 'http://docs.spring.io/spring/docs/4.3.x/javadoc-api/', 'http://docs.oracle.com/javase/8/docs/api/', 'http://docs.spring.io/spring-ws/docs/2.3.0.RELEASE/api/', 'http://docs.spring.io/spring-security/site/docs/4.0.4.RELEASE/apidocs/'
|
||||||
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
|
|
||||||
|
delete "./docs"
|
||||||
|
|
||||||
|
subprojects.each { proj ->
|
||||||
|
proj.tasks.withType(Javadoc).each { javadocTask ->
|
||||||
|
source += javadocTask.source
|
||||||
|
classpath += javadocTask.classpath
|
||||||
|
excludes += javadocTask.excludes
|
||||||
|
includes += javadocTask.includes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,5 +53,19 @@
|
|||||||
<!-- <module name="PackageName"/> Unlikely that we would miss this in a PR -->
|
<!-- <module name="PackageName"/> Unlikely that we would miss this in a PR -->
|
||||||
<module name="ParameterName"/>
|
<module name="ParameterName"/>
|
||||||
<!-- <module name="TypeName"/> Unlikely that we would miss this in a PR -->
|
<!-- <module name="TypeName"/> Unlikely that we would miss this in a PR -->
|
||||||
|
<!-- Validate assignment operators -->
|
||||||
|
<module name="WhitespaceAround">
|
||||||
|
<property name="tokens" value="ASSIGN"/>
|
||||||
|
</module>
|
||||||
|
<!-- Validate String.to(Lower|Upper)Case() calls include Locale argument -->
|
||||||
|
<module name="Regexp">
|
||||||
|
<property name="message" value="Case-conversion calls must include an explicit Locale"/>
|
||||||
|
<property name="format" value="(?!Character)\.to(Lower|Upper)Case\(\)"/>
|
||||||
|
<property name="illegalPattern" value="true"/>
|
||||||
|
</module>
|
||||||
|
</module>
|
||||||
|
<!-- Validate that command annotations are formatted correctly -->
|
||||||
|
<module name="RegexpMultiline">
|
||||||
|
<property name="format" value="^( +)@(Arg|Switch|Command)\(.*?\n\1 {5,}"/>
|
||||||
</module>
|
</module>
|
||||||
</module>
|
</module>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<allow pkg="net.royawesome.jlibnoise"/>
|
<allow pkg="net.royawesome.jlibnoise"/>
|
||||||
<allow pkg="org.json.simple" />
|
<allow pkg="org.json.simple" />
|
||||||
<allow pkg="org.slf4j"/>
|
<allow pkg="org.slf4j"/>
|
||||||
|
<allow pkg="org.enginehub"/>
|
||||||
|
|
||||||
<subpackage name="util.yaml">
|
<subpackage name="util.yaml">
|
||||||
<allow pkg="org.yaml.snakeyaml"/>
|
<allow pkg="org.yaml.snakeyaml"/>
|
||||||
@ -38,11 +39,12 @@
|
|||||||
<subpackage name="worldedit">
|
<subpackage name="worldedit">
|
||||||
<allow pkg="org.mozilla.javascript"/>
|
<allow pkg="org.mozilla.javascript"/>
|
||||||
<allow pkg="de.schlichtherle"/>
|
<allow pkg="de.schlichtherle"/>
|
||||||
|
<allow pkg="com.google.auto"/>
|
||||||
|
|
||||||
<subpackage name="bukkit">
|
<subpackage name="bukkit">
|
||||||
<allow pkg="org.bukkit"/>
|
<allow pkg="org.bukkit"/>
|
||||||
<allow pkg="org.bstats.bukkit"/>
|
<allow pkg="org.bstats.bukkit"/>
|
||||||
<allow pkg="net.minecraft.server"/>
|
<allow pkg="io.papermc.lib"/>
|
||||||
</subpackage>
|
</subpackage>
|
||||||
|
|
||||||
<subpackage name="forge">
|
<subpackage name="forge">
|
||||||
@ -55,6 +57,7 @@
|
|||||||
<allow pkg="io.netty.buffer"/>
|
<allow pkg="io.netty.buffer"/>
|
||||||
<allow pkg="org.spongepowered.api" />
|
<allow pkg="org.spongepowered.api" />
|
||||||
<allow pkg="com.mojang.brigadier" />
|
<allow pkg="com.mojang.brigadier" />
|
||||||
|
<allow pkg="com.mojang.datafixers" />
|
||||||
</subpackage>
|
</subpackage>
|
||||||
|
|
||||||
<subpackage name="sponge">
|
<subpackage name="sponge">
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.boydti.fawe.bukkit.favs;
|
package com.boydti.fawe.bukkit.favs;
|
||||||
|
|
||||||
import com.boydti.fawe.config.BBC;
|
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
@ -23,7 +22,7 @@ public class PatternUtil {
|
|||||||
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + arg);
|
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + arg);
|
||||||
return pattern;
|
return pattern;
|
||||||
} catch (InputParseException e) {
|
} catch (InputParseException e) {
|
||||||
fp.sendMessage(BBC.getPrefix() + e.getMessage());
|
fp.sendMessage(e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,6 @@ package com.thevoxelbox.voxelsniper;
|
|||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class Message {
|
public class Message {
|
||||||
private static final int BRUSH_SIZE_WARNING_THRESHOLD = 20;
|
private static final int BRUSH_SIZE_WARNING_THRESHOLD = 20;
|
||||||
private final SnipeData snipeData;
|
private final SnipeData snipeData;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
||||||
|
|
||||||
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
||||||
@ -281,8 +281,8 @@ public class RangeBlockHelper {
|
|||||||
this.range = range;
|
this.range = range;
|
||||||
this.step = step;
|
this.step = step;
|
||||||
this.length = 0.0D;
|
this.length = 0.0D;
|
||||||
this.rotX = (double)((this.playerLoc.getYaw() + 90.0F) % 360.0F);
|
this.rotX = (this.playerLoc.getYaw() + 90.0F) % 360.0F;
|
||||||
this.rotY = (double)(this.playerLoc.getPitch() * -1.0F);
|
this.rotY = this.playerLoc.getPitch() * -1.0F;
|
||||||
this.rotYCos = Math.cos(Math.toRadians(this.rotY));
|
this.rotYCos = Math.cos(Math.toRadians(this.rotY));
|
||||||
this.rotYSin = Math.sin(Math.toRadians(this.rotY));
|
this.rotYSin = Math.sin(Math.toRadians(this.rotY));
|
||||||
this.rotXCos = Math.cos(Math.toRadians(this.rotX));
|
this.rotXCos = Math.cos(Math.toRadians(this.rotX));
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package com.thevoxelbox.voxelsniper;
|
package com.thevoxelbox.voxelsniper;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public enum SnipeAction {
|
public enum SnipeAction {
|
||||||
ARROW, GUNPOWDER
|
ARROW, GUNPOWDER
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
||||||
|
|
||||||
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
||||||
@ -33,9 +33,6 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class SnipeData {
|
public class SnipeData {
|
||||||
|
|
||||||
public static final int DEFAULT_REPLACE_DATA_VALUE = 0;
|
public static final int DEFAULT_REPLACE_DATA_VALUE = 0;
|
||||||
@ -87,9 +84,6 @@ public class SnipeData {
|
|||||||
private Pattern pattern;
|
private Pattern pattern;
|
||||||
private String patternInfo;
|
private String patternInfo;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param vs
|
|
||||||
*/
|
|
||||||
public SnipeData(final Sniper vs) {
|
public SnipeData(final Sniper vs) {
|
||||||
this.owner = vs;
|
this.owner = vs;
|
||||||
}
|
}
|
||||||
@ -219,9 +213,6 @@ public class SnipeData {
|
|||||||
this.voxelList = new VoxelList();
|
this.voxelList = new VoxelList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param message
|
|
||||||
*/
|
|
||||||
public final void sendMessage(final String message) {
|
public final void sendMessage(final String message) {
|
||||||
this.owner.getPlayer().sendMessage(message);
|
this.owner.getPlayer().sendMessage(message);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
||||||
|
|
||||||
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
||||||
@ -71,7 +71,6 @@ import java.util.Map;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Sniper {
|
public class Sniper {
|
||||||
private VoxelSniper plugin;
|
|
||||||
private final UUID player;
|
private final UUID player;
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
// private LinkedList<FaweChangeSet> undoList = new LinkedList<>();
|
// private LinkedList<FaweChangeSet> undoList = new LinkedList<>();
|
||||||
@ -80,7 +79,6 @@ public class Sniper {
|
|||||||
public Sniper(VoxelSniper plugin, Player player) {
|
public Sniper(VoxelSniper plugin, Player player) {
|
||||||
Preconditions.checkNotNull(plugin);
|
Preconditions.checkNotNull(plugin);
|
||||||
Preconditions.checkNotNull(player);
|
Preconditions.checkNotNull(player);
|
||||||
this.plugin = plugin;
|
|
||||||
this.player = player.getUniqueId();
|
this.player = player.getUniqueId();
|
||||||
SniperTool sniperTool = new SniperTool(this);
|
SniperTool sniperTool = new SniperTool(this);
|
||||||
sniperTool.assignAction(SnipeAction.ARROW, Material.ARROW);
|
sniperTool.assignAction(SnipeAction.ARROW, Material.ARROW);
|
||||||
@ -89,7 +87,7 @@ public class Sniper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentToolId() {
|
public String getCurrentToolId() {
|
||||||
return getToolId((getPlayer().getInventory().getItemInMainHand() != null) ? getPlayer().getInventory().getItemInMainHand().getType() : null);
|
return getToolId(getPlayer().getInventory().getItemInMainHand().getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToolId(Material itemInHand) {
|
public String getToolId(Material itemInHand) {
|
||||||
@ -397,14 +395,12 @@ public class Sniper {
|
|||||||
} else {
|
} else {
|
||||||
changeQueue.flush();
|
changeQueue.flush();
|
||||||
}
|
}
|
||||||
if (changeSet != null) {
|
|
||||||
if (Settings.IMP.HISTORY.COMBINE_STAGES) {
|
if (Settings.IMP.HISTORY.COMBINE_STAGES) {
|
||||||
changeSet.closeAsync();
|
changeSet.closeAsync();
|
||||||
} else {
|
} else {
|
||||||
changeSet.close();
|
changeSet.close();
|
||||||
}
|
}
|
||||||
session.remember(changeSet.toEditSession(fp));
|
session.remember(changeSet.toEditSession(fp));
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -511,7 +507,7 @@ public class Sniper {
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
BBC.COMMAND_UNDO_SUCCESS.send(fp);
|
BBC.COMMAND_UNDO_SUCCESS.send(fp, count == 1 ? "" : " x" + count);
|
||||||
} else {
|
} else {
|
||||||
BBC.COMMAND_UNDO_ERROR.send(fp);
|
BBC.COMMAND_UNDO_ERROR.send(fp);
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@ import org.bukkit.entity.Player;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class SniperManager {
|
public class SniperManager {
|
||||||
private Map<UUID, Sniper> sniperInstances = Maps.newHashMap();
|
private Map<UUID, Sniper> sniperInstances = Maps.newHashMap();
|
||||||
private VoxelSniper plugin;
|
private VoxelSniper plugin;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
||||||
|
|
||||||
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.thevoxelbox.voxelsniper;
|
package com.thevoxelbox.voxelsniper;
|
||||||
|
|
||||||
|
import com.boydti.fawe.Fawe;
|
||||||
import com.boydti.fawe.bukkit.BukkitCommand;
|
import com.boydti.fawe.bukkit.BukkitCommand;
|
||||||
import com.boydti.fawe.object.FaweCommand;
|
import com.boydti.fawe.object.FaweCommand;
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
@ -8,7 +9,16 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bukkit extension point.
|
* Bukkit extension point.
|
||||||
@ -54,16 +64,46 @@ public class VoxelSniper extends JavaPlugin {
|
|||||||
return sniperManager;
|
return sniperManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Map<String, Plugin> lookupNames;
|
||||||
|
static {
|
||||||
|
{ // Disable BetterBrushes - FAVS includes the features and BetterBrushes is outdated
|
||||||
|
PluginManager manager = Bukkit.getPluginManager();
|
||||||
|
try {
|
||||||
|
Field pluginsField = manager.getClass().getDeclaredField("plugins");
|
||||||
|
Field lookupNamesField = manager.getClass().getDeclaredField("lookupNames");
|
||||||
|
pluginsField.setAccessible(true);
|
||||||
|
lookupNamesField.setAccessible(true);
|
||||||
|
List<Plugin> plugins = (List<Plugin>) pluginsField.get(manager);
|
||||||
|
lookupNames = (Map<String, Plugin>) lookupNamesField.get(manager);
|
||||||
|
pluginsField.set(manager, new ArrayList<Plugin>(plugins) {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
public boolean add(Plugin plugin) {
|
||||||
if (sender instanceof Player) {
|
if (plugin.getName().startsWith("BetterBrushes")) {
|
||||||
String[] arguments = args;
|
Fawe.debug("Disabling `" + plugin.getName() + "`. FastAsyncVoxelSniper includes all the features.");
|
||||||
|
} else {
|
||||||
if (arguments == null) {
|
return super.add(plugin);
|
||||||
arguments = new String[0];
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
lookupNamesField.set(manager, lookupNames = new ConcurrentHashMap<String, Plugin>(lookupNames) {
|
||||||
|
@Override
|
||||||
|
public Plugin put(@NotNull String key, @NotNull Plugin plugin) {
|
||||||
|
if (plugin.getName().startsWith("BetterBrushes")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return super.put(key, plugin);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Throwable ignore) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return voxelSniperListener.onCommand((Player) sender, arguments, command.getName());
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, String commandLabel, @NotNull String[] args) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
|
||||||
|
return voxelSniperListener.onCommand((Player) sender, args, command.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogger().info("Only players can execute VoxelSniper commands.");
|
getLogger().info("Only players can execute VoxelSniper commands.");
|
||||||
@ -90,7 +130,7 @@ public class VoxelSniper extends JavaPlugin {
|
|||||||
Player player = (Player) fp.parent;
|
Player player = (Player) fp.parent;
|
||||||
return onCommand(player, new Command("p") {
|
return onCommand(player, new Command("p") {
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
public boolean execute(@NotNull CommandSender sender, String commandLabel, @NotNull String[] args) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, null, args);
|
}, null, args);
|
||||||
@ -103,7 +143,7 @@ public class VoxelSniper extends JavaPlugin {
|
|||||||
Player player = (Player) fp.parent;
|
Player player = (Player) fp.parent;
|
||||||
return onCommand(player, new Command("d") {
|
return onCommand(player, new Command("d") {
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
public boolean execute(@NotNull CommandSender sender, String commandLabel, @NotNull String[] args) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, null, args);
|
}, null, args);
|
||||||
|
@ -1,20 +1,14 @@
|
|||||||
package com.thevoxelbox.voxelsniper;
|
package com.thevoxelbox.voxelsniper;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration storage defining global configurations for VoxelSniper.
|
* Configuration storage defining global configurations for VoxelSniper.
|
||||||
*/
|
*/
|
||||||
public class VoxelSniperConfiguration {
|
public class VoxelSniperConfiguration {
|
||||||
public static final String CONFIG_IDENTIFIER_LITESNIPER_MAX_BRUSH_SIZE = "litesniper-max-brush-size";
|
public static final String CONFIG_IDENTIFIER_LITESNIPER_MAX_BRUSH_SIZE = "litesniper-max-brush-size";
|
||||||
public static final String CONFIG_IDENTIFIER_UNDO_CACHE_SIZE = "undo-cache-size";
|
|
||||||
public static final String CONFIG_IDENTIFIER_LITESNIPER_RESTRICTED_ITEMS = "litesniper-restricted-items";
|
|
||||||
public static final String CONFIG_IDENTIFIER_MESSAGE_ON_LOGIN_ENABLED = "message-on-login-enabled";
|
public static final String CONFIG_IDENTIFIER_MESSAGE_ON_LOGIN_ENABLED = "message-on-login-enabled";
|
||||||
public static final int DEFAULT_LITESNIPER_MAX_BRUSH_SIZE = 5;
|
public static final int DEFAULT_LITESNIPER_MAX_BRUSH_SIZE = 30;
|
||||||
public static final int DEFAULT_UNDO_CACHE_SIZE = 20;
|
|
||||||
public static final boolean DEFAULT_MESSAGE_ON_LOGIN_ENABLED = true;
|
public static final boolean DEFAULT_MESSAGE_ON_LOGIN_ENABLED = true;
|
||||||
private FileConfiguration configuration;
|
private FileConfiguration configuration;
|
||||||
|
|
||||||
@ -25,24 +19,6 @@ public class VoxelSniperConfiguration {
|
|||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the maximum amount of snipes stored in the undo cache of snipers.
|
|
||||||
*
|
|
||||||
* @return the maximum amount of snipes stored in the undo cache of snipers
|
|
||||||
*/
|
|
||||||
public int getUndoCacheSize() {
|
|
||||||
return configuration.getInt(CONFIG_IDENTIFIER_UNDO_CACHE_SIZE, DEFAULT_UNDO_CACHE_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the maximum amount of snipes stored in the undo cache of snipers.
|
|
||||||
*
|
|
||||||
* @param size size of undo cache
|
|
||||||
*/
|
|
||||||
public void setUndoCacheSize(int size) {
|
|
||||||
configuration.set(CONFIG_IDENTIFIER_UNDO_CACHE_SIZE, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns maximum size of brushes that LiteSnipers can use.
|
* Returns maximum size of brushes that LiteSnipers can use.
|
||||||
*
|
*
|
||||||
@ -52,34 +28,6 @@ public class VoxelSniperConfiguration {
|
|||||||
return configuration.getInt(CONFIG_IDENTIFIER_LITESNIPER_MAX_BRUSH_SIZE, DEFAULT_LITESNIPER_MAX_BRUSH_SIZE);
|
return configuration.getInt(CONFIG_IDENTIFIER_LITESNIPER_MAX_BRUSH_SIZE, DEFAULT_LITESNIPER_MAX_BRUSH_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set maximum size of brushes that LiteSnipers can use.
|
|
||||||
*
|
|
||||||
* @param size maximum size
|
|
||||||
*/
|
|
||||||
public void setLiteSniperMaxBrushSize(int size) {
|
|
||||||
configuration.set(CONFIG_IDENTIFIER_LITESNIPER_MAX_BRUSH_SIZE, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns List of restricted Litesniper Items.
|
|
||||||
*
|
|
||||||
* @return List of restricted Litesniper Items
|
|
||||||
*/
|
|
||||||
public List<Integer> getLiteSniperRestrictedItems() {
|
|
||||||
return configuration.getIntegerList(CONFIG_IDENTIFIER_LITESNIPER_RESTRICTED_ITEMS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set new list of restricted Litesniper Items.
|
|
||||||
*
|
|
||||||
* @param restrictedItems List of restricted Litesniper Items
|
|
||||||
*/
|
|
||||||
public void setLitesniperRestrictedItems(List<Integer> restrictedItems) {
|
|
||||||
Preconditions.checkNotNull(restrictedItems, "Restricted items must be a list.");
|
|
||||||
configuration.set(CONFIG_IDENTIFIER_LITESNIPER_RESTRICTED_ITEMS, restrictedItems);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the login message is enabled.
|
* Returns if the login message is enabled.
|
||||||
*
|
*
|
||||||
@ -88,13 +36,4 @@ public class VoxelSniperConfiguration {
|
|||||||
public boolean isMessageOnLoginEnabled() {
|
public boolean isMessageOnLoginEnabled() {
|
||||||
return configuration.getBoolean(CONFIG_IDENTIFIER_MESSAGE_ON_LOGIN_ENABLED, DEFAULT_MESSAGE_ON_LOGIN_ENABLED);
|
return configuration.getBoolean(CONFIG_IDENTIFIER_MESSAGE_ON_LOGIN_ENABLED, DEFAULT_MESSAGE_ON_LOGIN_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the message on login to be enabled or disabled.
|
|
||||||
*
|
|
||||||
* @param enabled Message on Login enabled
|
|
||||||
*/
|
|
||||||
public void setMessageOnLoginEnabled(boolean enabled) {
|
|
||||||
configuration.set(CONFIG_IDENTIFIER_MESSAGE_ON_LOGIN_ENABLED, enabled);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class VoxelSniperListener implements Listener {
|
public class VoxelSniperListener implements Listener {
|
||||||
|
|
||||||
private static final String SNIPER_PERMISSION = "voxelsniper.sniper";
|
private static final String SNIPER_PERMISSION = "voxelsniper.sniper";
|
||||||
@ -117,9 +115,6 @@ public class VoxelSniperListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
@EventHandler(ignoreCancelled = false)
|
@EventHandler(ignoreCancelled = false)
|
||||||
public final void onPlayerInteract(final PlayerInteractEvent event) {
|
public final void onPlayerInteract(final PlayerInteractEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
@ -133,14 +128,11 @@ public class VoxelSniperListener implements Listener {
|
|||||||
if (sniper.isEnabled() && sniper.snipe(event.getAction(), event.getMaterial(), event.getClickedBlock(), event.getBlockFace())) {
|
if (sniper.isEnabled() && sniper.snipe(event.getAction(), event.getMaterial(), event.getClickedBlock(), event.getBlockFace())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} catch (final Throwable ignored) {
|
} catch (final Throwable throwable) {
|
||||||
ignored.printStackTrace();
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public final void onPlayerJoin(final PlayerJoinEvent event) {
|
public final void onPlayerJoin(final PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A brush that creates a solid ball.
|
* A brush that creates a solid ball.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Ball_Brush
|
|
||||||
*
|
*
|
||||||
* @author Piotr
|
* @author Piotr
|
||||||
*/
|
*/
|
||||||
@ -17,10 +16,7 @@ public class BallBrush extends PerformBrush {
|
|||||||
public static final int TRUE_CIRCLE_OFF_VALUE = 0;
|
public static final int TRUE_CIRCLE_OFF_VALUE = 0;
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
|
|
||||||
/**
|
public BallBrush() {
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BallBrush() {
|
|
||||||
this.setName("Ball");
|
this.setName("Ball");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +107,7 @@ public class BallBrush extends PerformBrush {
|
|||||||
this.trueCircle = TRUE_CIRCLE_OFF_VALUE;
|
this.trueCircle = TRUE_CIRCLE_OFF_VALUE;
|
||||||
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,10 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class BiomeBrush extends Brush {
|
public class BiomeBrush extends Brush {
|
||||||
|
|
||||||
private Biome selectedBiome = Biome.PLAINS;
|
private Biome selectedBiome = Biome.PLAINS;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BiomeBrush() {
|
public BiomeBrush() {
|
||||||
this.setName("Biome (/b biome [Biome Name])");
|
this.setName("Biome (/b biome [Biome Name])");
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,8 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Blend_Brushes
|
|
||||||
*/
|
|
||||||
public class BlendBallBrush extends BlendBrushBase {
|
public class BlendBallBrush extends BlendBrushBase {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlendBallBrush() {
|
public BlendBallBrush() {
|
||||||
this.setName("Blend Ball");
|
this.setName("Blend Ball");
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,10 @@ import com.thevoxelbox.voxelsniper.Message;
|
|||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Monofraps
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public abstract class BlendBrushBase extends Brush {
|
public abstract class BlendBrushBase extends Brush {
|
||||||
protected boolean excludeAir = true;
|
protected boolean excludeAir = true;
|
||||||
protected boolean excludeWater = true;
|
protected boolean excludeWater = true;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
*/
|
|
||||||
protected abstract void blend(final SnipeData v);
|
protected abstract void blend(final SnipeData v);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -47,30 +40,18 @@ public abstract class BlendBrushBase extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected final boolean isExcludeAir() {
|
protected final boolean isExcludeAir() {
|
||||||
return excludeAir;
|
return excludeAir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param excludeAir
|
|
||||||
*/
|
|
||||||
protected final void setExcludeAir(boolean excludeAir) {
|
protected final void setExcludeAir(boolean excludeAir) {
|
||||||
this.excludeAir = excludeAir;
|
this.excludeAir = excludeAir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected final boolean isExcludeWater() {
|
protected final boolean isExcludeWater() {
|
||||||
return excludeWater;
|
return excludeWater;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param excludeWater
|
|
||||||
*/
|
|
||||||
protected final void setExcludeWater(boolean excludeWater) {
|
protected final void setExcludeWater(boolean excludeWater) {
|
||||||
this.excludeWater = excludeWater;
|
this.excludeWater = excludeWater;
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,8 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Blend_Brushes
|
|
||||||
*/
|
|
||||||
public class BlendDiscBrush extends BlendBrushBase {
|
public class BlendDiscBrush extends BlendBrushBase {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlendDiscBrush() {
|
public BlendDiscBrush() {
|
||||||
this.setName("Blend Disc");
|
this.setName("Blend Disc");
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,8 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Blend_Brushes
|
|
||||||
*/
|
|
||||||
public class BlendVoxelBrush extends BlendBrushBase {
|
public class BlendVoxelBrush extends BlendBrushBase {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlendVoxelBrush() {
|
public BlendVoxelBrush() {
|
||||||
this.setName("Blend Voxel");
|
this.setName("Blend Voxel");
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,8 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Blend_Brushes
|
|
||||||
*/
|
|
||||||
public class BlendVoxelDiscBrush extends BlendBrushBase {
|
public class BlendVoxelDiscBrush extends BlendBrushBase {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlendVoxelDiscBrush() {
|
public BlendVoxelDiscBrush() {
|
||||||
this.setName("Blend Voxel Disc");
|
this.setName("Blend Voxel Disc");
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,6 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Blob_Brush
|
|
||||||
*
|
|
||||||
* @author Giltwist
|
|
||||||
*/
|
|
||||||
public class BlobBrush extends PerformBrush {
|
public class BlobBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
@ -20,9 +15,6 @@ public class BlobBrush extends PerformBrush {
|
|||||||
private Random randomGenerator = new Random();
|
private Random randomGenerator = new Random();
|
||||||
private int growPercent = GROW_PERCENT_DEFAULT; // chance block on recursion pass is made active
|
private int growPercent = GROW_PERCENT_DEFAULT; // chance block on recursion pass is made active
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlobBrush() {
|
public BlobBrush() {
|
||||||
this.setName("Blob");
|
this.setName("Blob");
|
||||||
}
|
}
|
||||||
@ -233,7 +225,7 @@ public class BlobBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Growth percent must be an integer " + GROW_PERCENT_MIN + "-" + GROW_PERCENT_MAX + "!");
|
v.sendMessage(ChatColor.RED + "Growth percent must be an integer " + GROW_PERCENT_MIN + "-" + GROW_PERCENT_MAX + "!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,39 +7,36 @@ import org.bukkit.block.Block;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class BlockResetBrush extends Brush {
|
public class BlockResetBrush extends Brush {
|
||||||
private static final ArrayList<Material> DENIED_UPDATES = new ArrayList<>();
|
private static final ArrayList<Material> DENIED_UPDATES = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.SIGN);
|
BlockResetBrush.DENIED_UPDATES.add(Material.SIGN);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_SIGN_POST);
|
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.WALL_SIGN);
|
BlockResetBrush.DENIED_UPDATES.add(Material.WALL_SIGN);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.CHEST);
|
BlockResetBrush.DENIED_UPDATES.add(Material.CHEST);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.FURNACE);
|
BlockResetBrush.DENIED_UPDATES.add(Material.FURNACE);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_BURNING_FURNACE);
|
BlockResetBrush.DENIED_UPDATES.add(Material.REDSTONE_TORCH);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_REDSTONE_TORCH_OFF);
|
BlockResetBrush.DENIED_UPDATES.add(Material.REDSTONE_WALL_TORCH);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_REDSTONE_TORCH_ON);
|
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.REDSTONE_WIRE);
|
BlockResetBrush.DENIED_UPDATES.add(Material.REDSTONE_WIRE);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_DIODE_BLOCK_OFF);
|
BlockResetBrush.DENIED_UPDATES.add(Material.OAK_DOOR);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_DIODE_BLOCK_ON);
|
BlockResetBrush.DENIED_UPDATES.add(Material.DARK_OAK_DOOR);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_WOODEN_DOOR);
|
BlockResetBrush.DENIED_UPDATES.add(Material.BIRCH_DOOR);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_WOOD_DOOR);
|
BlockResetBrush.DENIED_UPDATES.add(Material.ACACIA_DOOR);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.SPRUCE_DOOR);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.JUNGLE_DOOR);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.IRON_DOOR);
|
BlockResetBrush.DENIED_UPDATES.add(Material.IRON_DOOR);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_IRON_DOOR_BLOCK);
|
BlockResetBrush.DENIED_UPDATES.add(Material.DARK_OAK_FENCE_GATE);
|
||||||
BlockResetBrush.DENIED_UPDATES.add(Material.LEGACY_FENCE_GATE);
|
BlockResetBrush.DENIED_UPDATES.add(Material.ACACIA_FENCE_GATE);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.BIRCH_FENCE_GATE);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.SPRUCE_FENCE_GATE);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.JUNGLE_FENCE_GATE);
|
||||||
|
BlockResetBrush.DENIED_UPDATES.add(Material.OAK_FENCE_GATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlockResetBrush() {
|
public BlockResetBrush() {
|
||||||
this.setName("Block Reset Brush");
|
this.setName("Block Reset Brush");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void applyBrush(final SnipeData v) {
|
private void applyBrush(final SnipeData v) {
|
||||||
for (int z = -v.getBrushSize(); z <= v.getBrushSize(); z++) {
|
for (int z = -v.getBrushSize(); z <= v.getBrushSize(); z++) {
|
||||||
for (int x = -v.getBrushSize(); x <= v.getBrushSize(); x++) {
|
for (int x = -v.getBrushSize(); x <= v.getBrushSize(); x++) {
|
||||||
|
@ -24,14 +24,11 @@ import org.bukkit.Material;
|
|||||||
* @author GavJenks
|
* @author GavJenks
|
||||||
*/
|
*/
|
||||||
public class BlockResetSurfaceBrush extends Brush {
|
public class BlockResetSurfaceBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public BlockResetSurfaceBrush() {
|
public BlockResetSurfaceBrush() {
|
||||||
this.setName("Block Reset Brush Surface Only");
|
this.setName("Block Reset Brush Surface Only");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void applyBrush(final SnipeData v) {
|
private void applyBrush(final SnipeData v) {
|
||||||
final AsyncWorld world = this.getWorld();
|
final AsyncWorld world = this.getWorld();
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ public abstract class Brush implements IBrush {
|
|||||||
private String name = "Undefined";
|
private String name = "Undefined";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param x
|
* @param x X coordinate
|
||||||
* @param y
|
* @param y Y coordinate
|
||||||
* @param z
|
* @param z Z coordinate
|
||||||
* @return {@link Block}
|
* @return {@link Block}
|
||||||
*/
|
*/
|
||||||
public final AsyncBlock clampY(final int x, final int y, final int z) {
|
public final AsyncBlock clampY(final int x, final int y, final int z) {
|
||||||
@ -103,9 +103,9 @@ public abstract class Brush implements IBrush {
|
|||||||
/**
|
/**
|
||||||
* Overridable getTarget method.
|
* Overridable getTarget method.
|
||||||
*
|
*
|
||||||
* @param v
|
* @param v Sniper caller
|
||||||
* @param clickedBlock
|
* @param clickedBlock Block that the player targeted/interacted with
|
||||||
* @param clickedFace
|
* @param clickedFace Face of that targeted Block
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected final boolean getTarget(final SnipeData v, final AsyncBlock clickedBlock, final BlockFace clickedFace) {
|
protected final boolean getTarget(final SnipeData v, final AsyncBlock clickedBlock, final BlockFace clickedFace) {
|
||||||
@ -123,7 +123,7 @@ public abstract class Brush implements IBrush {
|
|||||||
} else {
|
} else {
|
||||||
RangeBlockHelper rangeBlockHelper;
|
RangeBlockHelper rangeBlockHelper;
|
||||||
if (v.owner().getSnipeData(v.owner().getCurrentToolId()).isRanged()) {
|
if (v.owner().getSnipeData(v.owner().getCurrentToolId()).isRanged()) {
|
||||||
rangeBlockHelper = new RangeBlockHelper(v.owner().getPlayer(), v.owner().getWorld(), (double) v.owner().getSnipeData(v.owner().getCurrentToolId()).getRange());
|
rangeBlockHelper = new RangeBlockHelper(v.owner().getPlayer(), v.owner().getWorld(), v.owner().getSnipeData(v.owner().getCurrentToolId()).getRange());
|
||||||
this.setTargetBlock(rangeBlockHelper.getRangeBlock());
|
this.setTargetBlock(rangeBlockHelper.getRangeBlock());
|
||||||
} else {
|
} else {
|
||||||
rangeBlockHelper = new RangeBlockHelper(v.owner().getPlayer(), v.owner().getWorld());
|
rangeBlockHelper = new RangeBlockHelper(v.owner().getPlayer(), v.owner().getWorld());
|
||||||
@ -190,7 +190,6 @@ public abstract class Brush implements IBrush {
|
|||||||
* @param z Z coordinate
|
* @param z Z coordinate
|
||||||
* @return Type ID of Block at given coordinates in the world of the targeted Block.
|
* @return Type ID of Block at given coordinates in the world of the targeted Block.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
protected int getBlockIdAt(int x, int y, int z) {
|
protected int getBlockIdAt(int x, int y, int z) {
|
||||||
return getWorld().getBlockAt(x, y, z).getTypeId();
|
return getWorld().getBlockAt(x, y, z).getTypeId();
|
||||||
}
|
}
|
||||||
|
@ -11,27 +11,16 @@ import org.bukkit.Chunk;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_CANYONATOR
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class CanyonBrush extends Brush {
|
public class CanyonBrush extends Brush {
|
||||||
private static final int SHIFT_LEVEL_MIN = 10;
|
private static final int SHIFT_LEVEL_MIN = 10;
|
||||||
private static final int SHIFT_LEVEL_MAX = 60;
|
private static final int SHIFT_LEVEL_MAX = 60;
|
||||||
private int yLevel = 10;
|
private int yLevel = 10;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CanyonBrush() {
|
public CanyonBrush() {
|
||||||
this.setName("Canyon");
|
this.setName("Canyon");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param chunk
|
|
||||||
* @param undo
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
protected final void canyon(final AsyncChunk chunk, final Undo undo) {
|
protected final void canyon(final AsyncChunk chunk, final Undo undo) {
|
||||||
for (int x = 0; x < CHUNK_SIZE; x++) {
|
for (int x = 0; x < CHUNK_SIZE; x++) {
|
||||||
|
@ -6,19 +6,12 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Canyon_Selection_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class CanyonSelectionBrush extends CanyonBrush {
|
public class CanyonSelectionBrush extends CanyonBrush {
|
||||||
private boolean first = true;
|
private boolean first = true;
|
||||||
private int fx;
|
private int fx;
|
||||||
private int fz;
|
private int fz;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CanyonSelectionBrush() {
|
public CanyonSelectionBrush() {
|
||||||
this.setName("Canyon Selection");
|
this.setName("Canyon Selection");
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class CheckerVoxelDiscBrush extends PerformBrush {
|
public class CheckerVoxelDiscBrush extends PerformBrush {
|
||||||
private boolean useWorldCoordinates = true;
|
private boolean useWorldCoordinates = true;
|
||||||
|
|
||||||
@ -19,10 +16,6 @@ public class CheckerVoxelDiscBrush extends PerformBrush {
|
|||||||
this.setName("Checker Voxel Disc");
|
this.setName("Checker Voxel Disc");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
* @param target
|
|
||||||
*/
|
|
||||||
private void applyBrush(final SnipeData v, final Block target) {
|
private void applyBrush(final SnipeData v, final Block target) {
|
||||||
for (int x = v.getBrushSize(); x >= -v.getBrushSize(); x--) {
|
for (int x = v.getBrushSize(); x >= -v.getBrushSize(); x--) {
|
||||||
for (int y = v.getBrushSize(); y >= -v.getBrushSize(); y--) {
|
for (int y = v.getBrushSize(); y >= -v.getBrushSize(); y--) {
|
||||||
@ -69,7 +62,7 @@ public class CheckerVoxelDiscBrush extends PerformBrush {
|
|||||||
this.useWorldCoordinates = false;
|
this.useWorldCoordinates = false;
|
||||||
v.sendMessage(ChatColor.AQUA + "Disabled using World Coordinates.");
|
v.sendMessage(ChatColor.AQUA + "Disabled using World Coordinates.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,17 +7,9 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Clean_Snow_Brush
|
|
||||||
*
|
|
||||||
* @author psanker
|
|
||||||
*/
|
|
||||||
public class CleanSnowBrush extends Brush {
|
public class CleanSnowBrush extends Brush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CleanSnowBrush() {
|
public CleanSnowBrush() {
|
||||||
this.setName("Clean Snow");
|
this.setName("Clean Snow");
|
||||||
}
|
}
|
||||||
@ -80,7 +72,7 @@ public class CleanSnowBrush extends Brush {
|
|||||||
this.trueCircle = 0;
|
this.trueCircle = 0;
|
||||||
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,11 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The CloneStamp class is used to create a collection of blocks in a cylinder shape according to the selection the player has set.
|
* The CloneStamp class is used to create a collection of blocks in a cylinder shape according to the selection the player has set.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Clone_and_CopyPasta_Brushes
|
|
||||||
*
|
*
|
||||||
* @author Voxel
|
* @author Voxel
|
||||||
*/
|
*/
|
||||||
public class CloneStampBrush extends StampBrush {
|
public class CloneStampBrush extends StampBrush {
|
||||||
/**
|
public CloneStampBrush() {
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CloneStampBrush() {
|
|
||||||
this.setName("Clone");
|
this.setName("Clone");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +20,7 @@ public class CloneStampBrush extends StampBrush {
|
|||||||
* x y z -- initial center of the selection v.brushSize -- the radius of the cylinder v.voxelHeight -- the heigth of the cylinder c.cCen -- the offset on
|
* x y z -- initial center of the selection v.brushSize -- the radius of the cylinder v.voxelHeight -- the heigth of the cylinder c.cCen -- the offset on
|
||||||
* the Y axis of the selection ( bottom of the cylinder ) as blockPositionY: Bottom_Y = targetBlock.y + v.cCen;
|
* the Y axis of the selection ( bottom of the cylinder ) as blockPositionY: Bottom_Y = targetBlock.y + v.cCen;
|
||||||
*
|
*
|
||||||
* @param v the caller
|
* @param v Sniper Caller
|
||||||
*/
|
*/
|
||||||
private void clone(final SnipeData v) {
|
private void clone(final SnipeData v) {
|
||||||
final int brushSize = v.getBrushSize();
|
final int brushSize = v.getBrushSize();
|
||||||
@ -109,7 +105,7 @@ public class CloneStampBrush extends StampBrush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
final String parameter = par[1];
|
final String parameter = par[1];
|
||||||
|
|
||||||
if (parameter.equalsIgnoreCase("info")) {
|
if (parameter.equalsIgnoreCase("info")) {
|
||||||
|
@ -8,17 +8,9 @@ import org.bukkit.entity.LargeFireball;
|
|||||||
import org.bukkit.entity.SmallFireball;
|
import org.bukkit.entity.SmallFireball;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Gavjenks Heavily revamped from ruler brush blockPositionY
|
|
||||||
* @author Giltwist
|
|
||||||
* @author Monofraps (Merged Meteor brush)
|
|
||||||
*/
|
|
||||||
public class CometBrush extends Brush {
|
public class CometBrush extends Brush {
|
||||||
private boolean useBigBalls = false;
|
private boolean useBigBalls = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CometBrush() {
|
public CometBrush() {
|
||||||
this.setName("Comet");
|
this.setName("Comet");
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,6 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#CopyPasta_Brush
|
|
||||||
*
|
|
||||||
* @author giltwist
|
|
||||||
*/
|
|
||||||
public class CopyPastaBrush extends Brush {
|
public class CopyPastaBrush extends Brush {
|
||||||
private static final int BLOCK_LIMIT = 10000;
|
private static final int BLOCK_LIMIT = 10000;
|
||||||
|
|
||||||
@ -27,14 +22,10 @@ public class CopyPastaBrush extends Brush {
|
|||||||
private int[] arraySize = new int[3];
|
private int[] arraySize = new int[3];
|
||||||
private int pivot = 0; // ccw degrees
|
private int pivot = 0; // ccw degrees
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CopyPastaBrush() {
|
public CopyPastaBrush() {
|
||||||
this.setName("CopyPasta");
|
this.setName("CopyPasta");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void doCopy(final SnipeData v) {
|
private void doCopy(final SnipeData v) {
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
this.arraySize[i] = Math.abs(this.firstPoint[i] - this.secondPoint[i]) + 1;
|
this.arraySize[i] = Math.abs(this.firstPoint[i] - this.secondPoint[i]) + 1;
|
||||||
@ -103,7 +94,7 @@ public class CopyPastaBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final void arrow(final com.thevoxelbox.voxelsniper.SnipeData v) {
|
protected final void arrow(final SnipeData v) {
|
||||||
switch (this.points) {
|
switch (this.points) {
|
||||||
case 0:
|
case 0:
|
||||||
this.firstPoint[0] = this.getTargetBlock().getX();
|
this.firstPoint[0] = this.getTargetBlock().getX();
|
||||||
@ -131,7 +122,7 @@ public class CopyPastaBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final void powder(final com.thevoxelbox.voxelsniper.SnipeData v) {
|
protected final void powder(final SnipeData v) {
|
||||||
if (this.points == 2) {
|
if (this.points == 2) {
|
||||||
if (this.numBlocks == 0) {
|
if (this.numBlocks == 0) {
|
||||||
this.doCopy(v);
|
this.doCopy(v);
|
||||||
@ -156,7 +147,7 @@ public class CopyPastaBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
final String parameter = par[1];
|
final String parameter = par[1];
|
||||||
|
|
||||||
if (parameter.equalsIgnoreCase("info")) {
|
if (parameter.equalsIgnoreCase("info")) {
|
||||||
|
@ -6,15 +6,9 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Kavutop
|
|
||||||
*/
|
|
||||||
public class CylinderBrush extends PerformBrush {
|
public class CylinderBrush extends PerformBrush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CylinderBrush() {
|
public CylinderBrush() {
|
||||||
this.setName("Cylinder");
|
this.setName("Cylinder");
|
||||||
}
|
}
|
||||||
@ -104,7 +98,7 @@ public class CylinderBrush extends PerformBrush {
|
|||||||
v.setcCen((int) Double.parseDouble(parameter.replace("c", "")));
|
v.setcCen((int) Double.parseDouble(parameter.replace("c", "")));
|
||||||
v.sendMessage(ChatColor.AQUA + "Cylinder origin set to: " + v.getcCen());
|
v.sendMessage(ChatColor.AQUA + "Cylinder origin set to: " + v.getcCen());
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,6 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Disc_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class DiscBrush extends PerformBrush {
|
public class DiscBrush extends PerformBrush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
|
|
||||||
@ -25,7 +20,7 @@ public class DiscBrush extends PerformBrush {
|
|||||||
/**
|
/**
|
||||||
* Disc executor.
|
* Disc executor.
|
||||||
*
|
*
|
||||||
* @param v
|
* @param v Snipe Data
|
||||||
*/
|
*/
|
||||||
private void disc(final SnipeData v, final Block targetBlock) {
|
private void disc(final SnipeData v, final Block targetBlock) {
|
||||||
final double radiusSquared = (v.getBrushSize() + this.trueCircle) * (v.getBrushSize() + this.trueCircle);
|
final double radiusSquared = (v.getBrushSize() + this.trueCircle) * (v.getBrushSize() + this.trueCircle);
|
||||||
@ -76,7 +71,7 @@ public class DiscBrush extends PerformBrush {
|
|||||||
this.trueCircle = 0;
|
this.trueCircle = 0;
|
||||||
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,17 +7,9 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Disc_Face_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class DiscFaceBrush extends PerformBrush {
|
public class DiscFaceBrush extends PerformBrush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DiscFaceBrush() {
|
public DiscFaceBrush() {
|
||||||
this.setName("Disc Face");
|
this.setName("Disc Face");
|
||||||
}
|
}
|
||||||
@ -139,7 +131,7 @@ public class DiscFaceBrush extends PerformBrush {
|
|||||||
this.trueCircle = 0;
|
this.trueCircle = 0;
|
||||||
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
v.sendMessage(ChatColor.AQUA + "True circle mode OFF.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,8 @@ import org.bukkit.util.Vector;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Dome_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class DomeBrush extends Brush {
|
public class DomeBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DomeBrush() {
|
public DomeBrush() {
|
||||||
this.setName("Dome");
|
this.setName("Dome");
|
||||||
}
|
}
|
||||||
@ -34,8 +26,8 @@ public class DomeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param v
|
* @param v Snipe Data
|
||||||
* @param targetBlock
|
* @param targetBlock the targetBlock to set
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void generateDome(final SnipeData v, final Block targetBlock) {
|
private void generateDome(final SnipeData v, final Block targetBlock) {
|
||||||
|
@ -6,24 +6,14 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.Undo;
|
import com.thevoxelbox.voxelsniper.Undo;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Drain_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
* @author psanker
|
|
||||||
*/
|
|
||||||
public class DrainBrush extends Brush {
|
public class DrainBrush extends Brush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
private boolean disc = false;
|
private boolean disc = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DrainBrush() {
|
public DrainBrush() {
|
||||||
this.setName("Drain");
|
this.setName("Drain");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void drain(final SnipeData v) {
|
private void drain(final SnipeData v) {
|
||||||
final int brushSize = v.getBrushSize();
|
final int brushSize = v.getBrushSize();
|
||||||
final double brushSizeSquared = Math.pow(brushSize + this.trueCircle, 2);
|
final double brushSizeSquared = Math.pow(brushSize + this.trueCircle, 2);
|
||||||
@ -123,7 +113,7 @@ public class DrainBrush extends Brush {
|
|||||||
v.sendMessage(ChatColor.AQUA + "Disc drain mode ON");
|
v.sendMessage(ChatColor.AQUA + "Disc drain mode ON");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,6 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Ellipse_Brush
|
|
||||||
*
|
|
||||||
* @author psanker
|
|
||||||
*/
|
|
||||||
public class EllipseBrush extends PerformBrush {
|
public class EllipseBrush extends PerformBrush {
|
||||||
private static final double TWO_PI = (2 * Math.PI);
|
private static final double TWO_PI = (2 * Math.PI);
|
||||||
private static final int SCL_MIN = 1;
|
private static final int SCL_MIN = 1;
|
||||||
@ -25,9 +20,6 @@ public class EllipseBrush extends PerformBrush {
|
|||||||
private double stepSize;
|
private double stepSize;
|
||||||
private boolean fill;
|
private boolean fill;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EllipseBrush() {
|
public EllipseBrush() {
|
||||||
this.setName("Ellipse");
|
this.setName("Ellipse");
|
||||||
}
|
}
|
||||||
@ -182,7 +174,7 @@ public class EllipseBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
for (int i = 1; i < par.length; i++) {
|
for (int i = 1; i < par.length; i++) {
|
||||||
final String parameter = par[i];
|
final String parameter = par[i];
|
||||||
|
|
||||||
|
@ -6,18 +6,12 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Ellipsoid_Brush
|
|
||||||
*/
|
|
||||||
public class EllipsoidBrush extends PerformBrush {
|
public class EllipsoidBrush extends PerformBrush {
|
||||||
private double xRad;
|
private double xRad;
|
||||||
private double yRad;
|
private double yRad;
|
||||||
private double zRad;
|
private double zRad;
|
||||||
private boolean istrue;
|
private boolean istrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EllipsoidBrush() {
|
public EllipsoidBrush() {
|
||||||
this.setName("Ellipsoid");
|
this.setName("Ellipsoid");
|
||||||
}
|
}
|
||||||
@ -78,7 +72,7 @@ public class EllipsoidBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
this.istrue = false;
|
this.istrue = false;
|
||||||
for (int i = 1; i < par.length; i++) {
|
for (int i = 1; i < par.length; i++) {
|
||||||
final String parameter = par[i];
|
final String parameter = par[i];
|
||||||
|
@ -5,17 +5,10 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Entity_Brush
|
|
||||||
*
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class EntityBrush extends Brush {
|
public class EntityBrush extends Brush {
|
||||||
private EntityType entityType = EntityType.ZOMBIE;
|
private EntityType entityType = EntityType.ZOMBIE;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EntityBrush() {
|
public EntityBrush() {
|
||||||
this.setName("Entity");
|
this.setName("Entity");
|
||||||
}
|
}
|
||||||
|
@ -11,15 +11,9 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.PatternSyntaxException;
|
import java.util.regex.PatternSyntaxException;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class EntityRemovalBrush extends Brush {
|
public class EntityRemovalBrush extends Brush {
|
||||||
private final List<String> exemptions = new ArrayList<>(3);
|
private final List<String> exemptions = new ArrayList<>(3);
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EntityRemovalBrush() {
|
public EntityRemovalBrush() {
|
||||||
this.setName("Entity Removal");
|
this.setName("Entity Removal");
|
||||||
|
|
||||||
|
@ -10,11 +10,7 @@ import org.bukkit.block.Block;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Eraser_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class EraserBrush extends Brush {
|
public class EraserBrush extends Brush {
|
||||||
|
|
||||||
private static final Set<Material> EXCLUSIVE_MATERIALS = EnumSet.of(
|
private static final Set<Material> EXCLUSIVE_MATERIALS = EnumSet.of(
|
||||||
@ -22,9 +18,6 @@ public class EraserBrush extends Brush {
|
|||||||
private static final Set<Material> EXCLUSIVE_LIQUIDS = EnumSet.of(
|
private static final Set<Material> EXCLUSIVE_LIQUIDS = EnumSet.of(
|
||||||
Material.WATER, Material.WATER, Material.LAVA, Material.LAVA);
|
Material.WATER, Material.WATER, Material.LAVA, Material.LAVA);
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EraserBrush() {
|
public EraserBrush() {
|
||||||
this.setName("Eraser");
|
this.setName("Eraser");
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package com.thevoxelbox.voxelsniper.brush;
|
|||||||
import com.thevoxelbox.voxelsniper.Message;
|
import com.thevoxelbox.voxelsniper.Message;
|
||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
|
|
||||||
public class ErodeBlendBrush extends Brush{
|
public class ErodeBlendBrush extends Brush {
|
||||||
|
|
||||||
private BlendBallBrush blendBall;
|
private BlendBallBrush blendBall;
|
||||||
private ErodeBrush erode;
|
private ErodeBrush erode;
|
||||||
|
@ -22,20 +22,11 @@ import org.bukkit.util.Vector;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/VoxelSniper#The_Erosion_Brush
|
|
||||||
*
|
|
||||||
* @author Piotr
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class ErodeBrush extends Brush {
|
public class ErodeBrush extends Brush {
|
||||||
private static final Vector[] FACES_TO_CHECK = {new Vector(0, 0, 1), new Vector(0, 0, -1), new Vector(0, 1, 0), new Vector(0, -1, 0), new Vector(1, 0, 0), new Vector(-1, 0, 0)};
|
private static final Vector[] FACES_TO_CHECK = {new Vector(0, 0, 1), new Vector(0, 0, -1), new Vector(0, 1, 0), new Vector(0, -1, 0), new Vector(1, 0, 0), new Vector(-1, 0, 0)};
|
||||||
private final HelpJSAP parser = new HelpJSAP("/b e", "Brush for eroding landscape.", ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH);
|
private final HelpJSAP parser = new HelpJSAP("/b e", "Brush for eroding landscape.", ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH);
|
||||||
private ErosionPreset currentPreset = new ErosionPreset(0, 1, 0, 1);
|
private ErosionPreset currentPreset = new ErosionPreset(0, 1, 0, 1);
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ErodeBrush() {
|
public ErodeBrush() {
|
||||||
this.setName("Erode");
|
this.setName("Erode");
|
||||||
|
|
||||||
@ -49,12 +40,6 @@ public class ErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param result
|
|
||||||
* @param player
|
|
||||||
* @param helpJSAP
|
|
||||||
* @return if a message was sent.
|
|
||||||
*/
|
|
||||||
public static boolean sendHelpOrErrorMessageToPlayer(final JSAPResult result, final Player player, final HelpJSAP helpJSAP) {
|
public static boolean sendHelpOrErrorMessageToPlayer(final JSAPResult result, final Player player, final HelpJSAP helpJSAP) {
|
||||||
final List<String> output = helpJSAP.writeHelpOrErrorMessageIfRequired(result);
|
final List<String> output = helpJSAP.writeHelpOrErrorMessageIfRequired(result);
|
||||||
if (!output.isEmpty()) {
|
if (!output.isEmpty()) {
|
||||||
@ -252,11 +237,12 @@ public class ErodeBrush extends Brush {
|
|||||||
return "voxelsniper.brush.erode";
|
return "voxelsniper.brush.erode";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
private enum Preset {
|
private enum Preset {
|
||||||
MELT(new ErosionPreset(2, 1, 5, 1)), FILL(new ErosionPreset(5, 1, 2, 1)), SMOOTH(new ErosionPreset(3, 1, 3, 1)), LIFT(new ErosionPreset(6, 0, 1, 1)), FLOATCLEAN(new ErosionPreset(6, 1, 6, 1));
|
MELT(new ErosionPreset(2, 1, 5, 1)),
|
||||||
|
FILL(new ErosionPreset(5, 1, 2, 1)),
|
||||||
|
SMOOTH(new ErosionPreset(3, 1, 3, 1)),
|
||||||
|
LIFT(new ErosionPreset(6, 0, 1, 1)),
|
||||||
|
FLOATCLEAN(new ErosionPreset(6, 1, 6, 1));
|
||||||
private ErosionPreset preset;
|
private ErosionPreset preset;
|
||||||
|
|
||||||
Preset(final ErosionPreset preset) {
|
Preset(final ErosionPreset preset) {
|
||||||
@ -267,21 +253,20 @@ public class ErodeBrush extends Brush {
|
|||||||
* Generates a concat string of all options.
|
* Generates a concat string of all options.
|
||||||
*
|
*
|
||||||
* @param seperator Seperator for delimiting entries.
|
* @param seperator Seperator for delimiting entries.
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public static String getValuesString(String seperator) {
|
public static String getValuesString(String seperator) {
|
||||||
String valuesString = "";
|
StringBuilder valuesString = new StringBuilder();
|
||||||
|
|
||||||
boolean delimiterHelper = true;
|
boolean delimiterHelper = true;
|
||||||
for (final Preset preset : Preset.values()) {
|
for (final Preset preset : Preset.values()) {
|
||||||
if (delimiterHelper) {
|
if (delimiterHelper) {
|
||||||
delimiterHelper = false;
|
delimiterHelper = false;
|
||||||
} else {
|
} else {
|
||||||
valuesString += seperator;
|
valuesString.append(seperator);
|
||||||
}
|
}
|
||||||
valuesString += preset.name();
|
valuesString.append(preset.name());
|
||||||
}
|
}
|
||||||
return valuesString;
|
return valuesString.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ErosionPreset getPreset() {
|
public ErosionPreset getPreset() {
|
||||||
@ -291,9 +276,6 @@ public class ErodeBrush extends Brush {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
private static final class BlockChangeTracker {
|
private static final class BlockChangeTracker {
|
||||||
private final Map<Integer, Map<Vector, BlockWrapper>> blockChanges;
|
private final Map<Integer, Map<Vector, BlockWrapper>> blockChanges;
|
||||||
private final Map<Vector, BlockWrapper> flatChanges;
|
private final Map<Vector, BlockWrapper> flatChanges;
|
||||||
@ -307,7 +289,7 @@ public class ErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BlockWrapper get(final Vector position, final int iteration) {
|
public BlockWrapper get(final Vector position, final int iteration) {
|
||||||
BlockWrapper changedBlock = null;
|
BlockWrapper changedBlock;
|
||||||
|
|
||||||
for (int i = iteration - 1; i >= 0; --i) {
|
for (int i = iteration - 1; i >= 0; --i) {
|
||||||
if (this.blockChanges.containsKey(i) && this.blockChanges.get(i).containsKey(position)) {
|
if (this.blockChanges.containsKey(i) && this.blockChanges.get(i).containsKey(position)) {
|
||||||
@ -339,16 +321,12 @@ public class ErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
private static final class BlockWrapper {
|
private static final class BlockWrapper {
|
||||||
|
|
||||||
private final AsyncBlock block;
|
private final AsyncBlock block;
|
||||||
private final Material material;
|
private final Material material;
|
||||||
private final int data;
|
private final int data;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public BlockWrapper(final AsyncBlock block) {
|
public BlockWrapper(final AsyncBlock block) {
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.data = block.getPropertyId();
|
this.data = block.getPropertyId();
|
||||||
@ -411,9 +389,6 @@ public class ErodeBrush extends Brush {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
private static final class ErosionPreset {
|
private static final class ErosionPreset {
|
||||||
private final int erosionFaces;
|
private final int erosionFaces;
|
||||||
private final int erosionRecursion;
|
private final int erosionRecursion;
|
||||||
|
@ -7,17 +7,9 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Extrude_Brush
|
|
||||||
*
|
|
||||||
* @author psanker
|
|
||||||
*/
|
|
||||||
public class ExtrudeBrush extends Brush {
|
public class ExtrudeBrush extends Brush {
|
||||||
private double trueCircle;
|
private double trueCircle;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ExtrudeBrush() {
|
public ExtrudeBrush() {
|
||||||
this.setName("Extrude");
|
this.setName("Extrude");
|
||||||
}
|
}
|
||||||
@ -153,7 +145,7 @@ public class ExtrudeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
for (int i = 1; i < par.length; i++) {
|
for (int i = 1; i < par.length; i++) {
|
||||||
final String parameter = par[i];
|
final String parameter = par[i];
|
||||||
|
|
||||||
|
@ -8,17 +8,12 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class FillDownBrush extends PerformBrush {
|
public class FillDownBrush extends PerformBrush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
private boolean fillLiquid = true;
|
private boolean fillLiquid = true;
|
||||||
private boolean fromExisting = false;
|
private boolean fromExisting = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FillDownBrush() {
|
public FillDownBrush() {
|
||||||
this.setName("Fill Down");
|
this.setName("Fill Down");
|
||||||
}
|
}
|
||||||
@ -45,7 +40,9 @@ public class FillDownBrush extends PerformBrush {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) continue;
|
if (!found) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
y--;
|
y--;
|
||||||
}
|
}
|
||||||
for (; y >= -targetBlock.getY(); --y) {
|
for (; y >= -targetBlock.getY(); --y) {
|
||||||
@ -110,7 +107,7 @@ public class FillDownBrush extends PerformBrush {
|
|||||||
this.fromExisting = !this.fromExisting;
|
this.fromExisting = !this.fromExisting;
|
||||||
v.sendMessage(ChatColor.AQUA + "Now filling down from " + ((this.fromExisting) ? "existing" : "all") + " blocks.");
|
v.sendMessage(ChatColor.AQUA + "Now filling down from " + ((this.fromExisting) ? "existing" : "all") + " blocks.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,23 +6,16 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author GavJenks
|
|
||||||
*/
|
|
||||||
public class FlatOceanBrush extends Brush {
|
public class FlatOceanBrush extends Brush {
|
||||||
private static final int DEFAULT_WATER_LEVEL = 29;
|
private static final int DEFAULT_WATER_LEVEL = 29;
|
||||||
private static final int DEFAULT_FLOOR_LEVEL = 8;
|
private static final int DEFAULT_FLOOR_LEVEL = 8;
|
||||||
private int waterLevel = DEFAULT_WATER_LEVEL;
|
private int waterLevel = DEFAULT_WATER_LEVEL;
|
||||||
private int floorLevel = DEFAULT_FLOOR_LEVEL;
|
private int floorLevel = DEFAULT_FLOOR_LEVEL;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FlatOceanBrush() {
|
public FlatOceanBrush() {
|
||||||
this.setName("FlatOcean");
|
this.setName("FlatOcean");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void flatOcean(final AsyncChunk chunk) {
|
private void flatOcean(final AsyncChunk chunk) {
|
||||||
for (int x = 0; x < CHUNK_SIZE; x++) {
|
for (int x = 0; x < CHUNK_SIZE; x++) {
|
||||||
for (int z = 0; z < CHUNK_SIZE; z++) {
|
for (int z = 0; z < CHUNK_SIZE; z++) {
|
||||||
|
@ -14,11 +14,6 @@ import java.util.Random;
|
|||||||
|
|
||||||
// Proposal: Use /v and /vr for leave and wood material // or two more parameters -- Monofraps
|
// Proposal: Use /v and /vr for leave and wood material // or two more parameters -- Monofraps
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#VoxelTrees_Brush
|
|
||||||
*
|
|
||||||
* @author Ghost8700 @ Voxel
|
|
||||||
*/
|
|
||||||
public class GenerateTreeBrush extends Brush {
|
public class GenerateTreeBrush extends Brush {
|
||||||
// Tree Variables.
|
// Tree Variables.
|
||||||
private Random randGenerator = new Random();
|
private Random randGenerator = new Random();
|
||||||
@ -35,7 +30,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
private int thickness = 1;
|
private int thickness = 1;
|
||||||
private int slopeChance = 40;
|
private int slopeChance = 40;
|
||||||
private int twistChance = 5; // This is a hidden value not available through Parameters. Otherwise messy.
|
private int twistChance = 5; // This is a hidden value not available through Parameters. Otherwise messy.
|
||||||
private int heightMininmum = 14;
|
private int heightMinimum = 14;
|
||||||
private int heightMaximum = 18;
|
private int heightMaximum = 18;
|
||||||
private int branchLength = 8;
|
private int branchLength = 8;
|
||||||
private int nodeMax = 4;
|
private int nodeMax = 4;
|
||||||
@ -45,10 +40,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
private int blockPositionY;
|
private int blockPositionY;
|
||||||
private int blockPositionZ;
|
private int blockPositionZ;
|
||||||
|
|
||||||
/**
|
public GenerateTreeBrush() {
|
||||||
*
|
|
||||||
*/
|
|
||||||
public GenerateTreeBrush() {
|
|
||||||
this.setName("Generate Tree");
|
this.setName("Generate Tree");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +73,6 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Branch Creation based on direction chosen from the parameters passed.
|
// Branch Creation based on direction chosen from the parameters passed.
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void branchCreate(final int xDirection, final int zDirection) {
|
private void branchCreate(final int xDirection, final int zDirection) {
|
||||||
|
|
||||||
// Sets branch origin.
|
// Sets branch origin.
|
||||||
@ -125,7 +116,6 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
blockPositionZ = originZ;
|
blockPositionZ = originZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void leafNodeCreate() {
|
private void leafNodeCreate() {
|
||||||
// Generates the node size.
|
// Generates the node size.
|
||||||
final int nodeRadius = this.randGenerator.nextInt(this.nodeMax - this.nodeMin + 1) + this.nodeMin;
|
final int nodeRadius = this.randGenerator.nextInt(this.nodeMax - this.nodeMin + 1) + this.nodeMin;
|
||||||
@ -223,7 +213,6 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
* @param xDirection
|
* @param xDirection
|
||||||
* @param zDirection
|
* @param zDirection
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void rootCreate(final int xDirection, final int zDirection) {
|
private void rootCreate(final int xDirection, final int zDirection) {
|
||||||
// Sets Origin.
|
// Sets Origin.
|
||||||
final int originX = blockPositionX;
|
final int originX = blockPositionX;
|
||||||
@ -313,7 +302,6 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
this.rootCreate(-1, -1);
|
this.rootCreate(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void trunkCreate() {
|
private void trunkCreate() {
|
||||||
// Creates true circle discs of the set size using the wood type selected.
|
// Creates true circle discs of the set size using the wood type selected.
|
||||||
final double bSquared = Math.pow(this.thickness + 0.5, 2);
|
final double bSquared = Math.pow(this.thickness + 0.5, 2);
|
||||||
@ -368,7 +356,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
// ----------
|
// ----------
|
||||||
// Main Trunk
|
// Main Trunk
|
||||||
// ----------
|
// ----------
|
||||||
// Sets diretional preferences.
|
// Sets directional preferences.
|
||||||
int xPreference = this.randGenerator.nextInt(this.slopeChance);
|
int xPreference = this.randGenerator.nextInt(this.slopeChance);
|
||||||
int zPreference = this.randGenerator.nextInt(this.slopeChance);
|
int zPreference = this.randGenerator.nextInt(this.slopeChance);
|
||||||
|
|
||||||
@ -384,7 +372,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generates a height for trunk.
|
// Generates a height for trunk.
|
||||||
int height = this.randGenerator.nextInt(this.heightMaximum - this.heightMininmum + 1) + this.heightMininmum;
|
int height = this.randGenerator.nextInt(this.heightMaximum - this.heightMinimum + 1) + this.heightMinimum;
|
||||||
|
|
||||||
for (int p = 0; p < height; p++) {
|
for (int p = 0; p < height; p++) {
|
||||||
if (p > 3) {
|
if (p > 3) {
|
||||||
@ -409,7 +397,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
blockPositionY = blockPositionY + 1;
|
blockPositionY = blockPositionY + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates branchs at top of trunk for each quadrant.
|
// Generates branches at top of trunk for each quadrant.
|
||||||
this.branchCreate(1, 1);
|
this.branchCreate(1, 1);
|
||||||
this.branchCreate(-1, 1);
|
this.branchCreate(-1, 1);
|
||||||
this.branchCreate(1, -1);
|
this.branchCreate(1, -1);
|
||||||
@ -423,7 +411,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
// ---------------
|
// ---------------
|
||||||
// Secondary Trunk
|
// Secondary Trunk
|
||||||
// ---------------
|
// ---------------
|
||||||
// Sets diretional preferences.
|
// Sets directional preferences.
|
||||||
xPreference = this.randGenerator.nextInt(this.slopeChance);
|
xPreference = this.randGenerator.nextInt(this.slopeChance);
|
||||||
zPreference = this.randGenerator.nextInt(this.slopeChance);
|
zPreference = this.randGenerator.nextInt(this.slopeChance);
|
||||||
|
|
||||||
@ -439,7 +427,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generates a height for trunk.
|
// Generates a height for trunk.
|
||||||
height = this.randGenerator.nextInt(this.heightMaximum - this.heightMininmum + 1) + this.heightMininmum;
|
height = this.randGenerator.nextInt(this.heightMaximum - this.heightMinimum + 1) + this.heightMinimum;
|
||||||
|
|
||||||
if (height > 4) {
|
if (height > 4) {
|
||||||
for (int p = 0; p < height; p++) {
|
for (int p = 0; p < height; p++) {
|
||||||
@ -463,7 +451,7 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
blockPositionY = blockPositionY + 1;
|
blockPositionY = blockPositionY + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generates branchs at top of trunk for each quadrant.
|
// Generates branches at top of trunk for each quadrant.
|
||||||
this.branchCreate(1, 1);
|
this.branchCreate(1, 1);
|
||||||
this.branchCreate(-1, 1);
|
this.branchCreate(-1, 1);
|
||||||
this.branchCreate(1, -1);
|
this.branchCreate(1, -1);
|
||||||
@ -581,17 +569,17 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
this.slopeChance = Integer.parseInt(parameter.replace("ts", ""));
|
this.slopeChance = Integer.parseInt(parameter.replace("ts", ""));
|
||||||
v.sendMessage(ChatColor.BLUE + "Trunk Slope set to " + this.slopeChance);
|
v.sendMessage(ChatColor.BLUE + "Trunk Slope set to " + this.slopeChance);
|
||||||
} else if (parameter.startsWith("minh")) { // Height Minimum
|
} else if (parameter.startsWith("minh")) { // Height Minimum
|
||||||
this.heightMininmum = Integer.parseInt(parameter.replace("minh", ""));
|
this.heightMinimum = Integer.parseInt(parameter.replace("minh", ""));
|
||||||
if (this.heightMininmum > this.heightMaximum) {
|
if (this.heightMinimum > this.heightMaximum) {
|
||||||
this.heightMininmum = this.heightMaximum;
|
this.heightMinimum = this.heightMaximum;
|
||||||
v.sendMessage(ChatColor.RED + "Minimum Height exceed than Maximum Height, has been set to " + this.heightMininmum + " Instead!");
|
v.sendMessage(ChatColor.RED + "Minimum Height exceed than Maximum Height, has been set to " + this.heightMinimum + " Instead!");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.BLUE + "Minimum Height set to " + this.heightMininmum);
|
v.sendMessage(ChatColor.BLUE + "Minimum Height set to " + this.heightMinimum);
|
||||||
}
|
}
|
||||||
} else if (parameter.startsWith("maxh")) { // Height Maximum
|
} else if (parameter.startsWith("maxh")) { // Height Maximum
|
||||||
this.heightMaximum = Integer.parseInt(parameter.replace("maxh", ""));
|
this.heightMaximum = Integer.parseInt(parameter.replace("maxh", ""));
|
||||||
if (this.heightMininmum > this.heightMaximum) {
|
if (this.heightMinimum > this.heightMaximum) {
|
||||||
this.heightMaximum = this.heightMininmum;
|
this.heightMaximum = this.heightMinimum;
|
||||||
v.sendMessage(ChatColor.RED + "Maximum Height can't be lower than Minimum Height, has been set to " + this.heightMaximum + " Instead!");
|
v.sendMessage(ChatColor.RED + "Maximum Height can't be lower than Minimum Height, has been set to " + this.heightMaximum + " Instead!");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.BLUE + "Maximum Roots set to " + this.heightMaximum);
|
v.sendMessage(ChatColor.BLUE + "Maximum Roots set to " + this.heightMaximum);
|
||||||
@ -619,14 +607,14 @@ public class GenerateTreeBrush extends Brush {
|
|||||||
this.minRoots = 1;
|
this.minRoots = 1;
|
||||||
this.thickness = 1;
|
this.thickness = 1;
|
||||||
this.slopeChance = 40;
|
this.slopeChance = 40;
|
||||||
this.heightMininmum = 14;
|
this.heightMinimum = 14;
|
||||||
this.heightMaximum = 18;
|
this.heightMaximum = 18;
|
||||||
this.branchLength = 8;
|
this.branchLength = 8;
|
||||||
this.nodeMax = 4;
|
this.nodeMax = 4;
|
||||||
this.nodeMin = 3;
|
this.nodeMin = 3;
|
||||||
v.sendMessage(ChatColor.GOLD + "Brush reset to default parameters.");
|
v.sendMessage(ChatColor.GOLD + "Brush reset to default parameters.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
} catch (final Exception exception) {
|
} catch (final Exception exception) {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! \"" + par[i] + "\" is not a valid statement. Please use the 'info' parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! \"" + par[i] + "\" is not a valid statement. Please use the 'info' parameter to display parameter info.");
|
||||||
|
@ -13,27 +13,19 @@ import org.bukkit.util.noise.PerlinNoiseGenerator;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Heat_Ray
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class HeatRayBrush extends Brush {
|
public class HeatRayBrush extends Brush {
|
||||||
|
|
||||||
/**
|
/* private enum FlameableBlock
|
||||||
* @author MikeMatrix
|
{
|
||||||
*/
|
WOOD(Material.WOOD), SAPLING(Material.SAPLING), LOG(Material.LOG), LEAVES(Material.LEAVES), SPONGE(Material.SPONGE), WEB(Material.WEB), LONG_GRASS(Material.LONG_GRASS), DEAD_BUSH(Material.DEAD_BUSH), WOOL(Material.WOOL), YELLOW_FLOWER(Material.YELLOW_FLOWER), RED_ROSE(Material.RED_ROSE), TORCH(Material.TORCH), FIRE(Material.FIRE), WOOD_STAIRS(Material.WOOD_STAIRS), CROPS(Material.CROPS), SIGN_POST(Material.SIGN_POST), WOODEN_DOOR(Material.WOODEN_DOOR), LADDER(Material.LADDER), WALL_SIGN(Material.WALL_SIGN), WOOD_PLATE(Material.WOOD_PLATE), SNOW(Material.SNOW), ICE(Material.ICE), SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK), FENCE(Material.FENCE), TRAP_DOOR(Material.TRAP_DOOR), VINE(Material.VINE), FENCE_GATE(Material.FENCE_GATE), WATER_LILLY(Material.WATER_LILY);
|
||||||
// private enum FlameableBlock
|
|
||||||
// {
|
private Material material;
|
||||||
// WOOD(Material.WOOD), SAPLING(Material.SAPLING), LOG(Material.LOG), LEAVES(Material.LEAVES), SPONGE(Material.SPONGE), WEB(Material.WEB), LONG_GRASS(Material.LONG_GRASS), DEAD_BUSH(Material.DEAD_BUSH), WOOL(Material.WOOL), YELLOW_FLOWER(Material.YELLOW_FLOWER), RED_ROSE(Material.RED_ROSE), TORCH(Material.TORCH), FIRE(Material.FIRE), WOOD_STAIRS(Material.WOOD_STAIRS), CROPS(Material.CROPS), SIGN_POST(Material.SIGN_POST), WOODEN_DOOR(Material.WOODEN_DOOR), LADDER(Material.LADDER), WALL_SIGN(Material.WALL_SIGN), WOOD_PLATE(Material.WOOD_PLATE), SNOW(Material.SNOW), ICE(Material.ICE), SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK), FENCE(Material.FENCE), TRAP_DOOR(Material.TRAP_DOOR), VINE(Material.VINE), FENCE_GATE(Material.FENCE_GATE), WATER_LILLY(Material.WATER_LILY);
|
|
||||||
//
|
FlameableBlock(final Material material)
|
||||||
// private Material material;
|
{
|
||||||
//
|
this.material = material;
|
||||||
// FlameableBlock(final Material material)
|
}
|
||||||
// {
|
}*/
|
||||||
// this.material = material;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private static final double REQUIRED_OBSIDIAN_DENSITY = 0.6;
|
private static final double REQUIRED_OBSIDIAN_DENSITY = 0.6;
|
||||||
private static final double REQUIRED_COBBLE_DENSITY = 0.5;
|
private static final double REQUIRED_COBBLE_DENSITY = 0.5;
|
||||||
@ -84,7 +76,7 @@ public class HeatRayBrush extends Brush {
|
|||||||
|
|
||||||
if (currentLocation.toVector().isInSphere(targetLocation, v.getBrushSize())) {
|
if (currentLocation.toVector().isInSphere(targetLocation, v.getBrushSize())) {
|
||||||
currentBlock = currentLocation.getBlock();
|
currentBlock = currentLocation.getBlock();
|
||||||
if (currentBlock == null || currentBlock.getType() == Material.CHEST) {
|
if (currentBlock.getType() == Material.CHEST) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,13 +160,13 @@ public class HeatRayBrush extends Brush {
|
|||||||
v.sendMessage(ChatColor.AQUA + "/b hr freq[float] -- Frequency parameter for the noise generator.");
|
v.sendMessage(ChatColor.AQUA + "/b hr freq[float] -- Frequency parameter for the noise generator.");
|
||||||
}
|
}
|
||||||
if (parameter.startsWith("oct")) {
|
if (parameter.startsWith("oct")) {
|
||||||
this.octaves = Integer.valueOf(parameter.replace("oct", ""));
|
this.octaves = Integer.parseInt(parameter.replace("oct", ""));
|
||||||
v.getVoxelMessage().custom(ChatColor.GREEN + "Octaves: " + this.octaves);
|
v.getVoxelMessage().custom(ChatColor.GREEN + "Octaves: " + this.octaves);
|
||||||
} else if (parameter.startsWith("amp")) {
|
} else if (parameter.startsWith("amp")) {
|
||||||
this.amplitude = Double.valueOf(parameter.replace("amp", ""));
|
this.amplitude = Double.parseDouble(parameter.replace("amp", ""));
|
||||||
v.getVoxelMessage().custom(ChatColor.GREEN + "Amplitude: " + this.amplitude);
|
v.getVoxelMessage().custom(ChatColor.GREEN + "Amplitude: " + this.amplitude);
|
||||||
} else if (parameter.startsWith("freq")) {
|
} else if (parameter.startsWith("freq")) {
|
||||||
this.frequency = Double.valueOf(parameter.replace("freq", ""));
|
this.frequency = Double.parseDouble(parameter.replace("freq", ""));
|
||||||
v.getVoxelMessage().custom(ChatColor.GREEN + "Frequency: " + this.frequency);
|
v.getVoxelMessage().custom(ChatColor.GREEN + "Frequency: " + this.frequency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,6 @@ import org.bukkit.util.Vector;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Jagged_Line_Brush
|
|
||||||
*
|
|
||||||
* @author Giltwist
|
|
||||||
* @author Monofraps
|
|
||||||
*/
|
|
||||||
public class JaggedLineBrush extends PerformBrush {
|
public class JaggedLineBrush extends PerformBrush {
|
||||||
private static final Vector HALF_BLOCK_OFFSET = new Vector(0.5, 0.5, 0.5);
|
private static final Vector HALF_BLOCK_OFFSET = new Vector(0.5, 0.5, 0.5);
|
||||||
private static final int RECURSION_MIN = 1;
|
private static final int RECURSION_MIN = 1;
|
||||||
@ -31,9 +25,6 @@ public class JaggedLineBrush extends PerformBrush {
|
|||||||
private int recursion = RECURSION_DEFAULT;
|
private int recursion = RECURSION_DEFAULT;
|
||||||
private int spread = SPREAD_DEFAULT;
|
private int spread = SPREAD_DEFAULT;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public JaggedLineBrush() {
|
public JaggedLineBrush() {
|
||||||
this.setName("Jagged Line");
|
this.setName("Jagged Line");
|
||||||
}
|
}
|
||||||
|
@ -12,20 +12,11 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Jockey_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
* @author Monofraps
|
|
||||||
*/
|
|
||||||
public class JockeyBrush extends Brush {
|
public class JockeyBrush extends Brush {
|
||||||
private static final int ENTITY_STACK_LIMIT = 50;
|
private static final int ENTITY_STACK_LIMIT = 50;
|
||||||
private JockeyType jockeyType = JockeyType.NORMAL_ALL_ENTITIES;
|
private JockeyType jockeyType = JockeyType.NORMAL_ALL_ENTITIES;
|
||||||
private Entity jockeyedEntity = null;
|
private Entity jockeyedEntity = null;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public JockeyBrush() {
|
public JockeyBrush() {
|
||||||
this.setName("Jockey");
|
this.setName("Jockey");
|
||||||
}
|
}
|
||||||
@ -139,16 +130,15 @@ public class JockeyBrush extends Brush {
|
|||||||
public final void info(final Message vm) {
|
public final void info(final Message vm) {
|
||||||
vm.brushName(this.getName());
|
vm.brushName(this.getName());
|
||||||
vm.custom("Current jockey mode: " + ChatColor.GREEN + jockeyType.toString());
|
vm.custom("Current jockey mode: " + ChatColor.GREEN + jockeyType.toString());
|
||||||
vm.custom(ChatColor.GREEN + "Help: " + ChatColor.AQUA + "http://www.voxelwiki.com/minecraft/Voxelsniper#The_Jockey_Brush");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
|
|
||||||
|
try {
|
||||||
boolean inverse = false;
|
boolean inverse = false;
|
||||||
boolean playerOnly = false;
|
boolean playerOnly = false;
|
||||||
boolean stack = false;
|
boolean stack = false;
|
||||||
|
|
||||||
try {
|
|
||||||
for (String parameter : par) {
|
for (String parameter : par) {
|
||||||
if (parameter.startsWith("-i:")) {
|
if (parameter.startsWith("-i:")) {
|
||||||
inverse = parameter.endsWith("y");
|
inverse = parameter.endsWith("y");
|
||||||
|
@ -3,13 +3,8 @@ package com.thevoxelbox.voxelsniper.brush;
|
|||||||
import com.thevoxelbox.voxelsniper.Message;
|
import com.thevoxelbox.voxelsniper.Message;
|
||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class LightningBrush extends Brush {
|
public class LightningBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public LightningBrush() {
|
public LightningBrush() {
|
||||||
this.setName("Lightning");
|
this.setName("Lightning");
|
||||||
}
|
}
|
||||||
|
@ -10,22 +10,12 @@ import org.bukkit.util.BlockIterator;
|
|||||||
import org.bukkit.util.NumberConversions;
|
import org.bukkit.util.NumberConversions;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Line_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
* @author giltwist
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class LineBrush extends PerformBrush {
|
public class LineBrush extends PerformBrush {
|
||||||
private static final Vector HALF_BLOCK_OFFSET = new Vector(0.5, 0.5, 0.5);
|
private static final Vector HALF_BLOCK_OFFSET = new Vector(0.5, 0.5, 0.5);
|
||||||
private Vector originCoords = null;
|
private Vector originCoords = null;
|
||||||
private Vector targetCoords = new Vector();
|
private Vector targetCoords = new Vector();
|
||||||
private AsyncWorld targetWorld;
|
private AsyncWorld targetWorld;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public LineBrush() {
|
public LineBrush() {
|
||||||
this.setName("Line");
|
this.setName("Line");
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ import java.util.HashSet;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves a selection blockPositionY a certain amount.
|
* Moves a selection blockPositionY a certain amount.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Move_Brush
|
|
||||||
*
|
*
|
||||||
* @author MikeMatrix
|
* @author MikeMatrix
|
||||||
*/
|
*/
|
||||||
@ -31,9 +30,6 @@ public class MoveBrush extends Brush {
|
|||||||
*/
|
*/
|
||||||
private Selection selection = null;
|
private Selection selection = null;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public MoveBrush() {
|
public MoveBrush() {
|
||||||
this.setName("Move");
|
this.setName("Move");
|
||||||
}
|
}
|
||||||
@ -151,13 +147,13 @@ public class MoveBrush extends Brush {
|
|||||||
v.getVoxelMessage().custom(ChatColor.AQUA + "Z direction set to: " + this.moveDirections[2]);
|
v.getVoxelMessage().custom(ChatColor.AQUA + "Z direction set to: " + this.moveDirections[2]);
|
||||||
}
|
}
|
||||||
if (par[i].toLowerCase().startsWith("x")) {
|
if (par[i].toLowerCase().startsWith("x")) {
|
||||||
this.moveDirections[0] = Integer.valueOf(par[i].substring(1));
|
this.moveDirections[0] = Integer.parseInt(par[i].substring(1));
|
||||||
v.getVoxelMessage().custom(ChatColor.AQUA + "X direction set to: " + this.moveDirections[0]);
|
v.getVoxelMessage().custom(ChatColor.AQUA + "X direction set to: " + this.moveDirections[0]);
|
||||||
} else if (par[i].toLowerCase().startsWith("y")) {
|
} else if (par[i].toLowerCase().startsWith("y")) {
|
||||||
this.moveDirections[1] = Integer.valueOf(par[i].substring(1));
|
this.moveDirections[1] = Integer.parseInt(par[i].substring(1));
|
||||||
v.getVoxelMessage().custom(ChatColor.AQUA + "Y direction set to: " + this.moveDirections[1]);
|
v.getVoxelMessage().custom(ChatColor.AQUA + "Y direction set to: " + this.moveDirections[1]);
|
||||||
} else if (par[i].toLowerCase().startsWith("z")) {
|
} else if (par[i].toLowerCase().startsWith("z")) {
|
||||||
this.moveDirections[2] = Integer.valueOf(par[i].substring(1));
|
this.moveDirections[2] = Integer.parseInt(par[i].substring(1));
|
||||||
v.getVoxelMessage().custom(ChatColor.AQUA + "Z direction set to: " + this.moveDirections[2]);
|
v.getVoxelMessage().custom(ChatColor.AQUA + "Z direction set to: " + this.moveDirections[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,13 +178,7 @@ public class MoveBrush extends Brush {
|
|||||||
* Calculated BlockStates of the selection.
|
* Calculated BlockStates of the selection.
|
||||||
*/
|
*/
|
||||||
private final ArrayList<AsyncBlockState> blockStates = new ArrayList<>();
|
private final ArrayList<AsyncBlockState> blockStates = new ArrayList<>();
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private Location location1 = null;
|
private Location location1 = null;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private Location location2 = null;
|
private Location location2 = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -200,14 +190,14 @@ public class MoveBrush extends Brush {
|
|||||||
public boolean calculateRegion() throws Exception {
|
public boolean calculateRegion() throws Exception {
|
||||||
if (this.location1 != null && this.location2 != null) {
|
if (this.location1 != null && this.location2 != null) {
|
||||||
if (this.location1.getWorld().equals(this.location2.getWorld())) {
|
if (this.location1.getWorld().equals(this.location2.getWorld())) {
|
||||||
final int lowX = ((this.location1.getBlockX() <= this.location2.getBlockX()) ? this.location1.getBlockX() : this.location2.getBlockX());
|
final int lowX = Math.min(this.location1.getBlockX(), this.location2.getBlockX());
|
||||||
final int lowY = (this.location1.getBlockY() <= this.location2.getBlockY()) ? this.location1.getBlockY() : this.location2.getBlockY();
|
final int lowY = Math.min(this.location1.getBlockY(), this.location2.getBlockY());
|
||||||
final int lowZ = (this.location1.getBlockZ() <= this.location2.getBlockZ()) ? this.location1.getBlockZ() : this.location2.getBlockZ();
|
final int lowZ = Math.min(this.location1.getBlockZ(), this.location2.getBlockZ());
|
||||||
final int highX = (this.location1.getBlockX() >= this.location2.getBlockX()) ? this.location1.getBlockX() : this.location2.getBlockX();
|
final int highX = Math.max(this.location1.getBlockX(), this.location2.getBlockX());
|
||||||
final int highY = (this.location1.getBlockY() >= this.location2.getBlockY()) ? this.location1.getBlockY() : this.location2.getBlockY();
|
final int highY = Math.max(this.location1.getBlockY(), this.location2.getBlockY());
|
||||||
final int highZ = (this.location1.getBlockZ() >= this.location2.getBlockZ()) ? this.location1.getBlockZ() : this.location2.getBlockZ();
|
final int highZ = Math.max(this.location1.getBlockZ(), this.location2.getBlockZ());
|
||||||
if (Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY) > Selection.MAX_BLOCK_COUNT) {
|
if (Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY) > Selection.MAX_BLOCK_COUNT) {
|
||||||
throw new Exception(ChatColor.RED + "Selection size above hardcoded limit, please use a smaller selection.");
|
throw new Exception(ChatColor.RED + "Selection size above hardcoded limit of 5000000, please use a smaller selection.");
|
||||||
}
|
}
|
||||||
final AsyncWorld world = (AsyncWorld) this.location1.getWorld();
|
final AsyncWorld world = (AsyncWorld) this.location1.getWorld();
|
||||||
for (int y = lowY; y <= highY; y++) {
|
for (int y = lowY; y <= highY; y++) {
|
||||||
|
@ -9,11 +9,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_OCEANATOR_5000
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class OceanBrush extends Brush {
|
public class OceanBrush extends Brush {
|
||||||
private static final int WATER_LEVEL_DEFAULT = 62; // y=63 -- we are using array indices here
|
private static final int WATER_LEVEL_DEFAULT = 62; // y=63 -- we are using array indices here
|
||||||
private static final int WATER_LEVEL_MIN = 12;
|
private static final int WATER_LEVEL_MIN = 12;
|
||||||
@ -22,9 +18,6 @@ public class OceanBrush extends Brush {
|
|||||||
private int waterLevel = WATER_LEVEL_DEFAULT;
|
private int waterLevel = WATER_LEVEL_DEFAULT;
|
||||||
private boolean coverFloor = false;
|
private boolean coverFloor = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public OceanBrush() {
|
public OceanBrush() {
|
||||||
this.setName("OCEANATOR 5000(tm)");
|
this.setName("OCEANATOR 5000(tm)");
|
||||||
}
|
}
|
||||||
@ -39,10 +32,6 @@ public class OceanBrush extends Brush {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
* @param undo
|
|
||||||
*/
|
|
||||||
protected final void oceanator(final SnipeData v, final Undo undo) {
|
protected final void oceanator(final SnipeData v, final Undo undo) {
|
||||||
final AsyncWorld world = this.getWorld();
|
final AsyncWorld world = this.getWorld();
|
||||||
|
|
||||||
@ -55,7 +44,7 @@ public class OceanBrush extends Brush {
|
|||||||
for (int z = minZ; z <= maxZ; z++) {
|
for (int z = minZ; z <= maxZ; z++) {
|
||||||
final int currentHeight = getHeight(x, z);
|
final int currentHeight = getHeight(x, z);
|
||||||
final int wLevelDiff = currentHeight - (this.waterLevel - 1);
|
final int wLevelDiff = currentHeight - (this.waterLevel - 1);
|
||||||
final int newSeaFloorLevel = ((this.waterLevel - wLevelDiff) >= LOW_CUT_LEVEL) ? this.waterLevel - wLevelDiff : LOW_CUT_LEVEL;
|
final int newSeaFloorLevel = Math.max((this.waterLevel - wLevelDiff), LOW_CUT_LEVEL);
|
||||||
|
|
||||||
final int highestY = this.getWorld().getHighestBlockYAt(x, z);
|
final int highestY = this.getWorld().getHighestBlockYAt(x, z);
|
||||||
|
|
||||||
|
@ -10,19 +10,11 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Overlay_.2F_Topsoil_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class OverlayBrush extends PerformBrush {
|
public class OverlayBrush extends PerformBrush {
|
||||||
private static final int DEFAULT_DEPTH = 3;
|
private static final int DEFAULT_DEPTH = 3;
|
||||||
private int depth = DEFAULT_DEPTH;
|
private int depth = DEFAULT_DEPTH;
|
||||||
private boolean allBlocks = false;
|
private boolean allBlocks = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public OverlayBrush() {
|
public OverlayBrush() {
|
||||||
this.setName("Overlay (Topsoil Filling)");
|
this.setName("Overlay (Topsoil Filling)");
|
||||||
}
|
}
|
||||||
@ -207,7 +199,7 @@ public class OverlayBrush extends PerformBrush {
|
|||||||
ChatColor.BLUE + "Will overlay only natural block types." + this.depth);
|
ChatColor.BLUE + "Will overlay only natural block types." + this.depth);
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED
|
v.sendMessage(ChatColor.RED
|
||||||
+ "Invalid brush parameters! use the info parameter to display parameter info.");
|
+ "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,11 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Painting scrolling Brush.
|
* Painting scrolling Brush.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Painting_Picker_Brush
|
|
||||||
*
|
*
|
||||||
* @author Voxel
|
* @author Voxel
|
||||||
*/
|
*/
|
||||||
public class PaintingBrush extends Brush {
|
public class PaintingBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public PaintingBrush() {
|
public PaintingBrush() {
|
||||||
this.setName("Painting");
|
this.setName("Painting");
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,7 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class PullBrush extends Brush {
|
public class PullBrush extends Brush {
|
||||||
private final HashSet<BlockWrapper> surface = new HashSet<>();
|
private final HashSet<BlockWrapper> surface = new HashSet<>();
|
||||||
private int vh;
|
private int vh;
|
||||||
@ -244,9 +242,7 @@ public class PullBrush extends Brush {
|
|||||||
return "voxelsniper.brush.pull";
|
return "voxelsniper.brush.pull";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
private final class BlockWrapper {
|
private final class BlockWrapper {
|
||||||
|
|
||||||
private final int id;
|
private final int id;
|
||||||
|
@ -19,13 +19,6 @@ import org.bukkit.util.Vector;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Punish_Brush
|
|
||||||
*
|
|
||||||
* @author Monofraps
|
|
||||||
* @author Deamon
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class PunishBrush extends PerformBrush {
|
public class PunishBrush extends PerformBrush {
|
||||||
private static final int MAXIMAL_RANDOM_TELEPORTATION_RANGE = 400;
|
private static final int MAXIMAL_RANDOM_TELEPORTATION_RANGE = 400;
|
||||||
private static final int TICKS_PER_SECOND = 20;
|
private static final int TICKS_PER_SECOND = 20;
|
||||||
@ -213,7 +206,7 @@ public class PunishBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
} catch (final Exception exception) {
|
} catch (final Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
v.sendMessage("An error occured.");
|
v.sendMessage("An error occurred.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (v.getBrushSize() == PunishBrush.INFINIPUNISH_SIZE) {
|
} else if (v.getBrushSize() == PunishBrush.INFINIPUNISH_SIZE) {
|
||||||
@ -315,9 +308,6 @@ public class PunishBrush extends PerformBrush {
|
|||||||
return "voxelsniper.brush.punish";
|
return "voxelsniper.brush.punish";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Monofraps
|
|
||||||
*/
|
|
||||||
private enum Punishment {
|
private enum Punishment {
|
||||||
// Monofraps
|
// Monofraps
|
||||||
FIRE, LIGHTNING, BLINDNESS, DRUNK, KILL, RANDOMTP, ALL_POTION,
|
FIRE, LIGHTNING, BLINDNESS, DRUNK, KILL, RANDOMTP, ALL_POTION,
|
||||||
|
@ -8,12 +8,6 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Random-Erode_Brush
|
|
||||||
*
|
|
||||||
* @author Piotr
|
|
||||||
* @author Giltwist (Randomized blockPositionY)
|
|
||||||
*/
|
|
||||||
public class RandomErodeBrush extends Brush {
|
public class RandomErodeBrush extends Brush {
|
||||||
private final double trueCircle = 0.5;
|
private final double trueCircle = 0.5;
|
||||||
private BlockWrapper[][][] snap;
|
private BlockWrapper[][][] snap;
|
||||||
@ -21,14 +15,10 @@ public class RandomErodeBrush extends Brush {
|
|||||||
private int bsize;
|
private int bsize;
|
||||||
private int erodeFace;
|
private int erodeFace;
|
||||||
private int fillFace;
|
private int fillFace;
|
||||||
private int brushSize;
|
|
||||||
private int erodeRecursion = 1;
|
private int erodeRecursion = 1;
|
||||||
private int fillRecursion = 1;
|
private int fillRecursion = 1;
|
||||||
private Random generator = new Random();
|
private Random generator = new Random();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public RandomErodeBrush() {
|
public RandomErodeBrush() {
|
||||||
this.setName("RandomErode");
|
this.setName("RandomErode");
|
||||||
}
|
}
|
||||||
@ -60,7 +50,6 @@ public class RandomErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private boolean fill(final int x, final int y, final int z) {
|
private boolean fill(final int x, final int y, final int z) {
|
||||||
if (this.snap[x][y][z].isSolid()) {
|
if (this.snap[x][y][z].isSolid()) {
|
||||||
return false;
|
return false;
|
||||||
@ -95,19 +84,17 @@ public class RandomErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void getMatrix() {
|
private void getMatrix() {
|
||||||
this.brushSize = ((this.bsize + 1) * 2) + 1;
|
int brushSize = ((this.bsize + 1) * 2) + 1;
|
||||||
|
|
||||||
if (this.snap.length == 0) {
|
if (this.snap.length == 0) {
|
||||||
this.snap = new BlockWrapper[this.brushSize][this.brushSize][this.brushSize];
|
this.snap = new BlockWrapper[brushSize][brushSize][brushSize];
|
||||||
|
|
||||||
int sx = this.getTargetBlock().getX() - (this.bsize + 1);
|
int sx = this.getTargetBlock().getX() - (this.bsize + 1);
|
||||||
int sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
|
||||||
int sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
|
||||||
|
|
||||||
for (int x = 0; x < this.snap.length; x++) {
|
for (int x = 0; x < this.snap.length; x++) {
|
||||||
sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
int sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
||||||
for (int z = 0; z < this.snap.length; z++) {
|
for (int z = 0; z < this.snap.length; z++) {
|
||||||
sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
int sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
||||||
for (int y = 0; y < this.snap.length; y++) {
|
for (int y = 0; y < this.snap.length; y++) {
|
||||||
this.snap[x][y][z] = new BlockWrapper(this.clampY(sx, sy, sz));
|
this.snap[x][y][z] = new BlockWrapper(this.clampY(sx, sy, sz));
|
||||||
sy++;
|
sy++;
|
||||||
@ -118,16 +105,14 @@ public class RandomErodeBrush extends Brush {
|
|||||||
}
|
}
|
||||||
this.firstSnap = this.snap.clone();
|
this.firstSnap = this.snap.clone();
|
||||||
} else {
|
} else {
|
||||||
this.snap = new BlockWrapper[this.brushSize][this.brushSize][this.brushSize];
|
this.snap = new BlockWrapper[brushSize][brushSize][brushSize];
|
||||||
|
|
||||||
int sx = this.getTargetBlock().getX() - (this.bsize + 1);
|
int sx = this.getTargetBlock().getX() - (this.bsize + 1);
|
||||||
int sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
|
||||||
int sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
|
||||||
|
|
||||||
for (int x = 0; x < this.snap.length; x++) {
|
for (int x = 0; x < this.snap.length; x++) {
|
||||||
sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
int sz = this.getTargetBlock().getZ() - (this.bsize + 1);
|
||||||
for (int z = 0; z < this.snap.length; z++) {
|
for (int z = 0; z < this.snap.length; z++) {
|
||||||
sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
int sy = this.getTargetBlock().getY() - (this.bsize + 1);
|
||||||
for (int y = 0; y < this.snap.length; y++) {
|
for (int y = 0; y < this.snap.length; y++) {
|
||||||
this.snap[x][y][z] = new BlockWrapper(this.clampY(sx, sy, sz));
|
this.snap[x][y][z] = new BlockWrapper(this.clampY(sx, sy, sz));
|
||||||
sy++;
|
sy++;
|
||||||
@ -317,29 +302,18 @@ public class RandomErodeBrush extends Brush {
|
|||||||
return "voxelsniper.brush.randomerode";
|
return "voxelsniper.brush.randomerode";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author unknown
|
|
||||||
*/
|
|
||||||
private class BlockWrapper {
|
private class BlockWrapper {
|
||||||
private boolean solid;
|
private boolean solid;
|
||||||
private AsyncBlock nativeBlock;
|
private AsyncBlock nativeBlock;
|
||||||
private int id;
|
private int id;
|
||||||
private int i;
|
private int i;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bl
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public BlockWrapper(final AsyncBlock bl) {
|
public BlockWrapper(final AsyncBlock bl) {
|
||||||
this.setNativeBlock(bl);
|
this.setNativeBlock(bl);
|
||||||
this.setI(bl.getTypeId());
|
this.setI(bl.getTypeId());
|
||||||
switch (bl.getType()) {
|
switch (bl.getType()) {
|
||||||
case AIR:
|
case AIR:
|
||||||
this.setSolid(false);
|
|
||||||
break;
|
|
||||||
case WATER:
|
case WATER:
|
||||||
this.setSolid(false);
|
|
||||||
break;
|
|
||||||
case LAVA:
|
case LAVA:
|
||||||
this.setSolid(false);
|
this.setSolid(false);
|
||||||
break;
|
break;
|
||||||
|
@ -11,9 +11,7 @@ import org.bukkit.Chunk;
|
|||||||
* @author Mick
|
* @author Mick
|
||||||
*/
|
*/
|
||||||
public class RegenerateChunkBrush extends Brush {
|
public class RegenerateChunkBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public RegenerateChunkBrush() {
|
public RegenerateChunkBrush() {
|
||||||
this.setName("Chunk Generator 40k");
|
this.setName("Chunk Generator 40k");
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,11 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Ring_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class RingBrush extends PerformBrush {
|
public class RingBrush extends PerformBrush {
|
||||||
private double trueCircle = 0;
|
private double trueCircle = 0;
|
||||||
private double innerSize = 0;
|
private double innerSize = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public RingBrush() {
|
public RingBrush() {
|
||||||
this.setName("Ring");
|
this.setName("Ring");
|
||||||
}
|
}
|
||||||
@ -83,7 +76,7 @@ public class RingBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "The parameters included are invalid.");
|
v.sendMessage(ChatColor.RED + "The parameters included are invalid.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,7 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.util.BlockWrapper;
|
import com.thevoxelbox.voxelsniper.util.BlockWrapper;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class Rot2DBrush extends Brush {
|
public class Rot2DBrush extends Brush {
|
||||||
private int mode = 0;
|
private int mode = 0;
|
||||||
private int bSize;
|
private int bSize;
|
||||||
@ -17,9 +15,6 @@ public class Rot2DBrush extends Brush {
|
|||||||
private BlockWrapper[][][] snap;
|
private BlockWrapper[][][] snap;
|
||||||
private double se;
|
private double se;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Rot2DBrush() {
|
public Rot2DBrush() {
|
||||||
this.setName("2D Rotation");
|
this.setName("2D Rotation");
|
||||||
}
|
}
|
||||||
|
@ -8,40 +8,31 @@ import com.thevoxelbox.voxelsniper.util.BlockWrapper;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Gavjenks, hack job from the other 2d rotation brush blockPositionY piotr
|
|
||||||
*/
|
|
||||||
// The X Y and Z variable names in this file do NOT MAKE ANY SENSE. Do not attempt to actually figure out what on earth is going on here. Just go to the
|
// The X Y and Z variable names in this file do NOT MAKE ANY SENSE. Do not attempt to actually figure out what on earth is going on here. Just go to the
|
||||||
// original 2d horizontal brush if you wish to make anything similar to this, and start there. I didn't bother renaming everything.
|
// original 2d horizontal brush if you wish to make anything similar to this, and start there. I didn't bother renaming everything.
|
||||||
public class Rot2DvertBrush extends Brush {
|
public class Rot2DvertBrush extends Brush {
|
||||||
private int mode = 0;
|
private int mode = 0;
|
||||||
private int bSize;
|
private int bSize;
|
||||||
private int brushSize;
|
|
||||||
private BlockWrapper[][][] snap;
|
private BlockWrapper[][][] snap;
|
||||||
private double se;
|
private double se;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Rot2DvertBrush() {
|
public Rot2DvertBrush() {
|
||||||
this.setName("2D Rotation");
|
this.setName("2D Rotation");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void getMatrix() {
|
private void getMatrix() {
|
||||||
this.brushSize = (this.bSize * 2) + 1;
|
int brushSize = (this.bSize * 2) + 1;
|
||||||
|
|
||||||
this.snap = new BlockWrapper[this.brushSize][this.brushSize][this.brushSize];
|
this.snap = new BlockWrapper[brushSize][brushSize][brushSize];
|
||||||
|
|
||||||
int sx = this.getTargetBlock().getX() - this.bSize;
|
int sx = this.getTargetBlock().getX() - this.bSize;
|
||||||
int sy = this.getTargetBlock().getY() - this.bSize;
|
|
||||||
int sz = this.getTargetBlock().getZ() - this.bSize;
|
|
||||||
|
|
||||||
for (int x = 0; x < this.snap.length; x++) {
|
for (int x = 0; x < this.snap.length; x++) {
|
||||||
sz = this.getTargetBlock().getZ() - this.bSize;
|
int sz = this.getTargetBlock().getZ() - this.bSize;
|
||||||
|
|
||||||
for (int z = 0; z < this.snap.length; z++) {
|
for (int z = 0; z < this.snap.length; z++) {
|
||||||
sy = this.getTargetBlock().getY() - this.bSize;
|
int sy = this.getTargetBlock().getY() - this.bSize;
|
||||||
|
|
||||||
for (int y = 0; y < this.snap.length; y++) {
|
for (int y = 0; y < this.snap.length; y++) {
|
||||||
final AsyncBlock block = this.clampY(sx, sy, sz); // why is this not sx + x, sy + y sz + z?
|
final AsyncBlock block = this.clampY(sx, sy, sz); // why is this not sx + x, sy + y sz + z?
|
||||||
@ -56,7 +47,7 @@ public class Rot2DvertBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rotate(final SnipeData v) {
|
private void rotate() {
|
||||||
final double brushSizeSquared = Math.pow(this.bSize + 0.5, 2);
|
final double brushSizeSquared = Math.pow(this.bSize + 0.5, 2);
|
||||||
final double cos = Math.cos(this.se);
|
final double cos = Math.cos(this.se);
|
||||||
final double sin = Math.sin(this.se);
|
final double sin = Math.sin(this.se);
|
||||||
@ -142,7 +133,7 @@ public class Rot2DvertBrush extends Brush {
|
|||||||
|
|
||||||
if (this.mode == 0) {
|
if (this.mode == 0) {
|
||||||
this.getMatrix();
|
this.getMatrix();
|
||||||
this.rotate(v);
|
this.rotate();
|
||||||
} else {
|
} else {
|
||||||
v.owner().getPlayer().sendMessage(ChatColor.RED + "Something went wrong.");
|
v.owner().getPlayer().sendMessage(ChatColor.RED + "Something went wrong.");
|
||||||
}
|
}
|
||||||
@ -154,7 +145,7 @@ public class Rot2DvertBrush extends Brush {
|
|||||||
|
|
||||||
if (this.mode == 0) {
|
if (this.mode == 0) {
|
||||||
this.getMatrix();
|
this.getMatrix();
|
||||||
this.rotate(v);
|
this.rotate();
|
||||||
} else {
|
} else {
|
||||||
v.owner().getPlayer().sendMessage(ChatColor.RED + "Something went wrong.");
|
v.owner().getPlayer().sendMessage(ChatColor.RED + "Something went wrong.");
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,6 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
import com.thevoxelbox.voxelsniper.util.BlockWrapper;
|
import com.thevoxelbox.voxelsniper.util.BlockWrapper;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class Rot3DBrush extends Brush {
|
public class Rot3DBrush extends Brush {
|
||||||
private final int mode = 0;
|
private final int mode = 0;
|
||||||
private int bSize;
|
private int bSize;
|
||||||
@ -20,9 +17,6 @@ public class Rot3DBrush extends Brush {
|
|||||||
private double sePitch;
|
private double sePitch;
|
||||||
private double seRoll;
|
private double seRoll;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Rot3DBrush() {
|
public Rot3DBrush() {
|
||||||
this.setName("3D Rotation");
|
this.setName("3D Rotation");
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,6 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Ruler_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class RulerBrush extends Brush {
|
public class RulerBrush extends Brush {
|
||||||
private boolean first = true;
|
private boolean first = true;
|
||||||
private Vector coords = new Vector(0, 0, 0);
|
private Vector coords = new Vector(0, 0, 0);
|
||||||
@ -19,9 +14,6 @@ public class RulerBrush extends Brush {
|
|||||||
private int yOff = 0;
|
private int yOff = 0;
|
||||||
private int zOff = 0;
|
private int zOff = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public RulerBrush() {
|
public RulerBrush() {
|
||||||
this.setName("Ruler");
|
this.setName("Ruler");
|
||||||
}
|
}
|
||||||
@ -93,7 +85,7 @@ public class RulerBrush extends Brush {
|
|||||||
this.xOff = 0;
|
this.xOff = 0;
|
||||||
v.sendMessage(ChatColor.BLUE + "Ruler mode.");
|
v.sendMessage(ChatColor.BLUE + "Ruler mode.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,6 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DivineRage
|
|
||||||
*/
|
|
||||||
public class ScannerBrush extends Brush {
|
public class ScannerBrush extends Brush {
|
||||||
private static final int DEPTH_MIN = 1;
|
private static final int DEPTH_MIN = 1;
|
||||||
private static final int DEPTH_DEFAULT = 24;
|
private static final int DEPTH_DEFAULT = 24;
|
||||||
@ -19,9 +16,6 @@ public class ScannerBrush extends Brush {
|
|||||||
private int depth = DEPTH_DEFAULT;
|
private int depth = DEPTH_DEFAULT;
|
||||||
private Material checkFor = Material.AIR;
|
private Material checkFor = Material.AIR;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ScannerBrush() {
|
public ScannerBrush() {
|
||||||
this.setName("Scanner");
|
this.setName("Scanner");
|
||||||
}
|
}
|
||||||
@ -29,10 +23,8 @@ public class ScannerBrush extends Brush {
|
|||||||
private int clamp(final int value, final int min, final int max) {
|
private int clamp(final int value, final int min, final int max) {
|
||||||
if (value < min) {
|
if (value < min) {
|
||||||
return min;
|
return min;
|
||||||
} else if (value > max) {
|
|
||||||
return max;
|
|
||||||
} else {
|
} else {
|
||||||
return value;
|
return Math.min(value, max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +144,7 @@ public class ScannerBrush extends Brush {
|
|||||||
this.depth = this.clamp(Integer.parseInt(par[i].substring(1)), DEPTH_MIN, DEPTH_MAX);
|
this.depth = this.clamp(Integer.parseInt(par[i].substring(1)), DEPTH_MIN, DEPTH_MAX);
|
||||||
v.sendMessage(ChatColor.AQUA + "Scanner depth set to " + this.depth);
|
v.sendMessage(ChatColor.AQUA + "Scanner depth set to " + this.depth);
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,11 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Set_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SetBrush extends PerformBrush {
|
public class SetBrush extends PerformBrush {
|
||||||
private static final int SELECTION_SIZE_MAX = 5000000;
|
private static final int SELECTION_SIZE_MAX = 5000000;
|
||||||
private Block block = null;
|
private Block block = null;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SetBrush() {
|
public SetBrush() {
|
||||||
this.setName("Set");
|
this.setName("Set");
|
||||||
}
|
}
|
||||||
@ -32,15 +25,15 @@ public class SetBrush extends PerformBrush {
|
|||||||
this.block = null;
|
this.block = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
final int lowX = (this.block.getX() <= bl.getX()) ? this.block.getX() : bl.getX();
|
final int lowX = Math.min(this.block.getX(), bl.getX());
|
||||||
final int lowY = (this.block.getY() <= bl.getY()) ? this.block.getY() : bl.getY();
|
final int lowY = Math.min(this.block.getY(), bl.getY());
|
||||||
final int lowZ = (this.block.getZ() <= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int lowZ = Math.min(this.block.getZ(), bl.getZ());
|
||||||
final int highX = (this.block.getX() >= bl.getX()) ? this.block.getX() : bl.getX();
|
final int highX = Math.max(this.block.getX(), bl.getX());
|
||||||
final int highY = (this.block.getY() >= bl.getY()) ? this.block.getY() : bl.getY();
|
final int highY = Math.max(this.block.getY(), bl.getY());
|
||||||
final int highZ = (this.block.getZ() >= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int highZ = Math.max(this.block.getZ(), bl.getZ());
|
||||||
|
|
||||||
if (Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY) > SELECTION_SIZE_MAX) {
|
if (Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY) > SELECTION_SIZE_MAX) {
|
||||||
v.sendMessage(ChatColor.RED + "Selection size above hardcoded limit, please use a smaller selection.");
|
v.sendMessage(ChatColor.RED + "Selection size above hardcoded limit of 5000000, please use a smaller selection.");
|
||||||
} else {
|
} else {
|
||||||
for (int y = lowY; y <= highY; y++) {
|
for (int y = lowY; y <= highY; y++) {
|
||||||
for (int x = lowX; x <= highX; x++) {
|
for (int x = lowX; x <= highX; x++) {
|
||||||
|
@ -8,17 +8,12 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SetRedstoneFlipBrush extends Brush {
|
public class SetRedstoneFlipBrush extends Brush {
|
||||||
private Block block = null;
|
private Block block = null;
|
||||||
private Undo undo;
|
private Undo undo;
|
||||||
private boolean northSouth = true;
|
private boolean northSouth = true;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SetRedstoneFlipBrush() {
|
public SetRedstoneFlipBrush() {
|
||||||
this.setName("Set Redstone Flip");
|
this.setName("Set Redstone Flip");
|
||||||
}
|
}
|
||||||
@ -29,12 +24,12 @@ public class SetRedstoneFlipBrush extends Brush {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.undo = new Undo();
|
this.undo = new Undo();
|
||||||
final int lowX = (this.block.getX() <= bl.getX()) ? this.block.getX() : bl.getX();
|
final int lowX = Math.min(this.block.getX(), bl.getX());
|
||||||
final int lowY = (this.block.getY() <= bl.getY()) ? this.block.getY() : bl.getY();
|
final int lowY = Math.min(this.block.getY(), bl.getY());
|
||||||
final int lowZ = (this.block.getZ() <= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int lowZ = Math.min(this.block.getZ(), bl.getZ());
|
||||||
final int highX = (this.block.getX() >= bl.getX()) ? this.block.getX() : bl.getX();
|
final int highX = Math.max(this.block.getX(), bl.getX());
|
||||||
final int highY = (this.block.getY() >= bl.getY()) ? this.block.getY() : bl.getY();
|
final int highY = Math.max(this.block.getY(), bl.getY());
|
||||||
final int highZ = (this.block.getZ() >= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int highZ = Math.max(this.block.getZ(), bl.getZ());
|
||||||
|
|
||||||
for (int y = lowY; y <= highY; y++) {
|
for (int y = lowY; y <= highY; y++) {
|
||||||
for (int x = lowX; x <= highX; x++) {
|
for (int x = lowX; x <= highX; x++) {
|
||||||
@ -110,7 +105,7 @@ public class SetRedstoneFlipBrush extends Brush {
|
|||||||
this.northSouth = false;
|
this.northSouth = false;
|
||||||
v.sendMessage(ChatColor.AQUA + "Flip direction set to east/west.");
|
v.sendMessage(ChatColor.AQUA + "Flip direction set to east/west.");
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,16 +8,11 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SetRedstoneRotateBrush extends Brush {
|
public class SetRedstoneRotateBrush extends Brush {
|
||||||
private Block block = null;
|
private Block block = null;
|
||||||
private Undo undo;
|
private Undo undo;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SetRedstoneRotateBrush() {
|
public SetRedstoneRotateBrush() {
|
||||||
this.setName("Set Redstone Rotate");
|
this.setName("Set Redstone Rotate");
|
||||||
}
|
}
|
||||||
@ -28,12 +23,12 @@ public class SetRedstoneRotateBrush extends Brush {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.undo = new Undo();
|
this.undo = new Undo();
|
||||||
final int lowX = (this.block.getX() <= bl.getX()) ? this.block.getX() : bl.getX();
|
final int lowX = Math.min(this.block.getX(), bl.getX());
|
||||||
final int lowY = (this.block.getY() <= bl.getY()) ? this.block.getY() : bl.getY();
|
final int lowY = Math.min(this.block.getY(), bl.getY());
|
||||||
final int lowZ = (this.block.getZ() <= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int lowZ = Math.min(this.block.getZ(), bl.getZ());
|
||||||
final int highX = (this.block.getX() >= bl.getX()) ? this.block.getX() : bl.getX();
|
final int highX = Math.max(this.block.getX(), bl.getX());
|
||||||
final int highY = (this.block.getY() >= bl.getY()) ? this.block.getY() : bl.getY();
|
final int highY = Math.max(this.block.getY(), bl.getY());
|
||||||
final int highZ = (this.block.getZ() >= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int highZ = Math.max(this.block.getZ(), bl.getZ());
|
||||||
|
|
||||||
for (int y = lowY; y <= highY; y++) {
|
for (int y = lowY; y <= highY; y++) {
|
||||||
for (int x = lowX; x <= highX; x++) {
|
for (int x = lowX; x <= highX; x++) {
|
||||||
|
@ -8,14 +8,11 @@ import org.bukkit.block.Block;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* THIS BRUSH SHOULD NOT USE PERFORMERS.
|
* THIS BRUSH SHOULD NOT USE PERFORMERS.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Shell_Brushes
|
|
||||||
*
|
*
|
||||||
* @author Voxel
|
* @author Voxel
|
||||||
*/
|
*/
|
||||||
public class ShellBallBrush extends Brush {
|
public class ShellBallBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ShellBallBrush() {
|
public ShellBallBrush() {
|
||||||
this.setName("Shell Ball");
|
this.setName("Shell Ball");
|
||||||
}
|
}
|
||||||
@ -103,7 +100,7 @@ public class ShellBallBrush extends Brush {
|
|||||||
}
|
}
|
||||||
v.owner().storeUndo(undo);
|
v.owner().storeUndo(undo);
|
||||||
|
|
||||||
// This is needed because most uses of this brush will not be sible to the sniper.
|
// This is needed because most uses of this brush will not be sible to the sible sniper.
|
||||||
v.owner().getPlayer().sendMessage(ChatColor.AQUA + "Shell complete.");
|
v.owner().getPlayer().sendMessage(ChatColor.AQUA + "Shell complete.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,18 +9,11 @@ import org.bukkit.block.Block;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Shell_Brushes
|
|
||||||
*
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class ShellSetBrush extends Brush {
|
public class ShellSetBrush extends Brush {
|
||||||
private static final int MAX_SIZE = 5000000;
|
private static final int MAX_SIZE = 5000000;
|
||||||
private Block block = null;
|
private Block block = null;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ShellSetBrush() {
|
public ShellSetBrush() {
|
||||||
this.setName("Shell Set");
|
this.setName("Shell Set");
|
||||||
}
|
}
|
||||||
@ -37,18 +30,18 @@ public class ShellSetBrush extends Brush {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int lowX = (this.block.getX() <= bl.getX()) ? this.block.getX() : bl.getX();
|
final int lowX = Math.min(this.block.getX(), bl.getX());
|
||||||
final int lowY = (this.block.getY() <= bl.getY()) ? this.block.getY() : bl.getY();
|
final int lowY = Math.min(this.block.getY(), bl.getY());
|
||||||
final int lowZ = (this.block.getZ() <= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int lowZ = Math.min(this.block.getZ(), bl.getZ());
|
||||||
final int highX = (this.block.getX() >= bl.getX()) ? this.block.getX() : bl.getX();
|
final int highX = Math.max(this.block.getX(), bl.getX());
|
||||||
final int highY = (this.block.getY() >= bl.getY()) ? this.block.getY() : bl.getY();
|
final int highY = Math.max(this.block.getY(), bl.getY());
|
||||||
final int highZ = (this.block.getZ() >= bl.getZ()) ? this.block.getZ() : bl.getZ();
|
final int highZ = Math.max(this.block.getZ(), bl.getZ());
|
||||||
|
|
||||||
if (Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY) > MAX_SIZE) {
|
int selectionSize = Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY);
|
||||||
v.sendMessage(ChatColor.RED + "Selection size above hardcoded limit, please use a smaller selection.");
|
if (selectionSize > MAX_SIZE) {
|
||||||
|
v.sendMessage(ChatColor.RED + "Selection size above hardcoded limit of 5000000, please use a smaller selection.");
|
||||||
} else {
|
} else {
|
||||||
final ArrayList<AsyncBlock> blocks = new ArrayList<>(
|
final ArrayList<AsyncBlock> blocks = new ArrayList<>(selectionSize / 2);
|
||||||
((Math.abs(highX - lowX) * Math.abs(highZ - lowZ) * Math.abs(highY - lowY)) / 2));
|
|
||||||
for (int y = lowY; y <= highY; y++) {
|
for (int y = lowY; y <= highY; y++) {
|
||||||
for (int x = lowX; x <= highX; x++) {
|
for (int x = lowX; x <= highX; x++) {
|
||||||
for (int z = lowZ; z <= highZ; z++) {
|
for (int z = lowZ; z <= highZ; z++) {
|
||||||
|
@ -8,14 +8,11 @@ import org.bukkit.block.Block;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* THIS BRUSH SHOULD NOT USE PERFORMERS.
|
* THIS BRUSH SHOULD NOT USE PERFORMERS.
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Shell_Brushes
|
|
||||||
*
|
*
|
||||||
* @author Voxel
|
* @author Voxel
|
||||||
*/
|
*/
|
||||||
public class ShellVoxelBrush extends Brush {
|
public class ShellVoxelBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ShellVoxelBrush() {
|
public ShellVoxelBrush() {
|
||||||
this.setName("Shell Voxel");
|
this.setName("Shell Voxel");
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ import org.bukkit.block.BlockState;
|
|||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overwrites signs. (Wiki:
|
* Overwrites signs.
|
||||||
* http://www.voxelwiki.com/minecraft/VoxelSniper#Sign_Overwrite_Brush)
|
|
||||||
*
|
*
|
||||||
* @author Monofraps
|
* @author Monofraps
|
||||||
*/
|
*/
|
||||||
@ -27,9 +27,6 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
private boolean[] signLinesEnabled = new boolean[NUM_SIGN_LINES];
|
private boolean[] signLinesEnabled = new boolean[NUM_SIGN_LINES];
|
||||||
private boolean rangedMode = false;
|
private boolean rangedMode = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SignOverwriteBrush() {
|
public SignOverwriteBrush() {
|
||||||
this.setName("Sign Overwrite Brush");
|
this.setName("Sign Overwrite Brush");
|
||||||
|
|
||||||
@ -134,7 +131,7 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
try {
|
try {
|
||||||
if (parameter.equalsIgnoreCase("info")) {
|
if (parameter.equalsIgnoreCase("info")) {
|
||||||
v.sendMessage(ChatColor.AQUA + "Sign Overwrite Brush Powder/Arrow:");
|
v.sendMessage(ChatColor.AQUA + "Sign Overwrite Brush Powder/Arrow:");
|
||||||
v.sendMessage(ChatColor.BLUE + "The arrow writes the internal line buffer to the tearget sign.");
|
v.sendMessage(ChatColor.BLUE + "The arrow writes the internal line buffer to the target sign.");
|
||||||
v.sendMessage(ChatColor.BLUE + "The powder reads the text of the target sign into the internal buffer.");
|
v.sendMessage(ChatColor.BLUE + "The powder reads the text of the target sign into the internal buffer.");
|
||||||
v.sendMessage(ChatColor.AQUA + "Sign Overwrite Brush Parameters:");
|
v.sendMessage(ChatColor.AQUA + "Sign Overwrite Brush Parameters:");
|
||||||
v.sendMessage(ChatColor.GREEN + "-1[:(enabled|disabled)] ... " + ChatColor.BLUE + "-- Sets the text of the first sign line. (e.g. -1 Blah Blah)");
|
v.sendMessage(ChatColor.GREEN + "-1[:(enabled|disabled)] ... " + ChatColor.BLUE + "-- Sets the text of the first sign line. (e.g. -1 Blah Blah)");
|
||||||
@ -240,7 +237,7 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
String newText = "";
|
StringBuilder newText = new StringBuilder();
|
||||||
|
|
||||||
// go through the array until the next top level parameter is found
|
// go through the array until the next top level parameter is found
|
||||||
for (i++; i < params.length; i++) {
|
for (i++; i < params.length; i++) {
|
||||||
@ -250,16 +247,16 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
i--;
|
i--;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
newText += currentParameter + " ";
|
newText.append(currentParameter).append(" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newText = ChatColor.translateAlternateColorCodes('&', newText);
|
newText = new StringBuilder(ChatColor.translateAlternateColorCodes('&', newText.toString()));
|
||||||
|
|
||||||
// remove last space or return if the string is empty and the user just wanted to set the status
|
// remove last space or return if the string is empty and the user just wanted to set the status
|
||||||
if (!newText.isEmpty() && newText.endsWith(" ")) {
|
if ((newText.length() > 0) && newText.toString().endsWith(" ")) {
|
||||||
newText = newText.substring(0, newText.length() - 1);
|
newText = new StringBuilder(newText.substring(0, newText.length() - 1));
|
||||||
} else if (newText.isEmpty()) {
|
} else if (newText.length() == 0) {
|
||||||
if (statusSet) {
|
if (statusSet) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -269,10 +266,10 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
// check the line length and cut the text if needed
|
// check the line length and cut the text if needed
|
||||||
if (newText.length() > MAX_SIGN_LINE_LENGTH) {
|
if (newText.length() > MAX_SIGN_LINE_LENGTH) {
|
||||||
v.sendMessage(ChatColor.RED + "Warning: Text on line " + lineNumber + " exceeds the maximum line length of " + MAX_SIGN_LINE_LENGTH + " characters. Your text will be cut.");
|
v.sendMessage(ChatColor.RED + "Warning: Text on line " + lineNumber + " exceeds the maximum line length of " + MAX_SIGN_LINE_LENGTH + " characters. Your text will be cut.");
|
||||||
newText = newText.substring(0, MAX_SIGN_LINE_LENGTH);
|
newText = new StringBuilder(newText.substring(0, MAX_SIGN_LINE_LENGTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.signTextLines[lineIndex] = newText;
|
this.signTextLines[lineIndex] = newText.toString();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,16 +295,12 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
store.createNewFile();
|
store.createNewFile();
|
||||||
FileWriter outFile = new FileWriter(store);
|
try (FileWriter outFile = new FileWriter(store); BufferedWriter outStream = new BufferedWriter(outFile)) {
|
||||||
BufferedWriter outStream = new BufferedWriter(outFile);
|
|
||||||
|
|
||||||
for (int i = 0; i < this.signTextLines.length; i++) {
|
for (int i = 0; i < this.signTextLines.length; i++) {
|
||||||
outStream.write(this.signLinesEnabled[i] + "\n");
|
outStream.write(this.signLinesEnabled[i] + "\n");
|
||||||
outStream.write(this.signTextLines[i] + "\n");
|
outStream.write(this.signTextLines[i] + "\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
outStream.close();
|
|
||||||
outFile.close();
|
|
||||||
|
|
||||||
v.sendMessage(ChatColor.BLUE + "File saved successfully.");
|
v.sendMessage(ChatColor.BLUE + "File saved successfully.");
|
||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
@ -330,18 +323,13 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try (FileReader inFile = new FileReader(store); BufferedReader inStream = new BufferedReader(inFile)) {
|
||||||
FileReader inFile = new FileReader(store);
|
|
||||||
BufferedReader inStream = new BufferedReader(inFile);
|
|
||||||
|
|
||||||
for (int i = 0; i < this.signTextLines.length; i++) {
|
for (int i = 0; i < this.signTextLines.length; i++) {
|
||||||
this.signLinesEnabled[i] = Boolean.valueOf(inStream.readLine());
|
this.signLinesEnabled[i] = Boolean.parseBoolean(inStream.readLine());
|
||||||
this.signTextLines[i] = inStream.readLine();
|
this.signTextLines[i] = inStream.readLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
inStream.close();
|
|
||||||
inFile.close();
|
|
||||||
|
|
||||||
v.sendMessage(ChatColor.BLUE + "File loaded successfully.");
|
v.sendMessage(ChatColor.BLUE + "File loaded successfully.");
|
||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
v.sendMessage(ChatColor.RED + "Failed to load file. " + exception.getMessage());
|
v.sendMessage(ChatColor.RED + "Failed to load file. " + exception.getMessage());
|
||||||
@ -353,18 +341,14 @@ public class SignOverwriteBrush extends Brush {
|
|||||||
* Clears the internal text buffer. (Sets it to empty strings)
|
* Clears the internal text buffer. (Sets it to empty strings)
|
||||||
*/
|
*/
|
||||||
private void clearBuffer() {
|
private void clearBuffer() {
|
||||||
for (int i = 0; i < this.signTextLines.length; i++) {
|
Arrays.fill(this.signTextLines, "");
|
||||||
this.signTextLines[i] = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets line enabled states to enabled.
|
* Resets line enabled states to enabled.
|
||||||
*/
|
*/
|
||||||
private void resetStates() {
|
private void resetStates() {
|
||||||
for (int i = 0; i < this.signLinesEnabled.length; i++) {
|
Arrays.fill(this.signLinesEnabled, true);
|
||||||
this.signLinesEnabled[i] = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,15 +4,9 @@ import com.thevoxelbox.voxelsniper.Message;
|
|||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Snipe_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SnipeBrush extends PerformBrush {
|
public class SnipeBrush extends PerformBrush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SnipeBrush() {
|
public SnipeBrush() {
|
||||||
this.setName("Snipe");
|
this.setName("Snipe");
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Snow_cone_brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SnowConeBrush extends Brush {
|
public class SnowConeBrush extends Brush {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void addSnow(final SnipeData v, Block targetBlock) {
|
private void addSnow(final SnipeData v, Block targetBlock) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.thevoxelbox.voxelsniper.brush;
|
package com.thevoxelbox.voxelsniper.brush;
|
||||||
|
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import com.thevoxelbox.voxelsniper.Message;
|
import com.thevoxelbox.voxelsniper.Message;
|
||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
@ -9,24 +8,15 @@ import com.thevoxelbox.voxelsniper.Undo;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Spiral_Staircase_Brush
|
|
||||||
*
|
|
||||||
* @author giltwist
|
|
||||||
*/
|
|
||||||
public class SpiralStaircaseBrush extends Brush {
|
public class SpiralStaircaseBrush extends Brush {
|
||||||
private String stairtype = "block"; // "block" 1x1 blocks (default), "step" alternating step double step, "stair" staircase with blocks on corners
|
private String stairtype = "block"; // "block" 1x1 blocks (default), "step" alternating step double step, "stair" staircase with blocks on corners
|
||||||
private String sdirect = "c"; // "c" clockwise (default), "cc" counter-clockwise
|
private String sdirect = "c"; // "c" clockwise (default), "cc" counter-clockwise
|
||||||
private String sopen = "n"; // "n" north (default), "e" east, "world" south, "world" west
|
private String sopen = "n"; // "n" north (default), "e" east, "world" south, "world" west
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SpiralStaircaseBrush() {
|
public SpiralStaircaseBrush() {
|
||||||
this.setName("Spiral Staircase");
|
this.setName("Spiral Staircase");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void buildStairWell(final SnipeData v, Block targetBlock) {
|
private void buildStairWell(final SnipeData v, Block targetBlock) {
|
||||||
if (v.getVoxelHeight() < 1) {
|
if (v.getVoxelHeight() < 1) {
|
||||||
v.setVoxelHeight(1);
|
v.setVoxelHeight(1);
|
||||||
@ -37,12 +27,9 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
|
|
||||||
// locate first block in staircase
|
// locate first block in staircase
|
||||||
// Note to self, fix these
|
// Note to self, fix these
|
||||||
int startX = 0;
|
int startX;
|
||||||
int startZ = 0;
|
int startZ;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
int xOffset = 0;
|
|
||||||
int zOffset = 0;
|
|
||||||
int toggle = 0;
|
|
||||||
|
|
||||||
if (this.sdirect.equalsIgnoreCase("cc")) {
|
if (this.sdirect.equalsIgnoreCase("cc")) {
|
||||||
if (this.sopen.equalsIgnoreCase("n")) {
|
if (this.sopen.equalsIgnoreCase("n")) {
|
||||||
@ -74,6 +61,9 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xOffset = 0;
|
||||||
|
int zOffset = 0;
|
||||||
|
int toggle = 0;
|
||||||
while (y < v.getVoxelHeight()) {
|
while (y < v.getVoxelHeight()) {
|
||||||
if (this.stairtype.equalsIgnoreCase("block")) {
|
if (this.stairtype.equalsIgnoreCase("block")) {
|
||||||
// 1x1x1 voxel material steps
|
// 1x1x1 voxel material steps
|
||||||
@ -223,9 +213,6 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
switch (stairtype) {
|
|
||||||
|
|
||||||
}
|
|
||||||
if (this.stairtype.equalsIgnoreCase("block")) {
|
if (this.stairtype.equalsIgnoreCase("block")) {
|
||||||
this.setBlockIdAt(blockPositionZ - v.getBrushSize() + z, blockPositionX - v.getBrushSize() + x, blockPositionY + i, v.getVoxelId());
|
this.setBlockIdAt(blockPositionZ - v.getBrushSize() + z, blockPositionX - v.getBrushSize() + x, blockPositionY + i, v.getVoxelId());
|
||||||
} else if (this.stairtype.equalsIgnoreCase("step")) {
|
} else if (this.stairtype.equalsIgnoreCase("step")) {
|
||||||
@ -258,7 +245,6 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
v.owner().storeUndo(undo);
|
v.owner().storeUndo(undo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void digStairWell(final SnipeData v, Block targetBlock) {
|
private void digStairWell(final SnipeData v, Block targetBlock) {
|
||||||
if (v.getVoxelHeight() < 1) {
|
if (v.getVoxelHeight() < 1) {
|
||||||
v.setVoxelHeight(1);
|
v.setVoxelHeight(1);
|
||||||
@ -270,12 +256,8 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
|
|
||||||
// locate first block in staircase
|
// locate first block in staircase
|
||||||
// Note to self, fix these
|
// Note to self, fix these
|
||||||
int startX = 0;
|
int startX;
|
||||||
int startZ = 0;
|
int startZ;
|
||||||
int y = 0;
|
|
||||||
int xOffset = 0;
|
|
||||||
int zOffset = 0;
|
|
||||||
int toggle = 0;
|
|
||||||
|
|
||||||
if (this.sdirect.equalsIgnoreCase("cc")) {
|
if (this.sdirect.equalsIgnoreCase("cc")) {
|
||||||
if (this.sopen.equalsIgnoreCase("n")) {
|
if (this.sopen.equalsIgnoreCase("n")) {
|
||||||
@ -307,6 +289,10 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xOffset = 0;
|
||||||
|
int zOffset = 0;
|
||||||
|
int toggle = 0;
|
||||||
|
int y = 0;
|
||||||
while (y < v.getVoxelHeight()) {
|
while (y < v.getVoxelHeight()) {
|
||||||
if (this.stairtype.equalsIgnoreCase("block")) {
|
if (this.stairtype.equalsIgnoreCase("block")) {
|
||||||
// 1x1x1 voxel material steps
|
// 1x1x1 voxel material steps
|
||||||
@ -522,14 +508,11 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
// step/slab
|
// step/slab
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BlockType type = BlockTypes.parse(par[i]);
|
|
||||||
this.stairtype = par[i].toLowerCase().intern();
|
this.stairtype = par[i].toLowerCase().intern();
|
||||||
v.sendMessage(ChatColor.BLUE + "Staircase type: " + this.stairtype);
|
v.sendMessage(ChatColor.BLUE + "Staircase type: " + this.stairtype);
|
||||||
return;
|
return;
|
||||||
} catch (InputParseException ignore) {
|
} catch (InputParseException ignore) {
|
||||||
}
|
}
|
||||||
if ("block".equals(par[i].toLowerCase())) {
|
|
||||||
}
|
|
||||||
if (par[i].equalsIgnoreCase("block") || par[i].equalsIgnoreCase("step") || par[i].equalsIgnoreCase("woodstair") || par[i].equalsIgnoreCase("cobblestair")) {
|
if (par[i].equalsIgnoreCase("block") || par[i].equalsIgnoreCase("step") || par[i].equalsIgnoreCase("woodstair") || par[i].equalsIgnoreCase("cobblestair")) {
|
||||||
this.stairtype = par[i].toLowerCase().intern();
|
this.stairtype = par[i].toLowerCase().intern();
|
||||||
v.sendMessage(ChatColor.BLUE + "Staircase type: " + this.stairtype);
|
v.sendMessage(ChatColor.BLUE + "Staircase type: " + this.stairtype);
|
||||||
@ -540,7 +523,7 @@ public class SpiralStaircaseBrush extends Brush {
|
|||||||
this.sopen = par[i];
|
this.sopen = par[i];
|
||||||
v.sendMessage(ChatColor.BLUE + "Staircase opens: " + this.sopen);
|
v.sendMessage(ChatColor.BLUE + "Staircase opens: " + this.sopen);
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,7 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Splatter_Brushes
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SplatterBallBrush extends PerformBrush {
|
public class SplatterBallBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
@ -28,9 +24,6 @@ public class SplatterBallBrush extends PerformBrush {
|
|||||||
private int splatterRecursions; // How many times you grow the seeds
|
private int splatterRecursions; // How many times you grow the seeds
|
||||||
private Random generator = new Random();
|
private Random generator = new Random();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SplatterBallBrush() {
|
public SplatterBallBrush() {
|
||||||
this.setName("Splatter Ball");
|
this.setName("Splatter Ball");
|
||||||
}
|
}
|
||||||
@ -105,12 +98,13 @@ public class SplatterBallBrush extends PerformBrush {
|
|||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
for (int y = 2 * v.getBrushSize(); y >= 0; y--) {
|
for (int y = 2 * v.getBrushSize(); y >= 0; y--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempSplat[x][y], 0, splat[x][y], 0,
|
System.arraycopy(tempSplat[x][y], 0, splat[x][y], 0,
|
||||||
2 * v.getBrushSize() + 1);
|
2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
// Fill 1x1x1 holes
|
// Fill 1x1x1 holes
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
@ -211,7 +205,7 @@ public class SplatterBallBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,7 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Splatter_Brushes
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SplatterDiscBrush extends PerformBrush {
|
public class SplatterDiscBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
@ -28,9 +24,6 @@ public class SplatterDiscBrush extends PerformBrush {
|
|||||||
private int splatterRecursions; // How many times you grow the seeds
|
private int splatterRecursions; // How many times you grow the seeds
|
||||||
private Random generator = new Random();
|
private Random generator = new Random();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SplatterDiscBrush() {
|
public SplatterDiscBrush() {
|
||||||
this.setName("Splatter Disc");
|
this.setName("Splatter Disc");
|
||||||
}
|
}
|
||||||
@ -95,10 +88,11 @@ public class SplatterDiscBrush extends PerformBrush {
|
|||||||
|
|
||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
// Fill 1x1 holes
|
// Fill 1x1 holes
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
@ -186,7 +180,7 @@ public class SplatterDiscBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,6 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Splatter_Overlay_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks Splatterized blockPositionY Giltwist
|
|
||||||
*/
|
|
||||||
public class SplatterOverlayBrush extends PerformBrush {
|
public class SplatterOverlayBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
@ -34,9 +29,6 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
private int depth = 3;
|
private int depth = 3;
|
||||||
private boolean allBlocks = false;
|
private boolean allBlocks = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SplatterOverlayBrush() {
|
public SplatterOverlayBrush() {
|
||||||
this.setName("Splatter Overlay");
|
this.setName("Splatter Overlay");
|
||||||
}
|
}
|
||||||
@ -88,10 +80,11 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
|
|
||||||
final int[][] memory = new int[2 * v.getBrushSize() + 1][2 * v.getBrushSize() + 1];
|
final int[][] memory = new int[2 * v.getBrushSize() + 1][2 * v.getBrushSize() + 1];
|
||||||
@ -124,9 +117,6 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1;
|
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final int depth = randomizeHeight ? generator.nextInt(this.depth) : this.depth;
|
final int depth = randomizeHeight ? generator.nextInt(this.depth) : this.depth;
|
||||||
@ -197,10 +187,11 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempsplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
System.arraycopy(tempsplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
|
|
||||||
final int[][] memory = new int[v.getBrushSize() * 2 + 1][v.getBrushSize() * 2 + 1];
|
final int[][] memory = new int[v.getBrushSize() * 2 + 1][v.getBrushSize() * 2 + 1];
|
||||||
@ -225,9 +216,6 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
// in parameters
|
// in parameters
|
||||||
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
|
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final int depth = randomizeHeight ? generator.nextInt(this.depth) : this.depth;
|
final int depth = randomizeHeight ? generator.nextInt(this.depth) : this.depth;
|
||||||
@ -338,10 +326,10 @@ public class SplatterOverlayBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
v.sendMessage(String.format("An error occured while processing parameter %s.", parameter));
|
v.sendMessage(String.format("An error occurred while processing parameter %s.", parameter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,7 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Splatter_Brushes
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SplatterVoxelBrush extends PerformBrush {
|
public class SplatterVoxelBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
@ -28,9 +24,6 @@ public class SplatterVoxelBrush extends PerformBrush {
|
|||||||
private int splatterRecursions; // How many times you grow the seeds
|
private int splatterRecursions; // How many times you grow the seeds
|
||||||
private Random generator = new Random();
|
private Random generator = new Random();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SplatterVoxelBrush() {
|
public SplatterVoxelBrush() {
|
||||||
this.setName("Splatter Voxel");
|
this.setName("Splatter Voxel");
|
||||||
}
|
}
|
||||||
@ -105,12 +98,13 @@ public class SplatterVoxelBrush extends PerformBrush {
|
|||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
for (int y = 2 * v.getBrushSize(); y >= 0; y--) {
|
for (int y = 2 * v.getBrushSize(); y >= 0; y--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempSplat[x][y], 0, splat[x][y], 0,
|
System.arraycopy(tempSplat[x][y], 0, splat[x][y], 0,
|
||||||
2 * v.getBrushSize() + 1);
|
2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
// Fill 1x1x1 holes
|
// Fill 1x1x1 holes
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
@ -201,7 +195,7 @@ public class SplatterVoxelBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,7 @@ import org.bukkit.block.Block;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Splatter_Brushes
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class SplatterVoxelDiscBrush extends PerformBrush {
|
public class SplatterVoxelDiscBrush extends PerformBrush {
|
||||||
private static final int GROW_PERCENT_MIN = 1;
|
private static final int GROW_PERCENT_MIN = 1;
|
||||||
private static final int GROW_PERCENT_DEFAULT = 1000;
|
private static final int GROW_PERCENT_DEFAULT = 1000;
|
||||||
@ -28,9 +24,6 @@ public class SplatterVoxelDiscBrush extends PerformBrush {
|
|||||||
private int splatterRecursions; // How many times you grow the seeds
|
private int splatterRecursions; // How many times you grow the seeds
|
||||||
private Random generator = new Random();
|
private Random generator = new Random();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SplatterVoxelDiscBrush() {
|
public SplatterVoxelDiscBrush() {
|
||||||
this.setName("Splatter Voxel Disc");
|
this.setName("Splatter Voxel Disc");
|
||||||
}
|
}
|
||||||
@ -92,10 +85,11 @@ public class SplatterVoxelDiscBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
// integrate tempsplat back into splat at end of iteration
|
// integrate tempsplat back into splat at end of iteration
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
if (2 * v.getBrushSize() + 1 >= 0)
|
if (2 * v.getBrushSize() + 1 >= 0) {
|
||||||
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
System.arraycopy(tempSplat[x], 0, splat[x], 0, 2 * v.getBrushSize() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.growPercent = gref;
|
this.growPercent = gref;
|
||||||
// Fill 1x1 holes
|
// Fill 1x1 holes
|
||||||
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
for (int x = 2 * v.getBrushSize(); x >= 0; x--) {
|
||||||
@ -184,7 +178,7 @@ public class SplatterVoxelDiscBrush extends PerformBrush {
|
|||||||
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
v.sendMessage(ChatColor.RED + "Recursions must be an integer 1-10!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ public class SplineBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void parameters(final String[] par, final com.thevoxelbox.voxelsniper.SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
for (int i = 1; i < par.length; i++) {
|
for (int i = 1; i < par.length; i++) {
|
||||||
if (par[i].equalsIgnoreCase("info")) {
|
if (par[i].equalsIgnoreCase("info")) {
|
||||||
v.sendMessage(ChatColor.GOLD + "Spline brush parameters");
|
v.sendMessage(ChatColor.GOLD + "Spline brush parameters");
|
||||||
@ -181,7 +181,7 @@ public class SplineBrush extends PerformBrush {
|
|||||||
this.render(v);
|
this.render(v);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,6 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class StampBrush extends Brush {
|
public class StampBrush extends Brush {
|
||||||
protected HashSet<BlockWrapper> clone = new HashSet<>();
|
protected HashSet<BlockWrapper> clone = new HashSet<>();
|
||||||
protected HashSet<BlockWrapper> fall = new HashSet<>();
|
protected HashSet<BlockWrapper> fall = new HashSet<>();
|
||||||
@ -20,39 +17,24 @@ public class StampBrush extends Brush {
|
|||||||
protected Undo undo;
|
protected Undo undo;
|
||||||
protected boolean sorted = false;
|
protected boolean sorted = false;
|
||||||
protected StampType stamp = StampType.DEFAULT;
|
protected StampType stamp = StampType.DEFAULT;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StampBrush() {
|
public StampBrush() {
|
||||||
this.setName("Stamp");
|
this.setName("Stamp");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public final void reSort() {
|
public final void reSort() {
|
||||||
this.sorted = false;
|
this.sorted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected final boolean falling(final int id) {
|
protected final boolean falling(final int id) {
|
||||||
return (id > 7 && id < 14);
|
return (id > 7 && id < 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected final boolean fallsOff(final int id) {
|
protected final boolean fallsOff(final int id) {
|
||||||
return (BlockTypes.get(id).getMaterial().isFragileWhenPushed());
|
return (BlockTypes.get(id).getMaterial().isFragileWhenPushed());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param cb
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
protected final void setBlock(final BlockWrapper cb) {
|
protected final void setBlock(final BlockWrapper cb) {
|
||||||
final AsyncBlock block = this.clampY(this.getTargetBlock().getX() + cb.x, this.getTargetBlock().getY() + cb.y, this.getTargetBlock().getZ() + cb.z);
|
final AsyncBlock block = this.clampY(this.getTargetBlock().getX() + cb.x, this.getTargetBlock().getY() + cb.y, this.getTargetBlock().getZ() + cb.z);
|
||||||
@ -61,9 +43,6 @@ public class StampBrush extends Brush {
|
|||||||
block.setPropertyId(cb.d);
|
block.setPropertyId(cb.d);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param cb
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
protected final void setBlockFill(final BlockWrapper cb) {
|
protected final void setBlockFill(final BlockWrapper cb) {
|
||||||
final AsyncBlock block = this.clampY(this.getTargetBlock().getX() + cb.x, this.getTargetBlock().getY() + cb.y, this.getTargetBlock().getZ() + cb.z);
|
final AsyncBlock block = this.clampY(this.getTargetBlock().getX() + cb.x, this.getTargetBlock().getY() + cb.y, this.getTargetBlock().getZ() + cb.z);
|
||||||
@ -74,16 +53,10 @@ public class StampBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param type
|
|
||||||
*/
|
|
||||||
protected final void setStamp(final StampType type) {
|
protected final void setStamp(final StampType type) {
|
||||||
this.stamp = type;
|
this.stamp = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
*/
|
|
||||||
protected final void stamp(final SnipeData v) {
|
protected final void stamp(final SnipeData v) {
|
||||||
this.undo = new Undo();
|
this.undo = new Undo();
|
||||||
|
|
||||||
@ -123,9 +96,6 @@ public class StampBrush extends Brush {
|
|||||||
v.owner().storeUndo(this.undo);
|
v.owner().storeUndo(this.undo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
*/
|
|
||||||
protected final void stampFill(final SnipeData v) {
|
protected final void stampFill(final SnipeData v) {
|
||||||
|
|
||||||
this.undo = new Undo();
|
this.undo = new Undo();
|
||||||
@ -166,9 +136,6 @@ public class StampBrush extends Brush {
|
|||||||
v.owner().storeUndo(this.undo);
|
v.owner().storeUndo(this.undo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param v
|
|
||||||
*/
|
|
||||||
protected final void stampNoAir(final SnipeData v) {
|
protected final void stampNoAir(final SnipeData v) {
|
||||||
|
|
||||||
this.undo = new Undo();
|
this.undo = new Undo();
|
||||||
@ -245,16 +212,11 @@ public class StampBrush extends Brush {
|
|||||||
return "voxelsniper.brush.stamp";
|
return "voxelsniper.brush.stamp";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Monofraps
|
|
||||||
*/
|
|
||||||
protected enum StampType {
|
protected enum StampType {
|
||||||
NO_AIR, FILL, DEFAULT
|
NO_AIR, FILL, DEFAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
protected class BlockWrapper {
|
protected class BlockWrapper {
|
||||||
public int id;
|
public int id;
|
||||||
public int x;
|
public int x;
|
||||||
@ -262,13 +224,6 @@ public class StampBrush extends Brush {
|
|||||||
public int z;
|
public int z;
|
||||||
public int d;
|
public int d;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param b
|
|
||||||
* @param blx
|
|
||||||
* @param bly
|
|
||||||
* @param blz
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public BlockWrapper(final AsyncBlock b, final int blx, final int bly, final int blz) {
|
public BlockWrapper(final AsyncBlock b, final int blx, final int bly, final int blz) {
|
||||||
this.id = b.getTypeId();
|
this.id = b.getTypeId();
|
||||||
this.d = b.getPropertyId();
|
this.d = b.getPropertyId();
|
||||||
|
@ -42,10 +42,7 @@ public class StencilBrush extends Brush {
|
|||||||
private int[] pastePoint = new int[3];
|
private int[] pastePoint = new int[3];
|
||||||
private byte point = 1;
|
private byte point = 1;
|
||||||
|
|
||||||
/**
|
public StencilBrush() {
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StencilBrush() {
|
|
||||||
this.setName("Stencil");
|
this.setName("Stencil");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,8 +57,7 @@ public class StencilBrush extends Brush {
|
|||||||
final File file = new File("plugins/VoxelSniper/stencils/" + this.filename + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + this.filename + ".vstencil");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try (final FaweInputStream in = new FaweInputStream(new DataInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file)))))) {
|
||||||
final FaweInputStream in = new FaweInputStream(new DataInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file)))));
|
|
||||||
|
|
||||||
this.x = in.readShort();
|
this.x = in.readShort();
|
||||||
this.z = in.readShort();
|
this.z = in.readShort();
|
||||||
@ -203,7 +199,7 @@ public class StencilBrush extends Brush {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("UnstableApiUsage")
|
||||||
private void stencilSave(final SnipeData v) {
|
private void stencilSave(final SnipeData v) {
|
||||||
|
|
||||||
final File file = new File("plugins/VoxelSniper/stencils/" + this.filename + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + this.filename + ".vstencil");
|
||||||
@ -222,10 +218,10 @@ public class StencilBrush extends Brush {
|
|||||||
|
|
||||||
Files.createParentDirs(file);
|
Files.createParentDirs(file);
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
final FaweOutputStream out = new FaweOutputStream(new DataOutputStream(new PGZIPOutputStream(new BufferedOutputStream(new FileOutputStream(file)))));
|
try (FaweOutputStream out = new FaweOutputStream(new DataOutputStream(new PGZIPOutputStream(new BufferedOutputStream(new FileOutputStream(file)))))) {
|
||||||
int blockPositionX = (this.firstPoint[0] > this.secondPoint[0]) ? this.secondPoint[0] : this.firstPoint[0];
|
int blockPositionX = Math.min(this.firstPoint[0], this.secondPoint[0]);
|
||||||
int blockPositionZ = (this.firstPoint[1] > this.secondPoint[1]) ? this.secondPoint[1] : this.firstPoint[1];
|
int blockPositionZ = Math.min(this.firstPoint[1], this.secondPoint[1]);
|
||||||
int blockPositionY = (this.firstPoint[2] > this.secondPoint[2]) ? this.secondPoint[2] : this.firstPoint[2];
|
int blockPositionY = Math.min(this.firstPoint[2], this.secondPoint[2]);
|
||||||
out.writeShort(this.x);
|
out.writeShort(this.x);
|
||||||
out.writeShort(this.z);
|
out.writeShort(this.z);
|
||||||
out.writeShort(this.y);
|
out.writeShort(this.y);
|
||||||
@ -277,7 +273,7 @@ public class StencilBrush extends Brush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
v.sendMessage(ChatColor.BLUE + "Saved as '" + this.filename + "'.");
|
v.sendMessage(ChatColor.BLUE + "Saved as '" + this.filename + "'.");
|
||||||
out.close();
|
}
|
||||||
|
|
||||||
} catch (final Exception exception) {
|
} catch (final Exception exception) {
|
||||||
v.sendMessage(ChatColor.RED + "Something went wrong.");
|
v.sendMessage(ChatColor.RED + "Something went wrong.");
|
||||||
|
@ -12,9 +12,6 @@ import java.io.FileInputStream;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class StencilListBrush extends Brush {
|
public class StencilListBrush extends Brush {
|
||||||
private byte pasteOption = 1; // 0 = full, 1 = fill, 2 = replace
|
private byte pasteOption = 1; // 0 = full, 1 = fill, 2 = replace
|
||||||
private String filename = "NoFileLoaded";
|
private String filename = "NoFileLoaded";
|
||||||
@ -27,20 +24,17 @@ public class StencilListBrush extends Brush {
|
|||||||
private byte pasteParam = 0;
|
private byte pasteParam = 0;
|
||||||
private HashMap<Integer, String> stencilList = new HashMap<>();
|
private HashMap<Integer, String> stencilList = new HashMap<>();
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StencilListBrush() {
|
public StencilListBrush() {
|
||||||
this.setName("StencilList");
|
this.setName("StencilList");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String readRandomStencil(final SnipeData v) {
|
private String readRandomStencil() {
|
||||||
double rand = Math.random() * (this.stencilList.size());
|
double rand = Math.random() * (this.stencilList.size());
|
||||||
final int choice = (int) rand;
|
final int choice = (int) rand;
|
||||||
return this.stencilList.get(choice);
|
return this.stencilList.get(choice);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readStencilList(final String listname, final SnipeData v) {
|
private void readStencilList() {
|
||||||
final File file = new File("plugins/VoxelSniper/stencilLists/" + this.filename + ".txt");
|
final File file = new File("plugins/VoxelSniper/stencilLists/" + this.filename + ".txt");
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try {
|
||||||
@ -64,16 +58,14 @@ public class StencilListBrush extends Brush {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String stencilName = this.readRandomStencil(v);
|
final String stencilName = this.readRandomStencil();
|
||||||
v.sendMessage(stencilName);
|
v.sendMessage(stencilName);
|
||||||
|
|
||||||
final Undo undo = new Undo();
|
final Undo undo = new Undo();
|
||||||
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try (final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))){
|
||||||
final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
|
|
||||||
|
|
||||||
this.x = in.readShort();
|
this.x = in.readShort();
|
||||||
this.z = in.readShort();
|
this.z = in.readShort();
|
||||||
this.y = in.readShort();
|
this.y = in.readShort();
|
||||||
@ -224,14 +216,13 @@ public class StencilListBrush extends Brush {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String stencilName = this.readRandomStencil(v);
|
final String stencilName = this.readRandomStencil();
|
||||||
|
|
||||||
final Undo undo = new Undo();
|
final Undo undo = new Undo();
|
||||||
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try (final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
|
||||||
final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
|
|
||||||
|
|
||||||
this.x = in.readShort();
|
this.x = in.readShort();
|
||||||
this.z = in.readShort();
|
this.z = in.readShort();
|
||||||
@ -383,14 +374,13 @@ public class StencilListBrush extends Brush {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String stencilName = this.readRandomStencil(v);
|
final String stencilName = this.readRandomStencil();
|
||||||
|
|
||||||
final Undo undo = new Undo();
|
final Undo undo = new Undo();
|
||||||
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try (final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
|
||||||
final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
|
|
||||||
|
|
||||||
this.x = in.readShort();
|
this.x = in.readShort();
|
||||||
this.z = in.readShort();
|
this.z = in.readShort();
|
||||||
@ -550,7 +540,7 @@ public class StencilListBrush extends Brush {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String stencilName = this.readRandomStencil(v);
|
final String stencilName = this.readRandomStencil();
|
||||||
|
|
||||||
final Undo undo = new Undo();
|
final Undo undo = new Undo();
|
||||||
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
final File file = new File("plugins/VoxelSniper/stencils/" + stencilName + ".vstencil");
|
||||||
@ -704,7 +694,7 @@ public class StencilListBrush extends Brush {
|
|||||||
|
|
||||||
private void stencilPasteRotation(final SnipeData v) {
|
private void stencilPasteRotation(final SnipeData v) {
|
||||||
// just randomly chooses a rotation and then calls stencilPaste.
|
// just randomly chooses a rotation and then calls stencilPaste.
|
||||||
this.readStencilList(this.filename, v);
|
this.readStencilList();
|
||||||
final double random = Math.random();
|
final double random = Math.random();
|
||||||
if (random < 0.26) {
|
if (random < 0.26) {
|
||||||
this.stencilPaste(v);
|
this.stencilPaste(v);
|
||||||
@ -756,7 +746,7 @@ public class StencilListBrush extends Brush {
|
|||||||
final File file = new File("plugins/VoxelSniper/stencilLists/" + this.filename + ".txt");
|
final File file = new File("plugins/VoxelSniper/stencilLists/" + this.filename + ".txt");
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
v.sendMessage(ChatColor.RED + "Stencil List '" + this.filename + "' exists and was loaded.");
|
v.sendMessage(ChatColor.RED + "Stencil List '" + this.filename + "' exists and was loaded.");
|
||||||
this.readStencilList(this.filename, v);
|
this.readStencilList();
|
||||||
} else {
|
} else {
|
||||||
v.sendMessage(ChatColor.AQUA + "Stencil List '" + this.filename + "' does not exist. This brush will not function without a valid stencil list.");
|
v.sendMessage(ChatColor.AQUA + "Stencil List '" + this.filename + "' does not exist. This brush will not function without a valid stencil list.");
|
||||||
this.filename = "NoFileLoaded";
|
this.filename = "NoFileLoaded";
|
||||||
|
@ -7,11 +7,6 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.util.NumberConversions;
|
import org.bukkit.util.NumberConversions;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Three-Point_Circle_Brush
|
|
||||||
*
|
|
||||||
* @author Giltwist
|
|
||||||
*/
|
|
||||||
public class ThreePointCircleBrush extends PerformBrush {
|
public class ThreePointCircleBrush extends PerformBrush {
|
||||||
private Vector coordsOne;
|
private Vector coordsOne;
|
||||||
private Vector coordsTwo;
|
private Vector coordsTwo;
|
||||||
@ -159,12 +154,12 @@ public class ThreePointCircleBrush extends PerformBrush {
|
|||||||
public final void parameters(final String[] par, final SnipeData v) {
|
public final void parameters(final String[] par, final SnipeData v) {
|
||||||
if (par[1].equalsIgnoreCase("info")) {
|
if (par[1].equalsIgnoreCase("info")) {
|
||||||
v.sendMessage(ChatColor.YELLOW + "3-Point Circle Brush instructions: Select three corners with the arrow brush, then generate the Circle with the powder brush.");
|
v.sendMessage(ChatColor.YELLOW + "3-Point Circle Brush instructions: Select three corners with the arrow brush, then generate the Circle with the powder brush.");
|
||||||
String toleranceOptions = "";
|
StringBuilder toleranceOptions = new StringBuilder();
|
||||||
for (final Tolerance tolerance : Tolerance.values()) {
|
for (final Tolerance tolerance : Tolerance.values()) {
|
||||||
if (!toleranceOptions.isEmpty()) {
|
if (toleranceOptions.length() > 0) {
|
||||||
toleranceOptions += "|";
|
toleranceOptions.append("|");
|
||||||
}
|
}
|
||||||
toleranceOptions += tolerance.name().toLowerCase();
|
toleranceOptions.append(tolerance.name().toLowerCase());
|
||||||
}
|
}
|
||||||
v.sendMessage(ChatColor.GOLD + "/b tpc " + toleranceOptions + " -- Toggle the calculations to emphasize accuracy or smoothness");
|
v.sendMessage(ChatColor.GOLD + "/b tpc " + toleranceOptions + " -- Toggle the calculations to emphasize accuracy or smoothness");
|
||||||
return;
|
return;
|
||||||
@ -193,7 +188,9 @@ public class ThreePointCircleBrush extends PerformBrush {
|
|||||||
* @author MikeMatrix
|
* @author MikeMatrix
|
||||||
*/
|
*/
|
||||||
private enum Tolerance {
|
private enum Tolerance {
|
||||||
DEFAULT(1000), ACCURATE(10), SMOOTH(2000);
|
DEFAULT(1000),
|
||||||
|
ACCURATE(10),
|
||||||
|
SMOOTH(2000);
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
Tolerance(final int value) {
|
Tolerance(final int value) {
|
||||||
|
@ -12,18 +12,9 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.TreeType;
|
import org.bukkit.TreeType;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Tree_Brush
|
|
||||||
*
|
|
||||||
* @author Mick
|
|
||||||
*/
|
|
||||||
public class TreeSnipeBrush extends Brush {
|
public class TreeSnipeBrush extends Brush {
|
||||||
private TreeType treeType = TreeType.TREE;
|
private TreeType treeType = TreeType.TREE;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public TreeSnipeBrush() {
|
public TreeSnipeBrush() {
|
||||||
this.setName("Tree Snipe");
|
this.setName("Tree Snipe");
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,6 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Triangle_Brush
|
|
||||||
*
|
|
||||||
* @author Giltwist
|
|
||||||
*/
|
|
||||||
public class TriangleBrush extends PerformBrush {
|
public class TriangleBrush extends PerformBrush {
|
||||||
private double[] coordsOne = new double[3]; // Three corners
|
private double[] coordsOne = new double[3]; // Three corners
|
||||||
private double[] coordsTwo = new double[3];
|
private double[] coordsTwo = new double[3];
|
||||||
@ -21,9 +16,6 @@ public class TriangleBrush extends PerformBrush {
|
|||||||
private double[] vectorThree = new double[3]; // Point 2 to 3, for area calculations
|
private double[] vectorThree = new double[3]; // Point 2 to 3, for area calculations
|
||||||
private double[] normalVector = new double[3];
|
private double[] normalVector = new double[3];
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public TriangleBrush() {
|
public TriangleBrush() {
|
||||||
this.setName("Triangle");
|
this.setName("Triangle");
|
||||||
}
|
}
|
||||||
@ -62,10 +54,10 @@ public class TriangleBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void triangleP(final SnipeData v) {
|
private void triangleP(final SnipeData v) {
|
||||||
double lengthOne = 0;
|
double lengthOne;
|
||||||
double lengthTwo = 0;
|
double lengthTwo;
|
||||||
double lengthThree = 0;
|
double lengthThree;
|
||||||
double heronBig = 0;
|
double heronBig;
|
||||||
|
|
||||||
// Calculate slope vectors
|
// Calculate slope vectors
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
@ -85,7 +77,7 @@ public class TriangleBrush extends PerformBrush {
|
|||||||
lengthThree = Math.pow(Math.pow(this.vectorThree[0], 2) + Math.pow(this.vectorThree[1], 2) + Math.pow(this.vectorThree[2], 2), .5);
|
lengthThree = Math.pow(Math.pow(this.vectorThree[0], 2) + Math.pow(this.vectorThree[1], 2) + Math.pow(this.vectorThree[2], 2), .5);
|
||||||
|
|
||||||
// Bigger vector determines brush size
|
// Bigger vector determines brush size
|
||||||
final int brushSize = (int) Math.ceil((lengthOne > lengthTwo) ? lengthOne : lengthTwo);
|
final int brushSize = (int) Math.ceil(Math.max(lengthOne, lengthTwo));
|
||||||
|
|
||||||
// Calculate constant term
|
// Calculate constant term
|
||||||
final double planeConstant = this.normalVector[0] * this.coordsOne[0] + this.normalVector[1] * this.coordsOne[1] + this.normalVector[2] * this.coordsOne[2];
|
final double planeConstant = this.normalVector[0] * this.coordsOne[0] + this.normalVector[1] * this.coordsOne[1] + this.normalVector[2] * this.coordsOne[2];
|
||||||
|
@ -7,20 +7,11 @@ import com.thevoxelbox.voxelsniper.SnipeData;
|
|||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#Underlay_Brush
|
|
||||||
*
|
|
||||||
* @author jmck95 Credit to GavJenks for framework and 95 of code. Big Thank you to GavJenks
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UnderlayBrush extends PerformBrush {
|
public class UnderlayBrush extends PerformBrush {
|
||||||
private static final int DEFAULT_DEPTH = 3;
|
private static final int DEFAULT_DEPTH = 3;
|
||||||
private int depth = DEFAULT_DEPTH;
|
private int depth = DEFAULT_DEPTH;
|
||||||
private boolean allBlocks = false;
|
private boolean allBlocks = false;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public UnderlayBrush() {
|
public UnderlayBrush() {
|
||||||
this.setName("Underlay (Reverse Overlay)");
|
this.setName("Underlay (Reverse Overlay)");
|
||||||
}
|
}
|
||||||
@ -48,8 +39,6 @@ public class UnderlayBrush extends PerformBrush {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int d = 0; (d < this.depth); d++) {
|
for (int d = 0; (d < this.depth); d++) {
|
||||||
@ -91,8 +80,6 @@ public class UnderlayBrush extends PerformBrush {
|
|||||||
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
|
memory[x + v.getBrushSize()][z + v.getBrushSize()] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int d = -1; (d < this.depth - 1); d++) {
|
for (int d = -1; (d < this.depth - 1); d++) {
|
||||||
@ -148,7 +135,7 @@ public class UnderlayBrush extends PerformBrush {
|
|||||||
this.allBlocks = false;
|
this.allBlocks = false;
|
||||||
v.owner().getPlayer().sendMessage(ChatColor.BLUE + "Will underlay only natural block types." + this.depth);
|
v.owner().getPlayer().sendMessage(ChatColor.BLUE + "Will underlay only natural block types." + this.depth);
|
||||||
} else {
|
} else {
|
||||||
v.owner().getPlayer().sendMessage(ChatColor.RED + "Invalid brush parameters! use the info parameter to display parameter info.");
|
v.owner().getPlayer().sendMessage(ChatColor.RED + "Invalid brush parameters! Use the info parameter to display parameter info.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,20 +7,12 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Volt-Meter_Brush
|
|
||||||
*
|
|
||||||
* @author Gavjenks
|
|
||||||
*/
|
|
||||||
public class VoltMeterBrush extends Brush {
|
public class VoltMeterBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public VoltMeterBrush() {
|
public VoltMeterBrush() {
|
||||||
this.setName("VoltMeter");
|
this.setName("VoltMeter");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void data(final SnipeData v) {
|
private void data(final SnipeData v) {
|
||||||
final AsyncBlock block = this.clampY(this.getTargetBlock().getX(), this.getTargetBlock().getY(), this.getTargetBlock().getZ());
|
final AsyncBlock block = this.clampY(this.getTargetBlock().getX(), this.getTargetBlock().getY(), this.getTargetBlock().getZ());
|
||||||
final int data = block.getPropertyId();
|
final int data = block.getPropertyId();
|
||||||
|
@ -4,15 +4,9 @@ import com.thevoxelbox.voxelsniper.Message;
|
|||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Voxel_Brush
|
|
||||||
*
|
|
||||||
* @author Piotr
|
|
||||||
*/
|
|
||||||
public class VoxelBrush extends PerformBrush {
|
public class VoxelBrush extends PerformBrush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public VoxelBrush() {
|
public VoxelBrush() {
|
||||||
this.setName("Voxel");
|
this.setName("Voxel");
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,9 @@ import com.thevoxelbox.voxelsniper.Message;
|
|||||||
import com.thevoxelbox.voxelsniper.SnipeData;
|
import com.thevoxelbox.voxelsniper.SnipeData;
|
||||||
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Voxel_Disc_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class VoxelDiscBrush extends PerformBrush {
|
public class VoxelDiscBrush extends PerformBrush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public VoxelDiscBrush() {
|
public VoxelDiscBrush() {
|
||||||
this.setName("Voxel Disc");
|
this.setName("Voxel Disc");
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,9 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
/**
|
|
||||||
* http://www.voxelwiki.com/minecraft/Voxelsniper#The_Voxel_Disc_Face_Brush
|
|
||||||
*
|
|
||||||
* @author Voxel
|
|
||||||
*/
|
|
||||||
public class VoxelDiscFaceBrush extends PerformBrush {
|
public class VoxelDiscFaceBrush extends PerformBrush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public VoxelDiscFaceBrush() {
|
public VoxelDiscFaceBrush() {
|
||||||
this.setName("Voxel Disc Face");
|
this.setName("Voxel Disc Face");
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*
|
||||||
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
This file is part of VoxelSniper, licensed under the MIT License (MIT).
|
||||||
|
|
||||||
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
Copyright (c) The VoxelBox <http://thevoxelbox.com>
|
||||||
@ -32,21 +32,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author MikeMatrix
|
|
||||||
*/
|
|
||||||
public class WarpBrush extends Brush {
|
public class WarpBrush extends Brush {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public WarpBrush() {
|
public WarpBrush() {
|
||||||
this.setName("Warp");
|
this.setName("Warp");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Class<?> inject() {
|
|
||||||
return WarpBrush.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void info(final Message vm) {
|
public final void info(final Message vm) {
|
||||||
vm.brushName(this.getName());
|
vm.brushName(this.getName());
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user