geforkt von Mirrors/FastAsyncWorldEdit
upstream: Update upstream (#1430)
* upstream: Update upstream c407471 Re-add class shutter with tweaks. (1947) * upstream: Update Upstream 29f1c66 If a trace hits the world limit, cancel it (1942) * upstream: Update upstream 511daa5 Update paperweight dev bundle
Dieser Commit ist enthalten in:
Ursprung
bd9e237376
Commit
11e25911d5
@ -3,7 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyPaperweightAdapterConfiguration(
|
applyPaperweightAdapterConfiguration(
|
||||||
"1.17.1-R0.1-20211109.085555-183"
|
"1.17.1-R0.1-20211120.192557-194"
|
||||||
)
|
)
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* WorldEdit, a Minecraft world manipulation toolkit
|
||||||
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||||
|
* Copyright (C) WorldEdit team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sk89q.worldedit.scripting;
|
||||||
|
|
||||||
|
import org.mozilla.javascript.ClassShutter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides Minecraft's obfuscated names from scripts.
|
||||||
|
*/
|
||||||
|
class MinecraftHidingClassShutter implements ClassShutter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean visibleToScripts(String fullClassName) {
|
||||||
|
return fullClassName.contains(".") || fullClassName.length() >= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -50,6 +50,7 @@ public class RhinoCraftScriptEngine implements CraftScriptEngine {
|
|||||||
throws Throwable {
|
throws Throwable {
|
||||||
RhinoContextFactory factory = new RhinoContextFactory(timeLimit);
|
RhinoContextFactory factory = new RhinoContextFactory(timeLimit);
|
||||||
Context cx = factory.enterContext();
|
Context cx = factory.enterContext();
|
||||||
|
cx.setClassShutter(new MinecraftHidingClassShutter());
|
||||||
ScriptableObject scriptable = new ImporterTopLevel(cx);
|
ScriptableObject scriptable = new ImporterTopLevel(cx);
|
||||||
Scriptable scope = cx.initStandardObjects(scriptable);
|
Scriptable scope = cx.initStandardObjects(scriptable);
|
||||||
|
|
||||||
|
@ -170,17 +170,15 @@ public class TargetBlock {
|
|||||||
* @return Block
|
* @return Block
|
||||||
*/
|
*/
|
||||||
public Location getAnyTargetBlock() {
|
public Location getAnyTargetBlock() {
|
||||||
boolean searchForLastBlock = true;
|
|
||||||
Location lastBlock = null;
|
Location lastBlock = null;
|
||||||
while (getNextBlock() != null) {
|
while (getNextBlock() != null) {
|
||||||
if (stopMask.test(targetPos)) {
|
if (stopMask.test(targetPos)) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (searchForLastBlock) {
|
|
||||||
lastBlock = getCurrentBlock();
|
lastBlock = getCurrentBlock();
|
||||||
if (lastBlock.getBlockY() <= world.getMinY() || lastBlock.getBlockY() >= world.getMaxY()) {
|
if (lastBlock.getBlockY() < world.getMinY()
|
||||||
searchForLastBlock = false;
|
|| lastBlock.getBlockY() > world.getMaxY()) {
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren