ExpensiveStones

The plugin for a plugin

This plugin requires PreciousStones v7.0.6 or higher!

PreciousStones

Beta Release Notes

This plugin is tested against bukkit 1.0.1-R1 and PreciousStones v7.0.8b.

Please, post your issues on github: Issues

All bug-reports are highly welcome

What is it?

ExpensiveStones is a plugin for PreciousStones. PreciousStones is a plugin for bukkit adding a self-protection-service for the players on a server through blocks.

ExpensiveStones adds upkeepcost to these PreciousStones.

How To Use

Place a stone and this plugin will automatically recognize it and disable it.

Next, place a chest near the block you want your activation-sign being placed.

Finally place a sign with the text "[ExpStone]" and let the magic happen.

Added since v0.2.0: When you want to activate multiple fields at once you can hook them up with redstone. When you power the sign it will switch into Powered-state. Mind that you can still toggle the power by clicking the signs.

What happens

When the sign is placed ExpensiveStones searches the surrounding for a dormant stone. This is done in a sphere with a radius of 2 around the sign. Then it will try to find a chest in a cuboid around the sign.

If everything is present it will register and disable the field. When you either click the sign or the block it will toggle the field. It will then check if the resources are in the chest and schedule it's activation.

Clicked on the sign/block again it will disable on the next periodCheck.

Why this plugin for a plugin?

I adore ExpenisiveStones for its functionality. It allows the player himself to add protections to area's they define their own. But when you play on a all-out-pvp-warfare-server things might go strange when adding a few of these blocks to the mix.

For example the 'you-shall-not-pass'-block: When set up no one is able to enter the field until it goes down, creating an unfair advatage for the defenders for having a perfect defence.

What this plugin attempts to do is adding upkeepcost to the use of these stones. Meaning the defenders need to keep their supplies in check or their shield will go down, creating new strategies for the attacker.

What does it affect on the persistent scale in PreciousStones?

This plugin only adds one extra table to the PreciousStones-database. But it won't delete any excisting stones nor will it make excisting stones before install of this plugin turn into ExpensiveStones.

One command will be implemented to drop the ExpensiveStones-table from the database when this plugin has to be uninstalled.

How to configure

You can define each 'ExpensiveStone' with a custom Material, UpkeepPeriod and the amount of the material required to activate the next cycle. Configuring is simply done by adding the next options to the config.yml from PreciousStones:

- ExpensiveStone: true/false
enable or disable field as ExpensiveStone
- ExpensiveMaterial: <itemID>
defaults redstone when not present
- ExpensivePeriod: <int>[S|T]
defaults 15s when not present.
- ExpensiveCost: <int>
defaults 2 when not present
- ExpensiveToggle: true/false
Redstone can toggle this stone, default true when not present. Soon to be added.

You can define the Period by either placing 's' or 't', representing 's'econds or 't'icks. Remember that 20t is 1s servertime.

Permission Nodes

All nodes are implemented by SuperPerms. If you have a request for Permission Managers which doesn't use SuperPerms, please post an issue on GitHub Issue Tracker.

ExpensiveFields.admin
the ability to create 'admin'-field.
ExpensiveFields.bypass
gives player the ability to ignore the ExpensiveField Plugin AKA insta-admin-field

Commands

ALL COMMANDS NOT YET IMPLEMENTED

/es bypass
toggles bypass
/es admin <iD>
toggles admin on iD
/es admin point
toggles admin on the block being targeted

CONSOLE ONLY

expensiveStones prepareUninstall -a
This commands will delete the table either in the MySQL- or the SQLite-database and stop any tasks related to the plugin. It is still up to you to delete the jar.
expensiveStones clearDB -a
This command will drop the table, purge the cache and initiate a fresh DB.

Development Notes

This plugin is developed to be merged into PreciousStones at a certain point. Until then I try to optimize and perfect its functionality as a separate plugin.

Upcoming/Todo

  • Toggle field with redstone power since v0.2.0
  • Add cost per use for example: the Launcher.
  • Implement commands

Source Code: GitHub

Issue Tracker: Issue Tracker

