mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
SPIGOT-3886: Plugin exceptions in map rendering should not crash server
By: md_5 <git@md-5.net>
This commit is contained in:
parent
10a070d7a2
commit
d54b9c77e9
2 changed files with 7 additions and 1 deletions
|
@ -93,6 +93,7 @@ public class CraftMapCanvas implements MapCanvas {
|
|||
}
|
||||
catch (NumberFormatException ex) {}
|
||||
}
|
||||
throw new IllegalArgumentException("Text contains unterminated color string");
|
||||
}
|
||||
|
||||
CharacterSprite sprite = font.getChar(text.charAt(i));
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.server.WorldMap;
|
||||
|
||||
|
@ -143,7 +144,11 @@ public final class CraftMapView implements MapView {
|
|||
}
|
||||
|
||||
canvas.setBase(render.buffer);
|
||||
renderer.render(this, canvas, player);
|
||||
try {
|
||||
renderer.render(this, canvas, player);
|
||||
} catch (Throwable ex) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Could not render map using renderer " + renderer.getClass().getName(), ex);
|
||||
}
|
||||
|
||||
byte[] buf = canvas.getBuffer();
|
||||
for (int i = 0; i < buf.length; ++i) {
|
||||
|
|
Loading…
Add table
Reference in a new issue