This commit is contained in:
Anuken
2023-05-12 12:10:37 -04:00
parent bcee2e7083
commit 7bcfaf54ef
2 changed files with 10 additions and 7 deletions

View File

@@ -477,11 +477,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(build == null) return;
if(net.server() && (!Units.canInteract(player, build) ||
!netServer.admins.allowAction(player, ActionType.configure, build.tile, action -> action.config = value))){
var packet = new TileConfigCallPacket(); //undo the config on the client
packet.player = player;
packet.build = build;
packet.value = build.config();
player.con.send(packet, true);
if(player.con != null){
var packet = new TileConfigCallPacket(); //undo the config on the client
packet.player = player;
packet.build = build;
packet.value = build.config();
player.con.send(packet, true);
}
throw new ValidateException(player, "Player cannot configure a tile.");
}
build.configured(player == null || player.dead() ? null : player.unit(), value);