[INACTIVE][FIX/MISC] creaturebox v 0.7.3 - Wolves and Monsters and Critters, Oh My! [684]

Discussion in 'Inactive/Unsupported Plugins' started by Lodran, Mar 2, 2011.

  1. Offline

    Lodran

    creaturebox
    Make creature spawners tradable
    Now with Wolves, Monsters, Slimes and Giants!

    Download version 0.7.3 for CraftBukkit 602, 617, 670, 684
    Downloads for old (unsupported) versions (open)

    • Have you ever thought "I'd love to be able to dig this dungeon out, and move it somewhere more useful."?
    • Have you ever thought "I'd really like to be able to /give myself a spawner, and make it produce something other than pigs."?
    • Have you ever thought "I'd really like to be able to turn this spawner on and off with a switch?"
    If you answered "yes" to any of these, then creaturebox is the plugin for you.


    creaturebox fixes several issues with creature spawners, so that they can be altered, and traded between players.

    Features:
    • When a creature spawner is broken, it is dropped as an item.
    • When a creature spawner is placed, it retains its original creature type.
    • The creature type which is created by a creature spawner can be changed using the /creaturebox set command. To alter a mob spawner, look directly at it (through glass is fine), then type /creaturebox set {creaturename}, where {creaturename} is the name of a creature. Valid creature names are: pig, chicken, cow, sheep, squid, creeper, ghast, pig_zombie, skeleton, spider, zombie, slime, monster, giant and wolf.
    • The frequency at which a creature spawner generates creatures can be changed using the /creaturebox period {period} command, where {period} is the number of seconds between spawns. A period of -1 gives a random period between 10 and 20 seconds. A period of zero puts the creature spawner into "pulsed redstone" mode, where creatures are generated only when the redstone power of the spawner switches from high to low.
    • The number of creatures generated at a time can be changed using the /creaturebox count {count} command, where {count} is the number of creatures to generate. A count of -1 generates a random number of creatures (from 1 to 4), while a count of 0 disables the spawner.
    • The maximum number of live mobs that a spawner will maintain can be changed using the /creaturebox limit {limit} command, where {limit} is the desired maximum. A limit of -1 sets the default, which is 10 for a managed spawner, and unknown for a natural spawner.
    • The requirements for spawning a creature can be adjusted using the /creaturebox requires {requirements} command, where {requirements} is a space separated list any number of:
      • player - require a player to be within 20 blocks of the spawner.
      • surface - require grass for critters.
      • light - require light for critters, dark for monsters.
    • A creature spawner's settings can be displayed using the /creaturebox info command.
    • A creature spawner can be given to a player using the /creaturebox give {player} {creaturename} {count} command.
    • Supports the Permissions API. If Permissions (or GroupManager/FakePermissions) is not available, uses the player's Op status to determine its behavior.
    • A creature spawner can be turned off by powering it with redstone. Note: this will not affect the spawning of invincible "Ghost pigs".
    Permissions:
    • creaturebox.set - Allows use of the /creaturebox set command.
    • creaturebox.give - Allows use of the /creaturebox give command.
    • creaturebox.creature.{creaturename} - Allows the player to set or give {creaturename} spawners, where {creaturename} is a valid creature name (pig, cow, etc...).
    • creaturebox.period - Allows use of the /creaturebox period command.
    • creaturebox.count - Allows use of the /creaturebox count command.
    • creaturebox.limit - Allows use of the /creaturebox limit command.
    • creaturebox.requires - Allows use of the /creaturebox requires command.
    • creaturebox.dropspawner - When a creature spawner is broken, it is dropped as an item.
    • creaturebox.placespawner - When a creature spawner is placed, it retains its original creature type.
    Configuration:
    • creaturebox now creates a config.yml file in .../Plugins/creaturebox.
    • debugPriority: {integer range 0-3, default 2} - Sets the "noise level" for debugging messages - lower numbers = less noise. In general, you can ignore this because you have to set yourself as a debugger to see debugging messages.
    • messagePriority: {integer range 0-3, default 3 } - Sets the "noise level" for messages which are displayed when a player types a command.
    • enableRedstone: {boolean, default true} - Enables or disables redstone control of creature spawners.
    • operatorPermissions: {boolean, default true} - Enables separate operator permissions. If set to false, players are given the same permissions as operators. This setting will do nothing if a permissions plugin is installed.
    Notes:
    • creaturebox runs spawners in two different modes. "Natural" mode, where the spawner is run entirely by minecraft (and thus won't stop working, or change behavior when the map is loaded on a vanilla server), and "Managed" mode, where the spawner is run entirely by creaturebox. A spawner is switched to managed mode if any of its settings are changed from default. Squid, Slime, Monster and Giant spawners are always run in managed mode.
    • It is now possible to defeat the invincible "Ghost Pigs". Change the grass in a 9x9 area under the spawner to something else (green wool would work nicely) which would stop pigs from spawning entirely. Then, look at the spawner, and type /creaturebox requires player light to allow the pigs to spawn on the wool.
    Credits:
    Latest Revisions:

    Version 0.7.3
    • Added creaturebox.period, creaturebox.count, creaturebox.limit and creaturebox.requires permissions.
    • The source code for creaturebox is now included within the .jar.
    Revision History (open)
    Version 0.7.2
    • Managed spawner settings for multiple worlds (spawners.yml) are now loaded correctly.
    • A new configuration setting (operatorPermissions:) has been added to config.yml.
    Version 0.7.1
    • spawners.yml is now written whenever a spawner is modified.
    • Added exception handling to the code that reads spawners.yml.
    • Spawners are now removed from the managed spawners list when their block is broken (or otherwise changed).
    • Added (experimental) code to stop spawners from being run if their chunk is unloaded. This code needs more testing, as it appears that checking to see if a chunk is unloaded may be causing it to load.
    Version 0.7.0
    • Enabled all of my "experimental" features.
    • The frequency at which mobs are generated can be changed (see /creaturebox period).
    • Spawners can now be "pulsed" with redstone, to generate 1 or more mobs each time a button is pressed (see /creaturebox period).
    • The number of mobs generated each time can be changed (see /creaturebox count).
    • The total number of mobs that a spawner will create at a time can be changed (see /creaturebox limit).
    • Some of the requirements for spawning a mob can be relaxed (see /creaturebox requires).
    Version 0.6.3
    • Fixed default permissions for wolf spawners.
    • Fixed spawning for squid spawners.
    Version 0.6.2
    • Worked around a bug in bukkit which was causing all spawners to be placed as pig spawners.
    • Added support for wolf spawners.
    • Enabled experimental code which improves the spawning requirements for sqiud spawners (Note: to activate this code you have to use the /creaturebox set squid command on the spawner. Existing spawners and those placed from inventory still use the old code).
    Version 0.6.1
    • Updated to support CraftBukkit build 602. Note: creaturebox is not compatible with CraftBukkit build 600.
    Version 0.6.0
    • Rewrote the plugin from scratch, to make way for new features.
    • Replaced right-click selection of mob spawners with "where I'm looking" selection.
    • Added /creaturebox info command, which tells the player a creature spawner's settings.
    Version 0.5.1
    • Added /creaturebox access command, which tells the player what access they have.
    • Updated to support craftbukkit 522/bukkit 450
    • Removed the Slime creature type - slime spawners don't work as is.
    Version 0.5
    • Added the ability to turn spawners on and off with redstone.
    Version 0.4
    • Altered creaturebox.attachPermissions in an attempt to gain compatibility with Permissions version 2.1.
    Version 0.3
    • pig_zombie spawners now break correctly.
    Version 0.2
    • Changed /creaturebox {creaturename} command to /creaturebox set {creaturename}.
    • Changed creaturebox.changespawner permission to creaturebox.set.
    • Added /creaturebox give {player} {creaturename} {count} command.
    • Added per-creature permissions.
    Version 0.1
    • First Release
    To Do:
    • Adjust event priorities (Destroying a spawner in a protected area copies the spawner).
    • Looking for suggestions
    Features I'm considering:
    • Mobs riding mobs.
    • Per-server or per-world spawn limits.
    • Angry Wolves.
    • Rainbow sheep.
    Things I can't do anything about:
    • As of MineCraft 1.4, Spawners don't show damage when they're in your inventory. Sorry, Notch "Fixed" this.
    • As of MineCraft 1.4, if you pick up a pig spawner, and follow it up by picking up a wolf spawner, you'll end up with two pig spawners. This is caused by the above "damage" fix, and until bukkit adds inventory hooks, nothing can be done about it.
     
    cybercrash and PedoHascookies like this.
  2. Offline

    Derphiria

    i got 1 suggestion, maybe you could make it so admins/mods can use super pickaxe on it so it drops, it seems like it doesnt drop when i use super pickaxe on it it just disappears.

    Derphiria.
     
  3. Offline

    Taxen0

    Hello, im running craftbukkit 602 and the latest creaturebox.
    When I try to place a previously changed zombiespawner, (it's damaged so the conversion should have worked. also it said it changed successfully in chat)
    it say that i place a pig-spawner. and it spawns pigs. if I destroy it, I get a pig-spawner in my inventory (full"hp").
     
  4. Offline

    Lodran

    Unfortunately, the way that super-pickaxe breaks blocks keeps me from seeing that the block was broken, so I don't have the opportunity to make it drop a spawner.
    I'll have to look into it, but with today's update, I expect things to be a bit chaotic for awhile.

    It looks like a (rather unneccessary, imo) change to bukkit has broken the method that I used to keep track of the mob spawner's type.

    I hate to say it, but unless bukkit's devs see fit to reverse that change, I don't see a future for creaturebox.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  5. Offline

    Azelphur

    Like the guy said in your thread, the change was probably caused by the 1.4 update rather than a change in bukkit. I don't know if this is possible as I havn't done any work with bukkit yet, but if it's possible for you to know which inventory slot an item is in, you could simply keep track of the spawner in the inventory and it's type with sqlite, This should work and you could fix the stacking to clone spawners bug too :)
     
  6. Offline

    CorneliousJD

    Yeah it seems like we just need to help Lodran come up with an idea to keep the type somewhere other than in durability metadata. an SQLite file would be nice, but I'm not sure if he would be able to accurately keep track of that, what if a player has 5 spawn cubes littered all over the place and starts moving them? I guess the only way to do this is to track which inventory/chest slot it is in and make them not stackable at all?
     
  7. Offline

    Azelphur

    I believe stacking is client side, but if you can track which inventory/chest slot it is in I see no reason you can't track what spawners are in a stack, too. Just an idea as I say it's up to Lodran to decide if it's a good one (or even implement it at all)
     
  8. Offline

    Celtic Minstrel

    No, the durability is the right way to store it. (I imagine he could even force it despite the bug by digging into the Minecraft code.) What we need to do is figure out what went wrong and where.

    On an unrelated note, @Lodran - are you planning to add the three other creature types? Because if you are I'd like to make sure that you put them in the same order as I do.
     
  9. Offline

    Lodran

    I briefly considered using some kind of external DB to store it, but keeping it all straight would be a herculean task. Basically, I would have to track every move of a creature spawner from inventory to inventory, and update the database every time it moved. I'd never get it working right, it'd put unneeded strain on the server, and I'd probably end up giving up in disgust before it worked at all anyway.
    I actually spent a fair amount of time putting in (currently unused) architecture that will allow me to completely take over the spawner, and perform the spawns myself. In among this is a pair of classes - one which uses bukkit APIs to spawn creatures, and another which would hack it's way through and talk to the minecraft classes directly.

    Hopefully I won't have to use the second method.

    Looking at my roughed in code, the damage values would be:

    pig = 0, chicken = 1, cow = 2, sheep = 3, squid = 4, creeper = 5, ghast = 6, pig_zombie = 7, skeleton = 8, spider = 9, zombie = 10, slime=11, monster=12, giant=13.

    I'm also looking at being able to spawn riders, but I probably won't make those be tradable. If you broke a spawner that makes riders, you would get one for the rider, but not for the mount.
     
  10. Offline

    Celtic Minstrel

    So, if you added wolves, they would be 14? Thanks. :)
     
  11. Offline

    Lodran

    Ok, wolves = 14. I'm not sure that a creature spawner will actually be able to spawn wolves unaided - that may be where bits of my new architecture will come in handy. ;)
     
  12. Offline

    Lodran

    Version 0.6.2 is up (now with wolves!)

    • Worked around a bug in bukkit which was causing all spawners to be placed as pig spawners.
    • Added support for wolf spawners.
    • Enabled experimental code which improves the spawning requirements for sqiud spawners (Note: to activate this code you have to use the /creaturebox set squid command on the spawner. Existing spawners and those placed from inventory still use the old code).
     
  13. Offline

    Lakart

    Even though I'm an OP, when I try to change things with /creaturebox or use /creaturebox give it says im not. Permissions & GroupManager not installed.
     
  14. Offline

    Lodran

    Any creature type? or just wolves? default permissions are messed up for wolves.
     
  15. Offline

    Lakart

    Just wolves, which is what I really wanted it for.
     
  16. Offline

    Lodran

    Well, at this point, either install Permissions or GroupManager, or wait for my next update - should be sometime tonight.
     
  17. Offline

    tjdrago

    Do i need permissions for this?
     
  18. Offline

    Lakart

    Ill wait. I seem to be extreemly fail at configuring things like permissions.
     
  19. Offline

    Lodran

    Updated to Version 0.6.3

    • Fixed default permissions for wolf spawners.
    • Fixed spawning for squid spawners.
    @tjdrago not with version 0.6.3.
     
  20. Offline

    Lakart

    Sweet, WOLF ARMY UNITE!
     
  21. Offline

    Taxen0

    Would it be possible to add a few lines to the config so you could choose to have only certain items drop the regular spawner, and some only pig spawners?
    something like if you use a gold sword it will work as now. any other sword, will drop pig-spawners only. and anything else drops "air", nothing.
     
  22. Offline

    Astrognome

    Does anyone some sort of fix for the invincible pigs? Like a mod or something?
     
  23. Offline

    Celtic Minstrel

    It would require a client mod, yes, but I don't know of anyone who cares enough to do it.
     
  24. Offline

    Lodran

    @Taxen0 - Celtic Minstrel's post on page 4.

    I haven't tried it myself, but it looks like it would work.

    monster=12, giant=13, wolf=14

    You'll also need to make sure you don't give the creaturebox.dropspawner permission.


    For monster spawners, I just rock up the floor so that pigs won't spawn. For critter spawners? Well they're usually just gonna be fed into a grinder anyway, so I just ignore the ghost pigs.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  25. Offline

    Taxen0

    I know you just had to fix much in your code, so this might not be possible anymore, but is it possible to do something with the spawners so they don't auto-stack on pickup? the durability thing made sure they didn't earlier (tho you could still do it manually).
    Now if I pick up a pig-spawner and a skeleton-spawner, it will count as 2 pig-spawners when placed.
     
  26. Offline

    Lodran

    I'd be more inclined to consider adding inventory management features like that if I knew for certain that other plugins (like Stackable) couldn't be used to solve the problem.

    Looking at Stackable's features, it appears to me that configuring it with mob_spawner=1 would probably solve it.

    I guess what I'm asking is for folks to look around a bit for possible solutions before asking a mod developer for additional (probably complicated) features.
     
  27. Offline

    Celtic Minstrel

    I think he wants the spawners themselves to depend on the tool used, not have the mobs drop their spawners. It may be possible with Otherblocks, though... I'll take a look at it sometime.

    It probably would if CraftBukkit actually had inventory hooks, but currently Stackable doesn't really do what it sounds like due to that lack.

    But wait... surely you didn't do away with the durability?
     
  28. Offline

    Lodran

    The idea is to get Otherblocks to drop the spawner instead of creaturebox. By removing the dropspawner permission, you don't get double drops.
    Sounds like it's impossible until CraftBukkit gets inventory hooks, then.
    I didn't do away with durability, but apparently Notch did (sort of). In 1.4, the durability of a mob spawner no longer shows, and ones with different durability stack (destroying the type of the second spawner). I'm sure there was a reason for the change, but I can't imagine what it was...
     
  29. Offline

    Taxen0

    I have tried stackable and it does not work. while its true that it can set the stack to 1, it seems to be more of an auto-sort feature that's called upon typing a command.(more suitable for increasing stack sizes rather than decreasing)
    So the stacking would still appear, and later split once you type the command.
    But then its to late if you have different kind of spawners.
     
  30. Offline

    Lodran

    Apparently Stackable doesn't do it because bukkit lacks the needed hooks. In other words, what you're looking for isn't possible right now.

    Version 0.7.0
    • Enabled all of my "experimental" features.
    • The frequency at which mobs are generated can be changed (see /creaturebox period).
    • Spawners can now be "pulsed" with redstone, to generate 1 or more mobs each time a button is pressed (see /creaturebox period).
    • The number of mobs generated each time can be changed (see /creaturebox count).
    • The total number of mobs that a spawner will create at a time can be changed (see /creaturebox limit).
    • Some of the requirements for spawning a mob can be relaxed (see /creaturebox requires).
    • Slimes, Monsters and Giants are now supported.
    If you haven't read the first post in awhile, now's the time - there's a host of new features documented there, as well as a (somewhat hackish) method which should finally defeat the invincible "Ghost Pigs".

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  31. Offline

    Taxen0

    Ok, too bad the durability of spawners is hidden now since that's what seem to mess it up.
    I just have to remember to go back and put the spawner in a chest before picking up a new one =)
     

Share This Page