1.15.2 Better getType setType for blocks?

Discussion in 'Spigot Plugin Development' started by Stellrow, Mar 30, 2020.

  1. Is there any better way than the spigot provided methods to check/replace a block type? Atm im running it async but im pretty sure it's gonna get bit slow once it has to do it couple hundred times at once
     
  2. Why do you need to do this so many times?
     
  3. Automatic stuff.. but i think i will just section it in 4,so i do 25% now 25% couple secs later and so on..
     
  4. Right, but what automatic stuff. Perhaps we can find a better solution?
     
  5. Alt of stuff.. an example could be automating a sugar cane farm,in a certain region checking if the block its a sugarcane and then... but people tend to go overboard with these things as usual..
     
  6. No, don't check everything all the time.
    As an example -
    Let's say that someone creates a region?
    Check once for existing Sugarcane - log it
    Check if Player places Sugarcane - log it
    Check if Sugarcane 'grows' - log it
    etc.
    Make changes to logs, if Sugarcane is broken - log it

    Save Maps of Sugarcane activity and refer to them.

    Research the server API
     
  7. just curious, how can you use a bukkit API in async way?
     
  8. md_5

    Administrator Developer

    You can eg make a chunk snapshot and look at that async
     
  9. Sadly this isnt possible as already mentioned i have more than 500 entrys rn

    So rn im just trying to find out getting a block type through nms