From d33176add59618e44a9a56d3a782226c308bc738 Mon Sep 17 00:00:00 2001
From: benwoo1110 <30431861+benwoo1110@users.noreply.github.com>
Date: Mon, 8 Feb 2021 17:37:14 +0800
Subject: [PATCH] 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.
---
pom.xml | 18 +--
.../onarandombox/MultiverseCore/MVWorld.java | 12 +-
.../listeners/MVPlayerListener.java | 10 +-
.../utils/BukkitTravelAgent.java | 111 ------------------
.../MultiverseCore/utils/MVTravelAgent.java | 27 -----
.../utils/webpaste/BitlyURLShortener.java | 6 +-
.../utils/webpaste/GitHubPasteService.java | 6 +-
.../utils/webpaste/HastebinPasteService.java | 7 +-
.../utils/webpaste/PasteGGPasteService.java | 8 +-
9 files changed, 27 insertions(+), 178 deletions(-)
delete mode 100644 src/main/java/com/onarandombox/MultiverseCore/utils/BukkitTravelAgent.java
delete mode 100644 src/main/java/com/onarandombox/MultiverseCore/utils/MVTravelAgent.java
diff --git a/pom.xml b/pom.xml
index df3a80ab..821761b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,10 +22,6 @@
onarandombox
http://repo.onarandombox.com/content/groups/public
-
- spigot
- https://hub.spigotmc.org/nexus/content/groups/public/
-
vault-repo
http://nexus.hc.to/content/repositories/pub_releases
@@ -279,10 +275,10 @@
- org.bukkit
- bukkit
- 1.13.2-R0.1-SNAPSHOT
- provided
+ org.spigotmc
+ spigot-api
+ 1.16.5-R0.1-SNAPSHOT
+ provided
@@ -311,6 +307,12 @@
CommandHandler
11
+
+
+ net.minidev
+ json-smart
+ 2.3
+
com.dumptruckman.minecraft
buscript
diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
index d7367ad2..bbda6310 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
@@ -20,28 +20,20 @@ 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 org.bukkit.ChatColor;
-import org.bukkit.Difficulty;
-import org.bukkit.GameMode;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.World;
+import net.minidev.json.JSONObject;
+import org.bukkit.*;
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.
diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
index 853ed55d..334d7a78 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java
@@ -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());
}
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/BukkitTravelAgent.java b/src/main/java/com/onarandombox/MultiverseCore/utils/BukkitTravelAgent.java
deleted file mode 100644
index e2f658fa..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/BukkitTravelAgent.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVTravelAgent.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVTravelAgent.java
deleted file mode 100644
index a86def8a..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVTravelAgent.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java
index aa7d29d7..7606cd18 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java
@@ -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;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java
index bee098df..e9680183 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java
@@ -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;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/HastebinPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/HastebinPasteService.java
index e1fa7272..aa53fc57 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/HastebinPasteService.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/HastebinPasteService.java
@@ -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;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java
index 956d71c1..6c7c08e9 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java
@@ -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;