ToggleBlock
Introduction
A simple plugin that allows players to register blocks and then toggle on and off (all blocks to air). Useful for dams, bridges, traps, secret areas, controlling redstone via commands and much more.
Features
- Multi-world support
- Block data support (wool colours, wood types, container positions etc)
- All regions are saved and accessible after a reload
- Regions are easily backed up
- Supports tbon and tboff commands from the console and players
- Can be used to activate redstone via a command (redstone torch in a region)
- Useful for draw-bridges, moats, traps, secret areas and more
- All regions are global and can be accessed by anyone
- Redstone activation (region on only when powered)
- Redstone can be inverted (region off when powered)
- Use /tb to list all regions
- Can be used to wirelessly activate redstone
Upcoming Features
- Fix dupe issue by protecting blocks in a ToggleBlock region
- Take user requests (comment below)
- Will be available in Polish for the 1.4 update
Current Bugs/Issues
- See above concerning duplication issue
Commands
Possible commands:
- /tb [name] - Starts/stops edit mode for a specific region of blocks
- /tbon [name] - Resets all blocks in the specific region to their original state
- /tboff [name] - Turns all blocks in the region to air.
- /tbr [name] - Links a sign (look at it) with a region to support redstone
- /tbrd - Remove linked sign that you're looking at
Source Code
This may be helpful for those wishing to learn Java or for the approval process. See http://dev.bukkit.org/server-mods/toggle-blocks/pages/code/
@_InnoKo_
Fantastic, you're awesome :D
I've added you as a maintainer (you should be able to upload files etc, not too sure of the differences between them), be fantastic if you could upload it for me.
@lol768
I found the problem. The redstoneInfo class didn't implement Serializable, so it couldn't be saved to the file. I tested it with the fix and it works perfectly fine now. I also added some other code cleanups and checks Add me as an author and I'll upload the fix.
I've also fixed another potential problem. The files are stored in the server's root directory, not in the plugin's data folder. I changed the saving/loading location to the data folder and also made it check if there's old files that haven't been moved, and it'll move them to the data folder. No data will be lost.
@lol768
Of course i'm ok with that ;)
I'll look at it now.
@_InnoKo_
You ok with me adding you as an author?
Source: http://199.241.30.86/Downloads/toggleBlock.zip
Probably a permissions issue, as ideally ToggleBlock should write its data into its own data folder
@lol768
No, its not saving properly. Now that i looked more closely, I do get that error. 14:29:40 [SEVERE] Couldn't save toggleBlock redstone data :-(
Do you know whats causing this? Can i see the source code for the latest version? I could probably find the problem.
@_InnoKo_
From what I can see, there is no reason why the loading should fail. Does it save properly? Do you get a Couldn't save toggleBlock redstone data :-( error?
@lol768
I could help you out with that! I'll PM you some code later for file conversions.
But for now, have you figured out the cause of the triggers not saving? I really need that fixed ASAP for my server.
@_InnoKo_
Something which I could never actually get to work.
@lol768
You don't have to destroy all old data. There's ways around that. You just have to make it check if the file is in the old format, and if it is, convert everything and put it in the new format.
Same problem as below. After restarting the server, all the triggers are lost.
trigger info doesn't save in plugins/toggleblocks/config.yml
[INFO] [toggleBlocks] Enabling toggleBlocks v0.5
[SEVERE] Couldn't load redstone info
[INFO] Attempting a conversion...
[SEVERE] Conversion failed! Might be corrupt or non-existant
i know your going to say something about java but we both have the same java and everything needed for it but his works and mine doesn't so please reply because i really need this plugin to work
i have java 7 and my friend has this plugin on his server and he has the same thing i dont know what the prob is with the plugin
@chrisvl2010
I already answered this below, but I'll do it again:
"Java 7 is required.
To be honest, I'd like to completely rewrite this plugin, which would unfortunately destroy all old data."
It would help so much if you replied soon because im trying to make an animated billboard
ok i dont know what the problem is this is the first time i saw anything by toggleblocks in my log
19:44:34 [SEVERE] Could not load 'plugins/ToggleBlock.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/lol768/toggleBlocks/main : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:154) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:227) at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:205) at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:51) at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11) at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:111) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:398) at net.minecraft.server.ThreadServerApplication.run(SourceFile:856) Caused by: java.lang.UnsupportedClassVersionError: me/lol768/toggleBlocks/main : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:44) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:143) ... 9 more
@willkiller1234
Java 7 is required.
To be honest, I'd like to completely rewrite this plugin, which would unfortunately destroy all old data.
[INFO] [toggleBlocks] Enabling toggleBlocks v0.5 [SEVERE] Couldn't load redstone info [INFO] Attempting a conversion... [SEVERE] Conversion failed! Might be corrupt or non-existant
I couldn't recognize trigger blocks after server had restart
It still won't recognize the file as a plugin. Am i running the wrong java or something? I'm running it on a hoster.
@willkiller1234
had that same problem and just restarted server and the error went away.
Thanks lol768 for the link :)