lenis0012/LoginSecurity-2 — pull request #4 by Gibstick (2013-07-07 14:22:32+00:00)
Title: God mode, logout, and other small improvemnts

God mode (true god mode), the oft-requested feature on my server, has been implemented using creative mode for players who are not logged in. I decided to use creative mode since it is easier than blocking all the necessary events. As a result, the event handlers relating to damage and hunger are no longer necessary and have been removed. Players are unable exploit creative mode to obtain free items and blocks, since the relevant events are already being cancelled.

As well, two new methods were implemented: debilitatePlayer and rehabPlayer (perhaps these names aren't the best). The former should be called whenever a player needs to be "locked down", eg. all instances where the player is not logged in, or logging out. The latter should is called when the player logs in successfully. With these, redundant calls to removePotionEffect were taken out of the code.

The logout command was changed so that the player's session is ended, and debilitatePlayer is called. Otherwise, the logout command is pointless with sessions enabled. (I apologize for not putting these in the commit messages.)

Complete blindness was accomplished by adding a night vision potion on top of the blindness potion. For some reason, this causes the screen to go pitch black.

Finally, the lac rmpass command no longer needs lower-case usernames.