[2LS] HamsterAPI 0.2.2

Simple and easy to use API to read and write Packets.

  1. Sammwy
    Native Minecraft Version:
    Legacy (< 1.13)
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Contributors:
    LinsaFTW
    [​IMG]

    What is HamsterAPI?
    HamsterAPI is a small library for listening to incoming and outgoing packets, reading, modifying and canceling them.

    It also allows you to easily send packages to users without the need to use Reflection or NMS in your plugin.


    What can i do with HamsterAPI?
    - Send Title, Subtitle, ActionBar, and Packets to players.
    - Listen incoming and outgoing packets with events based on priority and cancellation.
    - Disconnect players safely/instantly.
    - Communicate with BungeeCord. (Kick, switch server, send message channel, etc)


    In the future, HamsterAPI will also have:
    1. BossBar API
    2. Client <-> server communication with custom channels (For modded clients)
    3. Bungeecord Listener


    How to use HamsterAPI?
    The first step is to get the HamsterAPI instance to access most of the methods of the API with the static method HamsterAPI.getInstance().

    From the HamsterAPI instance you can access the following methods:
    getBufferIO() - Util to split/decompress/decode bytebufs into packets.
    getBungeeMessenger() - Util to ease CustomPayload communication with BungeeCord.
    getReflection() - Optimized util to get NMS and CraftBukkit classes without losing compatibility.
    getPacketInjector() - Util to inject/remove HamsterAPI from the pipeline of a player.

    You can listen to the following events:
    PacketDecodeEvent
    PacketReceiveEvent
    PacketSendEvent


    Decode is ran after splitter & decompress on the pipeline and lets you access to a bytebuf object. You can decode it with BufferIO to get a PacketWrapper object. (Perfect for exploit fixing and security stuff)

    Receive/Send is ran after decode on the pipeline and lets you access to a PacketWrapper object. (Perfect for cosmetic/common stuff)

    To know how to listen to Events please read the following guide: https://www.spigotmc.org/wiki/using-the-event-api/

    Code (Java):

    HamsterAPI.getInstance().getHamsterPlayerManager().get(player).sendTitle(String title, String subtitle, int fadeInTime, int showTime, int fadeOutTime);
     
    Code (Java):

    HamsterAPI.getInstance().getHamsterPlayerManager().get(player)
    .sendActionbar(String message);
     
    Code (Java):

    HamsterAPI.getInstance().getHamsterPlayerManager().get(player).disconnect(String reason);
     
    Code (Java):

    HamsterAPI.getInstance().getHamsterPlayerManager().get(player).closeChannel();
     
    Code (Java):

    HamsterAPI.getInstance().getHamsterPlayerManager().get(player).sendServer(String serverName);
     

    [Developers] Don't forget to place HamsterAPI as a dependency in your "plugin.yml" file

Recent Reviews

  1. yearapu
    yearapu
    5/5,
    Version: 0.2.0
    this plugin cause my server lag I like this plugin but now this plugin is a exploit .
    1. Sammwy
      Author's Response
  2. AkosVR
    AkosVR
    4/5,
    Version: 0.1.8
    Great, but where is the 1.17.1 support? I hope you won't abandon this awsome project.
  3. Thundurh
    Thundurh
    5/5,
    Version: 0.1.6
    Love this plugin. Prevents many exploits, and DDOSers from infiltrating your server! Super good.
  4. brs73
    brs73
    5/5,
    Version: 0.1.6
    Same than OldPast.

    Linsa makes good plugins for free :)
    %-%-%-%-%-%-%-%-%-%-%-%-%
  5. OldPast
    OldPast
    5/5,
    Version: 0.1.6
    Seis tem que parar de ser idiota, e mostrar o erro no privado do desenvolvedor no Discord, pra ele poder arrumar, deste jeito, vocês baixam a moral do cara, ele sempre me trato com muita educação, e, não ficar com essa putaria de dar estrela baixa por meros erros, vocês sabem o que é passar dias trabalhando pra fazer algo de graça, e... Ser recebido desta forma? O trabalho do cara é incrível, ele tem uma network bem famosa, eu no lugar dele, nunca jamais liberaria sistemas de proteção tão impecáveis bem como o dele, ta na hora de crescer, não acha? Vocês estão criando um servidor, um servidor que provavelmente pessoas confiarão seu tempo para jogar, então... Cresçam, por favor!!
  6. Sentello
    Sentello
    2/5,
    Version: 0.1.6
    [HamsterAPI] Failed to setup "for everyone players"
    Reason: Tried to access field from a null object
  7. EzXabi
    EzXabi
    1/5,
    Version: 0.1.5
    [22:53:43 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException

    this happends on first join
  8. Juak24
    Juak24
    3/5,
    Version: 0.1.5
    cause inventory bugs in creative mode
    .
  9. extremall
    extremall
    3/5,
    Version: 0.1.5
    [22:53:42 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException
    [22:53:43 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException
    [22:53:44 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException
    [22:53:45 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException
    [22:53:46 INFO]: [HamsterAPI] Retrying injection to player Inappropriates! Reason: java.lang.IllegalAccessException
  10. Boxwel
    Boxwel
    5/5,
    Version: 0.1.5
    Funciona perfecto, ¡gracias por tu aporte!
    _____________________________________