mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Update to 1.16.1 (#3408)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com> Co-authored-by: md678685 <1917406+md678685@users.noreply.github.com> Co-authored-by: pop4959 <pop4959@gmail.com>
This commit is contained in:
parent
edf2f295d1
commit
1ab1b5713e
@ -52,6 +52,12 @@
|
|||||||
<groupId>com.github.milkbowl</groupId>
|
<groupId>com.github.milkbowl</groupId>
|
||||||
<artifactId>VaultAPI</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.bukkit</groupId>
|
||||||
|
<artifactId>bukkit</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -76,6 +82,12 @@
|
|||||||
<groupId>net.ess3</groupId>
|
<groupId>net.ess3</groupId>
|
||||||
<artifactId>NMSReflectionProvider</artifactId>
|
<artifactId>NMSReflectionProvider</artifactId>
|
||||||
<version>2.17.2</version>
|
<version>2.17.2</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.bukkit</groupId>
|
||||||
|
<artifactId>bukkit</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -90,5 +102,17 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.ess3</groupId>
|
||||||
|
<artifactId>1_8Provider</artifactId>
|
||||||
|
<version>2.17.2</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.bukkit</groupId>
|
||||||
|
<artifactId>bukkit</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -356,17 +356,18 @@ public class AsyncTeleport implements IAsyncTeleport {
|
|||||||
|
|
||||||
void respawnNow(IUser teleportee, TeleportCause cause, CompletableFuture<Boolean> future) {
|
void respawnNow(IUser teleportee, TeleportCause cause, CompletableFuture<Boolean> future) {
|
||||||
final Player player = teleportee.getBase();
|
final Player player = teleportee.getBase();
|
||||||
Location bed = player.getBedSpawnLocation();
|
PaperLib.getBedSpawnLocationAsync(player, true).thenAccept(location -> {
|
||||||
if (bed != null) {
|
if (location != null) {
|
||||||
nowAsync(teleportee, new LocationTarget(bed), cause, future);
|
nowAsync(teleportee, new LocationTarget(location), cause, future);
|
||||||
} else {
|
} else {
|
||||||
if (ess.getSettings().isDebug()) {
|
if (ess.getSettings().isDebug()) {
|
||||||
ess.getLogger().info("Could not find bed spawn, forcing respawn event.");
|
ess.getLogger().info("Could not find bed spawn, forcing respawn event.");
|
||||||
|
}
|
||||||
|
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
|
||||||
|
ess.getServer().getPluginManager().callEvent(pre);
|
||||||
|
nowAsync(teleportee, new LocationTarget(pre.getRespawnLocation()), cause, future);
|
||||||
}
|
}
|
||||||
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
|
});
|
||||||
ess.getServer().getPluginManager().callEvent(pre);
|
|
||||||
nowAsync(teleportee, new LocationTarget(pre.getRespawnLocation()), cause, future);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -251,6 +251,15 @@ public class Enchantments {
|
|||||||
}
|
}
|
||||||
} catch (IllegalArgumentException ignored) {}
|
} catch (IllegalArgumentException ignored) {}
|
||||||
|
|
||||||
|
try { // 1.16
|
||||||
|
Enchantment soulspeed = Enchantment.getByName("SOUL_SPEED");
|
||||||
|
if (soulspeed != null) {
|
||||||
|
ENCHANTMENTS.put("soulspeed", soulspeed);
|
||||||
|
ALIASENCHANTMENTS.put("soilspeed", soulspeed);
|
||||||
|
ALIASENCHANTMENTS.put("sandspeed", soulspeed);
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException ignored) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class<?> namespacedKeyClass = Class.forName("org.bukkit.NamespacedKey");
|
Class<?> namespacedKeyClass = Class.forName("org.bukkit.NamespacedKey");
|
||||||
Class<?> enchantmentClass = Class.forName("org.bukkit.enchantments.Enchantment");
|
Class<?> enchantmentClass = Class.forName("org.bukkit.enchantments.Enchantment");
|
||||||
|
@ -122,15 +122,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
super(new JavaPluginLoader(server), new PluginDescriptionFile("Essentials", "", "com.earth2me.essentials.Essentials"), null, null);
|
super(new JavaPluginLoader(server), new PluginDescriptionFile("Essentials", "", "com.earth2me.essentials.Essentials"), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public void forceLoadClasses() {
|
|
||||||
try {
|
|
||||||
Class.forName(OfflinePlayer.class.getName());
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ISettings getSettings() {
|
public ISettings getSettings() {
|
||||||
return settings;
|
return settings;
|
||||||
@ -193,8 +184,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forceLoadClasses();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
|
final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
|
||||||
upgrade.beforeSettings();
|
upgrade.beforeSettings();
|
||||||
|
@ -399,11 +399,14 @@ public class EssentialsPlayerListener implements Listener {
|
|||||||
|
|
||||||
Location loc = user.getHome(user.getLocation());
|
Location loc = user.getHome(user.getLocation());
|
||||||
if (loc == null) {
|
if (loc == null) {
|
||||||
loc = user.getBase().getBedSpawnLocation();
|
PaperLib.getBedSpawnLocationAsync(user.getBase(), false).thenAccept(location -> {
|
||||||
}
|
if (location != null) {
|
||||||
if (loc != null) {
|
user.getBase().setCompassTarget(location);
|
||||||
user.getBase().setCompassTarget(loc);
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
user.getBase().setCompassTarget(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
|
@ -3,8 +3,6 @@ package com.earth2me.essentials;
|
|||||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||||
import com.earth2me.essentials.signs.EssentialsSign;
|
import com.earth2me.essentials.signs.EssentialsSign;
|
||||||
import com.earth2me.essentials.textreader.IText;
|
import com.earth2me.essentials.textreader.IText;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -93,7 +91,7 @@ public interface ISettings extends IConf {
|
|||||||
|
|
||||||
String getNicknamePrefix();
|
String getNicknamePrefix();
|
||||||
|
|
||||||
ChatColor getOperatorColor() throws Exception;
|
String getOperatorColor() throws Exception;
|
||||||
|
|
||||||
boolean getPerWarpPermission();
|
boolean getPerWarpPermission();
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ public enum Mob {
|
|||||||
GIANT("Giant", Enemies.ENEMY, EntityType.GIANT),
|
GIANT("Giant", Enemies.ENEMY, EntityType.GIANT),
|
||||||
HORSE("Horse", Enemies.FRIENDLY, EntityType.HORSE),
|
HORSE("Horse", Enemies.FRIENDLY, EntityType.HORSE),
|
||||||
PIG("Pig", Enemies.FRIENDLY, EntityType.PIG),
|
PIG("Pig", Enemies.FRIENDLY, EntityType.PIG),
|
||||||
PIGZOMB("PigZombie", Enemies.NEUTRAL, EntityType.PIG_ZOMBIE),
|
PIGZOMB("PigZombie", Enemies.NEUTRAL, MobCompat.ZOMBIFIED_PIGLIN),
|
||||||
|
ZOMBIFIED_PIGLIN("ZombifiedPiglin", Enemies.NEUTRAL, MobCompat.ZOMBIFIED_PIGLIN),
|
||||||
SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP),
|
SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP),
|
||||||
SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON),
|
SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON),
|
||||||
SLIME("Slime", Enemies.ENEMY, EntityType.SLIME),
|
SLIME("Slime", Enemies.ENEMY, EntityType.SLIME),
|
||||||
@ -90,7 +91,12 @@ public enum Mob {
|
|||||||
RAVAGER("Ravager", Enemies.ENEMY, "RAVAGER"),
|
RAVAGER("Ravager", Enemies.ENEMY, "RAVAGER"),
|
||||||
TRADER_LLAMA("TraderLlama", Enemies.FRIENDLY, "TRADER_LLAMA"),
|
TRADER_LLAMA("TraderLlama", Enemies.FRIENDLY, "TRADER_LLAMA"),
|
||||||
WANDERING_TRADER("WanderingTrader", Enemies.FRIENDLY, "WANDERING_TRADER"),
|
WANDERING_TRADER("WanderingTrader", Enemies.FRIENDLY, "WANDERING_TRADER"),
|
||||||
BEE("Bee", Enemies.NEUTRAL, "BEE")
|
BEE("Bee", Enemies.NEUTRAL, "BEE"),
|
||||||
|
STRAY("Stray", Enemies.ENEMY, "STRAY"),
|
||||||
|
HOGLIN("Hoglin", Enemies.ADULT_ENEMY, "HOGLIN"),
|
||||||
|
PIGLIN("Piglin", Enemies.ADULT_ENEMY, "PIGLIN"),
|
||||||
|
STRIDER("Strider", Enemies.FRIENDLY, "STRIDER"),
|
||||||
|
ZOGLIN("Zoglin", Enemies.ENEMY, "ZOGLIN"),
|
||||||
;
|
;
|
||||||
|
|
||||||
public static final Logger logger = Logger.getLogger("Essentials");
|
public static final Logger logger = Logger.getLogger("Essentials");
|
||||||
@ -154,7 +160,8 @@ public enum Mob {
|
|||||||
public enum Enemies {
|
public enum Enemies {
|
||||||
FRIENDLY("friendly"),
|
FRIENDLY("friendly"),
|
||||||
NEUTRAL("neutral"),
|
NEUTRAL("neutral"),
|
||||||
ENEMY("enemy");
|
ENEMY("enemy"),
|
||||||
|
ADULT_ENEMY("adult_enemy");
|
||||||
|
|
||||||
Enemies(final String type) {
|
Enemies(final String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -1,28 +1,42 @@
|
|||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import com.earth2me.essentials.utils.EnumUtil;
|
import com.earth2me.essentials.utils.EnumUtil;
|
||||||
|
import com.earth2me.essentials.utils.VersionUtil;
|
||||||
import net.ess3.nms.refl.ReflUtil;
|
import net.ess3.nms.refl.ReflUtil;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Fox;
|
||||||
|
import org.bukkit.entity.Llama;
|
||||||
|
import org.bukkit.entity.MushroomCow;
|
||||||
import org.bukkit.entity.Ocelot;
|
import org.bukkit.entity.Ocelot;
|
||||||
|
import org.bukkit.entity.Panda;
|
||||||
|
import org.bukkit.entity.Parrot;
|
||||||
|
import org.bukkit.entity.TropicalFish;
|
||||||
import org.bukkit.entity.Villager;
|
import org.bukkit.entity.Villager;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import static com.earth2me.essentials.utils.EnumUtil.getEntityType;
|
import static com.earth2me.essentials.utils.EnumUtil.getEntityType;
|
||||||
|
|
||||||
public class MobCompat {
|
public class MobCompat {
|
||||||
|
|
||||||
|
// Constants for mob interfaces added in later versions
|
||||||
|
public static final Class RAIDER = ReflUtil.getClassCached("org.bukkit.entity.Raider");
|
||||||
|
|
||||||
// Constants for mobs added in later versions
|
// Constants for mobs added in later versions
|
||||||
public static final EntityType LLAMA = getEntityType("LLAMA");
|
public static final EntityType LLAMA = getEntityType("LLAMA");
|
||||||
public static final EntityType PARROT = getEntityType("PARROT");
|
public static final EntityType PARROT = getEntityType("PARROT");
|
||||||
public static final EntityType TROPICAL_FISH = getEntityType("TROPICAL_FISH");
|
public static final EntityType TROPICAL_FISH = getEntityType("TROPICAL_FISH");
|
||||||
public static final EntityType PANDA = getEntityType("PANDA");
|
public static final EntityType PANDA = getEntityType("PANDA");
|
||||||
public static final EntityType TRADER_LLAMA = getEntityType("TRADER_LLAMA");
|
public static final EntityType TRADER_LLAMA = getEntityType("TRADER_LLAMA");
|
||||||
|
public static final EntityType SHULKER = getEntityType("SHULKER");
|
||||||
|
public static final EntityType STRAY = getEntityType("STRAY");
|
||||||
|
public static final EntityType FOX = getEntityType("FOX");
|
||||||
|
public static final EntityType PHANTOM = getEntityType("PHANTOM");
|
||||||
|
|
||||||
// Constants for mobs that have changed since earlier versions
|
// Constants for mobs that have changed since earlier versions
|
||||||
public static final EntityType CAT = getEntityType("CAT", "OCELOT");
|
public static final EntityType CAT = getEntityType("CAT", "OCELOT");
|
||||||
|
public static final EntityType ZOMBIFIED_PIGLIN = getEntityType("ZOMBIFIED_PIGLIN", "PIG_ZOMBIE");
|
||||||
|
|
||||||
public enum CatType {
|
public enum CatType {
|
||||||
// These are (loosely) Mojang names for the cats
|
// These are (loosely) Mojang names for the cats
|
||||||
@ -64,7 +78,7 @@ public class MobCompat {
|
|||||||
NITWIT("NITWIT", "NITWIT"),
|
NITWIT("NITWIT", "NITWIT"),
|
||||||
SHEPHERD("FARMER", "SHEPHERD"),
|
SHEPHERD("FARMER", "SHEPHERD"),
|
||||||
TOOLSMITH("BLACKSMITH", "TOOL_SMITH", "TOOLSMITH"),
|
TOOLSMITH("BLACKSMITH", "TOOL_SMITH", "TOOLSMITH"),
|
||||||
WEAPONSMITH("BLACKSMITH", "WEAPON_SMITH", "WEAPONSMITH")
|
WEAPONSMITH("BLACKSMITH", "WEAPON_SMITH", "WEAPONSMITH"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String oldProfession;
|
private final String oldProfession;
|
||||||
@ -89,41 +103,33 @@ public class MobCompat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Older cats are Ocelots, whereas 1.14+ cats are Cats
|
// Older cats are Ocelots, whereas 1.14+ cats are Cats
|
||||||
private static final Class catClass = ReflUtil.getClassCached("org.bukkit.entity.Cat");
|
|
||||||
private static final Class catTypeClass = ReflUtil.getClassCached("org.bukkit.entity.Cat.Type");
|
|
||||||
private static final Method catSetTypeMethod = (catClass == null || catTypeClass == null) ? null : ReflUtil.getMethodCached(catClass, "setCatType", catTypeClass);
|
|
||||||
|
|
||||||
private static boolean isNewCat() {
|
|
||||||
return (catClass != null && catTypeClass != null && catSetTypeMethod != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCatType(final Entity entity, final CatType type) {
|
public static void setCatType(final Entity entity, final CatType type) {
|
||||||
if (isNewCat()) {
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
|
((Ocelot) entity).setCatType(Ocelot.Type.valueOf(type.ocelotTypeName));
|
||||||
|
} else {
|
||||||
|
Class cat = ReflUtil.getClassCached("org.bukkit.entity.Cat");
|
||||||
|
Class catType = ReflUtil.getClassCached("org.bukkit.entity.Cat$Type");
|
||||||
|
Method setCatType = ReflUtil.getMethodCached(cat, "setCatType", catType);
|
||||||
try {
|
try {
|
||||||
catSetTypeMethod.invoke(entity, EnumUtil.valueOf(catTypeClass, type.catTypeName));
|
setCatType.invoke(entity, EnumUtil.valueOf(catType, type.catTypeName));
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
((Ocelot) entity).setCatType(Ocelot.Type.valueOf(type.ocelotTypeName));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Older villagers have professions and careers, 1.14+ villagers only have professions
|
// Older villagers have professions and careers, 1.14+ villagers only have professions
|
||||||
private static final Class villagerCareerClass = ReflUtil.getClassCached("org.bukkit.entity.Villager.Career");
|
|
||||||
private static final Method villagerSetCareerMethod = (villagerCareerClass == null) ? null : ReflUtil.getMethodCached(Villager.class, "setCareer", villagerCareerClass);
|
|
||||||
|
|
||||||
private static boolean isCareerVillager() {
|
|
||||||
return (villagerCareerClass != null && villagerSetCareerMethod != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setVillagerProfession(final Entity entity, final VillagerProfession profession) {
|
public static void setVillagerProfession(final Entity entity, final VillagerProfession profession) {
|
||||||
if (!isCareerVillager()) {
|
if (!(entity instanceof Villager)) {
|
||||||
((Villager) entity).setProfession(profession.asEnum());
|
return;
|
||||||
} else {
|
}
|
||||||
((Villager) entity).setProfession(profession.asEnum());
|
Villager villager = (Villager) entity;
|
||||||
|
villager.setProfession(profession.asEnum());
|
||||||
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
|
Class villagerCareer = ReflUtil.getClassCached("org.bukkit.entity.Villager$Career");
|
||||||
|
Method setCareer = ReflUtil.getMethodCached(Villager.class, "setCareer", villagerCareer);
|
||||||
try {
|
try {
|
||||||
villagerSetCareerMethod.invoke(entity, EnumUtil.valueOf(villagerCareerClass, profession.oldCareer));
|
setCareer.invoke(entity, EnumUtil.valueOf(villagerCareer, profession.oldCareer));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -132,92 +138,77 @@ public class MobCompat {
|
|||||||
|
|
||||||
// Only 1.14+ villagers have biome variants
|
// Only 1.14+ villagers have biome variants
|
||||||
public static void setVillagerType(final Entity entity, final String type) {
|
public static void setVillagerType(final Entity entity, final String type) {
|
||||||
Class typeEnum = ReflUtil.getClassCached("org.bukkit.entity.Villager.Type");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
if (typeEnum == null) return;
|
return;
|
||||||
|
}
|
||||||
Method villagerSetTypeMethod = ReflUtil.getMethodCached(Villager.class, "setVillagerType", typeEnum);
|
if (entity instanceof Villager) {
|
||||||
try {
|
((Villager) entity).setVillagerType(Villager.Type.valueOf(type));
|
||||||
villagerSetTypeMethod.invoke(entity, EnumUtil.valueOf(typeEnum, type));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Llamas only exist in 1.11+
|
// Llamas only exist in 1.11+
|
||||||
public static void setLlamaColor(final Entity entity, final String color) {
|
public static void setLlamaColor(final Entity entity, final String color) {
|
||||||
Class llamaClass = ReflUtil.getClassCached("org.bukkit.entity.Llama");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_11_R01)) {
|
||||||
if (llamaClass == null) return;
|
return;
|
||||||
|
}
|
||||||
Class colorEnum = ReflUtil.getClassCached("org.bukkit.entity.Llama.Color");
|
if (entity instanceof Llama) {
|
||||||
Method setVariantMethod = ReflUtil.getMethodCached(llamaClass, "setColor");
|
((Llama) entity).setColor(Llama.Color.valueOf(color));
|
||||||
|
|
||||||
try {
|
|
||||||
setVariantMethod.invoke(entity, EnumUtil.valueOf(colorEnum, color));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parrots only exist in 1.12+
|
// Parrots only exist in 1.12+
|
||||||
public static void setParrotVariant(final Entity entity, final String variant) {
|
public static void setParrotVariant(final Entity entity, final String variant) {
|
||||||
Class parrotClass = ReflUtil.getClassCached("org.bukkit.entity.Parrot");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_12_0_R01)) {
|
||||||
if (parrotClass == null) return;
|
return;
|
||||||
|
}
|
||||||
Class variantEnum = ReflUtil.getClassCached("org.bukkit.entity.Parrot.Variant");
|
if (entity instanceof Parrot) {
|
||||||
Method setVariantMethod = ReflUtil.getMethodCached(parrotClass, "setVariant");
|
((Parrot) entity).setVariant(Parrot.Variant.valueOf(variant));
|
||||||
try {
|
|
||||||
setVariantMethod.invoke(entity, EnumUtil.valueOf(variantEnum, variant));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tropical fish only exist in 1.13+
|
// Tropical fish only exist in 1.13+
|
||||||
public static void setTropicalFishPattern(final Entity entity, final String pattern) {
|
public static void setTropicalFishPattern(final Entity entity, final String pattern) {
|
||||||
Class tropicalFishClass = ReflUtil.getClassCached("org.bukkit.entity.TropicalFish");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_12_0_R01)) {
|
||||||
if (tropicalFishClass == null) return;
|
return;
|
||||||
|
}
|
||||||
Class patternEnum = ReflUtil.getClassCached("org.bukkit.entity.TropicalFish.Pattern");
|
if (entity instanceof TropicalFish) {
|
||||||
Method setPatternMethod = ReflUtil.getMethodCached(tropicalFishClass, "setPattern");
|
((TropicalFish) entity).setPattern(TropicalFish.Pattern.valueOf(pattern));
|
||||||
try {
|
|
||||||
setPatternMethod.invoke(entity, EnumUtil.valueOf(patternEnum, pattern));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mushroom cow variant API only exists in 1.14+
|
// Mushroom cow variant API only exists in 1.14+
|
||||||
public static void setMooshroomVariant(final Entity entity, final String variant) {
|
public static void setMooshroomVariant(final Entity entity, final String variant) {
|
||||||
Class mushroomCowClass = ReflUtil.getClassCached("org.bukkit.entity.MushroomCow");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
Class variantEnum = ReflUtil.getClassCached("org.bukkit.entity.MushroomCow.Variant");
|
return;
|
||||||
if (mushroomCowClass == null || variantEnum == null) return;
|
}
|
||||||
|
if (entity instanceof MushroomCow) {
|
||||||
Method setVariantMethod = ReflUtil.getMethodCached(mushroomCowClass, "setVariant");
|
((MushroomCow) entity).setVariant(MushroomCow.Variant.valueOf(variant));
|
||||||
try {
|
|
||||||
setVariantMethod.invoke(entity, EnumUtil.valueOf(variantEnum, variant));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pandas only exists in 1.14+
|
// Pandas only exists in 1.14+
|
||||||
public static void setPandaGene(final Entity entity, final String gene, final boolean mainGene) {
|
public static void setPandaGene(final Entity entity, final String gene, final boolean mainGene) {
|
||||||
Class pandaClass = ReflUtil.getClassCached("org.bukkit.entity.Panda");
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
if (pandaClass == null) return;
|
return;
|
||||||
|
|
||||||
Class geneEnum = ReflUtil.getClassCached("org.bukkit.entity.Panda.Gene");
|
|
||||||
Method setGeneMethod;
|
|
||||||
|
|
||||||
if (mainGene) {
|
|
||||||
setGeneMethod = ReflUtil.getMethodCached(pandaClass, "setMainGene");
|
|
||||||
} else {
|
|
||||||
setGeneMethod = ReflUtil.getMethodCached(pandaClass, "setHiddenGene");
|
|
||||||
}
|
}
|
||||||
|
if (entity instanceof Panda) {
|
||||||
|
Panda panda = (Panda) entity;
|
||||||
|
Panda.Gene pandaGene = Panda.Gene.valueOf(gene);
|
||||||
|
if (mainGene) {
|
||||||
|
panda.setMainGene(pandaGene);
|
||||||
|
} else {
|
||||||
|
panda.setHiddenGene(pandaGene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
// Foxes only exist in 1.14+
|
||||||
setGeneMethod.invoke(entity, EnumUtil.valueOf(geneEnum, gene));
|
public static void setFoxType(final Entity entity, final String type) {
|
||||||
} catch (Exception e) {
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) {
|
||||||
e.printStackTrace();
|
return;
|
||||||
|
}
|
||||||
|
if (entity instanceof Fox) {
|
||||||
|
((Fox) entity).setFoxType(Fox.Type.valueOf(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import org.bukkit.material.Colorable;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.earth2me.essentials.I18n.tl;
|
import static com.earth2me.essentials.I18n.tl;
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ public enum MobData {
|
|||||||
TAMED_TAMEABLE("tamed", Tameable.class, Data.TAMED, true),
|
TAMED_TAMEABLE("tamed", Tameable.class, Data.TAMED, true),
|
||||||
TAME_TAMEABLE("tame", Tameable.class, Data.TAMED, false),
|
TAME_TAMEABLE("tame", Tameable.class, Data.TAMED, false),
|
||||||
RANDOM_SHEEP("random", EntityType.SHEEP, Data.COLORABLE, true),
|
RANDOM_SHEEP("random", EntityType.SHEEP, Data.COLORABLE, true),
|
||||||
COLORABLE_SHEEP("", StringUtil.joinList(DyeColor.values()).toLowerCase(Locale.ENGLISH), EntityType.SHEEP, Data.COLORABLE, true),
|
COLORABLE_SHEEP("", Arrays.stream(DyeColor.values()).map(color -> color.name().toLowerCase(Locale.ENGLISH)).collect(Collectors.toList()), EntityType.SHEEP, Data.COLORABLE, true),
|
||||||
POLKA_HORSE("polka", EntityType.HORSE, Horse.Style.BLACK_DOTS, true),
|
POLKA_HORSE("polka", EntityType.HORSE, Horse.Style.BLACK_DOTS, true),
|
||||||
SOOTY_HORSE("sooty", EntityType.HORSE, Horse.Style.BLACK_DOTS, false),
|
SOOTY_HORSE("sooty", EntityType.HORSE, Horse.Style.BLACK_DOTS, false),
|
||||||
BLAZE_HORSE("blaze", EntityType.HORSE, Horse.Style.WHITE, true),
|
BLAZE_HORSE("blaze", EntityType.HORSE, Horse.Style.WHITE, true),
|
||||||
@ -113,8 +114,8 @@ public enum MobData {
|
|||||||
SNOWY_VILLAGER("snowy", EntityType.VILLAGER, "villagertype:SNOWY", true),
|
SNOWY_VILLAGER("snowy", EntityType.VILLAGER, "villagertype:SNOWY", true),
|
||||||
SWAMP_VILLAGER("swamp", EntityType.VILLAGER, "villagertype:SWAMP", true),
|
SWAMP_VILLAGER("swamp", EntityType.VILLAGER, "villagertype:SWAMP", true),
|
||||||
TAIGA_VILLAGER("taiga", EntityType.VILLAGER, "villagertype:TAIGA", true),
|
TAIGA_VILLAGER("taiga", EntityType.VILLAGER, "villagertype:TAIGA", true),
|
||||||
SIZE_SLIME("", "<1-100>", EntityType.SLIME.getEntityClass(), Data.SIZE, true),
|
SIZE_SLIME("", Collections.singletonList("<1-100>"), EntityType.SLIME.getEntityClass(), Data.SIZE, true),
|
||||||
NUM_EXPERIENCE_ORB("", "<1-2000000000>", EntityType.EXPERIENCE_ORB, Data.EXP, true),
|
NUM_EXPERIENCE_ORB("", Collections.singletonList("<1-2000000000>"), EntityType.EXPERIENCE_ORB, Data.EXP, true),
|
||||||
RED_PARROT("red", MobCompat.PARROT, "parrot:RED", true),
|
RED_PARROT("red", MobCompat.PARROT, "parrot:RED", true),
|
||||||
GREEN_PARROT("green", MobCompat.PARROT, "parrot:GREEN", true),
|
GREEN_PARROT("green", MobCompat.PARROT, "parrot:GREEN", true),
|
||||||
BLUE_PARROT("blue", MobCompat.PARROT, "parrot:BLUE", true),
|
BLUE_PARROT("blue", MobCompat.PARROT, "parrot:BLUE", true),
|
||||||
@ -153,7 +154,15 @@ public enum MobData {
|
|||||||
CREAMY_TRADER_LLAMA("creamy", MobCompat.TRADER_LLAMA, "llama:CREAMY", true),
|
CREAMY_TRADER_LLAMA("creamy", MobCompat.TRADER_LLAMA, "llama:CREAMY", true),
|
||||||
WHITE_TRADER_LLAMA("white", MobCompat.TRADER_LLAMA, "llama:WHITE", true),
|
WHITE_TRADER_LLAMA("white", MobCompat.TRADER_LLAMA, "llama:WHITE", true),
|
||||||
BROWN_TRADER_LLAMA("brown", MobCompat.TRADER_LLAMA, "llama:BROWN", true),
|
BROWN_TRADER_LLAMA("brown", MobCompat.TRADER_LLAMA, "llama:BROWN", true),
|
||||||
GRAY_TRADER_LLAMA("gray", MobCompat.TRADER_LLAMA, "llama:GRAY", true)
|
GRAY_TRADER_LLAMA("gray", MobCompat.TRADER_LLAMA, "llama:GRAY", true),
|
||||||
|
RANDOM_SHULKER("random", MobCompat.SHULKER, Data.COLORABLE, true),
|
||||||
|
COLORABLE_SHULKER("", Arrays.stream(DyeColor.values()).map(color -> color.name().toLowerCase(Locale.ENGLISH)).collect(Collectors.toList()), MobCompat.SHULKER, Data.COLORABLE, true),
|
||||||
|
RED_FOX("red", MobCompat.FOX, "fox:RED", true),
|
||||||
|
SNOW_FOX("snow", MobCompat.FOX, "fox:SNOW", true),
|
||||||
|
SIZE_PHANTOM("", Collections.singletonList("<1-100>"), MobCompat.PHANTOM, Data.SIZE, true),
|
||||||
|
RAID_LEADER("leader", MobCompat.RAIDER, Data.RAID_LEADER, true),
|
||||||
|
TROPICAL_FISH_BODY_COLOR("fish_body_color", Arrays.stream(DyeColor.values()).map(color -> color.name().toLowerCase(Locale.ENGLISH) + "body").collect(Collectors.toList()), MobCompat.TROPICAL_FISH, Data.FISH_BODY_COLOR, true),
|
||||||
|
TROPICAL_FISH_PATTERN_COLOR("fish_pattern_color", Arrays.stream(DyeColor.values()).map(color -> color.name().toLowerCase(Locale.ENGLISH) + "pattern").collect(Collectors.toList()), MobCompat.TROPICAL_FISH, Data.FISH_PATTERN_COLOR, true),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -170,43 +179,46 @@ public enum MobData {
|
|||||||
TAMED,
|
TAMED,
|
||||||
COLORABLE,
|
COLORABLE,
|
||||||
EXP,
|
EXP,
|
||||||
SIZE
|
SIZE,
|
||||||
|
RAID_LEADER,
|
||||||
|
FISH_BODY_COLOR,
|
||||||
|
FISH_PATTERN_COLOR,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final Logger logger = Logger.getLogger("Essentials");
|
public static final Logger logger = Logger.getLogger("Essentials");
|
||||||
|
|
||||||
MobData(String n, Object type, Object value, boolean isPublic) {
|
|
||||||
this.nickname = n;
|
|
||||||
this.matched = n;
|
|
||||||
this.helpMessage = n;
|
|
||||||
this.type = type;
|
|
||||||
this.value = value;
|
|
||||||
this.isPublic = isPublic;
|
|
||||||
}
|
|
||||||
|
|
||||||
MobData(String n, String h, Object type, Object value, boolean isPublic) {
|
|
||||||
this.nickname = n;
|
|
||||||
this.matched = n;
|
|
||||||
this.helpMessage = h;
|
|
||||||
this.type = type;
|
|
||||||
this.value = value;
|
|
||||||
this.isPublic = isPublic;
|
|
||||||
}
|
|
||||||
|
|
||||||
final private String nickname;
|
final private String nickname;
|
||||||
final private String helpMessage;
|
final private List<String> suggestions;
|
||||||
final private Object type;
|
final private Object type;
|
||||||
final private Object value;
|
final private Object value;
|
||||||
final private boolean isPublic;
|
final private boolean isPublic;
|
||||||
private String matched;
|
private String matched;
|
||||||
|
|
||||||
|
MobData(String n, Object type, Object value, boolean isPublic) {
|
||||||
|
this.nickname = n;
|
||||||
|
this.matched = n;
|
||||||
|
this.suggestions = Collections.singletonList(n);
|
||||||
|
this.type = type;
|
||||||
|
this.value = value;
|
||||||
|
this.isPublic = isPublic;
|
||||||
|
}
|
||||||
|
|
||||||
|
MobData(String n, List<String> s, Object type, Object value, boolean isPublic) {
|
||||||
|
this.nickname = n;
|
||||||
|
this.matched = n;
|
||||||
|
this.suggestions = s;
|
||||||
|
this.type = type;
|
||||||
|
this.value = value;
|
||||||
|
this.isPublic = isPublic;
|
||||||
|
}
|
||||||
|
|
||||||
public static LinkedHashMap<String, MobData> getPossibleData(final Entity spawned, boolean publicOnly) {
|
public static LinkedHashMap<String, MobData> getPossibleData(final Entity spawned, boolean publicOnly) {
|
||||||
LinkedHashMap<String, MobData> mobList = new LinkedHashMap<>();
|
LinkedHashMap<String, MobData> mobList = new LinkedHashMap<>();
|
||||||
for (MobData data : MobData.values()) {
|
for (MobData data : MobData.values()) {
|
||||||
if (data.type == null || (publicOnly && !data.isPublic)) continue;
|
if (data.type == null || (publicOnly && !data.isPublic)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (data.type instanceof EntityType && spawned.getType().equals(data.type)) {
|
if (data.type instanceof EntityType && spawned.getType().equals(data.type)) {
|
||||||
mobList.put(data.nickname.toLowerCase(Locale.ENGLISH), data);
|
mobList.put(data.nickname.toLowerCase(Locale.ENGLISH), data);
|
||||||
} else if (data.type instanceof Class && ((Class) data.type).isAssignableFrom(spawned.getClass())) {
|
} else if (data.type instanceof Class && ((Class) data.type).isAssignableFrom(spawned.getClass())) {
|
||||||
@ -222,7 +234,7 @@ public enum MobData {
|
|||||||
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, true);
|
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, true);
|
||||||
|
|
||||||
for (MobData data : posData.values()) {
|
for (MobData data : posData.values()) {
|
||||||
output.add(data.helpMessage);
|
output.add(StringUtil.joinList(data.suggestions));
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@ -233,9 +245,11 @@ public enum MobData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, false);
|
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, false);
|
||||||
for (String data : posData.keySet()) {
|
for (MobData data : posData.values()) {
|
||||||
if (name.contains(data)) {
|
for (String suggestion : data.suggestions) {
|
||||||
return posData.get(data);
|
if (name.contains(suggestion)) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -291,7 +305,12 @@ public enum MobData {
|
|||||||
}
|
}
|
||||||
} else if (this.value.equals(Data.SIZE)) {
|
} else if (this.value.equals(Data.SIZE)) {
|
||||||
try {
|
try {
|
||||||
((Slime) spawned).setSize(Integer.parseInt(rawData));
|
int size = Integer.parseInt(rawData);
|
||||||
|
if (spawned instanceof Slime) {
|
||||||
|
((Slime) spawned).setSize(size);
|
||||||
|
} else if (spawned.getType() == MobCompat.PHANTOM) {
|
||||||
|
((Phantom) spawned).setSize(size);
|
||||||
|
}
|
||||||
this.matched = rawData;
|
this.matched = rawData;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new Exception(tl("slimeMalformedSize"), e);
|
throw new Exception(tl("slimeMalformedSize"), e);
|
||||||
@ -313,6 +332,26 @@ public enum MobData {
|
|||||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack((Material) this.value, 1));
|
InventoryWorkaround.setItemInMainHand(invent, new ItemStack((Material) this.value, 1));
|
||||||
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
||||||
}
|
}
|
||||||
|
} else if (this.value.equals(Data.RAID_LEADER)) {
|
||||||
|
((Raider) spawned).setPatrolLeader(true);
|
||||||
|
} else if (this.value.equals(Data.FISH_BODY_COLOR)) {
|
||||||
|
for (String match : TROPICAL_FISH_BODY_COLOR.suggestions) {
|
||||||
|
if (rawData.contains(match)) {
|
||||||
|
this.matched = match;
|
||||||
|
final String color = match.substring(0, match.indexOf("body")).toUpperCase(Locale.ENGLISH);
|
||||||
|
((TropicalFish) spawned).setBodyColor(DyeColor.valueOf(color));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.value.equals(Data.FISH_PATTERN_COLOR)) {
|
||||||
|
for (String match : TROPICAL_FISH_PATTERN_COLOR.suggestions) {
|
||||||
|
if (rawData.contains(match)) {
|
||||||
|
this.matched = match;
|
||||||
|
final String color = match.substring(0, match.indexOf("pattern")).toUpperCase(Locale.ENGLISH);
|
||||||
|
((TropicalFish) spawned).setPatternColor(DyeColor.valueOf(color));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (this.value instanceof String) {
|
} else if (this.value instanceof String) {
|
||||||
final String[] split = ((String) this.value).split(":");
|
final String[] split = ((String) this.value).split(":");
|
||||||
switch (split[0]) {
|
switch (split[0]) {
|
||||||
@ -337,6 +376,9 @@ public enum MobData {
|
|||||||
case "villagertype":
|
case "villagertype":
|
||||||
MobCompat.setVillagerType(spawned, split[1]);
|
MobCompat.setVillagerType(spawned, split[1]);
|
||||||
break;
|
break;
|
||||||
|
case "fox":
|
||||||
|
MobCompat.setFoxType(spawned, split[1]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warning("Unknown mob data type: " + this.toString());
|
logger.warning("Unknown mob data type: " + this.toString());
|
||||||
|
@ -365,29 +365,37 @@ public class Settings implements net.ess3.api.ISettings {
|
|||||||
return config.getBoolean("skip-used-one-time-kits-from-kit-list", false);
|
return config.getBoolean("skip-used-one-time-kits-from-kit-list", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChatColor operatorColor = null;
|
private String operatorColor = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChatColor getOperatorColor() {
|
public String getOperatorColor() {
|
||||||
return operatorColor;
|
return operatorColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChatColor _getOperatorColor() {
|
private String _getOperatorColor() {
|
||||||
String colorName = config.getString("ops-name-color", null);
|
String colorName = config.getString("ops-name-color", null);
|
||||||
|
|
||||||
if (colorName == null) {
|
if (colorName == null) {
|
||||||
return ChatColor.DARK_RED;
|
return ChatColor.RED.toString();
|
||||||
}
|
} else if (colorName.equalsIgnoreCase("none") || colorName.isEmpty()) {
|
||||||
if ("none".equalsIgnoreCase(colorName) || colorName.isEmpty()) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return ChatColor.valueOf(colorName.toUpperCase(Locale.ENGLISH));
|
return FormatUtil.parseHexColor(colorName);
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return ChatColor.valueOf(colorName.toUpperCase(Locale.ENGLISH)).toString();
|
||||||
} catch (IllegalArgumentException ignored) {
|
} catch (IllegalArgumentException ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ChatColor.getByChar(colorName);
|
ChatColor lastResort = ChatColor.getByChar(colorName);
|
||||||
|
if (lastResort != null) {
|
||||||
|
return lastResort.toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -235,30 +235,20 @@ public class SpawnMob {
|
|||||||
final EntityEquipment invent = ((LivingEntity) spawned).getEquipment();
|
final EntityEquipment invent = ((LivingEntity) spawned).getEquipment();
|
||||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(Material.BOW, 1));
|
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(Material.BOW, 1));
|
||||||
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
||||||
|
|
||||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
|
||||||
invent.setBootsDropChance(0.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EntityType.PIG_ZOMBIE) {
|
if (type == MobCompat.ZOMBIFIED_PIGLIN) {
|
||||||
final PigZombie zombie = ((PigZombie) spawned);
|
final PigZombie zombie = ((PigZombie) spawned);
|
||||||
setVillager(zombie, false);
|
setVillager(zombie, false);
|
||||||
|
|
||||||
final EntityEquipment invent = zombie.getEquipment();
|
final EntityEquipment invent = zombie.getEquipment();
|
||||||
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(GOLDEN_SWORD, 1));
|
InventoryWorkaround.setItemInMainHand(invent, new ItemStack(GOLDEN_SWORD, 1));
|
||||||
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
InventoryWorkaround.setItemInMainHandDropChance(invent, 0.1f);
|
||||||
|
|
||||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
|
||||||
invent.setBootsDropChance(0.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EntityType.ZOMBIE) {
|
if (type == EntityType.ZOMBIE) {
|
||||||
final Zombie zombie = ((Zombie) spawned);
|
final Zombie zombie = ((Zombie) spawned);
|
||||||
setVillager(zombie, false);
|
setVillager(zombie, false);
|
||||||
|
|
||||||
final EntityEquipment invent = zombie.getEquipment();
|
|
||||||
invent.setBoots(new ItemStack(GOLDEN_BOOTS, 1));
|
|
||||||
invent.setBootsDropChance(0.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EntityType.HORSE) {
|
if (type == EntityType.HORSE) {
|
||||||
|
@ -16,7 +16,6 @@ import net.ess3.api.events.JailStatusChangeEvent;
|
|||||||
import net.ess3.api.events.MuteStatusChangeEvent;
|
import net.ess3.api.events.MuteStatusChangeEvent;
|
||||||
import net.ess3.api.events.UserBalanceUpdateEvent;
|
import net.ess3.api.events.UserBalanceUpdateEvent;
|
||||||
import net.ess3.nms.refl.ReflUtil;
|
import net.ess3.nms.refl.ReflUtil;
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -27,7 +26,13 @@ import org.bukkit.potion.PotionEffect;
|
|||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.Calendar;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.WeakHashMap;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@ -338,12 +343,15 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
|||||||
|
|
||||||
if (this.getBase().isOp()) {
|
if (this.getBase().isOp()) {
|
||||||
try {
|
try {
|
||||||
final ChatColor opPrefix = ess.getSettings().getOperatorColor();
|
final String opPrefix = ess.getSettings().getOperatorColor();
|
||||||
if (opPrefix != null && opPrefix.toString().length() > 0) {
|
if (opPrefix != null && !opPrefix.isEmpty()) {
|
||||||
prefix.insert(0, opPrefix.toString());
|
prefix.insert(0, opPrefix);
|
||||||
suffix = "§r";
|
suffix = "§r";
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception e) {
|
||||||
|
if (ess.getSettings().isDebug()) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public class Commandspawnmob extends EssentialsCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
return Lists.newArrayList(SpawnMob.mobParts(args[0]));
|
return Lists.newArrayList(Mob.getMobList());
|
||||||
} else {
|
} else {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,37 @@
|
|||||||
package com.earth2me.essentials.craftbukkit;
|
package com.earth2me.essentials.craftbukkit;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.BlockChangeDelegate;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.ChunkSnapshot;
|
||||||
|
import org.bukkit.Difficulty;
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.FluidCollisionMode;
|
||||||
|
import org.bukkit.GameRule;
|
||||||
|
import org.bukkit.HeightMap;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Particle;
|
||||||
|
import org.bukkit.Raid;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.SoundCategory;
|
||||||
|
import org.bukkit.StructureType;
|
||||||
|
import org.bukkit.TreeType;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.WorldBorder;
|
||||||
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.boss.DragonBattle;
|
import org.bukkit.boss.DragonBattle;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.AbstractArrow;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.FallingBlock;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.LightningStrike;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -140,45 +166,46 @@ public class FakeWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChunkForceLoaded(int x, int z) {
|
public boolean isChunkForceLoaded(int i, int i1) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setChunkForceLoaded(int x, int z, boolean forced) {
|
public void setChunkForceLoaded(int i, int i1, boolean b) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Chunk> getForceLoadedChunks() {
|
public Collection<Chunk> getForceLoadedChunks() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addPluginChunkTicket(int i, int i1, Plugin plugin) {
|
public boolean addPluginChunkTicket(int i, int i1, Plugin plugin) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removePluginChunkTicket(int i, int i1, Plugin plugin) {
|
public boolean removePluginChunkTicket(int i, int i1, Plugin plugin) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removePluginChunkTickets(Plugin plugin) {
|
public void removePluginChunkTickets(Plugin plugin) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Plugin> getPluginChunkTickets(int i, int i1) {
|
public Collection<Plugin> getPluginChunkTickets(int i, int i1) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() {
|
public Map<Plugin, Collection<Chunk>> getPluginChunkTickets() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item dropItem(Location lctn, ItemStack is) {
|
public Item dropItem(Location lctn, ItemStack is) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
@ -195,7 +222,7 @@ public class FakeWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends AbstractArrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) {
|
public <T extends AbstractArrow> T spawnArrow(Location location, Vector vector, float v, float v1, Class<T> aClass) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,20 +405,15 @@ public class FakeWorld implements World {
|
|||||||
public boolean createExplosion(Location lctn, float f, boolean bln) {
|
public boolean createExplosion(Location lctn, float f, boolean bln) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean createExplosion(double d, double d1, double d2, float f, boolean bln, boolean bln1, Entity entity) {
|
public boolean createExplosion(Location location, float v, boolean b, boolean b1) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean createExplosion(Location lctn, float f, boolean bln, boolean bln1) {
|
public boolean createExplosion(Location location, float v, boolean b, boolean b1, Entity entity) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean createExplosion(Location lctn, float f, boolean bln, boolean bln1, Entity entity) {
|
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -451,22 +473,22 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHighestBlockYAt(int i, int i1, HeightMap heightMap) {
|
public int getHighestBlockYAt(int i, int i1, HeightMap heightMap) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHighestBlockYAt(Location location, HeightMap heightMap) {
|
public int getHighestBlockYAt(Location location, HeightMap heightMap) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Block getHighestBlockAt(int i, int i1, HeightMap heightMap) {
|
public Block getHighestBlockAt(int i, int i1, HeightMap heightMap) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Block getHighestBlockAt(Location location, HeightMap heightMap) {
|
public Block getHighestBlockAt(Location location, HeightMap heightMap) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -476,7 +498,7 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int i, int i1, int i2) {
|
public Biome getBiome(int i, int i1, int i2) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -486,7 +508,7 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getTemperature(int i, int i1, int i2) {
|
public double getTemperature(int i, int i1, int i2) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -496,7 +518,7 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getHumidity(int i, int i1, int i2) {
|
public double getHumidity(int i, int i1, int i2) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -576,12 +598,12 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isHardcore() {
|
public boolean isHardcore() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHardcore(boolean hardcore) {
|
public void setHardcore(boolean b) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -606,22 +628,32 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getTicksPerWaterSpawns() {
|
public long getTicksPerWaterSpawns() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTicksPerWaterSpawns(int i) {
|
public void setTicksPerWaterSpawns(int i) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getTicksPerWaterAmbientSpawns() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTicksPerWaterAmbientSpawns(int i) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getTicksPerAmbientSpawns() {
|
public long getTicksPerAmbientSpawns() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTicksPerAmbientSpawns(int i) {
|
public void setTicksPerAmbientSpawns(int i) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -671,7 +703,7 @@ public class FakeWorld implements World {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int i, int i1, int i2, Biome biome) {
|
public void setBiome(int i, int i1, int i2, Biome biome) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -704,6 +736,16 @@ public class FakeWorld implements World {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWaterAmbientSpawnLimit() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setWaterAmbientSpawnLimit(int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity spawnEntity(Location lctn, EntityType et) {
|
public Entity spawnEntity(Location lctn, EntityType et) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
@ -774,6 +816,11 @@ public class FakeWorld implements World {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean createExplosion(double v, double v1, double v2, float v3, boolean b, boolean b1, Entity entity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldBorder getWorldBorder() {
|
public WorldBorder getWorldBorder() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
@ -855,18 +902,28 @@ public class FakeWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Raid locateNearestRaid(Location location, int radius) {
|
public int getViewDistance() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Spigot spigot() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Raid locateNearestRaid(Location location, int i) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Raid> getRaids() {
|
public List<Raid> getRaids() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DragonBattle getEnderDragonBattle() {
|
public DragonBattle getEnderDragonBattle() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -875,58 +932,58 @@ public class FakeWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z, Predicate<Entity> filter) {
|
public Collection<Entity> getNearbyEntities(Location location, double v, double v1, double v2, Predicate<Entity> predicate) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox) {
|
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<Entity> filter) {
|
public Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<Entity> predicate) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance) {
|
public RayTraceResult rayTraceEntities(Location location, Vector vector, double v) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) {
|
public RayTraceResult rayTraceEntities(Location location, Vector vector, double v, double v1) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate<Entity> filter) {
|
public RayTraceResult rayTraceEntities(Location location, Vector vector, double v, Predicate<Entity> predicate) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<Entity> filter) {
|
public RayTraceResult rayTraceEntities(Location location, Vector vector, double v, double v1, Predicate<Entity> predicate) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance) {
|
public RayTraceResult rayTraceBlocks(Location location, Vector vector, double v) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) {
|
public RayTraceResult rayTraceBlocks(Location location, Vector vector, double v, FluidCollisionMode fluidCollisionMode) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
public RayTraceResult rayTraceBlocks(Location location, Vector vector, double v, FluidCollisionMode fluidCollisionMode, boolean b) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<Entity> filter) {
|
public RayTraceResult rayTrace(Location location, Vector vector, double v, FluidCollisionMode fluidCollisionMode, boolean b, double v1, Predicate<Entity> predicate) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.utils;
|
|||||||
import net.ess3.api.IUser;
|
import net.ess3.api.IUser;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -19,6 +20,8 @@ public class FormatUtil {
|
|||||||
private static final Pattern STRIP_ALL_PATTERN = Pattern.compile("\u00a7+([0-9a-fk-orA-FK-OR])");
|
private static final Pattern STRIP_ALL_PATTERN = Pattern.compile("\u00a7+([0-9a-fk-orA-FK-OR])");
|
||||||
//Essentials '&' convention colour codes
|
//Essentials '&' convention colour codes
|
||||||
private static final Pattern REPLACE_ALL_PATTERN = Pattern.compile("(&)?&([0-9a-fk-orA-FK-OR])");
|
private static final Pattern REPLACE_ALL_PATTERN = Pattern.compile("(&)?&([0-9a-fk-orA-FK-OR])");
|
||||||
|
|
||||||
|
private static final Pattern REPLACE_ALL_RGB_PATTERN = Pattern.compile("(&)?&#([0-9a-fA-F]{6})");
|
||||||
//Used to prepare xmpp output
|
//Used to prepare xmpp output
|
||||||
private static final Pattern LOGCOLOR_PATTERN = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]");
|
private static final Pattern LOGCOLOR_PATTERN = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]");
|
||||||
private static final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-zA-Z]{2,3}(?:/\\S+)?)");
|
private static final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-zA-Z]{2,3}(?:/\\S+)?)");
|
||||||
@ -57,28 +60,70 @@ public class FormatUtil {
|
|||||||
if (input == null) {
|
if (input == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return replaceColor(input, EnumSet.allOf(ChatColor.class));
|
return replaceColor(input, EnumSet.allOf(ChatColor.class), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static String replaceColor(final String input, final Set<ChatColor> supported) {
|
static String replaceColor(final String input, final Set<ChatColor> supported, boolean rgb) {
|
||||||
StringBuffer builder = new StringBuffer();
|
StringBuffer legacyBuilder = new StringBuffer();
|
||||||
Matcher matcher = REPLACE_ALL_PATTERN.matcher(input);
|
Matcher legacyMatcher = REPLACE_ALL_PATTERN.matcher(input);
|
||||||
searchLoop: while (matcher.find()) {
|
legacyLoop: while (legacyMatcher.find()) {
|
||||||
boolean isEscaped = (matcher.group(1) != null);
|
boolean isEscaped = (legacyMatcher.group(1) != null);
|
||||||
if (!isEscaped) {
|
if (!isEscaped) {
|
||||||
char code = matcher.group(2).toLowerCase(Locale.ROOT).charAt(0);
|
char code = legacyMatcher.group(2).toLowerCase(Locale.ROOT).charAt(0);
|
||||||
for (ChatColor color : supported) {
|
for (ChatColor color : supported) {
|
||||||
if (color.getChar() == code) {
|
if (color.getChar() == code) {
|
||||||
matcher.appendReplacement(builder, "\u00a7$2");
|
legacyMatcher.appendReplacement(legacyBuilder, "\u00a7$2");
|
||||||
continue searchLoop;
|
continue legacyLoop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Don't change & to section sign (or replace two &'s with one)
|
// Don't change & to section sign (or replace two &'s with one)
|
||||||
matcher.appendReplacement(builder, "&$2");
|
legacyMatcher.appendReplacement(legacyBuilder, "&$2");
|
||||||
}
|
}
|
||||||
matcher.appendTail(builder);
|
legacyMatcher.appendTail(legacyBuilder);
|
||||||
return builder.toString();
|
|
||||||
|
if (rgb) {
|
||||||
|
StringBuffer rgbBuilder = new StringBuffer();
|
||||||
|
Matcher rgbMatcher = REPLACE_ALL_RGB_PATTERN.matcher(legacyBuilder.toString());
|
||||||
|
while (rgbMatcher.find()) {
|
||||||
|
boolean isEscaped = (rgbMatcher.group(1) != null);
|
||||||
|
if (!isEscaped) {
|
||||||
|
try {
|
||||||
|
String hexCode = rgbMatcher.group(2);
|
||||||
|
rgbMatcher.appendReplacement(rgbBuilder, parseHexColor(hexCode));
|
||||||
|
continue;
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rgbMatcher.appendReplacement(rgbBuilder, "&#$2");
|
||||||
|
}
|
||||||
|
rgbMatcher.appendTail(rgbBuilder);
|
||||||
|
return rgbBuilder.toString();
|
||||||
|
}
|
||||||
|
return legacyBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws NumberFormatException If the provided hex color code is invalid or if version is lower than 1.16.
|
||||||
|
*/
|
||||||
|
public static String parseHexColor(String hexColor) throws NumberFormatException {
|
||||||
|
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_16_1_R01)) {
|
||||||
|
throw new NumberFormatException("Cannot use RGB colors in versions < 1.16");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hexColor.startsWith("#")) {
|
||||||
|
hexColor = hexColor.substring(1); //fuck you im reassigning this.
|
||||||
|
}
|
||||||
|
if (hexColor.length() != 6) {
|
||||||
|
throw new NumberFormatException("Invalid hex length");
|
||||||
|
}
|
||||||
|
Color.decode("#" + hexColor);
|
||||||
|
StringBuilder assembledColorCode = new StringBuilder();
|
||||||
|
assembledColorCode.append("\u00a7x");
|
||||||
|
for (char curChar : hexColor.toCharArray()) {
|
||||||
|
assembledColorCode.append("\u00a7").append(curChar);
|
||||||
|
}
|
||||||
|
return assembledColorCode.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static String stripColor(final String input, final Set<ChatColor> strip) {
|
static String stripColor(final String input, final Set<ChatColor> strip) {
|
||||||
@ -134,8 +179,9 @@ public class FormatUtil {
|
|||||||
}
|
}
|
||||||
EnumSet<ChatColor> strip = EnumSet.complementOf(supported);
|
EnumSet<ChatColor> strip = EnumSet.complementOf(supported);
|
||||||
|
|
||||||
if (!supported.isEmpty()) {
|
boolean rgb = user.isAuthorized(permBase + ".rgb");
|
||||||
message = replaceColor(message, supported);
|
if (!supported.isEmpty() || rgb) {
|
||||||
|
message = replaceColor(message, supported, rgb);
|
||||||
}
|
}
|
||||||
if (!strip.isEmpty()) {
|
if (!strip.isEmpty()) {
|
||||||
message = stripColor(message, strip);
|
message = stripColor(message, strip);
|
||||||
|
@ -14,7 +14,9 @@ public class VersionUtil {
|
|||||||
public static final BukkitVersion v1_8_8_R01 = BukkitVersion.fromString("1.8.8-R0.1-SNAPSHOT");
|
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_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_9_4_R01 = BukkitVersion.fromString("1.9.4-R0.1-SNAPSHOT");
|
||||||
|
public static final BukkitVersion v1_10_R01 = BukkitVersion.fromString("1.10-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_10_2_R01 = BukkitVersion.fromString("1.10.2-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_R01 = BukkitVersion.fromString("1.11-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_11_2_R01 = BukkitVersion.fromString("1.11.2-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_11_2_R01 = BukkitVersion.fromString("1.11.2-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_12_0_R01 = BukkitVersion.fromString("1.12.0-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_12_0_R01 = BukkitVersion.fromString("1.12.0-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_12_2_R01 = BukkitVersion.fromString("1.12.2-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_12_2_R01 = BukkitVersion.fromString("1.12.2-R0.1-SNAPSHOT");
|
||||||
@ -23,10 +25,10 @@ public class VersionUtil {
|
|||||||
public static final BukkitVersion v1_14_R01 = BukkitVersion.fromString("1.14-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_14_R01 = BukkitVersion.fromString("1.14-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_14_4_R01 = BukkitVersion.fromString("1.14.4-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_14_4_R01 = BukkitVersion.fromString("1.14.4-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_15_R01 = BukkitVersion.fromString("1.15-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_15_R01 = BukkitVersion.fromString("1.15-R0.1-SNAPSHOT");
|
||||||
public static final BukkitVersion v1_15_1_R01 = BukkitVersion.fromString("1.15.1-R0.1-SNAPSHOT");
|
|
||||||
public static final BukkitVersion v1_15_2_R01 = BukkitVersion.fromString("1.15.2-R0.1-SNAPSHOT");
|
public static final BukkitVersion v1_15_2_R01 = BukkitVersion.fromString("1.15.2-R0.1-SNAPSHOT");
|
||||||
|
public static final BukkitVersion v1_16_1_R01 = BukkitVersion.fromString("1.16.1-R0.1-SNAPSHOT");
|
||||||
|
|
||||||
private static final Set<BukkitVersion> supportedVersions = ImmutableSet.of(v1_8_8_R01, v1_9_4_R01, v1_10_2_R01, v1_11_2_R01, v1_12_2_R01, v1_13_2_R01, v1_14_4_R01, v1_15_2_R01);
|
private static final Set<BukkitVersion> supportedVersions = ImmutableSet.of(v1_8_8_R01, v1_9_4_R01, v1_10_2_R01, v1_11_2_R01, v1_12_2_R01, v1_13_2_R01, v1_14_4_R01, v1_15_2_R01, v1_16_1_R01);
|
||||||
|
|
||||||
private static BukkitVersion serverVersion = null;
|
private static BukkitVersion serverVersion = null;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
# A color code between 0-9 or a-f. Set to 'none' to disable.
|
# A color code between 0-9 or a-f. Set to 'none' to disable.
|
||||||
|
# In 1.16+ you can use hex color codes here as well. (For example, #613e1d is brown).
|
||||||
ops-name-color: '4'
|
ops-name-color: '4'
|
||||||
|
|
||||||
# The character(s) to prefix all nicknames, so that you know they are not true usernames.
|
# The character(s) to prefix all nicknames, so that you know they are not true usernames.
|
||||||
|
@ -741,6 +741,11 @@ public class FakeServer implements Server {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Spigot spigot() {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPermissionSet(String name) {
|
public boolean isPermissionSet(String name) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
@ -893,6 +898,11 @@ public class FakeServer implements Server {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTicksPerWaterAmbientSpawns() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTicksPerAmbientSpawns() {
|
public int getTicksPerAmbientSpawns() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
@ -978,6 +988,11 @@ public class FakeServer implements Server {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWaterAmbientSpawnLimit() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPrimaryThread() {
|
public boolean isPrimaryThread() {
|
||||||
return true; // Can be set to true or false, just needs to return for AFK status test to pass.
|
return true; // Can be set to true or false, just needs to return for AFK status test to pass.
|
||||||
@ -1074,6 +1089,11 @@ public class FakeServer implements Server {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Spigot spigot() {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BanList getBanList(BanList.Type arg0) {
|
public BanList getBanList(BanList.Type arg0) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
@ -31,12 +31,6 @@
|
|||||||
<includes>net.ess3:EssentialsXSpawn</includes>
|
<includes>net.ess3:EssentialsXSpawn</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<relocations>
|
|
||||||
<relocation>
|
|
||||||
<pattern>io.papermc.lib</pattern>
|
|
||||||
<shadedPattern>com.earth2me.essentials.paperlib</shadedPattern>
|
|
||||||
</relocation>
|
|
||||||
</relocations>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
@ -48,10 +42,5 @@
|
|||||||
<artifactId>EssentialsX</artifactId>
|
<artifactId>EssentialsX</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>io.papermc</groupId>
|
|
||||||
<artifactId>paperlib</artifactId>
|
|
||||||
<version>1.0.2</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -44,7 +44,7 @@ class EssentialsSpawnPlayerListener implements Listener {
|
|||||||
|
|
||||||
if (ess.getSettings().getRespawnAtHome()) {
|
if (ess.getSettings().getRespawnAtHome()) {
|
||||||
Location home;
|
Location home;
|
||||||
final Location bed = user.getBase().getBedSpawnLocation();
|
final Location bed = user.getBase().getBedSpawnLocation(); // cannot nuke this sync load due to the event being sync so it would hand either way.
|
||||||
if (bed != null) {
|
if (bed != null) {
|
||||||
home = bed;
|
home = bed;
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,7 +26,7 @@ EssentialsX is almost a completely drop-in replacement for Essentials. However,
|
|||||||
|
|
||||||
* **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, 1.12.2, 1.13.2, 1.14.4, and 1.15.2.**
|
* **EssentialsX supports Minecraft versions 1.8.8, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13.2, 1.14.4, 1.15.2, and 1.16.1.**
|
||||||
|
|
||||||
|
|
||||||
Support
|
Support
|
||||||
|
7
pom.xml
7
pom.xml
@ -52,13 +52,14 @@
|
|||||||
<module>providers/BaseProviders</module>
|
<module>providers/BaseProviders</module>
|
||||||
<module>providers/NMSReflectionProvider</module>
|
<module>providers/NMSReflectionProvider</module>
|
||||||
<module>providers/PaperProvider</module>
|
<module>providers/PaperProvider</module>
|
||||||
|
<module>providers/1_8Provider</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
22
providers/1_8Provider/pom.xml
Normal file
22
providers/1_8Provider/pom.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>EssentialsXParent</artifactId>
|
||||||
|
<groupId>net.ess3</groupId>
|
||||||
|
<version>2.17.2</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>1_8Provider</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.ess3</groupId>
|
||||||
|
<artifactId>NMSReflectionProvider</artifactId>
|
||||||
|
<version>2.17.2</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -1,8 +1,22 @@
|
|||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import net.ess3.nms.refl.ReflUtil;
|
import net.ess3.nms.refl.ReflUtil;
|
||||||
|
import org.bukkit.Achievement;
|
||||||
import org.bukkit.*;
|
import org.bukkit.BanList;
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.EntityEffect;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Instrument;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Note;
|
||||||
|
import org.bukkit.Particle;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.SoundCategory;
|
||||||
|
import org.bukkit.Statistic;
|
||||||
|
import org.bukkit.WeatherType;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.advancement.Advancement;
|
import org.bukkit.advancement.Advancement;
|
||||||
import org.bukkit.advancement.AdvancementProgress;
|
import org.bukkit.advancement.AdvancementProgress;
|
||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
@ -10,33 +24,44 @@ import org.bukkit.attribute.AttributeInstance;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.PistonMoveReaction;
|
import org.bukkit.block.PistonMoveReaction;
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.conversations.Conversation;
|
import org.bukkit.conversations.Conversation;
|
||||||
import org.bukkit.conversations.ConversationAbandonedEvent;
|
import org.bukkit.conversations.ConversationAbandonedEvent;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.memory.MemoryKey;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.entity.Vehicle;
|
||||||
|
import org.bukkit.entity.Villager;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
import org.bukkit.inventory.*;
|
import org.bukkit.inventory.EntityEquipment;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
import org.bukkit.inventory.InventoryView.Property;
|
import org.bukkit.inventory.InventoryView.Property;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.MainHand;
|
||||||
|
import org.bukkit.inventory.Merchant;
|
||||||
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.map.MapView;
|
import org.bukkit.map.MapView;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionAttachment;
|
import org.bukkit.permissions.PermissionAttachment;
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
import org.bukkit.persistence.PersistentDataContainer;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.scoreboard.Scoreboard;
|
import org.bukkit.scoreboard.Scoreboard;
|
||||||
import org.bukkit.util.BoundingBox;
|
|
||||||
import org.bukkit.util.RayTraceResult;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.*;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class OfflinePlayer implements Player {
|
public class OfflinePlayer implements Player {
|
||||||
private final transient Server server;
|
private final transient Server server;
|
||||||
@ -45,7 +70,7 @@ public class OfflinePlayer implements Player {
|
|||||||
private final transient org.bukkit.OfflinePlayer base;
|
private final transient org.bukkit.OfflinePlayer base;
|
||||||
private boolean allowFlight = false;
|
private boolean allowFlight = false;
|
||||||
private boolean isFlying = false;
|
private boolean isFlying = false;
|
||||||
private String name = null;
|
private String name;
|
||||||
|
|
||||||
public OfflinePlayer(final UUID uuid, final Server server) {
|
public OfflinePlayer(final UUID uuid, final Server server) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
@ -110,15 +135,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setHealth(double d) {
|
public void setHealth(double d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getAbsorptionAmount() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAbsorptionAmount(double v) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInsideVehicle() {
|
public boolean isInsideVehicle() {
|
||||||
return false;
|
return false;
|
||||||
@ -144,12 +160,6 @@ public class OfflinePlayer implements Player {
|
|||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setRotation(float yaw, float pitch) {
|
|
||||||
location.setYaw(yaw);
|
|
||||||
location.setPitch(pitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(Location loc) {
|
public void setLocation(Location loc) {
|
||||||
location = loc;
|
location = loc;
|
||||||
world = loc.getWorld();
|
world = loc.getWorld();
|
||||||
@ -173,11 +183,6 @@ public class OfflinePlayer implements Player {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Pose getPose() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean performCommand(String string) {
|
public boolean performCommand(String string) {
|
||||||
return false;
|
return false;
|
||||||
@ -214,6 +219,21 @@ public class OfflinePlayer implements Player {
|
|||||||
public void updateInventory() {
|
public void updateInventory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void awardAchievement(Achievement achievement) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAchievement(Achievement achievement) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasAchievement(Achievement achievement) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chat(String string) {
|
public void chat(String string) {
|
||||||
}
|
}
|
||||||
@ -243,26 +263,6 @@ public class OfflinePlayer implements Player {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Block getTargetBlockExact(int maxDistance) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Block getTargetBlockExact(int maxDistance, FluidCollisionMode fluidCollisionMode) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RayTraceResult rayTraceBlocks(double maxDistance) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RayTraceResult rayTraceBlocks(double maxDistance, FluidCollisionMode fluidCollisionMode) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFireTicks() {
|
public int getFireTicks() {
|
||||||
return 0;
|
return 0;
|
||||||
@ -286,15 +286,6 @@ public class OfflinePlayer implements Player {
|
|||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPersistent() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPersistent(boolean persistent) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector getMomentum() {
|
public Vector getMomentum() {
|
||||||
return getVelocity();
|
return getVelocity();
|
||||||
}
|
}
|
||||||
@ -311,6 +302,16 @@ public class OfflinePlayer implements Player {
|
|||||||
return new Vector(0, 0, 0);
|
return new Vector(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getHeight() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getWidth() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage(double d) {
|
public void damage(double d) {
|
||||||
}
|
}
|
||||||
@ -380,6 +381,21 @@ public class OfflinePlayer implements Player {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Entity> getPassengers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addPassenger(Entity passenger) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removePassenger(Entity passenger) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return true;
|
return true;
|
||||||
@ -519,11 +535,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void sendBlockChange(Location lctn, Material mtrl, byte b) {
|
public void sendBlockChange(Location lctn, Material mtrl, byte b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendBlockChange(Location loc, BlockData block) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLastDamageCause(EntityDamageEvent ede) {
|
public void setLastDamageCause(EntityDamageEvent ede) {
|
||||||
}
|
}
|
||||||
@ -542,6 +553,11 @@ public class OfflinePlayer implements Player {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendBlockChange(Location location, int i, byte b) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playNote(Location lctn, Instrument i, Note note) {
|
public void playNote(Location lctn, Instrument i, Note note) {
|
||||||
}
|
}
|
||||||
@ -653,14 +669,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setTotalExperience(int i) {
|
public void setTotalExperience(int i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendExperienceChange(float v) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendExperienceChange(float v, int i) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getExhaustion() {
|
public float getExhaustion() {
|
||||||
return 0F;
|
return 0F;
|
||||||
@ -701,31 +709,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setPlayerListName(String name) {
|
public void setPlayerListName(String name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPlayerListHeader() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPlayerListFooter() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerListHeader(String header) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerListFooter(String footer) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerListHeaderFooter(String header, String footer) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlayerListName() {
|
public String getPlayerListName() {
|
||||||
return name;
|
return name;
|
||||||
@ -807,21 +790,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setBedSpawnLocation(Location lctn, boolean force) {
|
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
|
@Override
|
||||||
public void playEffect(EntityEffect ee) {
|
public void playEffect(EntityEffect ee) {
|
||||||
}
|
}
|
||||||
@ -870,7 +838,7 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PotionEffect getPotionEffect(PotionEffectType potionEffectType) {
|
public PotionEffect getPotionEffect(PotionEffectType type) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,12 +895,12 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InventoryView openMerchant(Villager villager, boolean b) {
|
public InventoryView openMerchant(Villager trader, boolean force) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InventoryView openMerchant(Merchant merchant, boolean b) {
|
public InventoryView openMerchant(Merchant merchant, boolean force) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -949,6 +917,21 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setItemOnCursor(ItemStack is) {
|
public void setItemOnCursor(ItemStack is) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCooldown(Material material) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCooldown(Material material) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCooldown(Material material, int ticks) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMetadata(String string, MetadataValue mv) {
|
public void setMetadata(String string, MetadataValue mv) {
|
||||||
}
|
}
|
||||||
@ -1019,28 +1002,23 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getAttackCooldown() {
|
public Entity getShoulderEntityLeft() {
|
||||||
return 0f;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean discoverRecipe(NamespacedKey recipe) {
|
public void setShoulderEntityLeft(Entity entity) {
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int discoverRecipes(Collection<NamespacedKey> recipes) {
|
public Entity getShoulderEntityRight() {
|
||||||
return 0;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean undiscoverRecipe(NamespacedKey recipe) {
|
public void setShoulderEntityRight(Entity entity) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int undiscoverRecipes(Collection<NamespacedKey> recipes) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1078,7 +1056,7 @@ public class OfflinePlayer implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MainHand getMainHand() {
|
public MainHand getMainHand() {
|
||||||
return MainHand.RIGHT;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1125,6 +1103,11 @@ public class OfflinePlayer implements Player {
|
|||||||
public void setResourcePack(String s) {
|
public void setResourcePack(String s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setResourcePack(String url, byte[] hash) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMaxHealth(double i) {
|
public void setMaxHealth(double i) {
|
||||||
}
|
}
|
||||||
@ -1152,7 +1135,8 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGlowing(boolean b) {
|
public void setGlowing(boolean flag) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1161,7 +1145,8 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInvulnerable(boolean b) {
|
public void setInvulnerable(boolean flag) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1175,7 +1160,8 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSilent(boolean b) {
|
public void setSilent(boolean flag) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1184,7 +1170,8 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGravity(boolean b) {
|
public void setGravity(boolean gravity) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1193,7 +1180,7 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPortalCooldown(int i) {
|
public void setPortalCooldown(int cooldown) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1203,15 +1190,20 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addScoreboardTag(String s) {
|
public boolean addScoreboardTag(String tag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removeScoreboardTag(String s) {
|
public boolean removeScoreboardTag(String tag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PistonMoveReaction getPistonMoveReaction() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerWeather(WeatherType arg0) {
|
public void setPlayerWeather(WeatherType arg0) {
|
||||||
}
|
}
|
||||||
@ -1244,30 +1236,32 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playSound(Location location, Sound sound, SoundCategory soundCategory, float v, float v1) {
|
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playSound(Location location, String s, SoundCategory soundCategory, float v, float v1) {
|
public void playSound(Location location, String sound, SoundCategory category, float volume, float pitch) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopSound(Sound sound) {
|
public void stopSound(Sound sound) {
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void stopSound(String s) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void stopSound(Sound sound, SoundCategory soundCategory) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopSound(String s, SoundCategory soundCategory) {
|
public void stopSound(String sound) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopSound(Sound sound, SoundCategory category) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopSound(String sound, SoundCategory category) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1282,7 +1276,7 @@ public class OfflinePlayer implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHealthScale(double arg0) throws IllegalArgumentException {
|
public void setHealthScale(double arg0) throws IllegalArgumentException {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1315,26 +1309,13 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGliding(boolean b) {
|
public void setGliding(boolean gliding) {
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSwimming() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSwimming(boolean swimming) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRiptiding() {
|
public void setAI(boolean ai) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAI(boolean b) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1343,39 +1324,15 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attack(Entity entity) {
|
public void setCollidable(boolean collidable) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void swingMainHand() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void swingOffHand() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCollidable(boolean b) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCollidable() {
|
public boolean isCollidable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> T getMemory(MemoryKey<T> memoryKey) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> void setMemory(MemoryKey<T> memoryKey, T t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends Projectile> T launchProjectile(Class<? extends T> type, Vector vector) {
|
public <T extends Projectile> T launchProjectile(Class<? extends T> type, Vector vector) {
|
||||||
return null;
|
return null;
|
||||||
@ -1385,11 +1342,6 @@ public class OfflinePlayer implements Player {
|
|||||||
public void sendSignChange(Location arg0, String[] arg1) throws IllegalArgumentException {
|
public void sendSignChange(Location arg0, String[] arg1) throws IllegalArgumentException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendSignChange(Location loc, String[] lines, DyeColor dyeColor) throws IllegalArgumentException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location getBedSpawnLocation() {
|
public Location getBedSpawnLocation() {
|
||||||
return null;
|
return null;
|
||||||
@ -1443,7 +1395,7 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Method method = base.getClass().getDeclaredMethod("setBanned", boolean.class);
|
Method method = base.getClass().getDeclaredMethod("setBanned", boolean.class);
|
||||||
method.invoke(banned);
|
method.invoke(base, banned);
|
||||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
||||||
// This will never happen in a normal CraftBukkit pre-1.12 instance
|
// This will never happen in a normal CraftBukkit pre-1.12 instance
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -1495,178 +1447,87 @@ public class OfflinePlayer implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, Location location, int i) {
|
public void spawnParticle(Particle particle, Location location, int count) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, double v, double v1, double v2, int i) {
|
public void spawnParticle(Particle particle, double x, double y, double z, int count) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, Location location, int i, T t) {
|
public <T> void spawnParticle(Particle particle, Location location, int count, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, T t) {
|
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2) {
|
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5) {
|
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, T t) {
|
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, T t) {
|
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, double v3) {
|
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6) {
|
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, double v3, T t) {
|
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6, T t) {
|
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendTitle(String title, String subtitle) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AttributeInstance getAttribute(Attribute attribute) {
|
|
||||||
// GetAttribute is nullable as per CraftAttributeMap. This might need to be
|
|
||||||
// improved to support cases where dummy null instances should be returned.
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setResourcePack(String s, byte[] bytes) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
|
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getClientViewDistance() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLocale() {
|
public String getLocale() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCooldown(Material material) {
|
public void sendTitle(String title, String subtitle) {
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCooldown(Material material) {
|
public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut) {
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCooldown(Material material, int i) {
|
public AttributeInstance getAttribute(Attribute attribute) {
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Entity getShoulderEntityLeft() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setShoulderEntityLeft(Entity entity) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Entity getShoulderEntityRight() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setShoulderEntityRight(Entity entity) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getHeight() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getWidth() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BoundingBox getBoundingBox() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Entity> getPassengers() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean addPassenger(Entity entity) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean removePassenger(Entity entity) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PistonMoveReaction getPistonMoveReaction() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateCommands() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openBook(ItemStack book) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PersistentDataContainer getPersistentDataContainer() {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user