promotional bannermobile promotional banner

Freeze API

A Bukkit API that helps avoid the conflicting anti-movement protocols of different plugins.
<p>This is the project logo.</p>

This is the project logo.

<p>This is the project icon.</p>

This is the project icon.

Description

Have you ever had one of the folowing problems when trying to make your minigame plugin compatible with others:

  • Players were still somehow "frozen" from the last game from another plugin, and you don't know how to get that plugin to release them?
  • Players could still move when you "froze" them for a starting line-up?

If so, you need to use this API for your plugin. It is designed to help avoid these conflicts. It adds three events:

  • PlayerFrozenEvent: Thrown when a player is, for any reason, frozen.
  • PlayerUnfrozenEvent: Thrown when a player is, for any reason, unfrozen.
  • PlayerMoveWhileFrozen: Thrown when a player attempts to move while frozen, as requested by Geoneo97.

It has one big array to store all frozen players in. This helps avoid plugin "Freezing" conflicts. To add a player to the array, simply

  1. Add the API jar to your build path, much like you had to for the Bukkit API;
  2. Import Freeze.Freeze;
  3. Add the following to your code (where p is the player you are trying to freeze) :
Freeze.freezePlayer(p);

It's that simple! To unfreeze a player, use

Freeze.unfreezePlayer(p);

You can now check to see if a player is frozen! Simply call

PlayerIsFrozen.isPlayerFrozen(Player p);

If your plugin uses Freeze API, PM me and I will add you to the list. Plugins that use Freeze API:

  • None ATM, it was just released :P.

Source: Feel free to submit pull requests and such.

GitHub Link


Donations:

I do not accept donations at this time. Please support me by reporting problems and other suggestions to the ticket tracker.


Milestones:

  • 1 Download
  • 5 Downloads
  • 10 Downloads
  • 25 Downloads
  • 30 Downloads
  • 50 Downloads
  • 100 Downloads
  • 500 Downloads

The Freeze API Team

profile avatar
Owner
  • 8
    Projects
  • 18.9K
    Downloads
Donate

More from 20zinnmView all

  • RottenFood project image

    RottenFood

    • 1.6K
    • Bukkit Plugins

    Let that food rot in chests!

    • 1.6K
    • January 19, 2016
    • Bukkit Plugins
    • +4
  • BuildAPrefix project image

    BuildAPrefix

    • 9.8K
    • Bukkit Plugins

    A self-service prefix plugin!

    • 9.8K
    • January 19, 2016
    • Bukkit Plugins
    • +1
  • PerWorldJoinLeave project image

    PerWorldJoinLeave

    • 1.0K
    • Bukkit Plugins

    Custom join/leave messages per world.

    • 1.0K
    • December 1, 2015
    • Bukkit Plugins
    • +4
  • FireChat project image

    FireChat

    • 686
    • Bukkit Plugins

    A live chat log, using Firebase.

    • 686
    • November 28, 2015
    • Bukkit Plugins
    • +3
  • RottenFood project image

    RottenFood

    • 1.6K
    • Bukkit Plugins

    Let that food rot in chests!

    • 1.6K
    • January 19, 2016
    • Bukkit Plugins
    • +4
  • BuildAPrefix project image

    BuildAPrefix

    • 9.8K
    • Bukkit Plugins

    A self-service prefix plugin!

    • 9.8K
    • January 19, 2016
    • Bukkit Plugins
    • +1
  • PerWorldJoinLeave project image

    PerWorldJoinLeave

    • 1.0K
    • Bukkit Plugins

    Custom join/leave messages per world.

    • 1.0K
    • December 1, 2015
    • Bukkit Plugins
    • +4
  • FireChat project image

    FireChat

    • 686
    • Bukkit Plugins

    A live chat log, using Firebase.

    • 686
    • November 28, 2015
    • Bukkit Plugins
    • +3