[1.8-1.13] SpaciousLib 1.7.0

Command Builder, Hologram, NPC, BossBar, Socket, etc

  1. AnhCraft
    Native Minecraft Version:
    1.13
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    Source Code:
    https://github.com/anhcraft/SpaciousLib/
    SpaciousLib brings many features, help you save time in coding. Features are always compatible between Minecraft versions. Just use this library, it will do other things for you!

    ----------------------------------------------------------------------------------------
    Download the latest version for Bungeecord here
    https://github.com/anhcraft/SpaciousLib/releases/latest
    ----------------------------------------------------------------------------------------

    Features:
    ⮚ Annotations:
    - Packet handler: easy to read and modify the packets
    Code (Text):
    @PacketHandler
    public void packetHandler(PacketListener.Handler handler){
            if(handler.getBound() == PacketListener.BoundType.CLIENT_BOUND
            && handler.getPacket().getClass().getSimpleName().equals("PacketPlayOutChat")){
                    handler.setCancelled(true);
            }
    }
    - PlayerCleaner: automatically remove the offline players out of maps, collections => saves the memory!
    Code (Text):
    @PlayerCleaner
    private static List<UUID> players = new ArrayList<>();
    ⮚ BungeeAPI: works around with Bungeecord faster & easier
    Code (Text):
    BungeeAPI.getPlayerList("hub", new BungeePlayerListResponse() {
        @Override
        public void result(String server, List<String> players) {
            System.out.println("Hub: "+String.join(", ", players));
        }
    });
    ⮚ Command builder: confusing with the traditional command system? Hardly checking executed commands? Just use this builder. Special offer: supported auto completion
    Code (Text):
    new CommandBuilder("this", new CommandRunnable() {
        @Override
        public void run(CommandBuilder cmd, SubCommandBuilder subcmd, CommandSender sender, String[] args, String value) {

        }
    }).addSubCommand(new SubCommandBuilder("is a long command", "", new CommandRunnable() {
        @Override
        public void run(CommandBuilder cmd, SubCommandBuilder subcmd, CommandSender sender, String[] args, String value) {

        }
    })).buildExecutor(this);
    ⮚ Effects: contains many effect types, fully customize
    Code (Text):
    ImageEffect effect = new ImageEffect(player.getLocation(), getClass().getResourceAsStream("/test.png"));
    effect.setAngleX(90);
    effect.addNearbyViewers(10);
    effect.setImageSize(0.5);
    effect.setParticleAmount(effect.getParticleAmount() * 20);
    effect.spawn();
    ⮚ Entity
    - Hologram
    Code (Text):

    Hologram hologram = new Hologram(location);
    hologram.addLine("first line");
    hologram.addLine("second line");
    hologram.addLine("third line");
    hologram.buildPackets();
    hologram.addViewer(player.getUniqueId());
    - NPC: able to spawn an NPC (fake player), sets its skin and handles when a player interacts with it
    Code (Text):
    try {
         Skin skin = SkinAPI.getSkin(UUID.fromString("2c8d5050-eae7-438d-88c4-c29fbcebede9")).getSkin();
          GameProfile profile = new GameProfileManager("test").setSkin(skin).getGameProfile();
          npc = new NPC(profile, location);
          npc.buildPackets();
          npc.addViewer(player.getUniqueId());
    } catch(Exception e) {
         e.printStackTrace();
    }
    - Bossbar: 1.8 supported!
    Code (Text):
    BossBar bossbar = new BossBar("This is a boss bar", BossBar.Color.BLUE, BossBar.Style.NOTCHED_12, 1, BossBar.Flag.DARKEN_SKY);
    bossbar.addViewer(player.getUniqueId());
    - ArmorStand:
    Code (Text):
    ArmorStand armorStand = new ArmorStand(player.getLocation()).setArms(true).setGravity(true).setCustomName("aaa").setMarker(true).setVisible(true).setHelmet(new ItemManager("&aaaa", Material.BEACON, 1).setUnbreakable(true).getItem());
    armorstand.buildPackets();
    armorstand.addViewer(player.getUniqueId());
    ⮚ Events
    - ArmorEquipEvent: triggers when a player equip or unequip armors
    Code (Text):
    @EventHandler
    public void equip(ArmorEquipEvent event){
        if(!InventoryUtils.isNull(event.getNewArmor())){
            if(event.getNewArmor().getType().equals(Material.DIAMOND_HELMET)) {
                event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 9999999, 1));
            }
            return;
        }
        if(!InventoryUtils.isNull(event.getOldArmor())) {
            if(event.getOldArmor().getType().equals(Material.DIAMOND_HELMET)) {
                event.getPlayer().removePotionEffect(PotionEffectType.LEVITATION);
            }
        }
    }
    - BowArrowHitEvent: this is a combination between ProjectileHitEvent and EntityShootBowEvent, it's easier to check which is the used bow, which is the shot arrow and who shot it
    Code (Text):
    @EventHandler
    public void bow(BowArrowHitEvent event){
        event.getShooter().teleport(event.getArrow().getLocation());
    }
    - BungeeForwardEvent: triggers when a data was sent from a Bungeecord channel
    - NPCInteractEvent: triggers when a player interacts with an NPC
    - PlayerJumpEvent: triggers when a player jumps
    - ServerReloadEvent: called when a server is going to reload
    - ServerStopEvent: called when a server is going to stop​
    ⮚ Inventory
    - BookManager: creates a book easier, modify its pages, sets its author or something else
    - ItemManager: easy to create an item with color support, make it unbreakable or modify its attributes
    - InventoryManager: you can create a inventory faster! with special methods like #addUniqueItem, or adds a clickable item
    - RecipeManager: able to register/unregister recipes or compare them
    - SkullManager: easy to create a skull with skin support!​
    ⮚ Mojang
    - GameProfileManager: easiest way to modify a game profile, you can also modify its skin and then apply it to a player
    - SkinAPI: a safely api to get skins (yes, they will be cached)
    Code (Text):
    // warning: this code only works without a proxy
    new PlayerManager((Player) sender).changeSkin(SkinAPI.getSkin(MojangAPI.getUUID(value).getB()).getSkin());
    ⮚ NBT: able to load NBT tags from many types (configuration section, JSON, entities, items), then modify them and saves to another types
    Code (Text):
    NBTCompound nbt = NBTLoader.fromEntity(player);
    try {
        new FileManager("entity.json").delete()
             .initFile(nbt.toJSON().getBytes(StandardCharsets.UTF_8));
    } catch(IOException e) {
        e.printStackTrace();
    }
    ⮚ Placeholders: with three types: Placeholder (it's dynamic and always up-to-date), CachedPlaceholder (the recommended way, the placeholders will be cached and automatic be renewed), FixedPlaceholder (don't renew them)
    ⮚ Protocol: contains many common packets like Title, Action Bar, Particle, Camera, Player List
    ⮚ Socket: helps you create a socket server/client, able to send and receive data via byte arrays.
    Code (Text):
    ServerSocketManager server = new ServerSocketManager(16850, new ServerSocketHandler() {
        @Override
        public void request(ServerSocketClientManager client, byte[] data) {

        }

        @Override
        public void connect(ServerSocketClientManager client) {
            try {
                client.send("Welcome to our server!");
            } catch(IOException e) {
                e.printStackTrace();
            }
        }
    });
    ⮚ Utils: contains many util classes, look at them by yourself

    Links:
    Javadoc
    : https://anhcraft.github.io/SpaciousLib/javadoc/
    Wiki: https://github.com/anhcraft/SpaciousLib/wiki
    Placeholders: https://cdn.rawgit.com/anhcraft/SpaciousLib/master/.placeholders
    To-do list: https://github.com/anhcraft/SpaciousLib/projects/1

    This library will collect your server's information. See more: https://anhcraft.org/tracking.craft

    Discord: https://discord.gg/79QdUxN

    For any bugs or suggestions, please p.m me or create an issue on GitHub. The review section isn't a place for reporting bugs, they will be ignored :confused:

