mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-02 07:55:28 +00:00
Mitigate issues with tree generation in paper (#260)
* fix: mitigate cocoa tree generation crash * chore: suppress warnings * chore: fix formatting * refactor: catch specific exception * chore: added reference to PaperMC/Paper#6028
This commit is contained in:
parent
eef0e04682
commit
d7bb818f51
@ -46,6 +46,8 @@ public class BukkitTree implements Tree {
|
||||
public boolean plant(Location l, Random r) {
|
||||
try(ProfileFrame ignore = main.getProfiler().profile("bukkit_tree:" + delegate.toString().toLowerCase(Locale.ROOT))) {
|
||||
return ((BukkitWorld) l.getWorld()).getHandle().generateTree(BukkitAdapter.adapt(l), delegate);
|
||||
} catch(IndexOutOfBoundsException ignored) { // Workaround for https://github.com/PaperMC/Paper/issues/6028
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user