mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
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
This commit is contained in:
parent
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()
|
||||||
if (lastBlock.getBlockY() <= world.getMinY() || lastBlock.getBlockY() >= world.getMaxY()) {
|
|| lastBlock.getBlockY() > world.getMaxY()) {
|
||||||
searchForLastBlock = false;
|
return null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user