mirror of
https://github.com/essentials/Essentials.git
synced 2025-09-11 15:10:48 +02:00
Compare commits
6 Commits
stable-2.3
...
stable-2.3
Author | SHA1 | Date | |
---|---|---|---|
|
96b0f27c51 | ||
|
4051a377c3 | ||
|
fc13bc5d34 | ||
|
752600e518 | ||
|
4754b9fcca | ||
|
ce0164583c |
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@@ -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,7 @@ package com.earth2me.essentials;
|
||||
import java.util.List;
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.World;
|
||||
@@ -18,6 +19,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 +325,35 @@ 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.");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,7 +3,9 @@ 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.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
@@ -27,6 +29,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 +462,19 @@ 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;
|
||||
}
|
||||
}
|
||||
|
@@ -515,4 +515,19 @@ 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();
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,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 +198,24 @@ 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.");
|
||||
}
|
||||
}
|
||||
|
@@ -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