Recent Updates

  1. SL 1.7.0
  2. SpaciousLib 1.6.9
  3. SpaciousLib 1.6.8

Recent Reviews

  1. DUYSONGLOI
    DUYSONGLOI
    3/5,
    Version: 1.7.0
    plugins hay dok, nhung ma anhcarft da theo Shuu roi, cuoc tinh chung ta cham dut nen rate 3* thoi con di ham rank :(
    1. AnhCraft
      Author's Response
      reported your review
  2. TheFates123
    TheFates123
    1/5,
    Version: 1.6.9
    API nhu con cac, rate me may 1 sao
    ====================================================
    1. AnhCraft
      Author's Response
      adu thang quang tran
      chut report chet me fb m
  3. Darklust
    Darklust
    5/5,
    Version: 1.6.9
    Underrated library, has alot of helper methods for more complex Spigot tasks. The dev is responsive and knowledgeable as well!
    1. AnhCraft
      Author's Response
      Thanks for your review :D
  4. TozyMC
    TozyMC
    5/5,
    Version: 1.6.7
    Plugin này rất ok :)) nhưng vẫn mong tác giả thêm 1 số tình năng khác như event khi nhấp vào hologram, progress bossbar, bossbar timer, animated title, actionbar, dịch chuyển đến vùng an toàn, cảnh báo vùng nguy hiểm, afk event. Cũng có thể thêm hologram per player.
    ===========================================================
    The plugin is very great!
    1. AnhCraft
      Author's Response
      ok
      để tạo title/action bar động, chỉ việc gửi title, action bar nhiều lần là dc
      hologram per player đã có sẵn, xem wiki & javadoc

      --------------------------------------------------------------------
      tks for your review
      to create animated titles or action bars, I can suggest you an idea: send many titles which contain different colours -> you will have animated titles.
      SpaciousLib allows you to send hologram per players, please read the wiki (and the javadocs too)
  5. hophidat
    hophidat
    1/5,
    Version: 1.6.3
    ....................................
    tôi ko phá dc block khi cài
    ....................................
    1. AnhCraft
      Author's Response
      cut
      deo fix nua
  6. takahatashun
    takahatashun
    5/5,
    Version: 1.6.3
    Code plugin cường hoá dc đây hehe :V :V
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
    1. AnhCraft
  7. HeizMC
    HeizMC
    5/5,
    Version: 1.6.3
    tuyệt vời emcraft ơi em yêu anh nhiều lắm i love you chịch chịch vì cái bình luận bắt 80 cmt nên tôi phải viết dài vãi lồn
  8. EnityStaller
    EnityStaller
    5/5,
    Version: 1.5.4
    Support ENC dùm cái coi >:(
    ========================
    tks for no any think
    ========================
  9. GameFreakBaree
    GameFreakBaree
    4/5,
    Version: 1.5.4
    Good plugin! But why use this plugin instead the famous ProtocolLib?????????????
    1. AnhCraft
      Author's Response
      They are different.
      This library has features that ProtocolLib doesn't contain. ¯\_(ツ)_/¯
  10. C4Gift
    C4Gift
    1/5,
    Version: 1.5.2
    plugins như cái lồn trâu nhờ cả đám việt nam vào rate giúp :)),
    Pluigns fuck it pussy cow all the vietnamese to rate :))
    1. AnhCraft