Compare commits

..
Author SHA1 Message Date
benwoo1110 3072699aca Fix wildcard imports. 2021-02-09 15:15:23 +08:00
benwoo1110 d33176add5 Update to latest 1.16.5-R0.1-SNAPSHOT dependency.
This will break support for 1.14 and below.

* Add minidev json dependency.
* Remove use of travel agent.
2021-02-08 17:37:14 +08:00
benwoo1110 2c98fc7d90 Merge branch 'main' into 5.0.0 2021-02-08 17:08:06 +08:00
nicegamer7 89fd700e32 Merge pull request #2489 from benwoo1110/world-UID
Adds world UID and generator details to /mvinfo command
2021-01-17 12:36:27 -05:00
benwoo1110 035f3644ad Merge branch 'main' into 5.0.0 2021-01-08 18:19:29 +08:00
Ben Woo 001a6000f8 Merge pull request #2515 from Multiverse/update_bstats
Update bStats Metrics Class
2020-12-20 12:10:52 +08:00
Kermina Awad bf61069fed update bStats Metrics class 2020-12-19 22:17:04 -05:00
Jeremy Wood f41337f8a8 Bumped version to 5.0.0-SNAPSHOT for development of next major version. 2020-10-08 02:24:07 -04:00
benwoo1110 ed77cacb1a Adds generator detail to /mvinfo command 2020-10-07 21:00:40 +08:00
benwoo1110 cfae997de4 Adds world UID to /mvinfo command 2020-10-07 00:39:08 +08:00
32 changed files with 65 additions and 207 deletions

No files matched your search

