mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-13 19:52:08 +01:00
SPIGOT-3886: Plugin exceptions in map rendering should not crash server
This commit is contained in:
parent
fb423b8f48
commit
9060bfa9b9
@ -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…
Reference in New Issue
Block a user