geforkt von Mirrors/FastAsyncWorldEdit
Update Upstream
6008fe7 Remove class shutter
Dieser Commit ist enthalten in:
Ursprung
5d31b7034d
Commit
cdbbedb662
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* WorldEdit, a Minecraft world manipulation toolkit
|
|
||||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
||||||
* Copyright (C) WorldEdit team and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU 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 & de-obfuscated names from scripts.
|
|
||||||
*/
|
|
||||||
class MinecraftHidingClassShutter implements ClassShutter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean visibleToScripts(String fullClassName) {
|
|
||||||
if (!fullClassName.contains(".")) {
|
|
||||||
// Default package -- probably Minecraft
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !fullClassName.startsWith("net.minecraft");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -36,13 +36,13 @@ public class RhinoCraftScriptEngine implements CraftScriptEngine {
|
|||||||
private int timeLimit;
|
private int timeLimit;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTimeLimit(int milliseconds) {
|
public int getTimeLimit() {
|
||||||
timeLimit = milliseconds;
|
return timeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTimeLimit() {
|
public void setTimeLimit(int milliseconds) {
|
||||||
return timeLimit;
|
timeLimit = milliseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -50,7 +50,6 @@ 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);
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren