Git Product home page Git Product logo

spigotlib's Introduction


  ██████  ██▓███   ██▓  ▄████  ▒█████  ▄▄▄█████▓    ██▓     ██▓ ▄▄▄▄   
▒██    ▒ ▓██░  ██▒▓██▒ ██▒ ▀█▒▒██▒  ██▒▓  ██▒ ▓▒   ▓██▒    ▓██▒▓█████▄ 
░ ▓██▄   ▓██░ ██▓▒▒██▒▒██░▄▄▄░▒██░  ██▒▒ ▓██░ ▒░   ▒██░    ▒██▒▒██▒ ▄██
  ▒   ██▒▒██▄█▓▒ ▒░██░░▓█  ██▓▒██   ██░░ ▓██▓ ░    ▒██░    ░██░▒██░█▀  
▒██████▒▒▒██▒ ░  ░░██░░▒▓███▀▒░ ████▓▒░  ▒██▒ ░    ░██████▒░██░░▓█  ▀█▓
▒ ▒▓▒ ▒ ░▒▓▒░ ░  ░░▓   ░▒   ▒ ░ ▒░▒░▒░   ▒ ░░      ░ ▒░▓  ░░▓  ░▒▓███▀▒
░ ░▒  ░ ░░▒ ░      ▒ ░  ░   ░   ░ ▒ ▒░     ░       ░ ░ ▒  ░ ▒ ░▒░▒   ░ 
░  ░  ░  ░░        ▒ ░░ ░   ░ ░ ░ ░ ▒    ░           ░ ░    ▒ ░ ░    ░ 
      ░            ░        ░     ░ ░                  ░  ░ ░   ░      
                                                                     ░ 

Introduction

SpigotLib is a collection of several useful libraries and APIs for Spigot plugin development. It's not only perfect for developers, but it's also good for server owners, because they can use it's API testing commands, which are really useful.

Important links
Download
Official Discord Group
Online JavaDoc

Compiling with Maven

Before compiling this project with Maven after cloning it you need to add the following jar files to the libs folder:

  • Spigot-1.14.jar
  • PaperSpigot-1.12.2.jar
  • PaperSpigot-1.7.10.jar

They need to be called exactly as listed above.

I am not allowed to share these binaries in this repo, because of their license agreement.

Why should you use SpigotLib?

If you are a Minecraft server owner, then you should use it for one of the following purposes:

  1. You would like to use a plugin on your server which depends on it
  2. For using some of it's commands by server owners, admins. You may even put them to a sign or an NPC with other plugins, what can be very helpful
  3. For getting nice, colored and meaningful error reports encoded by the SpigotLibs CommandAPI instead of the old boring internal server error chat messages.

If you are a Spigot plugin developer, then you should use it for one of the following purposes:

  1. For coding plugins up to 2x faster
  2. For using already perfectly working solutions for common plugin development problems
  3. For hooking in to other plugins indirectly
  4. To avoid the possibility of so many bugs appearing in your plugin
  5. For coding plugins working on the packet level super easily

Troubleshooting Issues

If the plugin does not work for you then please do not panic, do NOT leave a bad review, or a comment, just read and follow these steps:

  1. Before posting the new update I always fully test the plugin, so it's verified that it works fine, which means that in the most of the cases it should also work at you without any issues. The only reason of malfunction can be the differences between my and your testing enviroment, so in the next points I will explain you what kind of testing enviroment differences exists

  2. Incorrect server version: Please use the Spigots BuildTools to build yourself one of the following server versions: 1.8.8; 1.9; 1.9.2; 1.9.4; 1.10; 1.10.2; 1.11; 1.11.2; 1.12; 1.12.2; 1.13; 1.13.1; 1.14; 1.14.4; 1.15; 1.15.1

    For any other version there is no guarantee that SpigotLib will work without any issues. On 1.7.10 and older servers the SpigotLib works might only work in a limited "safe" mode, which means that only some of it's funtionalities will work, which does not directly depend on the Spigot API.

  3. Using other plugins which causes issues:

    I will list you a few already known problematic plugins, of which some versions might cause issues:

  • ChatControl plugins packet related features: Please stop your server and disable these features in ChatControl plugins configuration

  • ProtocolSupport, ProtocolLib, ViaVersion: All of these plugins works with packets, so it's possible that some of them causes compatibility issues with SpigotLib. To resolve these issues it's suggested to make a new test server using just SpigotLib, and try to add these 3 plugins to it step by step. After these are added and working properly you may add the other plugins to your server. If they are not working, then check if you are using the correct versions of both of these plugins.

    I have tested and verified already, that using the right versions of ProtocolSupport, ProtocolLib and ViaVersion together with SpigotLib are working fine, however I believe, that the combination of these 4 plugins incorrectly causes the most of the problems.

  1. Remove old SpigotLib folder: After each update it's suggested to remove the old SpigotLib folder for letting the plugin extract the latest configuration and language file from the new SpigotLib jar.

  2. Verify that SpigotLib works fine: The easiest way to verify that SpigotLib works properly is the usage of the /sl command

  3. If you are absolutely sure about that none of the above mentioned points helped you: Still do NOT leave a bad review or write a comment, just contact me and I will help you.

Features

  • Animation API (make your animations and run them easily)
  • BungeeAPI (Communicate super easily with the BungeeCord or with other servers connected to BungeeCord)
  • ChatAPI (for sending Action bar, Chat and System JSON messages really easy, using my really simple custom format)
  • CommandAPI (make command simulations easily using this API. It provides commands like Title, Subtitle, ActionBar, Console, Chat, Message, e.t.c. And every command is executed through the VariableAPI, so you can also use variables in the commands. You can even create custom commands too)
  • Config management (Don't waste your time with config loading / saving. This system simplifiest all your Config management. From now it works with MySQL too.)
  • EconomyAPI (a simple but really useful EconomyAPI system with multiple balance types, Vault compatibility and bank support. Now it supports working with other economy management plugins too.)
  • ItemGuiAPI (Make custom item GUIs easily, supports inventory layout management so you can set up the same item to several inventory slots easily)
  • JSON API (Are you tired of using Gson, it's time to try out a way better JsonAPI system. This system works similiar to the configuration management, just with Jsons)
  • Language management API (use per player selectable languages for your plugins language file)
  • Map API (manage custom maps very easily and super fast on packet level)
  • Mojang API (easily handle the requests and responses between your server and between the Mojangs official API)
  • MySQL API (Never worry about MySQL connections anymore, just use this API to easily send MySQL commands and get the answers or just do some background/Async updates)
  • NBT API (get, list and add custom NBT tags for entities and items)
  • TPS meter and crashreporter (make a crash report from the per thread stack trace dumps, if the servers tps is too low)
  • TitleAPI (for setting Titles/Subtitles, for players without version incompatibility)
  • PacketAPI (I have created a brand new API for managing packets really easily and compatible between different Spigot versions)
  • PlayerFile (A brilliant way of storing any kind of data about a player. It supports both FILE and MySQL backend.)
  • RomanNumsAPI (A simple but powerful API for converting numbers to roman ones and vice versa)
  • ScoreboardAPI (manage per player different NO FLICKER sidebars, tabbars and nametagbars easily)
  • VariableAPI (for handling unlimited amount of variables cross plugins, with a really simple and easy to use way)
  • TimeAPI (for showing times in chat easily)

Commands

  • /sl cmd [p:player]
  • /sl debug
  • /sl item [give] [p:player] [item]
  • /sl lang [p:player] [language]
  • /sl migratetodb
  • /sl perm [p:player] [permission]
  • /sl reload [p:player] <pf|lf|config>
  • /sl save [p:player]
  • /sl vars [p:player] [message]
  • /sl velocity [p:player]

Permissions

  • spigotlib.debug (for getting debug messages, like error reports in the chat)
  • spigotlib.command.commandname (for using a SpigotLib command)

Translations

  • Available: English, German, Hungarian, Dutch (outdated, looking for new translators)

If you are able to, please translate this plugin to your language! In translation, you should keep the plugins colors, commands and variable names. You should only change the sentences in messages.

Contact

Before complaining about something doesn't work, please CONTACT ME.

Discord Group

Author's Discord: gyuriX#8413

Email

​License

SpigotLib is licensed under the GPL-3 license

Short overview

Full text

spigotlib's People

Contributors

gyurix avatar zozidalom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

spigotlib's Issues

[1.16.5] Problem with message sending

Hello.

I have a problem with message sending.
Version: latest 1.16.5 Spigot, latest SpigotLib

TestPlugin.java:

public class TestPlugin extends JavaPlugin implements Listener {
    private GlobalLangFile.PluginLang lang;

    public void onEnable() {
        SU.saveResources(this, "lang.yml");
        getServer().getPluginManager().registerEvents(this, this);
        lang = GlobalLangFile.loadLF("TestPlugin", this.getDataFolder() + File.separator + "lang.yml");
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        this.lang.msg(event.getPlayer(), "testMessage");
    }
}

lang.yml:

en:
  TestPlugin:
    prefix: &a[TestPluign] &r
    testMessage: Test message.

Error:

java.lang.NullPointerException
java.lang.NullPointerException
	at net.minecraft.server.v1_16_R3.PacketDataSerializer.a(PacketDataSerializer.java:203)
	at net.minecraft.server.v1_16_R3.PacketPlayOutChat.b(PacketPlayOutChat.java:45)
	at net.minecraft.server.v1_16_R3.PacketEncoder.encode(PacketEncoder.java:42)
	at net.minecraft.server.v1_16_R3.PacketEncoder.encode(PacketEncoder.java:12)
	at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702)
	at gyurix.protocol.manager.ProtocolImpl$ClientChannelHook.write(ProtocolImpl.java:214)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:808)
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025)
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:294)
	at net.minecraft.server.v1_16_R3.NetworkManager$1.run(NetworkManager.java:409)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:834)

