mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-05 01:00:13 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7cbb141f8 | ||
|
|
5690952516 | ||
|
|
e94202c55a | ||
|
|
aa6ad271a0 | ||
|
|
3b41bb47b6 | ||
|
|
e7bdb7fabc | ||
|
|
110698223d | ||
|
|
437be593b9 | ||
|
|
502d37b574 | ||
|
|
df59f9f859 | ||
|
|
f436fbab6b | ||
|
|
8404720501 | ||
|
|
4431d452f1 | ||
|
|
6a529d6671 | ||
|
|
78fca9a67a | ||
|
|
0114b5e4f6 | ||
|
|
5a14a64b6c | ||
|
|
b555ea6350 | ||
|
|
361ae1dd16 | ||
|
|
58117eba88 | ||
|
|
6260b49b4f | ||
|
|
988239267b | ||
|
|
19cffe3872 | ||
|
|
3b1cef918e | ||
|
|
246fd03265 |
No files matched your search
@@ -39,6 +39,7 @@
|
||||
/jars
|
||||
/out
|
||||
.idea/
|
||||
.buildtools/
|
||||
*.iml
|
||||
*.classpath
|
||||
*.project
|
||||
|
||||
+2
-15
@@ -1,23 +1,10 @@
|
||||
language: java
|
||||
|
||||
branches:
|
||||
only:
|
||||
- 2.x
|
||||
- 1.13
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- .buildtools
|
||||
- $HOME/.m2
|
||||
|
||||
before_install:
|
||||
- mkdir -p .buildtools
|
||||
- cd .buildtools
|
||||
- wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
|
||||
- rm -r work/
|
||||
- java -jar BuildTools.jar --rev 1.8
|
||||
- java -jar BuildTools.jar --rev 1.8.3
|
||||
- java -jar BuildTools.jar --rev 1.9
|
||||
- java -jar BuildTools.jar --rev 1.9.4
|
||||
- java -jar BuildTools.jar --rev 1.13.1
|
||||
- cd ..
|
||||
- chmod +x scripts/buildtools.sh
|
||||
- scripts/buildtools.sh
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
@@ -53,9 +54,9 @@ public enum MobData {
|
||||
BAY_HORSE("bay", EntityType.HORSE, Horse.Color.BROWN, true),
|
||||
BROWN_HORSE("brown", EntityType.HORSE, Horse.Color.BROWN, false),
|
||||
SADDLE_HORSE("saddle", EntityType.HORSE, Data.HORSESADDLE, true),
|
||||
GOLD_ARMOR_HORSE("goldarmor", EntityType.HORSE, Material.GOLDEN_HORSE_ARMOR, true),
|
||||
DIAMOND_ARMOR_HORSE("diamondarmor", EntityType.HORSE, Material.DIAMOND_HORSE_ARMOR, true),
|
||||
ARMOR_HORSE("armor", EntityType.HORSE, Material.IRON_HORSE_ARMOR, true),
|
||||
GOLD_ARMOR_HORSE("goldarmor", EntityType.HORSE, EnumUtil.getMaterial("GOLDEN_HORSE_ARMOR", "GOLD_BARDING"), true),
|
||||
DIAMOND_ARMOR_HORSE("diamondarmor", EntityType.HORSE, EnumUtil.getMaterial("DIAMOND_HORSE_ARMOR", "DIAMOND_BARDING"), true),
|
||||
ARMOR_HORSE("armor", EntityType.HORSE, EnumUtil.getMaterial("IRON_HORSE_ARMOR", "IRON_BARDING"), true),
|
||||
SIAMESE_CAT("siamese", EntityType.OCELOT, Ocelot.Type.SIAMESE_CAT, true),
|
||||
WHITE_CAT("white", EntityType.OCELOT, Ocelot.Type.SIAMESE_CAT, false),
|
||||
RED_CAT("red", EntityType.OCELOT, Ocelot.Type.RED_CAT, true),
|
||||
@@ -66,12 +67,12 @@ public enum MobData {
|
||||
BABY_ZOMBIE("baby", EntityType.ZOMBIE.getEntityClass(), Data.BABYZOMBIE, true),
|
||||
ADULT_ZOMBIE("adult", EntityType.ZOMBIE.getEntityClass(), Data.ADULTZOMBIE, true),
|
||||
DIAMOND_SWORD_ZOMBIE("diamondsword", EntityType.ZOMBIE.getEntityClass(), Material.DIAMOND_SWORD, true),
|
||||
GOLD_SWORD_ZOMBIE("goldsword", EntityType.ZOMBIE.getEntityClass(), Material.GOLDEN_SWORD, true),
|
||||
GOLD_SWORD_ZOMBIE("goldsword", EntityType.ZOMBIE.getEntityClass(), EnumUtil.getMaterial("GOLDEN_SWORD", "GOLD_SWORD"), true),
|
||||
IRON_SWORD_ZOMBIE("ironsword", EntityType.ZOMBIE.getEntityClass(), Material.IRON_SWORD, true),
|
||||
STONE_SWORD_ZOMBIE("stonesword", EntityType.ZOMBIE.getEntityClass(), Material.STONE_SWORD, false),
|
||||
SWORD_ZOMBIE("sword", EntityType.ZOMBIE.getEntityClass(), Material.STONE_SWORD, true),
|
||||
DIAMOND_SWORD_SKELETON("diamondsword", EntityType.SKELETON, Material.DIAMOND_SWORD, true),
|
||||
GOLD_SWORD_SKELETON("goldsword", EntityType.SKELETON, Material.GOLDEN_SWORD, true),
|
||||
GOLD_SWORD_SKELETON("goldsword", EntityType.SKELETON, EnumUtil.getMaterial("GOLDEN_SWORD", "GOLD_SWORD"), true),
|
||||
IRON_SWORD_SKELETON("ironsword", EntityType.SKELETON, Material.IRON_SWORD, true),
|
||||
STONE_SWORD_SKELETON("stonesword", EntityType.SKELETON, Material.STONE_SWORD, false),
|
||||
SWORD_SKELETON("sword", EntityType.SKELETON, Material.STONE_SWORD, true),
|
||||
|
||||
@@ -787,6 +787,21 @@ public class OfflinePlayer implements Player {
|
||||
public void setBedSpawnLocation(Location lctn, boolean force) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sleep(Location location, boolean force) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wakeup(boolean setSpawnLocation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(EntityEffect ee) {
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
private final transient EssentialsConf config;
|
||||
private static final Logger logger = Logger.getLogger("Essentials");
|
||||
private final transient IEssentials ess;
|
||||
private boolean metricsEnabled = true;
|
||||
|
||||
public Settings(IEssentials ess) {
|
||||
this.ess = ess;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.Mob.MobException;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.LocationUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
@@ -19,6 +20,13 @@ import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
||||
public class SpawnMob {
|
||||
|
||||
private static final Material GOLDEN_HELMET = EnumUtil.getMaterial("GOLDEN_HELMET", "GOLD_HELMET");
|
||||
private static final Material GOLDEN_CHESTPLATE = EnumUtil.getMaterial("GOLDEN_CHESTPLATE", "GOLD_CHESTPLATE");
|
||||
private static final Material GOLDEN_LEGGINGS = EnumUtil.getMaterial("GOLDEN_LEGGINGS", "GOLD_LEGGINGS");
|
||||
private static final Material GOLDEN_BOOTS = EnumUtil.getMaterial("GOLDEN_BOOTS", "GOLD_BOOTS");
|
||||
private static final Material GOLDEN_SWORD = EnumUtil.getMaterial("GOLDEN_SWORD", "GOLD_SWORD");
|
||||
|
||||
public static String mobList(final User user) {
|
||||
final Set<String> mobList = Mob.getMobList();
|
||||
final Set<String> availableList = new HashSet<String>();
|
||||
@@ -191,10 +199,10 @@ public class SpawnMob {
|
||||
invent.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
|
||||
invent.setHelmet(new ItemStack(Material.DIAMOND_HELMET, 1));
|
||||
} else if (inputData.contains("gold")) {
|
||||
invent.setBoots(new ItemStack(Material.GOLDEN_BOOTS, 1));
|
||||
invent.setLeggings(new ItemStack(Material.GOLDEN_LEGGINGS, 1));
|
||||
invent.setChestplate(new ItemStack(Material.GOLDEN_CHESTPLATE, 1));
|
||||
invent.setHelmet(new ItemStack(Material.GOLDEN_HELMET, 1));
|
||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
||||
invent.setLeggings(new ItemStack(GOLDEN_LEGGINGS, 1));
|
||||
invent.setChestplate(new ItemStack(GOLDEN_CHESTPLATE, 1));
|
||||
invent.setHelmet(new ItemStack(GOLDEN_HELMET, 1));
|
||||
} else if (inputData.contains("leather")) {
|
||||
invent.setBoots(new ItemStack(Material.LEATHER_BOOTS, 1));
|
||||
invent.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS, 1));
|
||||
@@ -228,7 +236,7 @@ public class SpawnMob {
|
||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(Material.BOW, 1));
|
||||
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
||||
|
||||
invent.setBoots(new ItemStack(Material.GOLDEN_BOOTS, 1));
|
||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
||||
invent.setBootsDropChance(0.0f);
|
||||
}
|
||||
|
||||
@@ -237,10 +245,10 @@ public class SpawnMob {
|
||||
setVillager(zombie, false);
|
||||
|
||||
final EntityEquipment invent = zombie.getEquipment();
|
||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(Material.GOLDEN_SWORD, 1));
|
||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(GOLDEN_SWORD, 1));
|
||||
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
||||
|
||||
invent.setBoots(new ItemStack(Material.GOLDEN_BOOTS, 1));
|
||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
||||
invent.setBootsDropChance(0.0f);
|
||||
}
|
||||
|
||||
@@ -249,7 +257,7 @@ public class SpawnMob {
|
||||
setVillager(zombie, false);
|
||||
|
||||
final EntityEquipment invent = zombie.getEquipment();
|
||||
invent.setBoots(new ItemStack(Material.GOLDEN_BOOTS, 1));
|
||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
||||
invent.setBootsDropChance(0.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.earth2me.essentials.register.payment.Methods;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import net.ess3.api.events.AfkStatusChangeEvent;
|
||||
@@ -27,12 +28,7 @@ import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -224,7 +220,18 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
|
||||
@Override
|
||||
public Boolean canSpawnItem(final Material material) {
|
||||
return !ess.getSettings().itemSpawnBlacklist().contains(material);
|
||||
if (ess.getSettings().permissionBasedItemSpawn()) {
|
||||
final String name = material.toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
|
||||
if (isAuthorized("essentials.itemspawn.item-all") || isAuthorized("essentials.itemspawn.item-" + name)) return true;
|
||||
|
||||
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_13_0_R01)) {
|
||||
final int id = material.getId();
|
||||
if (isAuthorized("essentials.itemspawn.item-" + id)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return isAuthorized("essentials.itemspawn.exempt") || !ess.getSettings().itemSpawnBlacklist().contains(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -872,7 +879,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
* Returns the {@link ItemStack} in the main hand or off-hand. If the main hand is empty then the offhand item is returned - also nullable.
|
||||
*/
|
||||
public ItemStack getItemInHand() {
|
||||
if (ReflUtil.getNmsVersionObject().isLowerThan(ReflUtil.V1_9_R1)) {
|
||||
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_9_R01)) {
|
||||
return getBase().getInventory().getItemInHand();
|
||||
} else {
|
||||
PlayerInventory inventory = getBase().getInventory();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
@@ -15,6 +16,9 @@ import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
||||
public class Commandbook extends EssentialsCommand {
|
||||
|
||||
private static final Material WRITABLE_BOOK = EnumUtil.getMaterial("WRITABLE_BOOK", "BOOK_AND_QUILL");
|
||||
|
||||
public Commandbook() {
|
||||
super("book");
|
||||
}
|
||||
@@ -44,7 +48,7 @@ public class Commandbook extends EssentialsCommand {
|
||||
}
|
||||
} else {
|
||||
if (isAuthor(bmeta, player) || user.isAuthorized("essentials.book.others")) {
|
||||
ItemStack newItem = new ItemStack(Material.WRITABLE_BOOK, item.getAmount());
|
||||
ItemStack newItem = new ItemStack(WRITABLE_BOOK, item.getAmount());
|
||||
newItem.setItemMeta(bmeta);
|
||||
InventoryWorkaround.setItemInMainHand(user.getBase(), newItem);
|
||||
user.sendMessage(tl("editBookContents"));
|
||||
@@ -52,7 +56,7 @@ public class Commandbook extends EssentialsCommand {
|
||||
throw new Exception(tl("denyBookEdit"));
|
||||
}
|
||||
}
|
||||
} else if (item.getType() == Material.WRITABLE_BOOK) {
|
||||
} else if (item.getType() == WRITABLE_BOOK) {
|
||||
BookMeta bmeta = (BookMeta) item.getItemMeta();
|
||||
if (!user.isAuthorized("essentials.book.author")) {
|
||||
bmeta.setAuthor(player);
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.EssentialsUpgrade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.UserMap;
|
||||
import com.earth2me.essentials.metrics.Metrics;
|
||||
import com.earth2me.essentials.utils.*;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -17,13 +16,15 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
// This command has 4 undocumented behaviours #EasterEgg
|
||||
public class Commandessentials extends EssentialsCommand {
|
||||
|
||||
private final Sound NOTE_HARP = EnumUtil.valueOf(Sound.class, "BLOCK_NOTE_HARP", "NOTE_PIANO");
|
||||
|
||||
public Commandessentials() {
|
||||
super("essentials");
|
||||
}
|
||||
@@ -154,15 +155,9 @@ public class Commandessentials extends EssentialsCommand {
|
||||
if (note == null || note.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Sound noteHarp;
|
||||
try {
|
||||
noteHarp = Sound.valueOf("NOTE_PIANO"); // pre-1.9, referenced internally as note.harp
|
||||
} catch (IllegalArgumentException e) {
|
||||
noteHarp = Sound.valueOf("BLOCK_NOTE_HARP"); // 1.9
|
||||
}
|
||||
|
||||
for (Player onlinePlayer : ess.getOnlinePlayers()) {
|
||||
onlinePlayer.playSound(onlinePlayer.getLocation(), noteHarp, 1, noteMap.get(note));
|
||||
onlinePlayer.playSound(onlinePlayer.getLocation(), NOTE_HARP, 1, noteMap.get(note));
|
||||
}
|
||||
}
|
||||
}, 20, 2);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.MetaItemStack;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.MaterialUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.DyeColor;
|
||||
@@ -43,8 +44,8 @@ public class Commandfirework extends EssentialsCommand {
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
||||
final ItemStack stack = user.getBase().getInventory().getItemInMainHand();
|
||||
if (stack.getType() == Material.FIREWORK_ROCKET || stack.getType() == Material.FIREWORK_STAR) {
|
||||
final ItemStack stack = user.getItemInHand();
|
||||
if (MaterialUtil.isFirework(stack.getType())) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("clear")) {
|
||||
FireworkMeta fmeta = (FireworkMeta) stack.getItemMeta();
|
||||
|
||||
@@ -31,9 +31,9 @@ public class Commandgive extends EssentialsCommand {
|
||||
}
|
||||
|
||||
ItemStack stack = ess.getItemDb().get(args[1]);
|
||||
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (sender.isPlayer() && (ess.getSettings().permissionBasedItemSpawn() ? (!ess.getUser(sender.getPlayer()).isAuthorized("essentials.itemspawn.item-all") && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.itemspawn.item-" + itemname)) : (!ess.getUser(sender.getPlayer()).isAuthorized("essentials.itemspawn.exempt") && !ess.getUser(sender.getPlayer()).canSpawnItem(stack.getType())))) {
|
||||
|
||||
if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).canSpawnItem(stack.getType())) {
|
||||
throw new Exception(tl("cantSpawnItem", itemname));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ public class Commandhat extends EssentialsCommand {
|
||||
user.sendMessage(tl("hatRemoved"));
|
||||
}
|
||||
} else {
|
||||
if (user.getBase().getInventory().getItemInMainHand().getType() != Material.AIR) {
|
||||
final ItemStack hand = user.getBase().getInventory().getItemInMainHand();
|
||||
final ItemStack hand = user.getItemInHand();
|
||||
if (hand != null && hand.getType() != Material.AIR) {
|
||||
if (hand.getType().getMaxDurability() == 0) {
|
||||
final PlayerInventory inv = user.getBase().getInventory();
|
||||
final ItemStack head = inv.getHelmet();
|
||||
|
||||
@@ -29,9 +29,10 @@ public class Commanditem extends EssentialsCommand {
|
||||
ItemStack stack = ess.getItemDb().get(args[0]);
|
||||
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (ess.getSettings().permissionBasedItemSpawn() ? (!user.isAuthorized("essentials.itemspawn.item-all") && !user.isAuthorized("essentials.itemspawn.item-" + itemname)) : (!user.isAuthorized("essentials.itemspawn.exempt") && !user.canSpawnItem(stack.getType()))) {
|
||||
if (!user.canSpawnItem(stack.getType())) {
|
||||
throw new Exception(tl("cantSpawnItem", itemname));
|
||||
}
|
||||
|
||||
try {
|
||||
if (args.length > 1 && Integer.parseInt(args[1]) > 0) {
|
||||
stack.setAmount(Integer.parseInt(args[1]));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -23,7 +24,7 @@ public class Commanditemdb extends EssentialsCommand {
|
||||
if (args.length < 1) {
|
||||
if (sender.isPlayer() && sender.getPlayer() != null) {
|
||||
itemHeld = true;
|
||||
itemStack = sender.getPlayer().getInventory().getItemInMainHand();
|
||||
itemStack = ess.getUser(sender.getPlayer()).getItemInHand();
|
||||
}
|
||||
if (itemStack == null) {
|
||||
throw new NotEnoughArgumentsException();
|
||||
@@ -34,6 +35,11 @@ public class Commanditemdb extends EssentialsCommand {
|
||||
|
||||
sender.sendMessage(tl("itemType", itemStack.getType().toString()));
|
||||
|
||||
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_13_0_R01)) {
|
||||
final String itemId = itemStack.getType().getId() + ":" + itemStack.getDurability();
|
||||
sender.sendMessage(tl("itemId", itemId));
|
||||
}
|
||||
|
||||
if (itemHeld && itemStack.getType() != Material.AIR) {
|
||||
int maxuses = itemStack.getType().getMaxDurability();
|
||||
int durability = ((maxuses + 1) - itemStack.getDurability());
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Commandmore extends EssentialsCommand {
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
||||
final ItemStack stack = user.getBase().getInventory().getItemInMainHand();
|
||||
final ItemStack stack = user.getItemInHand();
|
||||
if (stack == null) {
|
||||
throw new Exception(tl("cantSpawnItem", "Air"));
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class Commandmore extends EssentialsCommand {
|
||||
throw new Exception(tl("fullStack"));
|
||||
}
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (ess.getSettings().permissionBasedItemSpawn() ? (!user.isAuthorized("essentials.itemspawn.item-all") && !user.isAuthorized("essentials.itemspawn.item-" + itemname)) : (!user.isAuthorized("essentials.itemspawn.exempt") && !user.canSpawnItem(stack.getType()))) {
|
||||
if (!user.canSpawnItem(stack.getType())) {
|
||||
throw new Exception(tl("cantSpawnItem", itemname));
|
||||
}
|
||||
if (user.isAuthorized("essentials.oversizedstacks")) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import org.bukkit.Material;
|
||||
@@ -20,6 +21,11 @@ import net.ess3.nms.refl.ReflUtil;
|
||||
|
||||
|
||||
public class Commandrecipe extends EssentialsCommand {
|
||||
|
||||
private static final Material FIREWORK_ROCKET = EnumUtil.getMaterial("FIREWORK_ROCKET", "FIREWORK");
|
||||
private static final Material FIREWORK_STAR = EnumUtil.getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE");
|
||||
private static final Material GUNPOWDER = EnumUtil.getMaterial("GUNPOWDER", "SULPHUR");
|
||||
|
||||
public Commandrecipe() {
|
||||
super("recipe");
|
||||
}
|
||||
@@ -67,11 +73,11 @@ public class Commandrecipe extends EssentialsCommand {
|
||||
} else if (selectedRecipe instanceof ShapedRecipe) {
|
||||
shapedRecipe(sender, (ShapedRecipe) selectedRecipe, sender.isPlayer());
|
||||
} else if (selectedRecipe instanceof ShapelessRecipe) {
|
||||
if (recipesOfType.size() == 1 && (itemType.getType() == Material.FIREWORK_ROCKET || itemType.getType() == Material.FIREWORK_STAR)) {
|
||||
if (recipesOfType.size() == 1 && (itemType.getType() == FIREWORK_ROCKET)) {
|
||||
ShapelessRecipe shapelessRecipe = new ShapelessRecipe(itemType);
|
||||
shapelessRecipe.addIngredient(Material.LEGACY_SULPHUR);
|
||||
shapelessRecipe.addIngredient(GUNPOWDER);
|
||||
shapelessRecipe.addIngredient(Material.PAPER);
|
||||
shapelessRecipe.addIngredient(Material.FIREWORK_ROCKET);
|
||||
shapelessRecipe.addIngredient(FIREWORK_STAR);
|
||||
shapelessRecipe(sender, shapelessRecipe, sender.isPlayer());
|
||||
} else {
|
||||
shapelessRecipe(sender, (ShapelessRecipe) selectedRecipe, sender.isPlayer());
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.ess3.api.IUser;
|
||||
import org.bukkit.Material;
|
||||
@@ -38,7 +39,7 @@ public class Commandrepair extends EssentialsCommand {
|
||||
}
|
||||
|
||||
public void repairHand(User user) throws Exception {
|
||||
final ItemStack item = user.getBase().getInventory().getItemInMainHand();
|
||||
final ItemStack item = user.getItemInHand();
|
||||
if (item == null || item.getType().isBlock() || item.getDurability() == 0) {
|
||||
throw new Exception(tl("repairInvalidType"));
|
||||
}
|
||||
@@ -48,7 +49,7 @@ public class Commandrepair extends EssentialsCommand {
|
||||
}
|
||||
|
||||
final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
|
||||
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), new Trade("repair-item", ess), ess);
|
||||
final Trade charge = getCharge(item.getType());
|
||||
|
||||
charge.isAffordableFor(user);
|
||||
|
||||
@@ -95,7 +96,8 @@ public class Commandrepair extends EssentialsCommand {
|
||||
}
|
||||
|
||||
final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
|
||||
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), new Trade("repair-item", ess), ess);
|
||||
final Trade charge = getCharge(item.getType());
|
||||
|
||||
try {
|
||||
charge.isAffordableFor(user);
|
||||
} catch (ChargeException ex) {
|
||||
@@ -120,6 +122,16 @@ public class Commandrepair extends EssentialsCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private Trade getCharge(final Material material) {
|
||||
final String itemName = material.toString().toLowerCase(Locale.ENGLISH);
|
||||
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_13_0_R01)) {
|
||||
final int itemId = material.getId();
|
||||
return new Trade("repair-" + itemName.replace('_', '-'), new Trade("repair-" + itemId, new Trade("repair-item", ess), ess), ess);
|
||||
} else {
|
||||
return new Trade("repair-" + itemName.replace('_', '-'), new Trade("repair-item", ess), ess);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
||||
if (args.length == 1) {
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.MaterialUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
@@ -14,6 +16,9 @@ import java.util.List;
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class Commandskull extends EssentialsCommand {
|
||||
|
||||
private static final Material SKULL_ITEM = EnumUtil.getMaterial("PLAYER_HEAD", "SKULL_ITEM");
|
||||
|
||||
public Commandskull() {
|
||||
super("skull");
|
||||
}
|
||||
@@ -31,14 +36,14 @@ public class Commandskull extends EssentialsCommand {
|
||||
owner = user.getName();
|
||||
}
|
||||
|
||||
ItemStack itemSkull = user.getBase().getInventory().getItemInMainHand();
|
||||
ItemStack itemSkull = user.getItemInHand();
|
||||
SkullMeta metaSkull = null;
|
||||
boolean spawn = false;
|
||||
|
||||
if (itemSkull != null && itemSkull.getType() == Material.LEGACY_SKULL_ITEM && itemSkull.getDurability() == 3) {
|
||||
if (itemSkull != null && MaterialUtil.isPlayerHead(itemSkull.getType(), itemSkull.getDurability())) {
|
||||
metaSkull = (SkullMeta) itemSkull.getItemMeta();
|
||||
} else if (user.isAuthorized("essentials.skull.spawn")) {
|
||||
itemSkull = new ItemStack(Material.LEGACY_SKULL_ITEM, 1, (byte) 3);
|
||||
itemSkull = new ItemStack(SKULL_ITEM, 1, (byte) 3);
|
||||
metaSkull = (SkullMeta) itemSkull.getItemMeta();
|
||||
spawn = true;
|
||||
} else {
|
||||
|
||||
@@ -17,13 +17,12 @@ import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
||||
public class Commandwhois extends EssentialsCommand {
|
||||
private final Statistic playOneTick;
|
||||
// For some reason, in 1.13 PLAY_ONE_MINUTE = ticks played = what used to be PLAY_ONE_TICK
|
||||
// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/b848d8ce633871b52115247b089029749c02f579
|
||||
private static final Statistic PLAY_ONE_TICK = EnumUtil.getStatistic("PLAY_ONE_MINUTE", "PLAY_ONE_TICK");
|
||||
|
||||
public Commandwhois() {
|
||||
super("whois");
|
||||
// For some reason, in 1.13 PLAY_ONE_MINUTE = ticks played
|
||||
// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/b848d8ce633871b52115247b089029749c02f579
|
||||
playOneTick = EnumUtil.getStatistic("PLAY_ONE_MINUTE", "PLAY_ONE_TICK");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,7 +41,7 @@ public class Commandwhois extends EssentialsCommand {
|
||||
sender.sendMessage(tl("whoisHunger", user.getBase().getFoodLevel(), user.getBase().getSaturation()));
|
||||
sender.sendMessage(tl("whoisExp", SetExpFix.getTotalExperience(user.getBase()), user.getBase().getLevel()));
|
||||
sender.sendMessage(tl("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
|
||||
long playtimeMs = System.currentTimeMillis() - (user.getBase().getStatistic(playOneTick) * 50);
|
||||
long playtimeMs = System.currentTimeMillis() - (user.getBase().getStatistic(PLAY_ONE_TICK) * 50);
|
||||
sender.sendMessage(tl("whoisPlaytime", DateUtil.formatDateDiff(playtimeMs)));
|
||||
if (!ess.getSettings().isEcoDisabled()) {
|
||||
sender.sendMessage(tl("whoisMoney", NumberUtil.displayCurrency(user.getMoney(), ess)));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.*;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
@@ -25,6 +26,7 @@ import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
||||
public class EssentialsSign {
|
||||
private static final Material SIGN_POST = EnumUtil.getMaterial("SIGN", "SIGN_POST");
|
||||
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
|
||||
protected static final BigDecimal MINTRANSACTION = new BigDecimal("0.01");
|
||||
protected transient final String signName;
|
||||
@@ -58,9 +60,7 @@ public class EssentialsSign {
|
||||
sign.setLine(0, getSuccessName(ess));
|
||||
}
|
||||
return ret;
|
||||
} catch (ChargeException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
} catch (SignException ex) {
|
||||
} catch (ChargeException | SignException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
}
|
||||
// Return true, so the player sees the wrong sign.
|
||||
@@ -115,9 +115,6 @@ public class EssentialsSign {
|
||||
}
|
||||
|
||||
return onSignInteract(sign, user, getUsername(user), ess);
|
||||
} catch (ChargeException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
return false;
|
||||
} catch (Exception ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
return false;
|
||||
@@ -161,9 +158,7 @@ public class EssentialsSign {
|
||||
User user = ess.getUser(player);
|
||||
try {
|
||||
return onBlockPlace(block, user, getUsername(user), ess);
|
||||
} catch (ChargeException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
} catch (SignException ex) {
|
||||
} catch (ChargeException | SignException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
}
|
||||
return false;
|
||||
@@ -173,9 +168,7 @@ public class EssentialsSign {
|
||||
User user = ess.getUser(player);
|
||||
try {
|
||||
return onBlockInteract(block, user, getUsername(user), ess);
|
||||
} catch (ChargeException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
} catch (SignException ex) {
|
||||
} catch (ChargeException | SignException ex) {
|
||||
showError(ess, user.getSource(), ex, signName);
|
||||
}
|
||||
return false;
|
||||
@@ -213,7 +206,7 @@ public class EssentialsSign {
|
||||
|
||||
protected static boolean checkIfBlockBreaksSigns(final Block block) {
|
||||
final Block sign = block.getRelative(BlockFace.UP);
|
||||
if (sign.getType() == Material.SIGN && isValidSign(new BlockSign(sign))) {
|
||||
if (sign.getType() == SIGN_POST && isValidSign(new BlockSign(sign))) {
|
||||
return true;
|
||||
}
|
||||
final BlockFace[] directions = new BlockFace[]{BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST};
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.I18n;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
@@ -22,7 +23,7 @@ import java.util.logging.Logger;
|
||||
public class SignBlockListener implements Listener {
|
||||
private static final Logger LOGGER = Logger.getLogger("Essentials");
|
||||
private static final Material WALL_SIGN = Material.WALL_SIGN;
|
||||
private static final Material SIGN_POST = Material.SIGN;
|
||||
private static final Material SIGN_POST = EnumUtil.getMaterial("SIGN", "SIGN_POST");
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public SignBlockListener(IEssentials ess) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -11,6 +12,8 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
|
||||
|
||||
public class SignEntityListener implements Listener {
|
||||
|
||||
private static final Material SIGN_POST = EnumUtil.getMaterial("SIGN", "SIGN_POST");
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public SignEntityListener(final IEssentials ess) {
|
||||
@@ -25,7 +28,7 @@ public class SignEntityListener implements Listener {
|
||||
}
|
||||
|
||||
for (Block block : event.blockList()) {
|
||||
if (((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN) && EssentialsSign.isValidSign(ess, new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) {
|
||||
if (((block.getType() == Material.WALL_SIGN || block.getType() == SIGN_POST) && EssentialsSign.isValidSign(ess, new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@@ -46,7 +49,7 @@ public class SignEntityListener implements Listener {
|
||||
}
|
||||
|
||||
final Block block = event.getBlock();
|
||||
if (((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN) && EssentialsSign.isValidSign(ess, new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) {
|
||||
if (((block.getType() == Material.WALL_SIGN || block.getType() == SIGN_POST) && EssentialsSign.isValidSign(ess, new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.utils.MaterialUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -54,7 +55,7 @@ public class SignPlayerListener implements Listener {
|
||||
}
|
||||
|
||||
final Material mat = block.getType();
|
||||
if (mat == Material.SIGN || mat == Material.WALL_SIGN) {
|
||||
if (MaterialUtil.isSign(mat)) {
|
||||
final String csign = ((Sign) block.getState()).getLine(0);
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns()) {
|
||||
if (csign.equalsIgnoreCase(sign.getSuccessName(ess))) {
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.Trade.OverflowType;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import com.earth2me.essentials.utils.MaterialUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import org.bukkit.Location;
|
||||
@@ -21,13 +23,14 @@ import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
@Deprecated // This sign will be removed soon
|
||||
public class SignProtection extends EssentialsSign {
|
||||
private final transient Set<Material> protectedBlocks = EnumSet.noneOf(Material.class);
|
||||
private final transient Set<Material> protectedBlocks = EnumUtil.getAllMatching(Material.class,
|
||||
"CHEST",
|
||||
"FURNACE",
|
||||
"BURNING_FURNACE",
|
||||
"DISPENSER");
|
||||
|
||||
public SignProtection() {
|
||||
super("Protection");
|
||||
protectedBlocks.add(Material.CHEST);
|
||||
protectedBlocks.add(Material.FURNACE);
|
||||
protectedBlocks.add(Material.DISPENSER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,7 +105,7 @@ public class SignProtection extends EssentialsSign {
|
||||
}
|
||||
|
||||
private SignProtectionState checkProtectionSign(final Block block, final User user, final String username) {
|
||||
if (block.getType() == Material.SIGN || block.getType() == Material.WALL_SIGN) {
|
||||
if (MaterialUtil.isSign(block.getType())) {
|
||||
final BlockSign sign = new BlockSign(block);
|
||||
if (sign.getLine(0).equals(this.getSuccessName())) { // TODO call getSuccessName(IEssentials)
|
||||
return checkProtectionSign(sign, user, username);
|
||||
@@ -159,7 +162,7 @@ public class SignProtection extends EssentialsSign {
|
||||
public boolean isBlockProtected(final Block block) {
|
||||
final Block[] faces = getAdjacentBlocks(block);
|
||||
for (Block b : faces) {
|
||||
if (b.getType() == Material.SIGN || b.getType() == Material.WALL_SIGN) {
|
||||
if (MaterialUtil.isSign(b.getType())) {
|
||||
final Sign sign = (Sign) b.getState();
|
||||
if (sign.getLine(0).equalsIgnoreCase("§1[Protection]")) {
|
||||
return true;
|
||||
@@ -169,7 +172,7 @@ public class SignProtection extends EssentialsSign {
|
||||
final Block[] faceChest = getAdjacentBlocks(b);
|
||||
|
||||
for (Block a : faceChest) {
|
||||
if (a.getType() == Material.SIGN || a.getType() == Material.WALL_SIGN) {
|
||||
if (MaterialUtil.isSign(a.getType())) {
|
||||
final Sign sign = (Sign) a.getState();
|
||||
if (sign.getLine(0).equalsIgnoreCase("§1[Protection]")) {
|
||||
return true;
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.regex.Pattern;
|
||||
public class VersionUtil {
|
||||
|
||||
public static final BukkitVersion v1_8_8_R01 = BukkitVersion.fromString("1.8.8-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_9_R01 = BukkitVersion.fromString("1.9-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_9_4_R01 = BukkitVersion.fromString("1.9.4-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_10_2_R01 = BukkitVersion.fromString("1.10.2-R0.1-SNAPSHOT");
|
||||
public static final BukkitVersion v1_11_2_R01 = BukkitVersion.fromString("1.11.2-R0.1-SNAPSHOT");
|
||||
|
||||
@@ -211,6 +211,7 @@ is=is
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76is banned.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74That item cannot be sold to the server.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
|
||||
itemNames=\u00a76Item short names\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74You do not have enough of that item to sell.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=je
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76je zabanovana.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74Tento predmet nelze prodat serveru.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Predmety musi byt vymeneny ve stacku.
|
||||
itemNames=\u00a76Zkracene nazvy predmetu\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Nemas dostatek, aby jsi jej mohl prodat.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=er
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76er banlyst.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74Det element kan ikke s\u00e6lges til serveren.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Elementet skal forhandles i form at stakke. En m\u00e6ngde af 2s vil v\u00e6re 2 stakke, osv.
|
||||
itemNames=\u00a76Elementforkortelser\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Du har ikke nok af det element til at s\u00e6lge det.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=ist
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76wurde gesperrt.
|
||||
internalError=\u00a7cBeim ausf\u00fchren des Befehls ist ein interner Fehler aufgetreten.
|
||||
itemCannotBeSold=\u00a74Dieser Gegenstand kann nicht verkauft werden.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Gegenstand muss als Stapel verkauft werden. Eine Anzahl von 2s verkauft 2 Stapel usw.
|
||||
itemNames=\u00a76Kurze Gegenstandsnamen\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Du hast nicht genug Gegenst\u00e4nde zu verkaufen.
|
||||
@@ -574,7 +575,7 @@ versionOutputVaultMissing=\u00a74Vault ist nicht installiert. Der Chat und die P
|
||||
versionOutputFine=\u00a76{0} Version: \u00a7a{1}
|
||||
versionOutputWarn=\u00a76{0} Version: \u00a7c{1}
|
||||
versionOutputUnsupported=\u00a7d{0} \u00a76Version: \u00a7d{1}
|
||||
versionOutputUnsupportedPlugins=\u00a76Du verwendest Plugins, die \u00a7nicht unterst\u00fctzt\u00a76 werden.!
|
||||
versionOutputUnsupportedPlugins=\u00a76Du verwendest Plugins, die \u00A7dnicht \u00a76unterst\u00fctzt werden!
|
||||
versionMismatch=\u00a74Versionen sind nicht gleich\! Bitte aktualisiere {0}.
|
||||
versionMismatchAll=\u00a74Versionen sind nicht gleich\! Bitte aktualisiere alle Essentials jar-Dateien auf die gleiche Version.
|
||||
voiceSilenced=\u00a76Du bist nun stummgeschaltet\!
|
||||
|
||||
@@ -211,6 +211,7 @@ is=is
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76is banned.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74That item cannot be sold to the server.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
|
||||
itemNames=\u00a76Item short names\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74You do not have enough of that item to sell.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76Eliminado\u00a7c {0} \u00a76de\u00a7c {1} \u00a76d
|
||||
is=es
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76est\u00e1 baneada.
|
||||
itemCannotBeSold=\u00a74\u00a1Ese objeto no puede ser vendido al servidor\!
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=El objeto tiene que ser intercambiado en montones. Una cantidad de 2s ser\u00edan dos montones, etc.
|
||||
itemNames=\u00a76Nombre corto del \u00edtem\:\u00a7r {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=on
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76on blokeeritud.
|
||||
internalError=\u00a7cSelle k\u00e4skluse t\u00e4itmisel esines sisemine viga.
|
||||
itemCannotBeSold=\u00a74Seda eset ei saa serverile m\u00fc\u00fca.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Eset peab vahetama kuhjadena. N\u00e4iteks kogus 2s oleks kaks kuhja jne.
|
||||
itemNames=\u00a76Eseme l\u00fchinimed\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Sul pole sellest esemest m\u00fc\u00fcmiseks piisavat hulka.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76Removed\u00a7c {0} \u00a76of\u00a7c {1} \u00a76fro
|
||||
is=on
|
||||
isIpBanned=\u00a76IP \u00a7c {0} \u00a76On karkoitettu.
|
||||
itemCannotBeSold=Tuota tavaraa ei voi myyd\u00e4 t\u00e4ll\u00e4 palvelimella.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=Tavara pit\u00e4\u00e4 vaihtaa pakattuina. M\u00e4\u00e4r\u00e4 2s olisi kaksi pakettia, jne.
|
||||
itemNames=\u00a76Item short names\:\u00a7r {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=est
|
||||
isIpBanned=\u00a76L''IP \u00a7c{0} \u00a76est bannie.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
|
||||
itemNames=Noms d''item courts \: {0}
|
||||
itemNotEnough1=\u00a7cVous n''avez pas assez de cet objet pour le vendre.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=van
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76m\u00e1r ki van tiltva.
|
||||
internalError=\u00a7cBels\u00f5 hiba t\u00f6rt\u00e9nt a parancs v\u00e9grehajt\u00e1sa k\u00f6zben.
|
||||
itemCannotBeSold=\u00a74Ezt nem adhatod el a szerveren.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74A t\u00e1rgyat k\u00f6tegben kell \u00e9rt\u00e9kes\u00edteni. A 2s mennyis\u00e9ge k\u00e9t stack lenne, stb.
|
||||
itemNames=\u00a76T\u00e1rgy r\u00f6vid nevei\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Nincs el\u00e9g eladni val\u00f3 t\u00e1rgyad.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=\u00E8
|
||||
isIpBanned=\u00a76L''IP \u00a7c{0} \u00a76\u00e8 bannato.
|
||||
internalError=\u00a7cSi \u00e8 verificato un errore durante l''esecuzione di questo comando.
|
||||
itemCannotBeSold=\u00a74Quell''oggetto non pu\u00F2 essere venduto al server.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74L''oggetto deve essere scambiato in stack. Una quantit\u00E0 di 2 sarebbero due stack, etc.
|
||||
itemNames=\u00a76Nomi corti oggetti\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Non hai abbastanza di quell''oggetto per venderlo.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76Removed\u00a7c {0} \u00a76of\u00a7c {1} \u00a76fro
|
||||
is=\uc740/\ub294
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76\ub294 \ucc28\ub2e8 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.
|
||||
itemCannotBeSold=\uadf8 \uc544\uc774\ud15c\uc740 \uc11c\ubc84\uc5d0 \ud314 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=\uc544\uc774\ud15c\uc744 \uac70\ub798\ud558\uae30 \uc704\ud574\uc11c 2\uac1c \uc774\uc0c1\uc758 \uac19\uc740\uc544\uc774\ud15c\uc744 \uac00\uc9c0\uace0\uc788\uc5b4\uc57c\ud569\ub2c8\ub2e4.
|
||||
itemNames=\u00a76\uc9e7\uc740 \uc544\uc774\ud15c \uc774\ub984\:\u00a7r {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=is
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76yra u\u017eblokuotas.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74\u0160is daiktas negali b\u016bti parduotas serveryje.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Daiktas turi buti parduotas po 1 stack.
|
||||
itemNames=\u00a76Daikt\u0173 trumpi pavadinimai\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Tu neturi pakankamai daiktu pardavimui.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76\u00a7c {0} \u00a76stuks\u00a7c {1} \u00a76zijn ve
|
||||
is=is
|
||||
isIpBanned=\u00a76IP \u00a7c {0} \u00a76is verbannen.
|
||||
itemCannotBeSold=Dat voorwerp kan niet aan de server worden verkocht.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc.
|
||||
itemNames=Kortere namen voor het item\: {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=jest
|
||||
isIpBanned=\u00a77IP \u00a7c{0} \u00a77jest zbanowany.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a7rNie mo\u017Cesz sprzeda\u0107 tego przedmiotu serwerowi.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Przedmiotem handluje si\u0119 w stackach. Wielko\u015B\u0107 2s to dwa stacki itd.
|
||||
itemNames=\u00a77Kr\u00F3tka nazwa\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74Masz za ma\u0142o tego przedmiotu, aby go sprzeda\u0107.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00A76Removido\u00A7c {0} \u00A76de\u00A7c {1} \u00A76de
|
||||
is=\u00E9
|
||||
isIpBanned=\u00A76IP \u00A7c{0} \u00A76 est\u00E1 banido.
|
||||
itemCannotBeSold=\u00A74Esse item n\u00E3o pode ser vendido ao servidor.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=\u00A74O item tem de ser trocado em stacks. A quantidade de 2 deveria ser 2 stacks, etc.
|
||||
itemNames=\u00A76Nomes pequenos para o itens:\u00A7r {0}
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00A76Removido\u00A7c {0} \u00A76de\u00A7c {1} \u00A76de
|
||||
is=\u00E9
|
||||
isIpBanned=\u00A76IP \u00A7c{0} \u00A76 est\u00E1 banido.
|
||||
itemCannotBeSold=\u00A74Esse item n\u00E3o pode ser vendido para o servidor.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=\u00A74O item deve ser trocado em packs. A quantidade de 2 deveria ser 2 packs, etc.
|
||||
itemNames=\u00A76Nomes pequenos para o item\:\u00A7r {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=este
|
||||
isIpBanned=\u00a76IP-ul \u00a7c {0} \u00a76este interzis.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74Acest obiect nu poate fi vandut pe server.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74Obiectul trebuie comercializat in stacuri. O cantitate de 2s ar trebuie sa fie 2 stacuri, s.a.m.d.
|
||||
itemNames=\u00a76Numele scurte ale obiectului\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74YNu ai destul din acest obiect pentru a-l putea vinde.
|
||||
|
||||
@@ -211,6 +211,7 @@ is=\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76\u0437\u0430\u0431\u0430\u043d\u0435\u043d.
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74\u042d\u0442\u043e\u0442 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u043d.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74\u041f\u0440\u0435\u0434\u043c\u0435\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u0441\u0442\u0430\u043a\u0435. A quantity of 2s would be two stacks, etc.
|
||||
itemNames=\u00a76\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74\u0423 \u0412\u0430\u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76Tog bort \u00a7c {0} \u00a76av\u00a7c {1} \u00a76f
|
||||
is=\u00e4r
|
||||
isIpBanned=\u00a76IP \u00a7c {0} \u00a76\u00e4r bannad.
|
||||
itemCannotBeSold=Det objektet kan inte s\u00e4ljas till servern.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=Objektet m\u00e5ste k\u00f6pas i staplar. En m\u00e4ngd av 2s kommer bli 2 staplar, etc.
|
||||
itemNames=F\u00f6rkortning p\u00e5 objekt\: {0}
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76Silindi\u00a7c {0} \u00a76of\u00a7c {1} \u00a76Tar
|
||||
is=olan
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76yasaklandi.
|
||||
itemCannotBeSold=\u00a74Bu Esyayi Sunucuya Satamazsiniz\!
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=\u00a74Esya Takasi Icin Elindeki Esyanin Bir Stack(Dolu 64) Olmasi Gerekir.
|
||||
itemNames=\u00a76Esya Kisaltmalari\:\u00a7r {0}
|
||||
|
||||
@@ -188,6 +188,7 @@ invalidWarpName=\u00a74\u0054\u00ea\u006e \u006b\u0068\u0075 \u0076\u1ef1\u0063
|
||||
invalidWorld=\u00a74\u0054\u0068\u1ebf \u0067\u0069\u1edb\u0069 \u006b\u0068\u00f4\u006e\u0067 \u0068\u1ee3\u0070 \u006c\u1ec7.
|
||||
is=\u006c\u01b0\u0075 \u0067\u0069\u1eef
|
||||
itemCannotBeSold=\u00a74\u0056\u1ead\u0074 \u0070\u0068\u1ea9\u006d \u006e\u00e0\u0079 \u006b\u0068\u00f4\u006e\u0067 \u0074\u0068\u1ec3 \u0062\u00e1\u006e \u0074\u0072\u00ea\u006e \u006d\u00e1\u0079 \u0063\u0068\u1ee7.
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74\u0056\u1ead\u0074 \u0070\u0068\u1ea9\u006d \u0111\u1ed5\u0069 \u0111\u01b0\u1ee3\u0063 \u0070\u0068\u1ea3\u0069 \u0111\u1ea7\u0079\u002e \u004d\u1ed9\u0074 \u0073\u1ed1 \u006c\u01b0\u1ee3\u006e\u0067 \u0111\u1ea7\u0079 \u0068\u01a1\u006e \u006e\u00f3 \u0073\u1ebd \u0074\u0068\u00e0\u006e\u0068 \u0068\u0061\u0069\u002c \u0076\u002e\u0076\u002e\u002e\u002e.
|
||||
itemNames=\u00a76\u0054\u00ea\u006e \u0074\u0068\u0075 \u0067\u1ecd\u006e\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74\u0042\u1ea1\u006e \u006b\u0068\u00f4\u006e\u0067 \u0063\u00f3 \u0111\u1ee7 \u0076\u1ead\u0074 \u0070\u0068\u1ea9\u006d \u0111\u1ec3 \u0062\u00e1\u006e.
|
||||
|
||||
@@ -210,6 +210,7 @@ inventoryClearingStack=\u00a76\u79fb\u9664\u00a7c {0} \u00a76\u4e2a\u00a7c {1} \
|
||||
is=\u662f
|
||||
isIpBanned=\u00a76IP\u5730\u5740 \u00a7c{0} \u00a76\u5df2\u88ab\u5c01\u7981.
|
||||
itemCannotBeSold=\u00a74\u8be5\u7269\u54c1\u65e0\u6cd5\u5356\u7ed9\u670d\u52a1\u5668
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemMustBeStacked=\u00a74\u7269\u54c1\u5fc5\u987b\u6210\u7ec4\u7684\u8fdb\u884c\u4ea4\u6613,2s\u4ee3\u8868\u7684\u6570\u91cf\u662f2\u7ec4\u7269\u54c1,\u4ee5\u6b64\u7c7b\u63a8
|
||||
itemNames=\u00a76\u7269\u54c1\u7b80\u6613\u540d\u79f0\:\u00a7r {0}
|
||||
|
||||
@@ -211,6 +211,7 @@ is=\u662f
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76\u5df2\u88ab\u5c01\u9396\u3002
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74\u8a72\u7269\u54c1\u7121\u6cd5\u8ce3\u7d66\u670d\u52d9\u5668
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74\u7269\u54c1\u5fc5\u9808\u6210\u7d44\u4ea4\u6613,2s\u7684\u6578\u91cf\u662f2\u7d44,\u4ee5\u6b64\u985e\u63a8
|
||||
itemNames=\u00a76\u7269\u54c1\u7c21\u6613\u540d\u7a31\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74\u4f60\u6c92\u6709\u8db3\u5920\u7684\u8a72\u7269\u54c1\u4f86\u8ce3\u51fa
|
||||
|
||||
@@ -211,6 +211,7 @@ is=\u662f
|
||||
isIpBanned=\u00a76IP \u00a7c{0} \u00a76\u5df2\u88ab\u5c01\u9396\u3002
|
||||
internalError=\u00a7cAn internal error occurred while attempting to perform this command.
|
||||
itemCannotBeSold=\u00a74\u8a72\u7269\u54c1\u7121\u6cd5\u8ce3\u7d66\u4f3a\u670d\u5668
|
||||
itemId=\u00a76ID\:\u00a7c {0}
|
||||
itemMustBeStacked=\u00a74\u7269\u54c1\u5fc5\u9808\u6210\u7d44\u4ea4\u6613,2s\u7684\u6578\u91cf\u662f2\u7d44,\u4ee5\u6b64\u985e\u63a8
|
||||
itemNames=\u00a76\u7269\u54c1\u7c21\u6613\u540d\u7a31\:\u00a7r {0}
|
||||
itemNotEnough1=\u00a74\u4f60\u6c92\u6709\u8db3\u5920\u7684\u8a72\u7269\u54c1\u4f86\u8ce3\u51fa
|
||||
|
||||
+25
-6
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.antibuild;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -56,7 +57,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return metaPermCheck(user, action, block.getType());
|
||||
return metaPermCheck(user, action, block.getType(), block.getData());
|
||||
}
|
||||
|
||||
private boolean metaPermCheck(final User user, final String action, final Material material) {
|
||||
@@ -64,6 +65,24 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
return user.isAuthorized(blockPerm);
|
||||
}
|
||||
|
||||
private boolean metaPermCheck(final User user, final String action, final Material material, final short data) {
|
||||
final String blockPerm = "essentials.build." + action + "." + material;
|
||||
final String dataPerm = blockPerm + ":" + data;
|
||||
|
||||
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_13_0_R01)) {
|
||||
if (user.getBase().isPermissionSet(dataPerm)) {
|
||||
return user.isAuthorized(dataPerm);
|
||||
} else {
|
||||
if (ess.getSettings().isDebug()) {
|
||||
ess.getLogger().log(Level.INFO, "DataValue perm on " + user.getName() + " is not directly set: " + dataPerm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return user.isAuthorized(blockPerm);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(final BlockPlaceEvent event) {
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -181,7 +200,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
}
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) {
|
||||
if (event.hasItem() && !metaPermCheck(user, "interact", item.getType())) {
|
||||
if (event.hasItem() && !metaPermCheck(user, "interact", item.getType(), item.getDurability())) {
|
||||
event.setCancelled(true);
|
||||
if (ess.getSettings().warnOnBuildDisallow()) {
|
||||
user.sendMessage(tl("antiBuildUse", item.getType().toString()));
|
||||
@@ -206,7 +225,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
final ItemStack item = event.getRecipe().getResult();
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) {
|
||||
if (!metaPermCheck(user, "craft", item.getType())) {
|
||||
if (!metaPermCheck(user, "craft", item.getType(), item.getDurability())) {
|
||||
event.setCancelled(true);
|
||||
if (ess.getSettings().warnOnBuildDisallow()) {
|
||||
user.sendMessage(tl("antiBuildCraft", item.getType().toString()));
|
||||
@@ -223,7 +242,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
final ItemStack item = event.getItemDrop().getItemStack();
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) {
|
||||
if (!metaPermCheck(user, "drop", item.getType())) {
|
||||
if (!metaPermCheck(user, "drop", item.getType(), item.getDurability())) {
|
||||
event.setCancelled(true);
|
||||
user.getBase().updateInventory();
|
||||
if (ess.getSettings().warnOnBuildDisallow()) {
|
||||
@@ -250,7 +269,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
final ItemStack item = event.getItem().getItemStack();
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) {
|
||||
if (!metaPermCheck(user, "pickup", item.getType())) {
|
||||
if (!metaPermCheck(user, "pickup", item.getType(), item.getDurability())) {
|
||||
event.setCancelled(true);
|
||||
event.getItem().setPickupDelay(50);
|
||||
}
|
||||
@@ -266,7 +285,7 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
final ItemStack item = event.getItem().getItemStack();
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) {
|
||||
if (!metaPermCheck(user, "pickup", item.getType())) {
|
||||
if (!metaPermCheck(user, "pickup", item.getType(), item.getDurability())) {
|
||||
event.setCancelled(true);
|
||||
event.getItem().setPickupDelay(50);
|
||||
}
|
||||
|
||||
+9
-2
@@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials.protect;
|
||||
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -12,8 +13,14 @@ import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.world.PortalCreateEvent;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class EssentialsProtectBlockListener implements Listener {
|
||||
|
||||
private static final Set<Material> WATER_TYPES = EnumUtil.getAllMatching(Material.class, "WATER", "STATIONARY_WATER");
|
||||
private static final Set<Material> LAVA_TYPES = EnumUtil.getAllMatching(Material.class, "LAVA", "STATIONARY_LAVA");
|
||||
|
||||
final private IProtect prot;
|
||||
final private IEssentials ess;
|
||||
|
||||
@@ -57,12 +64,12 @@ public class EssentialsProtectBlockListener implements Listener {
|
||||
public void onBlockFromTo(final BlockFromToEvent event) {
|
||||
final Block block = event.getBlock();
|
||||
|
||||
if (block.getType() == Material.WATER || block.getType() == Material.WATER) {
|
||||
if (WATER_TYPES.contains(block.getType())) {
|
||||
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_flow));
|
||||
return;
|
||||
}
|
||||
|
||||
if (block.getType() == Material.LAVA || block.getType() == Material.LAVA) {
|
||||
if (LAVA_TYPES.contains(block.getType())) {
|
||||
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_lava_flow));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ The official upstream repository is at https://github.com/Essentials/Essentials.
|
||||
Why use EssentialsX?
|
||||
--------
|
||||
|
||||
EssentialsX is an unofficial continuation of EssentialsX, updated to support modern Minecraft and Spigot versions. It provides several performance enhancements and fixes that are currently not available in Essentials and Spigot-Essentials. [For more details, see the wiki.](https://essentialsx.github.io/#/Improvements)
|
||||
EssentialsX is an unofficial continuation of Essentials, updated to support modern Minecraft and Spigot versions. It provides several performance enhancements and fixes that are currently not available in Essentials and Spigot-Essentials. [For more details, see the wiki.](https://essentialsx.github.io/#/Improvements)
|
||||
|
||||
EssentialsX is almost a completely drop-in replacement for Essentials. However, it has different requirements:
|
||||
|
||||
@@ -24,7 +24,7 @@ EssentialsX is almost a completely drop-in replacement for Essentials. However,
|
||||
|
||||
* **If you have an unsupported permissions plugin but still wish to use wildcards, enable `use-bukkit-permissions` in the configuration.** Otherwise, the plugin will fall back to config-based permissions.
|
||||
|
||||
* **EssentialsX requires Java 8 or higher.** On older versions, the plugin may not work properly.
|
||||
* **EssentialsX requires Java 8 or higher.** On older versions, the plugin may not work properly.
|
||||
|
||||
* **EssentialsX supports Minecraft versions 1.8.8, 1.9.4, 1.10.2, 1.11.2 and 1.12.2.** Support for 1.13.2 is coming soon.
|
||||
|
||||
@@ -41,21 +41,19 @@ Building
|
||||
--------
|
||||
|
||||
EssentialsX builds against the Spigot/CraftBukkit server software for legacy support.
|
||||
To compile EssentialsX, you first need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools) several times:
|
||||
|
||||
```
|
||||
java -jar BuildTools.jar --rev 1.8
|
||||
java -jar BuildTools.jar --rev 1.8.3
|
||||
java -jar BuildTools.jar --rev 1.9
|
||||
java -jar BuildTools.jar --rev 1.9.4
|
||||
```
|
||||
To compile EssentialsX, you first need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools).
|
||||
This only needs to be done once. There are two ways to do this:
|
||||
|
||||
Then, to build with Maven, run the following command:
|
||||
* Use the provided script at `scripts/buildtools.sh` to automatically download and run BuildTools if needed.
|
||||
* Download and run BuildTools yourself for versions `1.8` and `1.8.3`.
|
||||
|
||||
Next, to build EssentialsX with Maven, run the following command:
|
||||
```
|
||||
mvn clean install
|
||||
```
|
||||
|
||||
Each module's jar can be found in `target/` inside each module's directory.
|
||||
Each module's jar can be found in `target/` inside each module's directory.
|
||||
|
||||
|
||||
Contributing
|
||||
@@ -66,7 +64,7 @@ Want to help improve EssentialsX? There are numerous ways you can contribute to
|
||||
If you'd like to make a financial contribution to the project, you can join our [Patreon](https://www.patreon.com/essentialsx/).
|
||||
If you can't make a donation, don't worry! There's lots of other ways to contribute:
|
||||
|
||||
* Do you run a server? Take a look at our ["help wanted" issues](https://github.com/EssentialsX/Essentials/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22),
|
||||
* Do you run a server? Take a look at our ["help wanted" issues](https://github.com/EssentialsX/Essentials/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22),
|
||||
where you can find issues that need extra testing and investigation. You can also join the [MOSS Discord community](https://discord.gg/casfFyh)
|
||||
and provide support to others.
|
||||
* Do you speak multiple languages? If so, we always welcome pull requests to our [language files](https://essentialsx.github.io/#/Locale).
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.20</version>
|
||||
<version>1.18.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -266,7 +266,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<!-- The plugins' release version -->
|
||||
<release.version>2.16-pre3</release.version>
|
||||
<release.version>2.16.0</release.version>
|
||||
|
||||
<!-- The plugins' build number -->
|
||||
<build.version>${git.closest.tag.commit.count}</build.version>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
mkdir -p .buildtools
|
||||
pushd .buildtools
|
||||
|
||||
is_installed() {
|
||||
mvn dependency:get -q -Dartifact=$1 -DremoteRepositories=file://$HOME/.m2/repository 1>/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
ensure_buildtools() {
|
||||
if [ ! -f "BuildTools.jar" ]; then
|
||||
echo "Downloading BuildTools..."
|
||||
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
|
||||
fi
|
||||
}
|
||||
|
||||
run_buildtools() {
|
||||
ensure_buildtools
|
||||
java -jar BuildTools.jar --rev $1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Running BuildTools for CB $1 failed! Aborting."
|
||||
popd
|
||||
exit 255
|
||||
else
|
||||
echo "Successfully built version $1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check CB 1.8
|
||||
is_installed org.bukkit:craftbukkit:1.8-R0.1-SNAPSHOT
|
||||
is_18=$? # 0 = present, 1 = not present
|
||||
|
||||
# Check CB 1.8.3
|
||||
is_installed org.bukkit:craftbukkit:1.8.3-R0.1-SNAPSHOT
|
||||
is_183=$?
|
||||
|
||||
if [ $is_18 -ne 0 ]; then
|
||||
echo "Installing CraftBukkit 1.8..."
|
||||
run_buildtools 1.8
|
||||
else
|
||||
echo "CraftBukkit 1.8 installed; skipping BuildTools..."
|
||||
fi
|
||||
|
||||
if [ $is_183 -ne 0 ]; then
|
||||
echo "Installing CraftBukkit 1.8.3..."
|
||||
run_buildtools 1.8.3
|
||||
else
|
||||
echo "CraftBukkit 1.8.3 installed; skipping BuildTools..."
|
||||
fi
|
||||
|
||||
popd
|
||||
Reference in new issue
Block a user