mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-01 14:07:46 +01:00
Merge branch 'refs/heads/master' into release
This commit is contained in:
commit
e1e7a1cfdb
@ -57,7 +57,7 @@ import org.bukkit.scheduler.BukkitScheduler;
|
|||||||
|
|
||||||
public class Essentials extends JavaPlugin implements IEssentials
|
public class Essentials extends JavaPlugin implements IEssentials
|
||||||
{
|
{
|
||||||
public static final int BUKKIT_VERSION = 1518;
|
public static final int BUKKIT_VERSION = 1522;
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||||
private transient ISettings settings;
|
private transient ISettings settings;
|
||||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||||
|
@ -151,13 +151,27 @@ public final class InventoryWorkaround
|
|||||||
{
|
{
|
||||||
ItemStack stack = item.clone();
|
ItemStack stack = item.clone();
|
||||||
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
|
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
|
||||||
|
if (cinventory instanceof FakeInventory)
|
||||||
|
{
|
||||||
|
cinventory.setItem(firstFree, stack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
EnchantmentFix.setItem(cinventory, firstFree, stack);
|
EnchantmentFix.setItem(cinventory, firstFree, stack);
|
||||||
|
}
|
||||||
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
|
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Just store it
|
// Just store it
|
||||||
|
if (cinventory instanceof FakeInventory)
|
||||||
|
{
|
||||||
|
cinventory.setItem(firstFree, item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
EnchantmentFix.setItem(cinventory, firstFree, item);
|
EnchantmentFix.setItem(cinventory, firstFree, item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,10 @@ public enum Mob
|
|||||||
ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON),
|
ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON),
|
||||||
VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER),
|
VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER),
|
||||||
BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE),
|
BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE),
|
||||||
MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW);
|
MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW),
|
||||||
//TODO: Snowman
|
MAGMACUBE("MagmaCube", Enemies.ENEMY, CreatureType.MAGMA_CUBE),
|
||||||
|
SNOWMAN("Snowman", Enemies.FRIENDLY, CreatureType.SNOWMAN);
|
||||||
|
|
||||||
public static final Logger logger = Logger.getLogger("Minecraft");
|
public static final Logger logger = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
private Mob(String n, Enemies en, String s, CreatureType type)
|
private Mob(String n, Enemies en, String s, CreatureType type)
|
||||||
|
@ -17,28 +17,34 @@ public class Commanddelhome extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
//Allowing both formats /delhome khobbits house | /delhome khobbits:house
|
if (args.length < 1)
|
||||||
final String[] expandedArgs = args[0].split(":");
|
{
|
||||||
|
throw new NotEnoughArgumentsException();
|
||||||
|
}
|
||||||
|
|
||||||
User user = ess.getUser(sender);
|
User user = ess.getUser(sender);
|
||||||
String name;
|
String name;
|
||||||
if (expandedArgs.length < 1)
|
final String[] expandedArg = args[0].split(":");
|
||||||
|
|
||||||
|
if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
|
||||||
|
{
|
||||||
|
user = getPlayer(server, expandedArg, 0, true);
|
||||||
|
name = expandedArg[1];
|
||||||
|
}
|
||||||
|
else if (user == null)
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
else if (expandedArgs.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
|
|
||||||
{
|
|
||||||
user = getPlayer(server, expandedArgs, 0, true);
|
|
||||||
name = expandedArgs[1];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (user == null)
|
name = expandedArg[0];
|
||||||
{
|
|
||||||
throw new NotEnoughArgumentsException();
|
|
||||||
}
|
|
||||||
name = expandedArgs[0];
|
|
||||||
}
|
}
|
||||||
|
//TODO: Think up a nice error message
|
||||||
|
/*
|
||||||
|
* if (name.equalsIgnoreCase("bed")) {
|
||||||
|
* throw new Exception("You cannot remove the vanilla home point");
|
||||||
|
* }
|
||||||
|
*/
|
||||||
user.delHome(name.toLowerCase(Locale.ENGLISH));
|
user.delHome(name.toLowerCase(Locale.ENGLISH));
|
||||||
sender.sendMessage(_("deleteHome", name));
|
sender.sendMessage(_("deleteHome", name));
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ public class Commandtp extends EssentialsCommand
|
|||||||
default:
|
default:
|
||||||
if (!user.isAuthorized("essentials.tpohere"))
|
if (!user.isAuthorized("essentials.tpohere"))
|
||||||
{
|
{
|
||||||
|
//TODO: Translate this
|
||||||
throw new Exception("You need access to /tpohere to teleport other players.");
|
throw new Exception("You need access to /tpohere to teleport other players.");
|
||||||
}
|
}
|
||||||
user.sendMessage(_("teleporting"));
|
user.sendMessage(_("teleporting"));
|
||||||
|
@ -43,6 +43,7 @@ public class Commandweather extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: Translate these
|
||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user