mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
parent
7d340b58b4
commit
911bef974a
@ -215,7 +215,13 @@ public class BukkitPlayer extends PlotPlayer {
|
|||||||
public void kick(final String message) {
|
public void kick(final String message) {
|
||||||
player.kickPlayer(message);
|
player.kickPlayer(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void stopSpectating() {
|
||||||
|
if (getGamemode() == PlotGamemode.SPECTATOR) {
|
||||||
|
player.setSpectatorTarget(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBanned() {
|
public boolean isBanned() {
|
||||||
return player.isBanned();
|
return player.isBanned();
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
package com.intellectualcrafters.plot.commands;
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.object.Location;
|
import com.intellectualcrafters.plot.object.Location;
|
||||||
@ -30,11 +28,14 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
|||||||
import com.intellectualcrafters.plot.util.EventUtil;
|
import com.intellectualcrafters.plot.util.EventUtil;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
|
import com.intellectualcrafters.plot.util.PlotGamemode;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.intellectualcrafters.plot.util.WorldUtil;
|
import com.intellectualcrafters.plot.util.WorldUtil;
|
||||||
import com.plotsquared.general.commands.Argument;
|
import com.plotsquared.general.commands.Argument;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandDeclaration(command = "deny", aliases = { "d", "ban" }, description = "Deny a user from a plot", usage = "/plot deny <player>", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE)
|
@CommandDeclaration(command = "deny", aliases = { "d", "ban" }, description = "Deny a user from a plot", usage = "/plot deny <player>", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE)
|
||||||
public class Deny extends SubCommand {
|
public class Deny extends SubCommand {
|
||||||
|
|
||||||
@ -102,6 +103,9 @@ public class Deny extends SubCommand {
|
|||||||
if (pp.hasPermission("plots.admin.entry.denied")) {
|
if (pp.hasPermission("plots.admin.entry.denied")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (pp.getGamemode() == PlotGamemode.SPECTATOR) {
|
||||||
|
pp.stopSpectating();
|
||||||
|
}
|
||||||
pp.teleport(WorldUtil.IMP.getSpawn(pp.getLocation().getWorld()));
|
pp.teleport(WorldUtil.IMP.getSpawn(pp.getLocation().getWorld()));
|
||||||
MainUtil.sendMessage(pp, C.YOU_GOT_DENIED);
|
MainUtil.sendMessage(pp, C.YOU_GOT_DENIED);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package com.intellectualcrafters.plot.object;
|
package com.intellectualcrafters.plot.object;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.commands.RequiredType;
|
import com.intellectualcrafters.plot.commands.RequiredType;
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.util.PlotGamemode;
|
import com.intellectualcrafters.plot.util.PlotGamemode;
|
||||||
import com.intellectualcrafters.plot.util.PlotWeather;
|
import com.intellectualcrafters.plot.util.PlotWeather;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ConsolePlayer extends PlotPlayer {
|
public class ConsolePlayer extends PlotPlayer {
|
||||||
|
|
||||||
private static ConsolePlayer instance;
|
private static ConsolePlayer instance;
|
||||||
@ -152,7 +152,9 @@ public class ConsolePlayer extends PlotPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void kick(final String message) {}
|
public void kick(final String message) {}
|
||||||
|
|
||||||
|
@Override public void stopSpectating() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBanned() {
|
public boolean isBanned() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -460,4 +460,6 @@ public abstract class PlotPlayer implements CommandCaller {
|
|||||||
public boolean hasPersistentMeta(String key) {
|
public boolean hasPersistentMeta(String key) {
|
||||||
return metaMap.containsKey(key);
|
return metaMap.containsKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract void stopSpectating();
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,6 @@ public class SpongePlayer extends PlotPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +249,11 @@ public class SpongePlayer extends PlotPlayer {
|
|||||||
public void kick(final String message) {
|
public void kick(final String message) {
|
||||||
player.kick(SpongeUtil.getText(message));
|
player.kick(SpongeUtil.getText(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void stopSpectating() {
|
||||||
|
//Not Implemented
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBanned() {
|
public boolean isBanned() {
|
||||||
BanService service = Sponge.getServiceManager().provide(BanService.class).get();
|
BanService service = Sponge.getServiceManager().provide(BanService.class).get();
|
||||||
|
Loading…
Reference in New Issue
Block a user