Spigot BetterServer Gamemodes/fly and more 1.7

[Gamemodes]-[Fly]-[Broadcast]-[Heal]-[Feed]-[clearchat]-[AutoBroadcast]-[Hub]-[SetHub]-[AntiSwear]

  1. Senneistheboss submitted a new resource:

    BetterServer Gamemodes/fly and more - [Gamemodes]-[Fly]-[Broadcast]-[Heal]-[Feed]-[clearchat]-[AutoBroadcast]-[Hub]-[SetHub]

    Read more about this resource...
     
  2. Thanks men for the plugin! It's perfect from my server! Thanks you! ;9
     
  3. I hope the updates!! o_Oo_Oo_O:);)
     
  4. Updates are done but can you send me your server ip i want join and free advertisement in TestServer
     
  5. Code (Java):
    package me.Senneistheboss.particles;

    import java.lang.reflect.Constructor;
    import java.lang.reflect.Field;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.HashMap;
    import java.util.Map;
    import org.bukkit.Bukkit;

    public final class ReflectionUtils
    {
      public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes)
        throws NoSuchMethodException
      {
        Class[] primitiveTypes = DataType.getPrimitive(parameterTypes);
        Constructor[] arrayOfConstructor;
        int j = (arrayOfConstructor = clazz.getConstructors()).length;
        for (int i = 0; i < j; i++)
        {
          Constructor<?> constructor = arrayOfConstructor[i];
          if (DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) {
            return constructor;
          }
        }
        throw new NoSuchMethodException("There is no such constructor in this class with the specified parameter types");
      }
     
      public static Constructor<?> getConstructor(String className, PackageType packageType, Class<?>... parameterTypes)
        throws NoSuchMethodException, ClassNotFoundException
      {
        return getConstructor(packageType.getClass(className), parameterTypes);
      }
     
      public static Object instantiateObject(Class<?> clazz, Object... arguments)
        throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
      {
        return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments);
      }
     
      public static Object instantiateObject(String className, PackageType packageType, Object... arguments)
        throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException
      {
        return instantiateObject(packageType.getClass(className), arguments);
      }
     
      public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
        throws NoSuchMethodException
      {
        Class[] primitiveTypes = DataType.getPrimitive(parameterTypes);
        Method[] arrayOfMethod;
        int j = (arrayOfMethod = clazz.getMethods()).length;
        for (int i = 0; i < j; i++)
        {
          Method method = arrayOfMethod[i];
          if ((method.getName().equals(methodName)) && (DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes))) {
            return method;
          }
        }
        throw new NoSuchMethodException("There is no such method in this class with the specified name and parameter types");
      }
     
      public static Method getMethod(String className, PackageType packageType, String methodName, Class<?>... parameterTypes)
        throws NoSuchMethodException, ClassNotFoundException
      {
        return getMethod(packageType.getClass(className), methodName, parameterTypes);
      }
     
      public static Object invokeMethod(Object instance, String methodName, Object... arguments)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
      {
        return getMethod(instance.getClass(), methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments);
      }
     
      public static Object invokeMethod(Object instance, Class<?> clazz, String methodName, Object... arguments)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
      {
        return getMethod(clazz, methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments);
      }
     
      public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException
      {
        return invokeMethod(instance, packageType.getClass(className), methodName, arguments);
      }
     
      public static Field getField(Class<?> clazz, boolean declared, String fieldName)
        throws NoSuchFieldException, SecurityException
      {
        Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName);
        field.setAccessible(true);
        return field;
      }
     
      public static Field getField(String className, PackageType packageType, boolean declared, String fieldName)
        throws NoSuchFieldException, SecurityException, ClassNotFoundException
      {
        return getField(packageType.getClass(className), declared, fieldName);
      }
     
      public static Object getValue(Object instance, Class<?> clazz, boolean declared, String fieldName)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
      {
        return getField(clazz, declared, fieldName).get(instance);
      }
     
      public static Object getValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException
      {
        return getValue(instance, packageType.getClass(className), declared, fieldName);
      }
     
      public static Object getValue(Object instance, boolean declared, String fieldName)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
      {
        return getValue(instance, instance.getClass(), declared, fieldName);
      }
     
      public static void setValue(Object instance, Class<?> clazz, boolean declared, String fieldName, Object value)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
      {
        getField(clazz, declared, fieldName).set(instance, value);
      }
     
      public static void setValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName, Object value)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException
      {
        setValue(instance, packageType.getClass(className), declared, fieldName, value);
      }
     
      public static void setValue(Object instance, boolean declared, String fieldName, Object value)
        throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
      {
        setValue(instance, instance.getClass(), declared, fieldName, value);
      }
     
      public static enum PackageType
      {
        MINECRAFT_SERVER("net.minecraft.server." + getServerVersion()),  CRAFTBUKKIT("org.bukkit.craftbukkit." + getServerVersion()),  CRAFTBUKKIT_BLOCK(CRAFTBUKKIT, "block"),  CRAFTBUKKIT_CHUNKIO(CRAFTBUKKIT, "chunkio"),  CRAFTBUKKIT_COMMAND(CRAFTBUKKIT, "command"),  CRAFTBUKKIT_CONVERSATIONS(CRAFTBUKKIT, "conversations"),  CRAFTBUKKIT_ENCHANTMENS(CRAFTBUKKIT, "enchantments"),  CRAFTBUKKIT_ENTITY(CRAFTBUKKIT, "entity"),  CRAFTBUKKIT_EVENT(CRAFTBUKKIT, "event"),  CRAFTBUKKIT_GENERATOR(CRAFTBUKKIT, "generator"),  CRAFTBUKKIT_HELP(CRAFTBUKKIT, "help"),  CRAFTBUKKIT_INVENTORY(CRAFTBUKKIT, "inventory"),  CRAFTBUKKIT_MAP(CRAFTBUKKIT, "map"),  CRAFTBUKKIT_METADATA(CRAFTBUKKIT, "metadata"),  CRAFTBUKKIT_POTION(CRAFTBUKKIT, "potion"),  CRAFTBUKKIT_PROJECTILES(CRAFTBUKKIT, "projectiles"),  CRAFTBUKKIT_SCHEDULER(CRAFTBUKKIT, "scheduler"),  CRAFTBUKKIT_SCOREBOARD(CRAFTBUKKIT, "scoreboard"),  CRAFTBUKKIT_UPDATER(CRAFTBUKKIT, "updater"),  CRAFTBUKKIT_UTIL(CRAFTBUKKIT, "util");
       
        private final String path;
       
        private PackageType(String path)
        {
          this.path = path;
        }
       
        private PackageType(PackageType parent, String path)
        {
          this(parent + "." + path);
        }
       
        public String getPath()
        {
          return this.path;
        }
       
        public Class<?> getClass(String className)
          throws ClassNotFoundException
        {
          return Class.forName(this + "." + className);
        }
       
        public String toString()
        {
          return this.path;
        }
       
        public static String getServerVersion()
        {
          return Bukkit.getServer().getClass().getPackage().getName().substring(23);
        }
      }
     
      public static enum DataType
      {
        BYTE(Byte.TYPE, Byte.class),  SHORT(Short.TYPE, Short.class),  INTEGER(Integer.TYPE, Integer.class),  LONG(Long.TYPE, Long.class),  CHARACTER(Character.TYPE, Character.class),  FLOAT(Float.TYPE, Float.class),  DOUBLE(Double.TYPE, Double.class),  BOOLEAN(Boolean.TYPE, Boolean.class);
       
        private static final Map<Class<?>, DataType> CLASS_MAP;
        private final Class<?> primitive;
        private final Class<?> reference;
       
        static
        {
          CLASS_MAP = new HashMap();
          DataType[] arrayOfDataType;
          int j = (arrayOfDataType = values()).length;
          for (int i = 0; i < j; i++)
          {
            DataType type = arrayOfDataType[i];
            CLASS_MAP.put(type.primitive, type);
            CLASS_MAP.put(type.reference, type);
          }
        }
       
        private DataType(Class<?> primitive, Class<?> reference)
        {
          this.primitive = primitive;
          this.reference = reference;
        }
       
        public Class<?> getPrimitive()
        {
          return this.primitive;
        }
       
        public Class<?> getReference()
        {
          return this.reference;
        }
       
        public static DataType fromClass(Class<?> clazz)
        {
          return (DataType)CLASS_MAP.get(clazz);
        }
       
        public static Class<?> getPrimitive(Class<?> clazz)
        {
          DataType type = fromClass(clazz);
          return type == null ? clazz : type.getPrimitive();
        }
       
        public static Class<?> getReference(Class<?> clazz)
        {
          DataType type = fromClass(clazz);
          return type == null ? clazz : type.getReference();
        }
       
        public static Class<?>[] getPrimitive(Class<?>[] classes)
        {
          int length = classes == null ? 0 : classes.length;
          Class[] types = new Class[length];
          for (int index = 0; index < length; index++) {
            types[index] = getPrimitive(classes[index]);
          }
          return types;
        }
       
        public static Class<?>[] getReference(Class<?>[] classes)
        {
          int length = classes == null ? 0 : classes.length;
          Class[] types = new Class[length];
          for (int index = 0; index < length; index++) {
            types[index] = getReference(classes[index]);
          }
          return types;
        }
       
        public static Class<?>[] getPrimitive(Object[] objects)
        {
          int length = objects == null ? 0 : objects.length;
          Class[] types = new Class[length];
          for (int index = 0; index < length; index++) {
            types[index] = getPrimitive(objects[index].getClass());
          }
          return types;
        }
       
        public static Class<?>[] getReference(Object[] objects)
        {
          int length = objects == null ? 0 : objects.length;
          Class[] types = new Class[length];
          for (int index = 0; index < length; index++) {
            types[index] = getReference(objects[index].getClass());
          }
          return types;
        }
       
        public static boolean compare(Class<?>[] primary, Class<?>[] secondary)
        {
          if ((primary == null) || (secondary == null) || (primary.length != secondary.length)) {
            return false;
          }
          for (int index = 0; index < primary.length; index++)
          {
            Class<?> primaryClass = primary[index];
            Class<?> secondaryClass = secondary[index];
            if ((!primaryClass.equals(secondaryClass)) && (!primaryClass.isAssignableFrom(secondaryClass))) {
              return false;
            }
          }
          return true;
        }
      }
    }
     
    Credits, please?

    Code (Java):
    ItemStack fed = new ItemStack(Material.PAPER, 1);
        ItemMeta fedmeta = fed.getItemMeta();
        fedmeta.setDisplayName(ChatColor.RED + "WhiteList on");
        if (p.hasPermission("betterserver.whitelist")) {
          fedmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Whitelist on", ChatColor.GRAY + "Permission: " + ChatColor.GREEN + ChatColor.BOLD + "YES!" }));
        } else {
          fedmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Whitelist on", ChatColor.GRAY + "Permission: " + ChatColor.RED + ChatColor.BOLD + "NO!" }));
        }
        fed.setItemMeta(fedmeta);
        inv.setItem(2, fed);
    What about using bukkit and minecraft's whitelist permissions?

    Code (Java):
    if (p.hasPermission("betterserver.restart")) {
          shitmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Kick all", ChatColor.GRAY + "Permission: " + ChatColor.GREEN + ChatColor.BOLD + "YES!" }));
        } else {
          shitmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Kick all", ChatColor.GRAY + "Permission: " + ChatColor.RED + ChatColor.BOLD + "NO!" }));
        }
    1. Shit is the red mushroom?
    2. Kick all != Restart

    Code (Java):
    @EventHandler
      public void OnMove(PlayerMoveEvent e)
      {
        Player p = e.getPlayer();
        try
        {
          if (p.getInventory().getHelmet().getItemMeta().getDisplayName().equalsIgnoreCase("�cSantaHat")) {
            ParticleEffect.SNOW_SHOVEL.display(0.3F, 0.0F, 0.3F, 0.0F, 25, p.getLocation(), 10.0D);
          }
        }
        catch (NullPointerException localNullPointerException) {}
      }
    Where is the use in this?

    Code (Java):
    .replaceAll("&", "§")
    Please.. use ChatColor#translateAlternateColor
     
  6. Code (Java):

    public class PingServer
    {
      private String host = null;
      private int port = 0;
      private Socket socket = new Socket();
      private String[] data = new String['?'];
     
      public PingServer(String host, int port)
      {
        this.host = host;
        this.port = port;
        try
        {
          this.socket.connect(new InetSocketAddress(host, port));
          OutputStream out = this.socket.getOutputStream();
          InputStream in = this.socket.getInputStream();
          out.write(254);
         
          StringBuffer str = new StringBuffer();
          int b;
          while ((b = in.read()) != -1)
          {
            int b;
            if ((b != 0) && (b > 16) && (b != 255) && (b != 23) && (b != 24)) {
              str.append((char)b);
            }
          }
          this.data = str.toString().split("�");
          this.data[0] = this.data[0].substring(1, this.data[0].length());
        }
        catch (IOException e)
        {
          e.printStackTrace();
        }
      }
     
      public String getMotd()
      {
        return this.data[0];
      }
     
      public int getOnline()
      {
        return Integer.parseInt(this.data[1]);
      }
     
      public int getMax()
      {
        return Integer.parseInt(this.data[2]);
      }
     
      public void update()
      {
        try
        {
          this.socket.close();
          this.socket = new Socket();
          this.socket.connect(new InetSocketAddress(this.host, this.port));
          OutputStream out = this.socket.getOutputStream();
          InputStream in = this.socket.getInputStream();
          out.write(254);
         
          StringBuffer str = new StringBuffer();
          int b;
          while ((b = in.read()) != -1)
          {
            int b;
            if ((b != 0) && (b > 16) && (b != 255) && (b != 23) && (b != 24)) {
              str.append((char)b);
            }
          }
          this.data = str.toString().split("�");
          this.data[0] = this.data[0].substring(1, this.data[0].length());
        }
        catch (IOException e)
        {
          e.printStackTrace();
        }
      }
    }
    You didn't write that..
    Sorry.

    Code (Java):
    redmeta.setDisplayName(ChatColor.RED + "Reload the server");
        if (p.hasPermission("betterserver.fly")) {
          redmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Reload", ChatColor.GRAY + "Permission: " + ChatColor.GREEN + ChatColor.BOLD + "YES!" }));
        } else {
          redmeta.setLore(Arrays.asList(new String[] { ChatColor.GRAY + "Reload", ChatColor.GRAY + "Permission: " + ChatColor.RED + ChatColor.BOLD + "NO!" }));
        }
    WUT
    You need betterserver.fly to reload the server!?

    *particle effects class*
    Credits, please?

    [2 posts due 20k chars limit] [Removed 1 class due too long to be processed xD]
     
  7. Stop doing it and ps if you dont now what that upper is than you are dum
     
  8. Know what upper is?
    As in above?
    Also, 'dum' isn't a word.
    And I won't stop doing it until you update all the plugins with a fix to all these problems, especially '&' -> '§'.
     
  9. Ohh oke i need to update all my plugins only for you that you can decomplete my plugin and mayby use it for an other server Yea right im not doing ps i reported you for decompleting my plugins
     
  10. Why the hell would I just that crappy plugin?
    I have my own custom coded, huge plugin and I'm using that.
    Also, you have nothing against decompiling plugins, as you have no ToS or Disclaimer..