SuperSimpleSpawners
This is a very simple plugin.
- It enables you to use spawn eggs to place spawners of the same type.
- It enables spawners to drop spawn eggs of the same type when broken.
Permissions:
Spawners drop eggs (permission: sss.drop.*)
Eggs place spawners (permission: sss.place.*)
Both (permission: sss.*)
Specific drop (permission: sss.drop.entity_type)
Specific place (permission: sss.place.entity_type)
The names for entity_type must be the LOWERCASE form of how they appear here: http://jd.bukkit.org/apidocs/org/bukkit/entity/EntityType.html
Require Silk Touch enchant: (permission: sss.silk_touch)
WITHOUT THESE PERMISSIONS IT WILL BEHAVE NORMALLY EVEN IF YOU'RE OP OR HAVE '*'
If you don't have a SuperPerms manager click below because you need one unless you know you don't.
http://dev.bukkit.org/server-mods/bpermissions/
Get the latest on jenkins:
http://ci.onarandombox.com/job/SuperSimpleSpawners/
Github: https://github.com/dumptruckman/SuperSimpleSpawners
Hello, I love this plugin! But if a player has like 4 SpawnEggs in a stack, and he tries to place it, all 4 will disappear instead of 1. (Spawner will still be placed).
@ZeekDaGeek
player.updateInventory() would most commonly be used for armour but its actually used for a lot of inventory changes as due to an implementation bug, minecraft doesnt treat changes properly until their inventory has either been updated by a click from the player, or from updateInventory()
Edit: As to your second point, Its not actually possible for that to happen as when the player changes ItemInHand it calls an ItemInHandEvent which is scheduled to run after the Interact Handler has finished running.
-Nicka101
@chickenputty
Eh, use b7, that's the ONLY thing I added in b10.
@dumptruckman
I am using PermissionEx the only group that has * is admins, ill try to get rid of the *'s on the sss permissions
All this did was not allow people to place and mine spawners
I cant get them to drop at all for regular members, it works for me only with silktouch.
It was working until i just updated
@chickenputty
I tried this setup with this permissions.yml(that's built in bukkit super perms). It works. The only reason this plugin would possibly require silk touch is if you have access to the "sss.silk_touch" permisison. It's permission default is "false"
The best I can say is that you have another plugin conflicting that is causing this or you have an issue with your permission setup (perhaps PermissionsBukkit is bugged?)
Edit: I don't think PermissionBukkit has a * node does it? If it does, having that would likely cause you to automatically have sss.silk_touch
@dumptruckman
All i have for sss in permissions is, Line 38: - sss.place.* Line 152: - sss.drop.* And still donators (and myself) cannot break spawners without silktouch
@chickenputty
You should only have to have silk touch if you also gave them sss.silk_touch. Make sure they do not have that permission. (It is NOT included with sss.*)
Do you have to have silktouch now? Because i gave my donators sss.drop.* and sss.place.* but they can only get the spawner with silktouch
@ZeekDaGeek
The only reason I added player.updateInventory() is because it wasn't working properly without it on occasion. (The egg would either not lose amount or disappear (when only 1)).
As for the second part, is that even possible? Also, did you see the most recent code?
@nicka1011
Simply because I didn't know it existed. I don't really know Java or Bukkit as of a week ago, just coding out of necessity and working off of what was in the code itself. The way things were calculated were based off of checking the block face so that's what I did when I made my changes.
Also from what I've read player.updateinventory(); is only needed when you're updating a player's armor. I've removed it from the code as a result. I've changed the itemInHand to event based to prevent the possibility that someone places a spawner and switches so quickly that they can dupe the eggs.
http://pastebin.com/jibXdrjF
@ZeekDaGeek
Just Wondering Zeek, But Why in the updated playerInteract Function are you using player.getTargetBlock when the interact function itself will tell you the clicked block and block face with event.getClickedBlock() and event.getBlockFace(). and also that means that you can simply call event.getClickedBlock().getRelative(event.getBlockFace()). Just Thought that might help for the future or if you or dumptruckman wants to make that segment smaller
@Chatez
Ocelot and Snow Golem spawners work from what I can tell Chatez. A few versions back they were not able to be spawned though. Try using the newest version, or ensure that you're giving sss.place.* and sss.drop.*
Also <3 ;D
Could you possibly add in other spawner's compatibility? Such as Ocelot, Snow Golem, Etc?
@dumptruckman
Well If You Just Want to find out whethere they are attempting to place inside their own head like Zeek Said then you could simply check if the player location is inside the block they're trying to place in.. then call the BlockCanBuildEvent to be kind to other plugins and allow them to change whether they can build there...not that theres any reason for them to want to put a spawner inside their own head. -Nicka101
@DJ411
OH, sure, why not.
@dumptruckman
Like can you add some sort of setting so users have to use Silk Touch or not. So if there was a settings file it would be true or false.
@ZeekDaGeek
Thanks for pointing out these things. Next time, please use www.pastebin.com or something. It's a pain to read them on dev.bukkit.org.
Not sure how to combat placing inside of entities however, placing inside your head seems to work just fine.. It just pushes me out of the blocks.
@nicka1011
How exactly do you "call a canBuild event" where it would actually do what you're suggesting? In b5+ it DOES call a BlockPlaceEvent exactly for compatibility reasons.
@ZeekDaGeek
Call A canBuild Event for the Block ur trying to change. Also (on a side note to dumptruckman) this plugin should call a BlockPlaceEvent so that plugins that protect areas can prevent the spawner from being put down there
There's only one problem I couldn't figure out; you can place blocks onto your own head. No idea how to figure out if an entity (player, monster) is in the block you're attempting to place the spawner.
Alright, I've updated the playerInteract function again, this will allow you to place spawners on the sides of blocks as well as the bottom of the block. I've also made it so it'll check that you're placing the block within air, water or lava that way you cannot create infinite pig spawners. I've also commented all of the portions. Here's the updated function: