Posts by notabadminer

    The API has player.getInventory().insertNewItem(itemID, itemVariation, amount); This does not work for adding objects. It adds item ID:43, Variation:0, Name: objectkit but the item is blank


    testItem.toString() shows:"Item: Item - id: 43 texture: 1 stack: 1 value: -1.0 status: 0 attribute: obj_9, name: objectkit"


    I am assuming all that is required to add the workbench to inventory is having a way to assign the attribute "obj_9"?

    Thanks for the help. That was easier than I was expecting. release 0.6 has the new database and a lot of code cleanup. I removed some of the horrible workarounds that I was playing around with trying to avoid delayed database writes. It seems to be working much better.

    @Miwarre You havegood points. This is very much a work in progress. I am a sloppycoder both to inexperience and laziness. It will take severalrevisions before the code becomes anything resembling good.



    1) I used the world database out of ease of implementation. I willlook into changing to a separate database.
    2) the function tries to load the lang file from the plugin dir,then from the jar, then defaults back to the en.lang file from thejar. I'm looking into how to implement loading once on plugin init.I'm not sure how to do that yet. I've been working off tutorialsonline.
    3) it is a major overhead and needs to be corrected. I'm not surehow to fix it at the moment. I'm still learning
    4/5) I see your point. I will revert to static command names thatshouldn't conflict

    I have been working on an economy plugin for my personal server. I figured I'd share with others. The mod adds a virtual wallet for players and works via chat commands. Over half the items have been priced. I'll work on pricing the rest over the next couple days. It will take a while as there are lots of items in game.


    commands:
    /ebalance - check wallet balance.
    /eprice - check price of item held.
    /ebuy - buy item held. is optional. If no amount is specified, one will be bought.
    /esell - sell stack held. is optional. If no amount is specified, whole stack will be sold.


    admin commands:
    /egivecoins - give specified player coins. All command options required.
    /economy set - set price of item held. is required.
    /economy export - export pricelist table to csv file in plugin folder.
    /economy import - import pricelist.csv from plugin folder.


    Downloads: https://github.com/notabadminer/rw-economy/releases


    BUGS? Please file an issue here: economy issues


    KNOWN ISSUES: players cannot buy objectkits. The API doesn't have a way to add objects to inventory. I've disabled buying for now.


    WANTED: Help with german transaltion support. PM me if interested.

    Thanks! I think I have a working solution now. I just copied the data from your spoiler, created a csv, and created a couple functions to import from and export to/from csv. I did find that the API is missing a getItemAttribute() function. I need this to price the workbenches and other objects. I worked around the issue by converting the item to a string and using regex to strip out the attribute.

    I've poked around in the API for a bit but I can't seem to locate a way to get a list of all in-game items. Something along the lines of (short itemID, int variation, string name) would work. I need a full list so prices can be assigned to each item for my economy mod.


    Does anyone know how to get this?