Solved Change colour of stained glass pane

Discussion in 'Plugin Development' started by thechrisanator, Nov 15, 2018.

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

    thechrisanator

    How can I change the colour of a stained glass pane itemstack?
     
  2. Offline

    Zombie_Striker

    @thechrisanator
    1. For 1.12, set the durability of the itemstack.
    2. For 1.13, change the material type to be the color of stain glass that you want.
     
  3. Offline

    thechrisanator

    @Zombie_Striker Perfect!
    Also, how can I make it so all players have a variable called multitoggle (bool) that determines whether they can or cannot do something? It needs to be stored somehow, and also a variable that stores the last block that a player hit.

    basically I just need to know how to store variables for players.
    are config files the only way? and if so, aren't they kinda slow?
     
  4. Offline

    Esophose

    If you don't need the data to persist between server restarts, you can just use an ArrayList or something similar to store objects you want. If you need it to persist, .yml files (or the config.yml) are probably what you want, and no, they aren't very slow, maybe a millisecond or two for a lookup as long as the .yml file isn't massive. If you are going to be storing tens of thousands of entries, I would look at SQLite, MySQL, or some other RDBMS instead, as the lookup times will be faster.
     
  5. Offline

    Zombie_Striker

    @thechrisanator
    Configs are not necessarily slow. When you use configs when writing plugins, you are not directly accessing the config file, but another class that stores all the information for the config. The only laggy bit is the saving, which can be delayed if needed.

    Basically, you can simply use the config, or do the same thing the config does and store the information in hashmaps.
     
Thread Status:
Not open for further replies.

Share This Page