-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Folia support #570
base: master
Are you sure you want to change the base?
Folia support #570
Conversation
…a.yml and cauldron particles
fix a lot of reading world async errors, which fixes reading worlddata.yml and cauldron particles
|
||
public class BCauldron { | ||
public static final byte EMPTY = 0, SOME = 1, FULL = 2; | ||
public static final int PARTICLEPAUSE = 15; | ||
public static Random particleRandom = new Random(); | ||
private static Set<UUID> plInteracted = new HashSet<>(); // Interact Event helper | ||
public static Map<Block, BCauldron> bcauldrons = new HashMap<>(); // All active cauldrons. Mapped to their block for fast retrieve | ||
public volatile static Map<Block, BCauldron> bcauldrons = new ConcurrentHashMap<>(); // All active cauldrons. Mapped to their block for fast retrieve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you added volatile
to this Map? It is already a ConcurrentHashMap, did you find a reason that this has to be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case. I'm not sure about the need for this
// for example when removing it with some world editor | ||
barrel.checked = true; | ||
} | ||
P.getScheduler().runTaskTimer(barrel.getSpigot().getLocation(), () -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as i understand the Scheduler, this will run the Task in the Region for that Location.
Considering we load all Barrels on server start, they could all over the world and in multiple worlds. Many of them not loaded and in regions that do not exist at the moment.
So this would cause Folia to create the missing regions if im correct?
Is there a way to only run the Task if the region exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could there be a case where a barrel would be in a non-existent region? If someone installed it, then the region was created before, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not if the plugin folder is moved to another server with a new map. If they forget about it, then it will throw errors. It may be an edgecase but important to have in mind
I like the idea of adding Folia :) Have you found any other issues with this so far? |
Using https://github.com/Anon8281/UniversalScheduler