You must login to post a comment. Don't have an account? Register to get one!

  • 8 comments
  • Avatar of S3thc0n S3thc0n Mar 14, 2012 at 18:40 UTC - 0 likes

    Update? +1!

  • Avatar of LEOcab LEOcab Jan 12, 2012 at 19:47 UTC - 0 likes

    Hello sir! I love the idea of this plugin. :3

    However I'm having some trouble using it.

    Issue #1: if I remove the [ExpStone] sign and then break the actual precious stone, the sign re-appears (blank) after a few seconds. The sign can be broken and picked up so people can use this to dupe signs.

    Issue #2: I can't seem to change the ExpensivePeriod setting. For example I tried the number 2592000 (12 hours) but it didn't work; I got 2 redstone eaten every 15 seconds. Also if I try to add 's', for example, "15s" I get this error on startup:

    2012-01-12 13:26:11 [SEVERE] Error occurred while enabling ExpensiveStones v0.2.1 (Is it up to date?): For input string: "1515s"
    java.lang.NumberFormatException: For input string: "1515s"
    	at java.lang.NumberFormatException.forInputString(Unknown Source)
    

    (skipped backtrace) Same thing for 60, it acts as if I had typed "6060s". It dupes the number... o.O

    Where exactly am I supposed to put these settings? I put them under each stone like you said in your very latest post but I'm thinking maybe I misunderstood since every time you refer to the setting you put a dash before it, but in the PS config, the settings don't have dashes. I just want 3 tiers of City Protection (iron: 5 block radius, 1 redstone for 12 hours; gold: 10 block radius, 2 redstone for 12 hours; diamond: 20 block radius, 4 redstone for 12 hours). This is what I have for the iron one:

    force-field-blocks:
    - title: Iron Forcefield
      block: 42
      radius: 5
      breakable: false
      prevent-fire: true
      prevent-place: true
      prevent-destroy: true
      prevent-explosions: true
      prevent-unprotectable: true
      prevent-flow: true
      prevent-use:
      - 23
      - 54
      - 64
      - 69
      - 70
      - 72
      - 77
      - 84
      - 95
      - 96
      - 107
      welcome-message: true
      farewell-message: true
      visualize-on-rightclick: false
      cuboid: true
      ExpensiveStone: true
      ExpensivePeriod: 2592000
      ExpensiveCost: 1
    

    Could you please help me out? I really want to use this on my server. Thanks in advance! :)

    Oh and... I got around this, but you may want to know: Issue #3: the plugin worked fine on a Windows test server, but when I hooked it into my Linux box for further testing, I got an error complaining about PreciousStones being a missing dependency. I managed to get it working by changing 'q' to 'z' in the JAR file name. :P

    Last edited Jan 12, 2012 by LEOcab
  • Avatar of Scriblon Scriblon Dec 22, 2011 at 07:39 UTC - 0 likes

    @aedgar: Go

    You can. All the configuration is done within the preciousstones config file. Simply add " - ExpensiveStone: true" to the PreciousStone you don't want to be free. It will only affect that stone. This way you can have different settings for different stoned.

    For the other config you can put the following:

    - ExpensiveMaterial: 264

    - ExpensivePeriod: 300S

    And again: it will only affect the stoned you put these lines into its properties.

    Hope it helped ;) .

    If you encounter any bug please post a ticket.

    Last edited Dec 22, 2011 by Scriblon: clarify
  • Avatar of aedgar aedgar Dec 21, 2011 at 14:51 UTC - 0 likes

    Is it possible to set this plugin so it is only needed for one type preciousstone?

    For example my server uses 4 preciousstones, I want 3 of them to be free to use and activate on placement but I want the final precioustone to cost 2 diamond to activate for 5 minutes.

  • Avatar of Scriblon Scriblon Dec 05, 2011 at 20:42 UTC - 0 likes

    Update v0.2.0 is on its way. With this update you can toggle fields by powering the signs with redstone. See change log for all updates. Until the file passes the modqueue it will be available here.

  • Avatar of Scriblon Scriblon Nov 28, 2011 at 01:17 UTC - 0 likes

    Update on its way. v0.1.3 will fix the table-check and gets rid of the most recurring debug code. Other debug-code, however will stay for a little while longer. This is until a problem with PreciousStones is resolved.

    EDIT: The file is now in the moderator-queue, so until then use this link.

    Last edited Nov 28, 2011 by Scriblon: Linking to mirror
  • Avatar of Scriblon Scriblon Nov 27, 2011 at 23:51 UTC - 0 likes

    Ah sorry, Forgot about that paticular debug-code. It is a task which runs every 15 seconds to push the chace to the mysql server with all the updates.

    About the error. It should just take the info given inside preciousStones and use that to contact the server. (it even uses the classes of PreciousStones to handle it). If the table fails to create it should give you a random SQL-error on startup. Could you please provide this error for me? Made a ticket, any further info concerning this issue will be posted there.

    I couldn't test the mysql server.

    Will try and fix it asap.

    UPDATE: DOH! had the table name written wrong.

    Last edited Nov 28, 2011 by Scriblon: Not cluttering the post-section
  • Avatar of bladedpenguin bladedpenguin Nov 27, 2011 at 23:30 UTC - 0 likes

    Very cool! I Like! It does not seem to create the relevant MySQL table though. I'm not sure if thats a problem with my databases or the plugin. What columns does it need? I'll create it manually. Also, I seem to get console spam about updating every 15s. Is there a fix?

    http://minestatus.net/17417-jewel-of-artifice/image/original.png

  • 8 comments

Facts

Date created
Nov 21, 2011
Category
Last update
Dec 17, 2011
Development stage
Beta
License
GNU General Public License version 3 (GPLv3)
Curse link
ExpensiveStones
Downloads
1,167
Recent files
  • B: v0.2.1 for CB 1.0.1-R1 Dec 17, 2011
  • B: v0.2.0b for CB 1337 Dec 06, 2011
  • B: v0.2.0 for CB 1337 Dec 05, 2011
  • B: v0.1.3 for CB 1337 Nov 28, 2011
  • B: v0.1.2 for CB 1337 Nov 27, 2011

Authors