+12 -10
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>4.2.3-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
<name>Multiverse-Core</name>
<description>World Management Plugin</description>
<properties>
@@ -22,10 +22,6 @@
<id>onarandombox</id>
<url>http://repo.onarandombox.com/content/groups/public</url>
</repository>
<repository>
<id>spigot</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
@@ -279,10 +275,10 @@
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- SerializationConfig Dependency -->
<dependency>
@@ -311,6 +307,12 @@
<artifactId>CommandHandler</artifactId>
<version>11</version>
</dependency>
<!-- End of CommandHandler Dependency -->
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.dumptruckman.minecraft</groupId>
<artifactId>buscript</artifactId>
@@ -319,7 +321,7 @@
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.7</version>
<version>1.8</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
@@ -20,6 +20,7 @@ import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
import me.main__.util.SerializationConfig.ChangeDeniedException;
import me.main__.util.SerializationConfig.NoSuchPropertyException;
import me.main__.util.SerializationConfig.VirtualProperty;
import net.minidev.json.JSONObject;
import org.bukkit.ChatColor;
import org.bukkit.Difficulty;
import org.bukkit.GameMode;
@@ -28,20 +29,17 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.WorldType;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.serialization.SerializableAs;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.Nullable;
import org.json.simple.JSONObject;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.logging.Level;
/**
* The implementation of a Multiverse handled world.
@@ -128,9 +128,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
private static final int PROTOCOL = 24;
// TODO: Investigate if this one is really needed to be static.
// Doubt it. -- FernFerret
private static final Map<String, String> teleportQueue = new HashMap<String, String>();
private static Map<String, String> teleportQueue = new HashMap<String, String>();
private final AnchorManager anchorManager = new AnchorManager(this);
private AnchorManager anchorManager = new AnchorManager(this);
// TODO please let's make this non-static
private volatile MultiverseCoreConfiguration config;
@@ -20,7 +20,7 @@ import com.onarandombox.MultiverseCore.api.MVWorldManager;
* Creates a clone of a world.
*/
public class CloneCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public CloneCommand(MultiverseCore plugin) {
super(plugin);
@@ -19,7 +19,6 @@ import java.util.Map;
* Allows you to set Global MV Variables.
*/
public class ConfigCommand extends MultiverseCommand {
public ConfigCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Configuration");
@@ -24,7 +24,7 @@ import java.util.List;
* Returns detailed information on the Players where abouts.
*/
public class CoordCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public CoordCommand(MultiverseCore plugin) {
super(plugin);
@@ -26,7 +26,7 @@ import java.util.List;
* Creates a new world and loads it.
*/
public class CreateCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public CreateCommand(MultiverseCore plugin) {
super(plugin);
@@ -30,7 +30,7 @@ import java.util.List;
* Returns detailed information about a world.
*/
public class InfoCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public InfoCommand(MultiverseCore plugin) {
super(plugin);
@@ -115,6 +115,7 @@ public class InfoCommand extends MultiverseCommand {
FancyColorScheme colors = new FancyColorScheme(ChatColor.AQUA, ChatColor.AQUA, ChatColor.GOLD, ChatColor.WHITE);
message.add(new FancyHeader("General Info", colors));
message.add(new FancyMessage("World Name: ", world.getName(), colors));
message.add(new FancyMessage("World UID: ", world.getCBWorld().getUID().toString(), colors));
message.add(new FancyMessage("World Alias: ", world.getColoredWorldString(), colors));
message.add(new FancyMessage("Game Mode: ", world.getGameMode().toString(), colors));
message.add(new FancyMessage("Difficulty: ", world.getDifficulty().toString(), colors));
@@ -151,6 +152,7 @@ public class InfoCommand extends MultiverseCommand {
message = new ArrayList<FancyText>();
message.add(new FancyHeader("More World Settings", colors));
message.add(new FancyMessage("World Type: ", world.getWorldType().toString(), colors));
message.add(new FancyMessage("Generator: ", world.getGenerator(), colors));
message.add(new FancyMessage("Structures: ", world.getCBWorld().canGenerateStructures() + "", colors));
message.add(new FancyMessage("Weather: ", world.isWeatherEnabled() + "", colors));
message.add(new FancyMessage("Players will get hungry: ", world.getHunger() + "", colors));
@@ -25,7 +25,7 @@ import java.util.List;
* Used to modify various aspects of worlds.
*/
public class ModifyAddCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public ModifyAddCommand(MultiverseCore plugin) {
super(plugin);
@@ -22,7 +22,7 @@ import java.util.List;
* Removes all values from a world-property.
*/
public class ModifyClearCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public ModifyClearCommand(MultiverseCore plugin) {
super(plugin);
@@ -22,7 +22,7 @@ import java.util.List;
* Removes values from a world-property.
*/
public class ModifyRemoveCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public ModifyRemoveCommand(MultiverseCore plugin) {
super(plugin);
@@ -23,7 +23,7 @@ import java.util.List;
* Used to set world-properties.
*/
public class ModifySetCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public ModifySetCommand(MultiverseCore plugin) {
super(plugin);
@@ -24,7 +24,7 @@ import java.util.List;
* Removes a type of mob from a world.
*/
public class PurgeCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public PurgeCommand(MultiverseCore plugin) {
super(plugin);
@@ -34,7 +34,7 @@ import java.util.logging.Level;
* Used to teleport players.
*/
public class TeleportCommand extends MultiverseCommand {
private final SafeTTeleporter playerTeleporter;
private SafeTTeleporter playerTeleporter;
public TeleportCommand(MultiverseCore plugin) {
super(plugin);
@@ -23,7 +23,8 @@ import java.util.List;
* States who is in what world.
*/
public class WhoCommand extends MultiverseCommand {
private final MVWorldManager worldManager;
private MVWorldManager worldManager;
public WhoCommand(MultiverseCore plugin) {
super(plugin);
@@ -16,7 +16,7 @@ import java.util.List;
* Called when the Multiverse-config should be reloaded.
*/
public class MVConfigReloadEvent extends Event {
private final List<String> configsLoaded;
private List<String> configsLoaded;
public MVConfigReloadEvent(List<String> configsLoaded) {
this.configsLoaded = configsLoaded;
@@ -17,8 +17,8 @@ import org.bukkit.event.HandlerList;
* This event is thrown when a portal is touched.
*/
public class MVPlayerTouchedPortalEvent extends Event implements Cancellable {
private final Player p;
private final Location l;
private Player p;
private Location l;
private boolean isCancelled;
private boolean canUse = true;
@@ -16,9 +16,10 @@ import org.bukkit.event.HandlerList;
* Called when a player is respawning.
*/
public class MVRespawnEvent extends Event {
private final Player player;
private final String respawnMethod;
private Player player;
private Location location;
private String respawnMethod;
public MVRespawnEvent(Location spawningAt, Player p, String respawnMethod) {
this.player = p;
@@ -21,10 +21,10 @@ import org.bukkit.event.HandlerList;
* Event that gets called when a player use the /mvtp command.
*/
public class MVTeleportEvent extends Event implements Cancellable {
private final Player teleportee;
private final CommandSender teleporter;
private final MVDestination dest;
private final boolean useSafeTeleport;
private Player teleportee;
private CommandSender teleporter;
private MVDestination dest;
private boolean useSafeTeleport;
private boolean isCancelled;
public MVTeleportEvent(MVDestination dest, Player teleportee, CommandSender teleporter, boolean safeTeleport) {
@@ -24,11 +24,11 @@ import org.bukkit.event.HandlerList;
* @param <T> The type of the property that was set.
*/
public class MVWorldPropertyChangeEvent<T> extends Event implements Cancellable {
private final MultiverseWorld world;
private final CommandSender changer;
private final String name;
private T value;
private MultiverseWorld world;
private CommandSender changer;
private boolean isCancelled = false;
private String name;
private T value;
public MVWorldPropertyChangeEvent(MultiverseWorld world, CommandSender changer, String name, T value) {
this.world = world;
@@ -28,8 +28,8 @@ import java.util.logging.Level;
* Multiverse's Entity {@link Listener}.
*/
public class MVEntityListener implements Listener {
private final MultiverseCore plugin;
private final MVWorldManager worldManager;
private MultiverseCore plugin;
private MVWorldManager worldManager;
public MVEntityListener(MultiverseCore plugin) {
this.plugin = plugin;
@@ -305,15 +305,7 @@ public class MVPlayerListener implements Listener {
+ "' because enforceaccess is off.");
}
if (!plugin.getMVConfig().isUsingDefaultPortalSearch()) {
try {
Class.forName("org.bukkit.TravelAgent");
if (event.getPortalTravelAgent() != null) {
event.getPortalTravelAgent().setSearchRadius(plugin.getMVConfig().getPortalSearchRadius());
}
} catch (ClassNotFoundException ignore) {
Logging.fine("TravelAgent not available for PlayerPortalEvent for " + event.getPlayer().getName());
}
event.setSearchRadius(this.plugin.getMVConfig().getPortalSearchRadius());
}
}
@@ -26,7 +26,7 @@ import java.util.logging.Level;
*/
public class MVPortalListener implements Listener {
private final MultiverseCore plugin;
private MultiverseCore plugin;
public MVPortalListener(MultiverseCore core) {
this.plugin = core;
@@ -18,7 +18,7 @@ import org.bukkit.event.weather.WeatherChangeEvent;
* Multiverse's Weather {@link Listener}.
*/
public class MVWeatherListener implements Listener {
private final MultiverseCore plugin;
private MultiverseCore plugin;
public MVWeatherListener(MultiverseCore plugin) {
this.plugin = plugin;
@@ -14,7 +14,7 @@ import org.bukkit.event.world.WorldInitEvent;
public class MVWorldInitListener implements Listener {
private final MultiverseCore plugin;
MultiverseCore plugin;
public MVWorldInitListener(MultiverseCore plugin) {
this.plugin = plugin;
@@ -20,8 +20,8 @@ import org.bukkit.event.world.WorldUnloadEvent;
* Multiverse's World {@link Listener}.
*/
public class MVWorldListener implements Listener {
private final MultiverseCore plugin;
private final MVWorldManager worldManager;
private MultiverseCore plugin;
private MVWorldManager worldManager;
public MVWorldListener(MultiverseCore plugin) {
this.plugin = plugin;
@@ -1,111 +0,0 @@
package com.onarandombox.MultiverseCore.utils;
import java.util.logging.Level;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
import com.onarandombox.MultiverseCore.destination.CannonDestination;
import org.bukkit.Location;
import org.bukkit.TravelAgent;
import org.bukkit.event.player.PlayerPortalEvent;
public class BukkitTravelAgent implements TravelAgent {
private final MVTravelAgent agent;
public BukkitTravelAgent(MVTravelAgent agent) {
this.agent = agent;
}
/**
* {@inheritDoc}
*/
@Override
public BukkitTravelAgent setSearchRadius(int radius) {
return this;
}
/**
* {@inheritDoc}
*/
@Override
public int getSearchRadius() {
return 0;
}
/**
* {@inheritDoc}
*/
@Override
public BukkitTravelAgent setCreationRadius(int radius) {
return this;
}
/**
* {@inheritDoc}
*/
@Override
public int getCreationRadius() {
return 0;
}
/**
* {@inheritDoc}
*/
@Override
public boolean getCanCreatePortal() {
return false;
}
/**
* {@inheritDoc}
*/
@Override
public void setCanCreatePortal(boolean create) {
}
/**
* {@inheritDoc}
*/
@Override
public Location findOrCreate(Location location) {
return this.getSafeLocation();
}
/**
* {@inheritDoc}
*/
@Override
public Location findPortal(Location location) {
return this.getSafeLocation();
}
/**
* {@inheritDoc}
*/
@Override
public boolean createPortal(Location location) {
return false;
}
private Location getSafeLocation() {
// At this time, these can never use the velocity.
if (agent.destination instanceof CannonDestination) {
Logging.fine("Using Stock TP method. This cannon will have 0 velocity");
}
SafeTTeleporter teleporter = agent.core.getSafeTTeleporter();
Location newLoc = agent.destination.getLocation(agent.player);
if (agent.destination.useSafeTeleporter()) {
newLoc = teleporter.getSafeLocation(agent.player, agent.destination);
}
if (newLoc == null) {
return agent.player.getLocation();
}
return newLoc;
}
public void setPortalEventTravelAgent(PlayerPortalEvent event) {
event.setPortalTravelAgent(this);
event.useTravelAgent(true);
}
}
@@ -1,27 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.utils;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.entity.Player;
/**
* The Multiverse TravelAgent.
*/
public class MVTravelAgent {
protected MVDestination destination;
protected MultiverseCore core;
protected Player player;
public MVTravelAgent(MultiverseCore multiverseCore, MVDestination d, Player p) {
this.destination = d;
this.core = multiverseCore;
this.player = p;
}
}
@@ -1,8 +1,8 @@
package com.onarandombox.MultiverseCore.utils.webpaste;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import java.io.IOException;
import java.util.Map;
@@ -1,8 +1,8 @@
package com.onarandombox.MultiverseCore.utils.webpaste;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import java.io.IOException;
import java.util.HashMap;
@@ -1,8 +1,9 @@
package com.onarandombox.MultiverseCore.utils.webpaste;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import java.io.IOException;
import java.util.Map;
@@ -1,9 +1,9 @@
package com.onarandombox.MultiverseCore.utils.webpaste;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import java.io.IOException;
import java.util.HashMap;