1.15.2:

img_1

I desperatily need help

So, this dude logs on and instantly crashes the server. It's only him, and no one else. He also is doing it purposefully and I can not find out how he's doing it. Here are the errors I'm getting in Console from SpigotLib.

https://hastebin.com/ibofeqivew.md

Please help.

Update SpigotLib to 1.20

Please consider updating SpigotLib to 1.19 or even better 1.20 as a customer I service paid money for a Stargate plugin from you.

I updated it for him to version 1.20 and everything would work if SpigotLib was also compatible with the newer versions.

Anyone who has a plugin from you that is based on SpigotLib will no longer be able to use it, which is a shame.

Please, gyurix and zozidalom, update SpigotLib to version 1.20 or at least 1.19.

That is the only correct thing to do.

Have a nice day!

Minecreator200

Add Kotlin Support

I would find it nice if I could use Kotlin DSLs for things like the gui api. So i can do Something Like this:

player.openGui {
    slots = 27
    title = "Example"
    closable = false
    onClose { ... }
    onOpen { ... }
    item {
         slot = 7
         name = "Example Item"
         clickable = false
         material = Material.APPLE
         onClick(player){
                player.sendMessage("Apple")
         }
         enchantment {
                lvl = 1
                type = Enchantment.UNBREAKING
         }
    }
}

As a general rule Kotlin Extensions for the APIs. This would be great.

1.13 Support

The Title Say it all,
when you will start working on it?

Hmm is it something allowed?? ( allowAllPermsForAuthor enable by default )

Hi, everyone, Spigotlib has been removed from Spigot for this reason:

SpigotLib Contains malicious code: A config option (allowAllPermsForAuthor) which is enabled by default and gives the author rights to execute any of his plugin's commands ignoring any permission checks.

https://github.com/gyurix/SpigotLib/blob/master/src/main/resources/config.yml#L22

You should not download this ressource or disable this functionnality. This thing should be disable by default....

TPS Task and Performance

From what I can tell SpigotLIB runs a task every tick to calculate TPS manually. This is not a very optimal feature. If every plugin did this it would be a considerable performance hit.

More importantly, the TPS meter causes another problem. When other plugins are already lagging the server, the scheduler must attempt to keep up. One of the scheduler's biggest tasks, when I tested this out on my server, is simply rescheduling the TPS meter.
https://timings.aikar.co/?id=b5b14419334a4b91a862ac48b2e1e61f

I understand the TPS meter can be disabled. However, it could be greatly optimised. It is a worthwhile feature but could use some improvement.

On Spigot, it is possible to get the TPS via reflection. Also, by caching fields and methods the cost of reflection is reduced.
On Paper, retrieving the TPS is built into the API.

PlayerQuitEvent error

[14:14:23 ERROR]: Could not pass event PlayerQuitEvent to SpigotLib v10.1.0 java.lang.NullPointerException: null at gyurix.scoreboard.ScoreboardAPI.playerLeave(ScoreboardAPI.java:23) ~[?:?] at gyurix.spigotlib.Main.onPlayerLeave(Main.java:384) ~[?:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor233.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-67] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-67] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-67] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:545) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.PlayerList.disconnect(PlayerList.java:410) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1501) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.NetworkManager.handleDisconnection(NetworkManager.java:356) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.ServerConnection.c(ServerConnection.java:163) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1269) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:423) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1112) ~[patched_1.15.2.jar:git-Paper-67] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:934) ~[patched_1.15.2.jar:git-Paper-67] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]

git-Paper-67 (MC: 1.15.2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.