PreciousStones

PreciousStones

269k Downloads

How to refresh cuboids from DB like /ps pull?

UltraMC opened this issue ยท 9 comments

commented

I want to refresh cuboids.

/ps pull- does it's job but how to call it from external plugin? API dont have it.

commented

I can add a hook on the api later today.

commented

Could I do:

import net.sacredlabyrinth.Phaed.PreciousStones.*;

PreciousStones PreciousStones = new PreciousStones();
PreciousStones.getStorageManager().loadWorldData();

PS I've red some of PreciousStones code, you people are badass

commented

Yep, you can do that.

commented

Than is it REALLY needed in API?

I need that for refreshing deleted cuboids from outside the plugin intself (i.e. PHP database manipulation).

The core feature needed is:
in config: doPullUpdatesEvery: x seconds

as now it does so only onEnable

commented

To clear out deleted cuboids use the code in /ps clean or clear i forget.

commented

Pulling the db down to memory every few secs would be a bad idea performance-wise tho so i would recommend against that

commented

I pull only when control table contains cuboids to delete.

Anyway there should be a cool way of dynamicly reloading cubs

commented

If you delete a cuboid fron the db and you want it to be removed from the world as well then use /ps clean, it will remove any fields from the wirld that are no longer on the db. If you add new fields to the db and you want them to be added to the world, then you use /ps pull, it will pull all fields on tge db to tge world.

commented

And I assume that /ps clean is more efficent than /ps pull, right?