Solved I need help with Vault and WorldEdit code

Discussion in 'Plugin Development' started by ArsenArsen, Jul 1, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ArsenArsen

    Im using:
    Code:java
    1. private void loadArea(World world, File file,Vector origin) throws DataException, IOException, MaxChangedBlocksException{
    2. EditSession es = new EditSession(new BukkitWorld((org.bukkit.World) world), 999999999);
    3. CuboidClipboard cc = CuboidClipboard.loadSchematic(file);
    4. cc.paste(es, origin, false);

    and
    Code:java
    1. loadArea(world, file, origin);
    but i cant link file,
    About Vault, i need to check for balance and put it in string called bal then to check if bal is less then string price: in config, i cant convert to string.
     
  2. Offline

    stirante

    ArsenArsen For vault use something like that:
    Code:
        public static boolean pay(String playername, double amount) {
            EconomyResponse r = econ.withdrawPlayer(playername, amount);
            return r.transactionSuccess();
        }
    If player don't have enough money they won't be taken from his account and method will return false. Otherwise it returns true.
    About file, if schematic is in plugin folder (/plugins/PluginName/schem.schematic):
    Code:
    new File(plugin.getDataFolder(), "schem.schematic");
    EDIT: Forgot about method initializing my economy util:
    Code:
     
        public static void init() {
            if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) return;
            RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
            econ = rsp.getProvider();
        }
     
  3. Offline

    ArsenArsen

    econ cannot be resolved

    and what for world and orign stirante

    B u m p i n g a r o u n d

    Please stirante

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  4. ArsenArsen Have a little patience, you're only meant to bump once every 24 hours :) And econ is your economy provider - see the vault setup guide
     
  5. Offline

    ArsenArsen

    I was looking for it like 4 days!

    Thanks stirante for help! I solved all!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page