OceManaBar
Last Dev Build
here is the last development build that contains ALL changes written here
03/05/2012
Hi, filled by requestes, i've found some time to understand how new bukkit event system works, and i've rewritten my plugin to have it work. I've tested on my server and seems fine, no errors, but let me know. As i told many times, i'm not a java expert and i just copied something from other plugins code, mainly MobHealth. Thanks to his author, so.
Note: you need to delete old config and put the included new one. Due to a bug that i'm trying to fix, the autogenerated configuration file is missing from everything except header with instructions -_- Also, i've added a link to my github page with the source code. If you like this plugin and you think it helps your server, please consider a small donation ;)
11/01/2012
MagicSpells has a new version, with listerner bug fixed, so please download it before using this plugin!
08/01/2012
Updated again, work as I wanted (with listener) but listener of magicspells is incomplete. wait for a new version of magicspells, then this will work as intended. For now it wont refill bar when mana is regenerated. Link is same as always: last working version (or just wait for approval on bukkitdev)
source code is now released inside .jar file new todo things added
Donations
Want to offer me a beer? Here you go!:P
Configuration
Configure this plugin is easy and intuitive, but if you want you can check this page
Permissions
- ocemanabar.show
- Set manabar visible or not
- ocemanabar.user
- Allow players to change size and position of the bar
- ocemanabar.admin
- Allow players to reload plugin
Commands
Every command can begin with /manabar or /ocemanabar, both are identical
- /manabar reload
- reload configuration from file
- /manabar on
- shows manabar for single player (not globally)
- /manabar off
- hides manabar for single player (not globally)
- /manabar position [X] [Y]
- for players with "user" permission, change the position of the bar according to the two numbers X and Y
- /manabar position reset
- for players with "user" permission, reset bar position to default (from config file)
- /manabar size [X] [Y]
- for players with "user" permission, change the width and the height of the bar according to the two numbers X and Y
- /manabar size reset
- for players with "user" permission, reset bar width and height to default (from config file)
Changelog
See this page.
Planned
permission to show manabar or notdone in v0.3configurable X and Y from the screendone in v0.2configurable height - widthdone in v0.2configurable sizedone in v0.2- use values from magicspell config
- configurable colors for full/empty ascii bar
configurable colors for gradient bardone in v2.5change the bar type to color-filled instead of text (it's a bit advanced I think, but I'll try)done in v0.4optional [current value / total value] near mana bar (now is always displayed)done in v0.2configurable X and Y from the screendone in v0.2fix widget flicks/disappeardone in v0.5use magicspell events to update mana value instead of player move. This will use A LOT of less CPU.done in v0.6- add a label to write which spell is currently selected
- attach 2 keys to scroll through spells (like current right click and shift-right click)
commands to set bar position per-player instead of globally from config. config values will be just the default position.done in v2.5
Source
https://github.com/oceanor/OceManaBar
Screenshot
I'm very interested in suggestions, so if you have some, just open a ticket!
cant seem to change the position of the mana bar
@hofikaa
too strange.. the part of the code causing error is "else if (args.length > 0 && args[0].toLowerCase().equals("size") || args[0].toLowerCase().equals("position") || args[0].toLowerCase().equals("off") || args[0].toLowerCase().equals("on"))"
that is correctly checked and cant give errors, maybe you have some plugin with same command, or some sort of string replacer? try it without any other plugins.. or try with /ocemanabar instead of /manabar
@oceanor
the same. an internal error occured while attempting to perform this command. :S :(
@hofikaa
try /manabar size 40 40
or
/manabar position 50 50
and tell me :)
@oceanor
no matter which one i use, commands doesnt working for me :(
please can you post this in the forums on spout.org where it should be before even here!
need to be keeping spout projects in one place.
nice plugins ftw.
@shankomaster
these errors are definitly gone with version 2.8, get it here or wait for approval :)
@hofikaa
hi, what is the command that get you error? i'm using "/manabar" with listed parameters and no errors at all..
Hy,
if i want to use that plugin whhit /manabar or st else ivgot this error in server log:
20:21:46 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'mana bar' in plugin OceManaBar v2.7 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:16 6) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:4 79) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler. java:821) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java :103) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java :169) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:7 8) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at me.oceanor.OceManaBar.OceCommandHandler.onCommand(OceCommandHandler.j ava:138) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 14 more
any idea? whats the problem?
i use the newest manabar, magicspells and spout
@shankomaster
it should be fixed in rev 2.7, you can wait for approvation (it's under approvation since 10 hours ago) or get it from here.. ;)
I was using the latest Dev Spout and latest Dev magicspells
@shankomaster
hi and thanks for the reply :) are you using last version of spout and magicspells?
got many errors
http://pastebin.com/zgW9KeEw
glad to see this is back
@Flenix1
i've done a new version, remember to delete old config and try with this :) is waiting for approval, but you can take it here
@oceanor
The error still occurs if only spout users are online, could it be if the server isn't forcing spout?
Also just to test my knowledge :P To fix that, you'd add an if statement to see if the user is on Spoutcraft, right? Still trying to work out Java and learning a fair bit from this and mmoInfo. I've actually made 8 working addons for mmoInfo in the past 2 days :P Now working on the health and EXP bar derived from this... which is proving a little harder
@daeger
uhm, i think you are using a server with both spout and non spout users..
you can ignore that error, for now, it just say "this player does not have spout, i cant change his bar", nothing else.
I'll fix this on next version, coming in these days :)
OceManaBar throws tons of errors on my server.
23:55:50 [SEVERE] Could not pass event ManaChangeEvent to OceManaBar
java.lang.NullPointerException
at me.oceanor.OceManaBar.OceListener.onManaChange(OceListener.java:26)
at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:461)
at com.nisovin.magicspells.ManaBar.callManaChangeEvent(ManaBar.java:112)
at com.nisovin.magicspells.ManaBar.add(ManaBar.java:42)
at com.nisovin.magicspells.ManaBarManager$ManaBarRegenerator.run(ManaBarManager.java:144)
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:588)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:506)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Imagine this roughly 10 times every minute.
jigga_jones: Not possible.
you should pretty please make this work with craftbukkit :D !!! you would be awesome the api will not connect :( makes me a sad panda
@Flenix1
sure! your suggestion is good, i'll do it when possible..
for the healtbar plugin: source code is public, you can do everything you want, i hope it will help someone like the code of @SableDnah helped me :P by the way, i'm planning to add an healthbar that gets value from various plugin and place it up the mana bar, i'm just deciding if add that feature to this plugin or start another project using most of this code.. if you want, just wait for it :D