mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-03-12 06:43:05 +01:00
refactor: Remove buscript entirely (#2837)
This commit is contained in:
parent
9cf2c68fe8
commit
c05d866f2f
9
pom.xml
9
pom.xml
@ -228,10 +228,6 @@
|
||||
<pattern>me.main__.util</pattern>
|
||||
<shadedPattern>com.onarandombox.serializationconfig</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>buscript</pattern>
|
||||
<shadedPattern>com.onarandombox.buscript</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>com.onarandombox.bstats</shadedPattern>
|
||||
@ -327,11 +323,6 @@
|
||||
<artifactId>json-smart</artifactId>
|
||||
<version>2.4.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dumptruckman.minecraft</groupId>
|
||||
<artifactId>buscript</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
|
@ -17,7 +17,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import buscript.Buscript;
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.anchor.AnchorManager;
|
||||
import com.onarandombox.MultiverseCore.api.BlockSafety;
|
||||
@ -85,7 +84,6 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
// Setup various managers
|
||||
private final AnchorManager anchorManager = new AnchorManager(this);
|
||||
private BlockSafety blockSafety = new SimpleBlockSafety(this);
|
||||
private Buscript buscript;
|
||||
private MVCommandManager commandManager;
|
||||
private DestinationsProvider destinationsProvider;
|
||||
private MVEconomist economist;
|
||||
@ -168,7 +166,6 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
this.registerCommands();
|
||||
this.registerDestinations();
|
||||
this.setupMetrics();
|
||||
this.initializeBuscript();
|
||||
this.saveMVConfig();
|
||||
this.logEnableMessage();
|
||||
}
|
||||
@ -238,25 +235,6 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the buscript javascript library.
|
||||
*/
|
||||
private void initializeBuscript() {
|
||||
if (!this.getMVConfig().getEnableBuscript()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
buscript = new Buscript(this);
|
||||
// Add global variable "multiverse" to javascript environment
|
||||
buscript.setScriptVariable("multiverse", this);
|
||||
} catch (NullPointerException e) {
|
||||
Logging.warning("Buscript failed to load! The script command will be disabled! " +
|
||||
"If you would like not to see this message, " +
|
||||
"use `/mv conf enablebuscript false` to disable Buscript from loading.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the enable message.
|
||||
*/
|
||||
@ -517,14 +495,6 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Buscript getScriptAPI() {
|
||||
return buscript;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -55,8 +55,6 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
@Property
|
||||
private volatile boolean displaypermerrors;
|
||||
@Property
|
||||
private volatile boolean enablebuscript;
|
||||
@Property
|
||||
private volatile int globaldebug;
|
||||
@Property
|
||||
private volatile boolean silentstart;
|
||||
@ -99,7 +97,6 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
teleportintercept = true;
|
||||
firstspawnoverride = true;
|
||||
displaypermerrors = true;
|
||||
enablebuscript = true;
|
||||
globaldebug = 0;
|
||||
messagecooldown = 5000;
|
||||
teleportcooldown = 1000;
|
||||
@ -214,22 +211,6 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
return this.displaypermerrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnableBuscript() {
|
||||
return this.enablebuscript;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setEnableBuscript(boolean enableBuscript) {
|
||||
this.enablebuscript = enableBuscript;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -86,18 +86,6 @@ public interface MVConfig extends ConfigurationSerializable {
|
||||
*/
|
||||
boolean getDisplayPermErrors();
|
||||
|
||||
/**
|
||||
* Sets enableBuscript.
|
||||
* @param enableBuscript The new value.
|
||||
*/
|
||||
void setEnableBuscript(boolean enableBuscript);
|
||||
|
||||
/**
|
||||
* Gets enableBuscript.
|
||||
* @return enableBuscript.
|
||||
*/
|
||||
boolean getEnableBuscript();
|
||||
|
||||
/**
|
||||
* Sets firstSpawnOverride.
|
||||
* @param firstSpawnOverride The new value.
|
||||
|
@ -7,16 +7,15 @@
|
||||
|
||||
package com.onarandombox.MultiverseCore.api;
|
||||
|
||||
import buscript.Buscript;
|
||||
import com.onarandombox.MultiverseCore.anchor.AnchorManager;
|
||||
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
|
||||
import com.onarandombox.MultiverseCore.destination.DestinationsProvider;
|
||||
import com.onarandombox.MultiverseCore.anchor.AnchorManager;
|
||||
import com.onarandombox.MultiverseCore.economy.MVEconomist;
|
||||
import com.onarandombox.MultiverseCore.utils.MVPermissions;
|
||||
import com.onarandombox.MultiverseCore.utils.MVPlayerSession;
|
||||
import com.onarandombox.MultiverseCore.teleportation.SimpleBlockSafety;
|
||||
import com.onarandombox.MultiverseCore.teleportation.SimpleLocationManipulation;
|
||||
import com.onarandombox.MultiverseCore.teleportation.SimpleSafeTTeleporter;
|
||||
import com.onarandombox.MultiverseCore.utils.MVPermissions;
|
||||
import com.onarandombox.MultiverseCore.utils.MVPlayerSession;
|
||||
import com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -187,11 +186,4 @@ public interface MVCore extends MVPlugin {
|
||||
* @return The configuration.
|
||||
*/
|
||||
MVConfig getMVConfig();
|
||||
|
||||
/**
|
||||
* Gets the buscript object for Multiverse. This is what handles Javascript processing.
|
||||
*
|
||||
* @return The Multiverse buscript object.
|
||||
*/
|
||||
Buscript getScriptAPI();
|
||||
}
|
||||
|
@ -7,7 +7,14 @@
|
||||
|
||||
package com.onarandombox.MultiverseCore.utils;
|
||||
|
||||
import buscript.Buscript;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorld;
|
||||
import com.onarandombox.MultiverseCore.listeners.MVEntityListener;
|
||||
@ -32,14 +39,6 @@ import org.mockito.internal.util.reflection.ReflectionMemberAccessor;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Mockito.anyBoolean;
|
||||
@ -203,20 +202,6 @@ public class TestInstanceCreator {
|
||||
serverfield.setAccessible(true);
|
||||
serverfield.set(core, mockServer);
|
||||
|
||||
// Set buscript
|
||||
Buscript buscript;
|
||||
Field buscriptfield = MultiverseCore.class.getDeclaredField("buscript");
|
||||
buscriptfield.setAccessible(true);
|
||||
|
||||
try {
|
||||
buscript = spy(new Buscript(core));
|
||||
when(buscript.getPlugin()).thenReturn(core);
|
||||
} catch (NullPointerException e) {
|
||||
buscript = null;
|
||||
}
|
||||
|
||||
buscriptfield.set(core, buscript);
|
||||
|
||||
// Set worldManager
|
||||
SimpleMVWorldManager wm = spy(new SimpleMVWorldManager(core));
|
||||
Field worldmanagerfield = MultiverseCore.class.getDeclaredField("worldManager");
|
||||
|
Loading…
Reference in New Issue
Block a user