MultiLanguage and schematic placing

Discussion in 'Plugin Development' started by ArsenArsen, Jun 30, 2014.

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

    ArsenArsen

    Hello guys! Im trying to make bukkit plugin witch has folder for language packs and making somethink like //wand to place schematic. It will need recipe to craft and it will consume items from invertory to make tent.
     
  2. Offline

    NoLiver92


    For the language side, thats easy - you need to decide how you want to store the language packs, aka .yml file (I personally use a localemanager inside plugin so users cant edit messages, the language files are also protected). once thats decided then we can help you with the relevant system/code to help you
     
    ArsenArsen likes this.
  3. Offline

    ArsenArsen

    Ok NoLiver92 , about schema?
    And where i can find it?

    Folder is called Language and packs are like en_US.yml

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  4. Offline

    NoLiver92


    with the schematics is a bit harder, the wand is easy but the hard part is taking the schematic and pasting it while consuming resources. I was working on this for a plugin but minecraft moved too fast for me to keep up so I suspended it. but you have to get the blocks from the schematic file using JNBT. once you have the blocks you can then do whatever you want to the blocks, but there are certain things to watch out for.

    And find what exactly?

    For the language files, all you need to do is have a default laguage coded in to the plugin incase there isnt a language file in the folder. Then in the config file which selects the language file to use and then in code you access that file for the message. But the problem you will have is if someone edits the file and removes a key then your plugin will break, thats why I have all my languages internal to the plugin.
     
    ArsenArsen likes this.
  5. Offline

    ArsenArsen

    Ok then ill make folder in plugin NoLiver92
    and i need WorldEdit API but how to use it?
     
  6. Offline

    NoLiver92


    No idea how to use WorldEditAPI, ive always created my own as world edit is overkill. plus my schematics were big so i built them block by block rather than using world edit because it froze my server
     
  7. Offline

    ArsenArsen

    What code i need to add for lang NoLiver92 ?
     
  8. Offline

    NoLiver92

    ArsenArsen Im sorry but im reluctant to release my code as its taken me along time to do it and its my plugin for a private server and has alot of extra items in there, BUT I will give you the link which I got my information from and was helpful for when I wrote my code from scratch.

    Link

    Im also willing to help if you have a problem, but I do believe in you doing the work rather than giving you the answer as you wont learn :)
     
  9. Offline

    ArsenArsen

    Ok NoLiver92 do u know any1 for schemas, and how i can make onUpdate to start update?
     
  10. Offline

    NoLiver92

    ArsenArsen I dont know im afraid, I knew how to do it in 1.6.2 but were now on 1.7.10 and alot of things have changed so I cant tell you the way to do it without going back into it (which i cant do atm).

    Is this for an auto updater? if so look at the resources section. theres a tutorial on it there
     
  11. Offline

    ArsenArsen

    Ok NoLiver92 can you give me link of wand source
     
  12. Offline

    NoLiver92


    i dont have source but:
    -in playerinteractevent, check for the wand item
    -if wand then check action (left/right click on block/air)
    -then if on block get the blocks location, that is then the position for you to work with
     
  13. Offline

    ArsenArsen

    Still looking for schematics...

    Bump all over again :/ ...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  14. Offline

    NoLiver92

    ArsenArsen
    Dont bump within 24 hours!!! someone will get back to you, they do look past page 1
     
  15. Offline

    ArsenArsen

    It was 10h
     
  16. Offline

    NoLiver92

    right so 10 hours is less then 24 hours!!! therefore the result = Dont bump unless > 24
     
    ArsenArsen likes this.
  17. Offline

    ArsenArsen

    I was 8-min bump *faccepalm*

    NoLiver92 i founded
    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);
    5.  
    6. public void onPlace(PlayerInteractEvent evt){
    7. Player p = evt.getPlayer();
    8. if(evt.getClickedBlock().getType() == Material.AIR){
    9. p.sendMessage(ChatColor.DARK_RED + "You cant place tent on sky!" + ChatColor.AQUA + " LOL!");
    10. } else {
    11. loadArea(world, tent.schematic);
    12. }
    13. }


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  18. Offline

    NoLiver92

    Congratulations :) does it work now?
     
  19. Offline

    ArsenArsen

    No error at line loadArea(world, tent.schematic);

    NoLiver92

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  20. Offline

    NoLiver92

    ok and the error is what exactly? a space monkey eating human brains?
     
  21. Offline

    ArsenArsen

    public void onPlace(PlayerInteractEvent evt) has void is invalid for variable
    loadArea(world, tent, origin); has tent cannot be resolved
    NoLiver92

    do you get
    Error 520

    wben u try to load page

    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