mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Cover a couple of NPEs
This commit is contained in:
parent
5780ad370a
commit
31de7de385
@ -27,6 +27,7 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
|
|
||||||
@CommandDeclaration(command = "chat",
|
@CommandDeclaration(command = "chat",
|
||||||
usage = "/plot chat",
|
usage = "/plot chat",
|
||||||
@ -37,6 +38,8 @@ public class Chat extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(PlotPlayer<?> player, String[] args) {
|
public boolean onCommand(PlotPlayer<?> player, String[] args) {
|
||||||
|
PlotArea area = player.getPlotAreaAbs();
|
||||||
|
check(area, TranslatableCaption.of("errors.not_in_plot_world"));
|
||||||
if (player.getPlotAreaAbs().isForcingPlotChat()) {
|
if (player.getPlotAreaAbs().isForcingPlotChat()) {
|
||||||
player.sendMessage(TranslatableCaption.of("chat.plot_chat_forced"));
|
player.sendMessage(TranslatableCaption.of("chat.plot_chat_forced"));
|
||||||
return true;
|
return true;
|
||||||
|
@ -68,6 +68,8 @@ public class DebugRoadRegen extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlotArea area = player.getPlotAreaAbs();
|
||||||
|
check(area, TranslatableCaption.of("errors.not_in_plot_world"));
|
||||||
if (plot.getVolume() > Integer.MAX_VALUE) {
|
if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user