how can I make a plugin that writes letters in blocks? like mineplex

Discussion in 'Plugin Development' started by dxrknez, Mar 25, 2018.

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

    dxrknez

    I''ve tried making a plugin that writes words in block, but it wasnt very easy because i had to set block on every position to make it look like this: .

    is there any other way to do this without having to setblock on every position? it took me days to get the xyzs right. that video was taken from pocket edition and i wrote it in php. now im trying to develop plugins for bukkit too.
     
  2. Offline

    timtower Administrator Administrator Moderator

    @dxrknez You need to have a font, when you have that you can create every letter with ease.
     
  3. Offline

    dxrknez

    how will i write with blocks?
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    dxrknez

    where/how can i get a font? java.awt.Font?
     
    Last edited: Mar 26, 2018
  6. Offline

    timtower Administrator Administrator Moderator

    @dxrknez You need to search for a simple font, or you use one that is one the machine of the user.
    Not sure how to load it into Java, you need to be able to access it pixel by pixel.
     
  7. Hey there. Nice idea to make a letter writing plugin. Unfortunately I have to say that there is no option than making relative locations of where the block should be placed against the other. But I found an easy way of doing it. Why don't you write a code that will write all the locations of the selected areas that contains letters and give it the letters name. Such as a.txt so you don't have to write it anymore. You can you worldedit for this. And if you do need some help I can support with that.

    Sent from my SM-G920F using Tapatalk
     
  8. Offline

    dxrknez

    I've made this "block writing letter" and it works pretty good. just not what i wanted. it sets blocks likr a text, facing up and not vertical thats facing you when you just stand on the ground
     
  9. Offline

    timtower Administrator Administrator Moderator

    @dxrknez Then you need to transform it, or switch x, y and z around till it gets put upright.
     
  10. Offline

    dxrknez

    how can i transform it?
     
  11. Offline

    timtower Administrator Administrator Moderator

    Not sure how in Bukkit
     
  12. Offline

    The_Coder

    Okay, there are a few different ways to approach the problem:

    1. Create a font manager and also a base class for each letter. In the base class have a 2d array with x, y, and the pixel color at that location. Write another function that returns a block array with the starting location passed into it. Then populate the array with the 2d class array based on the pixel's color.

    What the first solution provides is a way to make a word array, basically a sentence. Call some method in font manager like createSentence and pass the starting location and sentence array. It would then call the function in the base class that returns the block array.


    2.
    Copy and save with world edit and link in with their API to paste it.
     
  13. Offline

    dxrknez

    :emoji
     

    Attached Files:

Thread Status:
Not open for further replies.

Share This Page