From 9c0ad7d70ccf42329aa1406789da19c5aeea4114 Mon Sep 17 00:00:00 2001 From: games647 Date: Sat, 5 Mar 2016 21:47:28 +0100 Subject: [PATCH] Fixed UltraAuth support --- CHANGELOG.md | 7 +- .../fastlogin/bukkit/EncryptionUtil.java | 53 +- .../fastlogin/bukkit/hooks/UltraAuthHook.java | 1412 ++++++++++++++++- .../bukkit/listener/BukkitJoinListener.java | 2 + 4 files changed, 1412 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b71fb205..6fabfe2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,12 @@ +######0.6 + +* Added /premium [player] command with optional player parameter +* Fixed 1.9 bugs +* Added UltraAuth support + ######0.5 * Added unpremium command -* Added /premium [player] command with optional player parameter * Added autologin - See config * Added config * Added isRegistered API method diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java index 10c8ff5a..a2dff92d 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/EncryptionUtil.java @@ -2,25 +2,20 @@ package com.github.games647.fastlogin.bukkit; import com.google.common.base.Charsets; -import java.security.GeneralSecurityException; import java.security.InvalidKeyException; import java.security.Key; -import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.X509EncodedKeySpec; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; -import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; /** @@ -64,19 +59,19 @@ public class EncryptionUtil { } } - public static PublicKey decodePublicKey(byte[] encodedKey) { - try { - KeyFactory keyfactory = KeyFactory.getInstance("RSA"); - - X509EncodedKeySpec x509encodedkeyspec = new X509EncodedKeySpec(encodedKey); - return keyfactory.generatePublic(x509encodedkeyspec); - } catch (NoSuchAlgorithmException | InvalidKeySpecException nosuchalgorithmexception) { - //ignore - } - - System.err.println("Public key reconstitute failed!"); - return null; - } +// public static PublicKey decodePublicKey(byte[] encodedKey) { +// try { +// KeyFactory keyfactory = KeyFactory.getInstance("RSA"); +// +// X509EncodedKeySpec x509encodedkeyspec = new X509EncodedKeySpec(encodedKey); +// return keyfactory.generatePublic(x509encodedkeyspec); +// } catch (NoSuchAlgorithmException | InvalidKeySpecException nosuchalgorithmexception) { +// //ignore +// } +// +// System.err.println("Public key reconstitute failed!"); +// return null; +// } public static SecretKey decryptSharedKey(PrivateKey privateKey, byte[] encryptedSharedKey) { return new SecretKeySpec(decryptData(privateKey, encryptedSharedKey), "AES"); @@ -110,17 +105,17 @@ public class EncryptionUtil { System.err.println("Cipher creation failed!"); return null; } - - public static Cipher createBufferedBlockCipher(int operationMode, Key key) { - try { - Cipher cipher = Cipher.getInstance("AES/CFB8/NoPadding"); - - cipher.init(operationMode, key, new IvParameterSpec(key.getEncoded())); - return cipher; - } catch (GeneralSecurityException generalsecurityexception) { - throw new RuntimeException(generalsecurityexception); - } - } +// +// public static Cipher createBufferedBlockCipher(int operationMode, Key key) { +// try { +// Cipher cipher = Cipher.getInstance("AES/CFB8/NoPadding"); +// +// cipher.init(operationMode, key, new IvParameterSpec(key.getEncoded())); +// return cipher; +// } catch (GeneralSecurityException generalsecurityexception) { +// throw new RuntimeException(generalsecurityexception); +// } +// } private EncryptionUtil() { //utility diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java index a9bdcad6..7c29f9d8 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java @@ -1,14 +1,56 @@ package com.github.games647.fastlogin.bukkit.hooks; -import java.lang.reflect.Method; +import java.net.InetSocketAddress; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; -import net.sf.cglib.proxy.Callback; -import net.sf.cglib.proxy.Enhancer; -import net.sf.cglib.proxy.MethodInterceptor; -import net.sf.cglib.proxy.MethodProxy; -import net.sf.cglib.proxy.NoOp; +import org.bukkit.Achievement; +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.Statistic; +import org.bukkit.WeatherType; +import org.bukkit.World; +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeInstance; +import org.bukkit.block.Block; +import org.bukkit.conversations.Conversation; +import org.bukkit.conversations.ConversationAbandonedEvent; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.Villager; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +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.ItemStack; +import org.bukkit.inventory.PlayerInventory; +import org.bukkit.map.MapView; +import org.bukkit.metadata.MetadataValue; +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionAttachment; +import org.bukkit.permissions.PermissionAttachmentInfo; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scoreboard.Scoreboard; +import org.bukkit.util.Vector; import ultraauth.api.UltraAuthAPI; @@ -23,36 +65,1342 @@ public class UltraAuthHook implements AuthPlugin { } @Override - public boolean isRegistered(final String playerName) { - return UltraAuthAPI.isRegisterd(createFakePlayer(playerName)); - } - - private Player createFakePlayer(final String playerName) { - Callback implementation = new MethodInterceptor() { - @Override - public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { - String methodName = method.getName(); - - if (methodName.equals("getName")) { - return playerName; - } - - // Ignore all other methods - throw new UnsupportedOperationException( - "The method " + method.getName() + " is not supported for temporary players."); - } - }; - - // CGLib is amazing - Enhancer ex = new Enhancer(); - ex.setInterfaces(new Class[]{Player.class}); - ex.setCallbacks(new Callback[]{NoOp.INSTANCE, implementation}); - - return (Player) ex.create(); + public boolean isRegistered(String playerName) { + return UltraAuthAPI.isRegisterd(new FakePlayer(playerName)); } @Override public void forceRegister(Player player, String password) { UltraAuthAPI.setPlayerPasswordOnline(player, password); } + + class FakePlayer implements Player { + + private final String username; + + public FakePlayer(String username) { + this.username = username; + } + + @Override + public String getDisplayName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDisplayName(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPlayerListName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPlayerListName(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCompassTarget(Location loc) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getCompassTarget() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InetSocketAddress getAddress() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendRawMessage(String message) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void kickPlayer(String message) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void chat(String msg) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean performCommand(String command) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSneaking() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSneaking(boolean sneak) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSprinting() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSprinting(boolean sprinting) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void saveData() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void loadData() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSleepingIgnored(boolean isSleeping) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSleepingIgnored() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playNote(Location loc, byte instrument, byte note) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playNote(Location loc, Instrument instrument, Note note) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playSound(Location location, Sound sound, float volume, float pitch) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playSound(Location location, String sound, float volume, float pitch) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location loc, Effect effect, int data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location loc, Effect effect, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendBlockChange(Location loc, Material material, byte data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendBlockChange(Location loc, int material, byte data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendSignChange(Location loc, String[] lines) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMap(MapView map) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInventory() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void awardAchievement(Achievement achievement) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeAchievement(Achievement achievement) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasAchievement(Achievement achievement) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setStatistic(Statistic statistic, int newValue) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getStatistic(Statistic statistic) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setStatistic(Statistic statistic, Material material, int newValue) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType, int amount) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setStatistic(Statistic statistic, EntityType entityType, int newValue) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPlayerTime(long time, boolean relative) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getPlayerTime() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getPlayerTimeOffset() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPlayerTimeRelative() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void resetPlayerTime() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPlayerWeather(WeatherType type) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public WeatherType getPlayerWeather() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void resetPlayerWeather() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void giveExp(int amount) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void giveExpLevels(int amount) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getExp() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setExp(float exp) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getLevel() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLevel(int level) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTotalExperience() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTotalExperience(int exp) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getExhaustion() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setExhaustion(float value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getSaturation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSaturation(float value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFoodLevel() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFoodLevel(int value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getBedSpawnLocation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBedSpawnLocation(Location location) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBedSpawnLocation(Location location, boolean force) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getAllowFlight() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAllowFlight(boolean flight) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void hidePlayer(Player player) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void showPlayer(Player player) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean canSee(Player player) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isOnGround() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFlying() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFlying(boolean value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFlySpeed(float value) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setWalkSpeed(float value) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFlySpeed() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getWalkSpeed() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTexturePack(String url) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setResourcePack(String url) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Scoreboard getScoreboard() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setScoreboard(Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isHealthScaled() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setHealthScaled(boolean scale) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setHealthScale(double scale) throws IllegalArgumentException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getHealthScale() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getSpectatorTarget() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSpectatorTarget(Entity entity) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendTitle(String title, String subtitle) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void resetTitle() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Spigot spigot() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getName() { + return username; + } + + @Override + public PlayerInventory getInventory() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory getEnderChest() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setWindowProperty(Property prop, int value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView getOpenInventory() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openInventory(Inventory inventory) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openWorkbench(Location location, boolean force) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openEnchanting(Location location, boolean force) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void openInventory(InventoryView inventory) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openMerchant(Villager trader, boolean force) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void closeInventory() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemInHand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemInHand(ItemStack item) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemOnCursor() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemOnCursor(ItemStack item) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSleeping() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getSleepTicks() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public GameMode getGameMode() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setGameMode(GameMode mode) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBlocking() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getExpToLevel() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getEyeHeight() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getEyeHeight(boolean ignoreSneaking) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getEyeLocation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLineOfSight(HashSet transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLineOfSight(Set transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Block getTargetBlock(HashSet transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Block getTargetBlock(Set transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLastTwoTargetBlocks(HashSet transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLastTwoTargetBlocks(Set transparent, int maxDistance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRemainingAir() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRemainingAir(int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaximumAir() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaximumAir(int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaximumNoDamageTicks() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaximumNoDamageTicks(int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getLastDamage() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int _INVALID_getLastDamage() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLastDamage(double damage) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void _INVALID_setLastDamage(int damage) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getNoDamageTicks() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNoDamageTicks(int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Player getKiller() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffect(PotionEffect effect) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffect(PotionEffect effect, boolean force) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffects(Collection effects) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPotionEffect(PotionEffectType type) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removePotionEffect(PotionEffectType type) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection getActivePotionEffects() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasLineOfSight(Entity other) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getRemoveWhenFarAway() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRemoveWhenFarAway(boolean remove) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityEquipment getEquipment() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCanPickupItems(boolean pickup) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getCanPickupItems() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLeashed() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getLeashHolder() throws IllegalStateException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setLeashHolder(Entity holder) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public AttributeInstance getAttribute(Attribute attribute) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getLocation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getLocation(Location loc) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setVelocity(Vector velocity) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Vector getVelocity() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public World getWorld() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Location location) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Location location, TeleportCause cause) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Entity destination) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Entity destination, TeleportCause cause) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getNearbyEntities(double x, double y, double z) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getEntityId() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFireTicks() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFireTicks() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFireTicks(int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void remove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isDead() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isValid() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Server getServer() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getPassenger() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setPassenger(Entity passenger) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isEmpty() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean eject() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFallDistance() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFallDistance(float distance) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLastDamageCause(EntityDamageEvent event) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityDamageEvent getLastDamageCause() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public UUID getUniqueId() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTicksLived() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTicksLived(int value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(EntityEffect type) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityType getType() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isInsideVehicle() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean leaveVehicle() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getVehicle() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCustomName(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCustomName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCustomNameVisible(boolean flag) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isCustomNameVisible() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setGlowing(boolean flag) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isGlowing() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String metadataKey) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String metadataKey) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String metadataKey, Plugin owningPlugin) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String message) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String[] messages) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPermissionSet(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPermissionSet(Permission perm) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPermission(String name) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPermission(Permission perm) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, int ticks) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeAttachment(PermissionAttachment attachment) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void recalculatePermissions() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Set getEffectivePermissions() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isOp() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOp(boolean value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void damage(double amount) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void _INVALID_damage(int amount) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void damage(double amount, Entity source) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void _INVALID_damage(int amount, Entity source) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getHealth() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int _INVALID_getHealth() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setHealth(double health) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void _INVALID_setHealth(int health) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getMaxHealth() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int _INVALID_getMaxHealth() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxHealth(double health) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void _INVALID_setMaxHealth(int health) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void resetMaxHealth() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T launchProjectile(Class projectile) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T launchProjectile(Class projectile, Vector velocity) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isConversing() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptConversationInput(String input) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean beginConversation(Conversation conversation) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation conversation) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isOnline() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBanned() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBanned(boolean banned) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWhitelisted() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setWhitelisted(boolean value) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Player getPlayer() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getFirstPlayed() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLastPlayed() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPlayedBefore() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map serialize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendPluginMessage(Plugin source, String channel, byte[] message) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Set getListeningPluginChannels() { + throw new UnsupportedOperationException("Not supported yet."); + } + + } } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java index d0a98fb7..37e50d58 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java @@ -56,6 +56,8 @@ public class BukkitJoinListener implements Listener { if (session.needsRegistration()) { plugin.getLogger().log(Level.FINE, "Register player {0}", player.getName()); + plugin.getEnabledPremium().add(session.getUsername()); + String generatedPassword = plugin.generateStringPassword(); plugin.getAuthPlugin().forceRegister(player, generatedPassword); player.sendMessage(ChatColor.DARK_GREEN + "Auto registered with password: "