mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 12:35:39 +01:00
Fix breakages with SignPortals
This commit is contained in:
parent
cc3889b166
commit
e31f2c79ac
4
pom.xml
4
pom.xml
@ -17,10 +17,6 @@
|
||||
<id>OnARandomBox</id>
|
||||
<url>http://repo.onarandombox.com/artifactory/repo</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>GetSpout</id>
|
||||
<url>http://repo.getspout.org/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
|
@ -0,0 +1,17 @@
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Dummy class to make old MV Plugins not explode.
|
||||
* If this loads, the user WILL get a severe telling them to update said plugin!
|
||||
* WILL BE DELETED ON 11/1/11
|
||||
*/
|
||||
@Deprecated
|
||||
public interface LoggablePlugin {
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
/**
|
||||
* Dummy class to make old MV Plugins not explode.
|
||||
* If this loads, the user WILL get a severe telling them to update said plugin!
|
||||
* WILL BE DELETED ON 11/1/11
|
||||
*/
|
||||
@Deprecated
|
||||
public class MVPermissions {
|
||||
public Permission addPermission(String string, PermissionDefault def) {
|
||||
return new Permission("update.all.multiverse.plugins");
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@ package com.onarandombox.MultiverseCore;
|
||||
/**
|
||||
* Dummy class to make old MV Plugins not explode.
|
||||
* If this loads, the user WILL get a severe telling them to update said plugin!
|
||||
* WILL BE DELETED ON 11/1/11
|
||||
*/
|
||||
@Deprecated
|
||||
public interface MVPlugin {
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ public class MVWorld implements MultiverseWorld {
|
||||
}
|
||||
|
||||
public boolean isExempt(Player p) {
|
||||
return (this.plugin.getPermissions().hasPermission(p, this.exempt.getName(), true));
|
||||
return (this.plugin.getMVPerms().hasPermission(p, this.exempt.getName(), true));
|
||||
}
|
||||
|
||||
public Permission getExempt() {
|
||||
|
@ -20,6 +20,9 @@ import com.onarandombox.MultiverseCore.listeners.MVPlayerListener;
|
||||
import com.onarandombox.MultiverseCore.listeners.MVPluginListener;
|
||||
import com.onarandombox.MultiverseCore.listeners.MVWeatherListener;
|
||||
import com.onarandombox.MultiverseCore.utils.*;
|
||||
import com.onarandombox.MultiverseCore.utils.DebugLog;
|
||||
import com.onarandombox.MultiverseCore.utils.MVPermissions;
|
||||
import com.onarandombox.utils.*;
|
||||
import com.pneumaticraft.commandhandler.CommandHandler;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -43,6 +46,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public class MultiverseCore extends JavaPlugin implements MVPlugin {
|
||||
|
||||
public static boolean outdatedPluginFound = false;
|
||||
private static int Protocol = 1;
|
||||
|
||||
@Override
|
||||
@ -383,10 +387,14 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin {
|
||||
*
|
||||
* @return A valid {@link MVPermissions}.
|
||||
*/
|
||||
public MVPermissions getPermissions() {
|
||||
public MVPermissions getMVPerms() {
|
||||
return this.ph;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public com.onarandombox.MultiverseCore.MVPermissions getPermissions() {
|
||||
return new com.onarandombox.MultiverseCore.MVPermissions();
|
||||
}
|
||||
@Deprecated
|
||||
public PurgeWorlds getWorldPurger() {
|
||||
return this.worldManager.getWorldPurger();
|
||||
|
@ -40,7 +40,7 @@ public class ListCommand extends MultiverseCommand {
|
||||
String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n";
|
||||
for (MVWorld world : this.plugin.getWorldManager().getMVWorlds()) {
|
||||
|
||||
if (p != null && (!this.plugin.getPermissions().canEnterWorld(p, world))) {
|
||||
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class SpawnCommand extends MultiverseCommand {
|
||||
}
|
||||
// If a persons name was passed in, you must be A. the console, or B have permissions
|
||||
if (args.size() == 1) {
|
||||
if (player != null && !this.plugin.getPermissions().hasPermission(player, "multiverse.core.spawn.other", true)) {
|
||||
if (player != null && !this.plugin.getMVPerms().hasPermission(player, "multiverse.core.spawn.other", true)) {
|
||||
sender.sendMessage("You don't have permission to teleport another player to spawn. (multiverse.core.spawn.other)");
|
||||
return;
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class SpawnCommand extends MultiverseCommand {
|
||||
sender.sendMessage(args.get(0) + " is not logged on right now!");
|
||||
}
|
||||
} else {
|
||||
if (player != null && !this.plugin.getPermissions().hasPermission(player, "multiverse.core.spawn.self", true)) {
|
||||
if (player != null && !this.plugin.getMVPerms().hasPermission(player, "multiverse.core.spawn.self", true)) {
|
||||
sender.sendMessage("You don't have permission to teleport yourself to spawn. (multiverse.core.spawn.self)");
|
||||
return;
|
||||
}
|
||||
|
@ -101,14 +101,14 @@ public class TeleportCommand extends MultiverseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (teleporter != null && !this.plugin.getPermissions().canEnterDestination(teleporter, d)) {
|
||||
if (teleporter != null && !this.plugin.getMVPerms().canEnterDestination(teleporter, d)) {
|
||||
if (teleportee.equals(teleporter)) {
|
||||
teleporter.sendMessage("Doesn't look like you're allowed to go " + ChatColor.RED + "there...");
|
||||
} else {
|
||||
teleporter.sendMessage("Doesn't look like you're allowed to send " + ChatColor.GOLD + teleportee.getName() + ChatColor.WHITE + " to " + ChatColor.RED + "there...");
|
||||
}
|
||||
return;
|
||||
} else if (teleporter != null && !this.plugin.getPermissions().canTravelFromLocation(teleporter, d.getLocation(teleportee))) {
|
||||
} else if (teleporter != null && !this.plugin.getMVPerms().canTravelFromLocation(teleporter, d.getLocation(teleportee))) {
|
||||
if (teleportee.equals(teleporter)) {
|
||||
teleporter.sendMessage("DOH! Doesn't look like you can get to " + ChatColor.RED + "THERE from " + ChatColor.GREEN + ((Player) teleporter).getWorld().getName());
|
||||
} else {
|
||||
@ -124,13 +124,13 @@ public class TeleportCommand extends MultiverseCommand {
|
||||
World w = d.getLocation(teleportee).getWorld();
|
||||
if (teleportee.getWorld().equals(w)) {
|
||||
if (teleporter.equals(teleportee)) {
|
||||
if (!this.plugin.getPermissions().hasPermission(teleporter, "multiverse.core.spawn.self", true)) {
|
||||
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.core.spawn.self", true)) {
|
||||
teleporter.sendMessage("Sorry you don't have permission to go to the world spawn!");
|
||||
teleporter.sendMessage(ChatColor.RED + " (multiverse.core.spawn.self)");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!this.plugin.getPermissions().hasPermission(teleporter, "multiverse.core.spawn.other", true)) {
|
||||
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.core.spawn.other", true)) {
|
||||
teleporter.sendMessage("Sorry you don't have permission to send " + teleportee.getDisplayName() + "to the world spawn!");
|
||||
teleporter.sendMessage(ChatColor.RED + " (multiverse.core.spawn.other)");
|
||||
return;
|
||||
@ -162,12 +162,12 @@ public class TeleportCommand extends MultiverseCommand {
|
||||
private boolean checkSendPermissions(CommandSender teleporter, Player teleportee, MVDestination destination) {
|
||||
MVMessaging message = this.plugin.getMessaging();
|
||||
if (teleporter.equals(teleportee)) {
|
||||
if (!this.plugin.getPermissions().hasPermission(teleporter, "multiverse.teleport.self." + destination.getIdentifier(), true)) {
|
||||
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.self." + destination.getIdentifier(), true)) {
|
||||
message.sendMessages(teleporter, new String[]{"You don't have permission to teleport yourself to a " + ChatColor.GREEN + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.self." + destination.getIdentifier() + ")"});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!this.plugin.getPermissions().hasPermission(teleporter, "multiverse.teleport.other." + destination.getIdentifier(), true)) {
|
||||
if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.other." + destination.getIdentifier(), true)) {
|
||||
message.sendMessages(teleporter, new String[]{"You don't have permission to teleport another player to a " + ChatColor.GREEN + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.other." + destination.getIdentifier() + ")"});
|
||||
return false;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class VersionCommand extends MultiverseCommand {
|
||||
logAndAddToPasteBinBuffer("Loaded Worlds: " + this.plugin.getWorldManager().getMVWorlds().size());
|
||||
logAndAddToPasteBinBuffer("Multiverse Plugins Loaded: " + this.plugin.getPluginCount());
|
||||
logAndAddToPasteBinBuffer("Economy being used: " + this.plugin.getBank().getEconUsed());
|
||||
logAndAddToPasteBinBuffer("Permissions Plugin: " + this.plugin.getPermissions().getType());
|
||||
logAndAddToPasteBinBuffer("Permissions Plugin: " + this.plugin.getMVPerms().getType());
|
||||
logAndAddToPasteBinBuffer("Dumping Config Values: (version " + this.plugin.getConfig().getString("version", "NOT SET") + ")");
|
||||
logAndAddToPasteBinBuffer("messagecooldown: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
|
||||
logAndAddToPasteBinBuffer("teleportcooldown: " + this.plugin.getConfig().getString("teleportcooldown", "NOT SET"));
|
||||
|
@ -74,7 +74,7 @@ public class WhoCommand extends MultiverseCommand {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p != null && (!this.plugin.getPermissions().canEnterWorld(p, world))) {
|
||||
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
||||
continue;
|
||||
}
|
||||
List<Player> players = world.getCBWorld().getPlayers();
|
||||
|
@ -98,7 +98,7 @@ public class MVPlayerListener extends PlayerListener {
|
||||
|
||||
@Override
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
if (this.worldManager.getMVWorlds().size() == 0 && this.plugin.getPermissions().hasPermission(event.getPlayer(), "multiverse.core.import", true)) {
|
||||
if (this.worldManager.getMVWorlds().size() == 0 && this.plugin.getMVPerms().hasPermission(event.getPlayer(), "multiverse.core.import", true)) {
|
||||
event.getPlayer().sendMessage("You don't have any worlds imported into Multiverse!");
|
||||
event.getPlayer().sendMessage("You can import your current worlds with " + ChatColor.AQUA + "/mvimport");
|
||||
event.getPlayer().sendMessage("or you can create new ones with " + ChatColor.GOLD + "/mvcreate");
|
||||
@ -158,7 +158,7 @@ public class MVPlayerListener extends PlayerListener {
|
||||
private boolean checkWorldPermissions(MVWorld fromWorld, MVWorld toWorld, Player player) {
|
||||
|
||||
if (toWorld != null) {
|
||||
if (!this.plugin.getPermissions().canEnterWorld(player, toWorld)) {
|
||||
if (!this.plugin.getMVPerms().canEnterWorld(player, toWorld)) {
|
||||
player.sendMessage("You don't have access to go here...");
|
||||
return true;
|
||||
}
|
||||
|
@ -28,6 +28,14 @@ public class MVPluginListener extends ServerListener {
|
||||
/** Keep an eye out for Plugins which we can utilize. */
|
||||
@Override
|
||||
public void onPluginEnable(PluginEnableEvent event) {
|
||||
if(event.getPlugin() instanceof com.onarandombox.MultiverseCore.MVPlugin) {
|
||||
this.plugin.log(Level.SEVERE, "Your version of '" + event.getPlugin() + "' is OUT OF DATE.");
|
||||
this.plugin.log(Level.SEVERE, "Please grab the latest version from:");
|
||||
this.plugin.log(Level.SEVERE, "http://bukkit.onarandombox.com/?dir="+event.getPlugin().getDescription().getName().toLowerCase());
|
||||
this.plugin.log(Level.SEVERE, "I'm going to disable " + event.getPlugin().getDescription().getName() + " now.");
|
||||
this.plugin.getServer().getPluginManager().disablePlugin(event.getPlugin());
|
||||
|
||||
}
|
||||
// Let AllPay handle all econ plugin loadings, only go for econ plugins we support
|
||||
if (Arrays.asList(AllPay.validEconPlugins).contains(event.getPlugin().getDescription().getName())) {
|
||||
this.plugin.setBank(this.plugin.getBanker().loadEconPlugin());
|
||||
|
20
src/main/java/com/onarandombox/utils/DebugLog.java
Normal file
20
src/main/java/com/onarandombox/utils/DebugLog.java
Normal file
@ -0,0 +1,20 @@
|
||||
/******************************************************************************
|
||||
* 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.utils;
|
||||
|
||||
/**
|
||||
* Dummy class to make old MV Plugins not explode.
|
||||
* If this loads, the user WILL get a severe telling them to update said plugin!
|
||||
* WILL BE DELETED ON 11/1/11
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
public class DebugLog {
|
||||
public DebugLog(String dummy, String dummy2) {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user