Cease node dumbness (#6670)

* Cease.

* Mobile players are second rate citizens

* Undo config on ratelimit, revert PowerNode for loop

* Fix being unable to drop items into core vaults when there are over 1k of the item already
This commit is contained in:
buthed010203
2022-03-28 14:32:36 -04:00
committed by GitHub
parent 12e1f328e8
commit 2bfc23c216
3 changed files with 13 additions and 6 deletions

View File

@@ -344,7 +344,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public static void tileConfig(@Nullable Player player, Building build, @Nullable Object value){
if(build == null) return;
if(net.server() && (!Units.canInteract(player, build) ||
!netServer.admins.allowAction(player, ActionType.configure, build.tile, action -> action.config = value))) throw new ValidateException(player, "Player cannot configure a tile.");
!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);
throw new ValidateException(player, "Player cannot configure a tile.");
}
build.configured(player == null || player.dead() ? null : player.unit(), value);
Core.app.post(() -> Events.fire(new ConfigEvent(build, player, value)));
}