[Discontinued] Prispongemine [v3.0.1] [API 4.1.0]

PRISPONGEMINE

A plugin to create and manage mine for prison server. A mine is basically a named rectangular zone filled with ore.

WARNING the v2 need modified config file.
use command updateconfig to update your config file

##Use

  1. /prisponge define
  2. With a stick(by default), you select two blocks (with right click both starting from v3) like you do with a cuboid.
  3. /prisponge save “mine name” and it’s done.

To see the result do /prisponge fill “'mine name”.
By default, mines are filled with stone until you start to add ore, then only the percentage left without ore is filled with stone.

To update a wrongly defined mine, do /prisponge define, select the two block and do /prisponge update .

Then you can start auto refill with /prisponge start or first change timer duration / format for the mine with /prisponge time
Duration format : SECONDS, MINUTES, HOURS, DAYS.

For the altar, do the command and hit the block (here a sponge), in these picture the rest is decoration.

Now you put a block on it like this

and do the addore or removeore commands, if all fine, you get the info text and the block is removed.

#Downloads

Releases
Sources

#Commands

/prisponge - List all commands
/prisponge list - List all mines
/prisponge reload - Reload config file
/prisponge altar - let you define an altar by hitting the block below the altar
/prisponge autorun - make a mine autorun at server start
/prisponge autorundelay <mine name> <delay> - Before running each mine add a delay by default of 5 minutes, you can change it with this command, minimu is 60 seconds.
/prisponge random - make a mine with random ore between all added
/prisponge startall - start all mine
/prisponge stopall - stop all mine
/prisponge spawn <mine name> - set mine spawn location where you stand
/prisponge fill <mine name> - Fill the named mine
/prisponge save <mine name> - Save the defined mine
/prisponge update <mine name> - Update a mine with new coordinates
/prisponge clear <mine name> - remove all blocks of a mine
/prisponge delete <mine name> - Delete a mine
/prisponge addore <mine name> <percentage> - Add ore put on the altar to a mine
/prisponge removeore <mine name> - Remove ore put on the altar to a mine
/prisponge time <mine name> <duration> <duration format> - Change timer duration/format
/prisponge start <mine name> - Start autofill of a mine (by default the refill time is set to 24 hours)
/prisponge stop <mine name> - Stop autofill of a mine
/prisponge changetool - Change tool used to define a mine, put it in your hand before using this
/prisponge set <mine name> <set_number> - Change mine set number, by default, all mine are in the set 0.Allow all mine in the same set (except for 0) to run in the same time.
/prisponge warning <boolean> - Allow you to show or hide warning messages.

##Permissions

prisponge.fill
prisponge.define
prisponge.save
prisponge.update
prisponge.delete
prisponge.start
prisponge.stop
prisponge.time
prisponge.addore
prisponge.removeore
prisponge.reload
prisponge.list
prisponge.clear
prisponge.changetool
prisponge.spawn
prisponge.random
prisponge.autorun
prisponge.startall
prisponge.stopall
prisponge.warning
prisponge.set
prisponge.delay
1 Like

Do you have any screenshots? It sounds like it’s just a re-settable mine, instead of an actual “prison”, per se.

Well the idea come from a bukkit plugin like this one : http://dev.bukkit.org/bukkit-plugins/prisonmine/ so my plugin do more or less the same things. Better than a picture the original video link who give me hints for my plugin : - YouTube
And sorry but for me (and after few youtube video titled ‘prison server’ who only show this thing) a prison server was named like this because of prison mine plugin. Seem i made a mistake.

Then I’d recommend renaming it to something that makes sense, like “PrisingMineUtility”, “SpongeMinery”, or some other fancy english-word-smithery.

But it needs to have “mine” in the name, because that’s what it does :stuck_out_tongue: .

For now, i only say it a prison mine so the mistake is corrected.

Done. I hope prispongemine is fine now. My apologies to all people who think of it more than only a mine plugin and were deceived. By the way if someone can explain what i miss concerning prison server as a private message, thank you.

1 Like

Been using your plugin, but noticed that the filling usually takes a large amount of time causing big lag spikes. I actually timed setting a mine of 22000 blocks to stone using world edit it took 1.14 seconds (mean of 5 times) and using prispongemine it took 29.16 (mean of 3). Therefore I was wondering if it would be possible to make worldedit a dependency and then hook into world edit to vastly increase the speed. I will be looking into the source however too to see if I can lend a hand in that regard. (I noticed the 1.0.6 update and used that update for doing the timings).

Thank, i will search how to solve this. If you find an idea, i will gladly try it.

Would you be able to add your build.gradle file to your github master branch please.

i use Maven, sorry. By the way i think i find where is the problem, i will still check it.

Done, must work fine now.

Your a beast, let me try it now!

Works a charm, very slightly slower then world edit but 29 seconds to 1.3 seconds per mine is quite the improvement! It would be nice now to check for players in the mine and teleport them to a location set in the config on mine reset.

I know, i had the same idea. I need to work on it.

The next thing I need to ask about is the percentages. Currently you are only allowing integer percentages. Would you be able to change these to float values so I can use decimal and fractions? I have done my webpage for the ores that I intend however because its integer I can’t do it. I was also hoping to use (2.5/6)% as a value.

http://pixelmonweb.officialtjp.com/mines-info/

Also would it be possible for you to wack your pom.xml in there and / or give instructions on how to import into intelliJ idea

I put the pom.xml on github. next for the instructions: IntelliJ IDEA 2016.1 Help/Importing Project from Maven Model

I will look if i can do something about the percentage.

I take a look to percentage. to be honest i can use float as a value but when i evaluate the number of blocks for each ore, it is converted to integer and i can’t do anything about it because the percentage is a true percentage done using the number of blocks … who is an integer.

I will release a version with float anyway.

For the other part, i have not planned to integrate a calculator inside the plugin.

As far as I understand from that is that to get the value of blocks to place you do:
float percentage (config) cast to integer , then ((int percentage / 100) * total volume) That will find the correct integer number of blocks using the nearest integer to the float value in config. But in my mine of 22,000 blocks the smallest change I could do would be 1% so 220 blocks.

Instead if you ((float percentage / 100) * total volume) then cast to the integer then you would get the closest integer to what would be the exact number of block. Now in my mine of 22,000 blocks I can adjust the percentages to place one block. If I used a float percentage of (0.005).

(0.005) /100 = 0.00005
0.00005 * 22000 = 1.1f
1.1f → 1 (int)

the current method (as I understand would do)
0.005f → 0 (int)

(sorry if I am off base here, find it hard to folow the structure without intelliJ and I still can’t import this project. I am not being given maven as an option :confused:. Should never has updated my intelliJ :cry:.

but java don’t like to multiply or divide an int with a float.
I will try something, maybe convert the number of block to float then after getting percentage re-convert it to int.