[INACTIVE][FUN/MECH] Philosopher's Box v1.7 - Item conversion based on defined values. [740]

Discussion in 'Inactive/Unsupported Plugins' started by Nohup, Feb 27, 2011.

  1. Offline

    Nohup


    The permissions you have listed look like a usage diagram, not an actual entry. Here is the default group entry from the Permissions release that I grabbed yesterday:

    Code:
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: false
            inheritance:
            permissions:
                - 'foo.bar'
        Moderator:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Default
            permissions:
                - 'bar.foo'
        Admins:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
    
    So with Admins they already have access to everything. Now if you wanted to added box access to Moderator you would change it to this:

    Code:
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: false
            inheritance:
            permissions:
                - 'foo.bar'
        Moderator:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Default
            permissions:
                - 'bar.foo'
                - 'philosophers.*'
        Admins:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
    
    --- merged: Mar 7, 2011 5:11 AM ---
    FYI - I found a small bug in the latest release. If you restart the server, and click a button that does not have a philosopher's box associated with it BEFORE setting a conversion value on a sign you will get an error in the logs. Once a type is set on the sign it will be cleared. I have it fixed, but was just holding out to see if something else was requested or needed changing rather than deploying a tiny build if it isn't truly problematic.
     
  2. Offline

    MacVaultDweller

    Were is the 1.3 download link?
     
  3. Offline

    flea1777

    ok so i got the new permissions plugin and still can;t get it to work i make the box then scroll gold ore appears on the sign then i put something in hit the button and nothing??

    is this mod incompatable with lockette or essentials protect could you test it and let me know thanks
     
  4. Offline

    MacVaultDweller

    sorry but what should config file setting be?
    Ihave

    opsonly: true
    material:
    diamond_ore:
    convertto: false
    value: 128
    stone:
    convertto: false
    value: 1
    gold_ore:
    convertto: true
    value: 64

    When I go to use the box it says I have to select at sign first
    and tagging sign with right or left click does nothing.
    Please forgive my ignorance.
     
  5. Offline

    Nohup

    so when you say 'nothing', are you getting an error in the server logs or a message back to the player or anything? Do you see in the logs where the enabled message comes in? I need a bit more to go on, but since this is pretty self-contained I wouldn't think there would be conflicts with essential protect, but with lockette using signs as well I am not sure if it would have an issue or not. Would think no, but not positive.
     
  6. Offline

    MacVaultDweller

    Ok for some reason it just started working. No changes on my part. I did restart the server maybe that did it.
    It's awesome! I do use Lockette and it seems to be working fine. If I find anything else out in testing I will keep you informed. THANKS AGAIN FOR A GREAT PLUGIN !
     
  7. Offline

    Nohup

    @MacVaultDweller - the sign is triggered on tool change, so mouse-wheel while looking at it:)
     
  8. Offline

    flea1777

    I get no server logs or errors and it does say its activated but i set the box up like u show then use mouse wheel on sign the gold ore option is the only one that comes up and then say i put some stuff in and click the button nothing no changes no logs or anything so i don't know but as macvaultdweller uses lockette and he says it works with that so i dont know al keep trying
    --- merged: Mar 7, 2011 4:53 PM ---
    Ok i sorted it all i need is a config for it that has alot of stuff on or some cos non of this works atm when i press the button nothing so say i put 1 cobblestone in it doesnt turn to stone when i press the button
     
  9. Offline

    Nohup

    yah, you have to actually config what you want changed :) Basically the default config is put in 64 stone and you can get 1 gold block for it. Not cobblestone, stone. I didn't build out a large config, not point in carrying that around in source, but I am sure some folks can post examples for you if you want.
     
  10. Offline

    flea1777

    yeah i would really like some examples or someones to use cos this takes a while to get everything i want convertable in and then to write down the values ect so if you or anyone has one could they give me a link or something and thanks for your assistance nohup was my fault in the end not sorting the config file :D you may need to put that in big red writing makesure config is set to blocks you want converting or it wont work and you will get annoyyed :d thanks nice plugin will be waiting for more from you and keep this updated i constantly update my server and am gunna make this the main thing :D
     
  11. Offline

    Marintha

    I know I had a lot of trouble working this config file out. So here's a little help for people that're having issues:

    What this example does is converts 5 stone to 1 gold ore. Notice that they are opposite of where you would think they should be; the value for GOLD is the actual amount of STONE you have to put in.

    convertto: false and convertto: true just set up what comes out. It looks like you can have multiple convertto: false but only one convertto: true.

    *** Nevermind, the forum takes out spaces, so don't copy/paste, just use the config file that it came with. I at least hope the explanation helps some people.
     
  12. Offline

    Nohup

    you can have all the convertto: true you want, and can scroll through them on the sign to choose which one you want to convert to at the time. Basically you are giving an overall value to each item, so in your example stone's value is 1, gold_ore's value is 5. You are therefore saying that it takes 5 stone to equal 1 gold_ore. They aren't opposite of where I think they should be obviously lol.

    I am working on getting this into my wiki as well so you have more examples. Here is the default, but I modified them all to be true for the convertto:

    Code:
    opsonly: false
    material:
        stone:
            value: 1
            convertto: true
        gold_ore:
            value: 64
            convertto: true
        diamond_ore:
            value: 128
            convertto: true
    
    Anything NOT in this configuration by default has a value of 0. So if i want diamond_ore to come out of the box with the above configuration, I can put in 128 stone and get 1 diamond ore. I can also put in 2 gold ore to get 1 diamond ore. I first must select diamond ore on the philosopher's box sign to choose that as the output. Now, if you go with this, you can scroll through the values on the sign and convert them back and forth. So I put in two gold ore, select diamond ore on the sign, convert and get 1 diamond ore. I then select stone on the sign and click the button, and now there is 128 stone in the box. Change the sign to gold ore, click, and I will be back to my 2 gold ore. If you put anything in the box with a value of 0 it will just be returned in its original form (as opposed to being destroyed...).
     
  13. Offline

    MacVaultDweller

    Ok you made one GIANT mistake. You made this plugin simply way to awesome for me not to bug you for one or two more features. Is it possible for you to make it so that you can have numbered boxes each with it own conversion settings and secondly is it possible separate true/false values for box creation and box use

    Something like
    opsonly create : true
    opsonly use : false
    Box 1
    material:
    stone:
    value: 1
    convertto: true
    gold_ore: value: 64
    convertto: true
    diamond_ore: value: 128
    convertto: true
    Box2
    material:
    stone: value: 1
    convertto: false
    gold_ore: value: 64
    convertto: true

    And so on...

    Permissions plugins are a big pain in the *** and break everything every time they are updated or abandoned. Just another weak link in a rusty chain. Until a permissions system is written in stone I try to stay away from any mod that requires someone else's plugin to run. I often encourage makers of mods that do use permissions to make it so that their mod will default to op-list for implementation. Mod creators that put in a default to op list soon find out that they aren't harassed by admin.'s and their players when changes take place because limited functionality remains and is in the hands of trusted administrators.
    I thank you Sir for making this non permissions plugin dependent. BRAVO!
     
  14. Offline

    Nohup

    Yah, adding Permissions was done by request, and I have added that to three of my four plugins so I was comfortable doing it, but the key was that I could add it without requiring it. Nothing like having something crash and burn and it not be your fault at all, so didn't want to get into that situation.

    I will have to look into the named box concept and the placement concept. Will give me something to ponder while my wife watches the Bachelor tonight lol
     
  15. Offline

    Devlah

    Thank you very much!
     
  16. Offline

    MacVaultDweller

    LOL
     
  17. Offline

    flea1777

    ok so i found a bug in this while adding alot of items to the config.
    ok so if i scroll down i get some options apart from say chest, then i scroll up and i get chest and just gold ore and i get some errors on the consol saying this

    2011-03-08 16:37:37 [SEVERE] Could not pass event PLAYER_ITEM_HELD to Philos
    r's Box
    java.lang.NullPointerException
    at com.nohupgaming.minecraft.util.PhilosophersUtil.getMaterialName(P
    sophersUtil.java:73)
    at com.nohupgaming.minecraft.listener.player.PhilosophersBoxPlayerLi
    er.onItemHeldChange(PhilosophersBoxPlayerListener.java:65)
    at org.bukkit.plugin.java.JavaPluginLoader$15.execute(JavaPluginLoad
    ava:200)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManag
    ava:225)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:573
    at net.minecraft.server.Packet16BlockItemSwitch.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  18. Offline

    Nohup

    Sounds like you have a bad material name in the config, and I then have a spot where I am not catching it.
     
  19. Offline

    flea1777

    well it doesnt work with chest and diamond ore
    for me anyways
    either that or its because of the wooden_plank as i have it wrote down
     
  20. Offline

    Nohup

    can you paste your config for me? in a convo is fine if you want
     
  21. Offline

    flea1777

    opsonly: true
    material:
    diamond_ore:
    convertto: true
    value: 400
    stone:
    convertto: true
    value: 2
    gold_ore:
    convertto: true
    value: 128
    cobblestone:
    convertto: true
    value: 1
    wooden_plank:
    convertto: true
    value: 0.2
    chest:
    convertto: true
    value: 2

    thats it for now
     
  22. Offline

    Nohup

    you want wood, not wooden_plank. While that is the description they used on the wiki, the plugin uses the underlying enumeration constants in the Bukkit code. You can find a list here
     
  23. Offline

    flea1777

    ok having a new problem i added more items

    opsonly: true
    material:
    diamond:
    convertto: false
    value: 2000
    iron_pickaxe:
    convertto: true
    value: 20
    gold_ignot:
    convertto: false
    value: 100
    iron_hoe:
    convertto: true
    value: 20
    wood:
    convertto: false
    value: 0.2
    chest:
    convertto: false
    value: 0.01
    iron_ignot:
    convertto: false
    value: 10
    coal:
    convertto: false
    value: 0.2
    iron_hoe:
    convertto: true
    value: 20
    iron_axe:
    convertto: true
    value: 20
    iron_pickaxe:
    convertto: true
    value: 20
    iron_spade:
    convertto: true
    value: 20
    gold_hoe:
    convertto: true
    value: 200
    gold_axe:
    convertto: true
    value: 200
    gold_pickaxe:
    convertto: true
    value: 200
    gold_spade:
    convertto: true
    value: 200
    diamond_hoe:
    convertto: true
    value: 6000
    diamond_axe:
    convertto: true
    value: 6000
    diamond_pickaxe:
    convertto: true
    value: 6000
    diamond_spade:
    convertto: true
    value: 6000
    wood_pickaxe:
    convertto: true
    value: 5
    wood_spade:
    convertto: true
    value: 5
    wood_axe:
    convertto: true
    value: 5
    wood_hoe:
    convertto: true
    value: 5
    stone_pickaxe:
    convertto: true
    value: 10
    stone_spade:
    convertto: true
    value: 10
    stone_axe:
    convertto: true
    value: 10
    stone_hoe:
    convertto: true
    value: 10

    right i use coal which is 0.2 which 25 should make a wood item so i put them in and press convert and it doesnt convert is there anything wrong with this config? coal doesnt seem to work to convert into other items
    [MERGETIME="1299614684"][/MERGETIME]
    it appears the values have to be 1 + could you in your next update make lowest value 0.1 please as were using this for shops and currency
     
  24. Code:
    opsonly: false
    material:
        diamond_ore:
            convertto: false
            value: 20
        gold_ore:
            convertto: false
            value: 2
        iron_ore:
            convertto: false
            value: 1
        diamond:
            convertto: false
            value: 20
        gold_ingot:
            convertto: false
            value: 2
        iron_ingot:
            convertto: false
            value: 1
        sponge:
            convertto: true
            value: 1
    

    Why isn't this working? It won't let me select a conversion. I've tried the mouse-wheel, clicking it, and more.

    EDIT: Nvm, I remade the sign and it worked. :p
     
  25. Offline

    Nohup

    @flea1777 - seems you found it on your own, these value are currently integer-only. The reason for this is that I can't return .2 coal to you if there is a remainder and you can't put .2 coal in to the box. If you are trying to use this in a currency type situation then you just need to adjust upwards. If you want coal to be .2 and dirt to be 1, coal is 2 and dirt is 10.

    @HmmmQuestionMark - sounds like you may have had a typo in the sign possibly?
    [MERGETIME="1299624606"][/MERGETIME]
    @flea1777 - also, you have the tool names wrong for hoe, check out the appendices on my wiki. Here is the one that has tools and materials and what not. It would be stone_spade.
     
  26. No there was no typo, it was just laggy I think.
     
  27. Offline

    Stormwolf

    Great plugin, thanks.
     
  28. Offline

    Nohup

    A minor bug-fix release is out there now. It fixes the bug that I mentioned a few posts back and the bug where I wasn't catching invalid materials very well. I also tested this against the new RB (522) and verified that things still work!
     
  29. Offline

    Nohup

    Updated supported version
     
  30. I love this concept :D
    Would it be possible to make a different scroll control? I find it extremely laggy when trying to change via the scroll bar (sometimes it changes with 1 inventory change, sometimes it takes 3-4 inv changes).

    Also, would it be possible to configure it so that the 3rd line of the sign makes a 'type' of philosopher's box? I would like to have different groups of items, which can be changed between eachother, but not have ALL the different types interchangable.
    Example: Have 1 "Group" interchange 3 gravel to become 1 flint. Have another group that changes 5 gold into 15 iron into 1 diamond. However, i dont want you to be able to convert flint into diamond, etc etc.
     

Share This Page