mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-25 13:30:10 +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:
1 parent
eef0e04682
commit
d7bb818f51
1 file changed
+2
@@ -46,6 +46,8 @@ public class BukkitTree implements Tree {
|
|||||||
public boolean plant(Location l, Random r) {
|
public boolean plant(Location l, Random r) {
|
||||||
try(ProfileFrame ignore = main.getProfiler().profile("bukkit_tree:" + delegate.toString().toLowerCase(Locale.ROOT))) {
|
try(ProfileFrame ignore = main.getProfiler().profile("bukkit_tree:" + delegate.toString().toLowerCase(Locale.ROOT))) {
|
||||||
return ((BukkitWorld) l.getWorld()).getHandle().generateTree(BukkitAdapter.adapt(l), delegate);
|
return ((BukkitWorld) l.getWorld()).getHandle().generateTree(BukkitAdapter.adapt(l), delegate);
|
||||||
|
} catch(IndexOutOfBoundsException ignored) { // Workaround for https://github.com/PaperMC/Paper/issues/6028
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user