mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-06 01:22:32 -05:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27c84ceaac | ||
|
|
d67ccd03ca | ||
|
|
5e2f4bcbb2 | ||
|
|
1331743ecf | ||
|
|
2b8d5a09a2 | ||
|
|
ed06b29dd7 | ||
|
|
ca9364d25b | ||
|
|
7fc6d73241 | ||
|
|
036bbbb462 | ||
|
|
c3a8a51ecd | ||
|
|
96b0f27c51 | ||
|
|
4051a377c3 | ||
|
|
fc13bc5d34 | ||
|
|
752600e518 | ||
|
|
4754b9fcca | ||
|
|
ce0164583c |
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
.DS_Store
|
||||
/BuildAll/nbproject/private/
|
||||
/EssentialsProtect/nbproject/private/
|
||||
/EssentialsChat/nbproject/private/
|
||||
/EssentialsGroupBridge/nbproject/private/
|
||||
/EssentialsGeoIP/nbproject/private/
|
||||
/EssentialsSpawn/nbproject/private/
|
||||
/EssentialsXMPP/nbproject/private/
|
||||
/EssentialsGroupManager/nbproject/private/
|
||||
/BuildAll/build/
|
||||
/EssentialsGroupBridge/dist/
|
||||
/EssentialsGroupBridge/build/
|
||||
/EssentialsGeoIP/dist/
|
||||
/EssentialsGeoIP/build/
|
||||
/EssentialsGroupManager/build/
|
||||
/EssentialsGroupManager/dist/
|
||||
/BuildAll/dist/
|
||||
/EssentialsChat/build/
|
||||
/EssentialsChat/dist/
|
||||
/EssentialsSpawn/build/
|
||||
/EssentialsSpawn/dist/
|
||||
/EssentialsXMPP/dist/
|
||||
/EssentialsXMPP/build/
|
||||
/EssentialsProtect/dist/
|
||||
/EssentialsProtect/build/
|
||||
@@ -43,7 +43,7 @@ import org.bukkit.plugin.java.*;
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final String AUTHORS = "Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology";
|
||||
public static final int minBukkitBuildVersion = 818;
|
||||
public static final int minBukkitBuildVersion = 860;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
private Settings settings;
|
||||
private EssentialsPlayerListener playerListener;
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.earth2me.essentials;
|
||||
import java.util.List;
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.World;
|
||||
@@ -18,6 +20,8 @@ import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.PoweredMinecart;
|
||||
import org.bukkit.entity.StorageMinecart;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@@ -322,5 +326,70 @@ public class FakeWorld implements World
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean createExplosion(double d, double d1, double d2, float f)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean createExplosion(Location lctn, float f)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public ChunkGenerator getGenerator()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public List<BlockPopulator> getPopulators()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void playEffect(Location lctn, Effect effect, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void playEffect(Location lctn, Effect effect, int i, int i1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean createExplosion(double d, double d1, double d2, float f, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean createExplosion(Location lctn, float f, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public <T extends Entity> T spawn(Location lctn, Class<T> type) throws IllegalArgumentException
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public ChunkSnapshot getEmptyChunkSnapshot(int i, int i1, boolean bln, boolean bln1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setSpawnFlags(boolean bln, boolean bln1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean getAllowAnimals()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean getAllowMonsters()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,9 +3,13 @@ package com.earth2me.essentials;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Achievement;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Instrument;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Note;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.World;
|
||||
@@ -27,6 +31,7 @@ public class OfflinePlayer implements Player
|
||||
private final String name;
|
||||
private Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private World world = null;
|
||||
private UUID uniqueId = UUID.randomUUID();
|
||||
|
||||
public OfflinePlayer(String name)
|
||||
{
|
||||
@@ -459,4 +464,49 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
|
||||
}
|
||||
|
||||
public void playEffect(Location lctn, Effect effect, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
|
||||
}
|
||||
|
||||
public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public UUID getUniqueId()
|
||||
{
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
public void playNote(Location lctn, Instrument i, Note note)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setPlayerTime(long l, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public long getPlayerTime()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public long getPlayerTimeOffset()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean isPlayerTimeRelative()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void resetPlayerTime()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -515,4 +515,49 @@ public class PlayerWrapper implements Player
|
||||
{
|
||||
return base.getLastDamageCause();
|
||||
}
|
||||
|
||||
public void playEffect(Location lctn, Effect effect, int i)
|
||||
{
|
||||
base.playEffect(lctn, effect, i);
|
||||
}
|
||||
|
||||
public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes)
|
||||
{
|
||||
return base.sendChunkChange(lctn, i, i1, i2, bytes);
|
||||
}
|
||||
|
||||
public UUID getUniqueId()
|
||||
{
|
||||
return base.getUniqueId();
|
||||
}
|
||||
|
||||
public void playNote(Location lctn, Instrument i, Note note)
|
||||
{
|
||||
base.playNote(lctn, i, note);
|
||||
}
|
||||
|
||||
public void setPlayerTime(long l, boolean bln)
|
||||
{
|
||||
base.setPlayerTime(l, bln);
|
||||
}
|
||||
|
||||
public long getPlayerTime()
|
||||
{
|
||||
return base.getPlayerTime();
|
||||
}
|
||||
|
||||
public long getPlayerTimeOffset()
|
||||
{
|
||||
return base.getPlayerTimeOffset();
|
||||
}
|
||||
|
||||
public boolean isPlayerTimeRelative()
|
||||
{
|
||||
return base.isPlayerTimeRelative();
|
||||
}
|
||||
|
||||
public void resetPlayerTime()
|
||||
{
|
||||
base.resetPlayerTime();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.earth2me.essentials.api;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.EssentialsConf;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.UserData;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
@@ -79,8 +78,7 @@ public final class Economy
|
||||
if (user == null) {
|
||||
throw new UserDoesNotExistException(name);
|
||||
}
|
||||
// Use UserData to avoid calls to iConomy and Register
|
||||
return ((UserData)user).getMoney();
|
||||
return user.getMoney();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,8 +98,7 @@ public final class Economy
|
||||
{
|
||||
throw new NoLoanPermittedException();
|
||||
}
|
||||
// Use UserData to avoid calls to iConomy and Register
|
||||
((UserData)user).setMoney(balance);
|
||||
user.setMoney(balance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,20 +15,45 @@ public class Commandtime extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
World world = user.getWorld();
|
||||
if (user.isAuthorized("essentials.time.world"))
|
||||
{
|
||||
final World world = user.getWorld();
|
||||
|
||||
charge(user);
|
||||
setWorldTime(world, args[0]);
|
||||
charge(user);
|
||||
setWorldTime(world, args[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user.isAuthorized("essentials.time.player"))
|
||||
{
|
||||
|
||||
long time = user.getPlayerTime();
|
||||
time -= time % 24000;
|
||||
if ("day".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
final World world = user.getWorld();
|
||||
user.setPlayerTime(time + 24000 - world.getTime(), true);
|
||||
return;
|
||||
}
|
||||
if ("night".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
final World world = user.getWorld();
|
||||
user.setPlayerTime(time + 37700 - world.getTime(), true);
|
||||
return;
|
||||
}
|
||||
throw new Exception(Util.i18n("onlyDayNight"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -42,10 +67,10 @@ public class Commandtime extends EssentialsCommand
|
||||
sender.sendMessage(Util.i18n("timeSet"));
|
||||
}
|
||||
|
||||
private void setWorldTime(World world, String timeString) throws Exception
|
||||
private void setWorldTime(final World world, final String timeString) throws Exception
|
||||
{
|
||||
long time = world.getTime();
|
||||
time = time - time % 24000;
|
||||
time -= time % 24000;
|
||||
if ("day".equalsIgnoreCase(timeString))
|
||||
{
|
||||
world.setTime(time + 24000);
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.earth2me.essentials.register.payment;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@@ -68,7 +70,8 @@ public class Methods {
|
||||
|
||||
if(!plugin.isEnabled()) {
|
||||
this.self = true;
|
||||
manager.enablePlugin(plugin);
|
||||
Logger.getLogger("Minecraft").log(Level.SEVERE, name + " Plugin was found, but not enabled before Essentials. Read the Essentials thread for help.");
|
||||
//manager.enablePlugin(plugin);
|
||||
}
|
||||
|
||||
if(plugin == null) continue;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.earth2me.essentials;
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
@@ -11,6 +12,7 @@ import org.bukkit.World.Environment;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.ServicesManager;
|
||||
@@ -197,4 +199,44 @@ public class FakeServer implements Server
|
||||
player.setLocation(new Location(worlds.get(0), 0, 0, 0, 0, 0));
|
||||
return player;
|
||||
}
|
||||
|
||||
public World createWorld(String string, Environment e, ChunkGenerator cg)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public World createWorld(String string, Environment e, long l, ChunkGenerator cg)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean unloadWorld(String string, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean unloadWorld(World world, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public Map<String, String[]> getCommandAliases()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public int getSpawnRadius()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setSpawnRadius(int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean getOnlineMode()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,12 @@ import java.util.logging.Logger;
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -55,23 +59,32 @@ public class Permissions extends JavaPlugin {
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
|
||||
if (Security == null) {//make sure we have only one instance
|
||||
Plugin p = (Plugin)(this.getServer() == null ? new GroupManager() : this.getServer().getPluginManager().getPlugin("GroupManager"));
|
||||
if (p != null) {
|
||||
if (!p.isEnabled()) {
|
||||
if (this.getServer() == null) {
|
||||
p.onEnable();
|
||||
} else {
|
||||
this.getServer().getPluginManager().enablePlugin(p);
|
||||
}
|
||||
}
|
||||
GroupManager gm = (GroupManager) p;
|
||||
groupManager = gm;
|
||||
Security = new NijikoPermissionsProxy(gm);
|
||||
} else {
|
||||
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
|
||||
Plugin p = (this.getServer() == null) ? null : this.getServer().getPluginManager().getPlugin("GroupManager");
|
||||
if (p != null) {
|
||||
if (p.isEnabled()) {
|
||||
setGM(p);
|
||||
} else {
|
||||
if (this.getServer() != null) {
|
||||
this.getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new ServerListener() {
|
||||
|
||||
@Override
|
||||
public void onPluginEnable(PluginEnableEvent event)
|
||||
{
|
||||
if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
|
||||
Permissions.this.setGM(event.getPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
}, Priority.Normal, this);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
}
|
||||
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
||||
if (pdfFile != null)
|
||||
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
@@ -81,17 +94,30 @@ public class Permissions extends JavaPlugin {
|
||||
//compiled code
|
||||
//throw new RuntimeException("Compiled Code");
|
||||
}
|
||||
|
||||
private void setGM(Plugin p) {
|
||||
groupManager = (GroupManager)p;
|
||||
((NijikoPermissionsProxy)Security).setGM(p);
|
||||
}
|
||||
|
||||
public PermissionHandler getHandler() {
|
||||
//compiled code
|
||||
//throw new RuntimeException("Compiled Code");
|
||||
//System.out.println("Alguem chamou o handler");
|
||||
checkEnable();
|
||||
if (Security == null)
|
||||
{
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
//checkEnable();
|
||||
return Security;
|
||||
}
|
||||
|
||||
public void setupPermissions() {
|
||||
checkEnable();
|
||||
if (Security == null)
|
||||
{
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
//checkEnable();
|
||||
}
|
||||
|
||||
private void checkEnable() {
|
||||
|
||||
+6
@@ -9,6 +9,7 @@ import java.io.File;
|
||||
import java.util.Map;
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
|
||||
/**
|
||||
@@ -425,4 +426,9 @@ public class NijikoPermissionsProxy extends Control {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionDouble(name,permission);
|
||||
}
|
||||
|
||||
public void setGM(Plugin p)
|
||||
{
|
||||
this.plugin = (GroupManager)p;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
name: GroupManager
|
||||
version: 1.0(alpha-5)
|
||||
version: "1.0(alpha-5) [Zombie-Version, please switch to Permissions 3]"
|
||||
main: org.anjocaido.groupmanager.GroupManager
|
||||
website: http://www.anjocaido.info/
|
||||
description: Provides on-the-fly system for Permission system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
||||
|
||||
+4
-1
@@ -293,7 +293,10 @@ public class EssentialsProtectEntityListener extends EntityListener
|
||||
User user = Essentials.getStatic().getUser(event.getTarget());
|
||||
if ((event.getReason() == TargetReason.CLOSEST_PLAYER
|
||||
|| event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY
|
||||
|| event.getReason() == TargetReason.PIG_ZOMBIE_TARGET)
|
||||
|| event.getReason() == TargetReason.PIG_ZOMBIE_TARGET
|
||||
|| event.getReason() == TargetReason.RANDOM_TARGET
|
||||
|| event.getReason() == TargetReason.TARGET_ATTACKED_OWNER
|
||||
|| event.getReason() == TargetReason.OWNER_ATTACKED_TARGET)
|
||||
&& EssentialsProtect.guardSettings.get("protect.prevent.entitytarget")
|
||||
&& !user.isAuthorized("essentials.protect.entitytarget.bypass"))
|
||||
{
|
||||
|
||||
+21
-10
@@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
{
|
||||
@Override
|
||||
public void onPlayerRespawn(PlayerRespawnEvent event)
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||
{
|
||||
final IEssentials ess = Essentials.getStatic();
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -25,7 +25,8 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
if (ess.getSettings().getRespawnAtHome())
|
||||
{
|
||||
Location home = user.getHome(user.getLocation());
|
||||
if (home == null) {
|
||||
if (home == null)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
event.setRespawnLocation(home);
|
||||
@@ -36,28 +37,38 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
{
|
||||
}
|
||||
Location spawn = ess.getSpawn().getSpawn(user.getGroup());
|
||||
if (spawn == null) {
|
||||
if (spawn == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
event.setRespawnLocation(spawn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
final IEssentials ess = Essentials.getStatic();
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
|
||||
if (!user.isNew())
|
||||
{
|
||||
return;
|
||||
}
|
||||
user.setNew(false);
|
||||
try {
|
||||
user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn()));
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex);
|
||||
}
|
||||
ess.scheduleSyncDelayedTask(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn()));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (ess.getSettings().getAnnounceNewPlayers())
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user