Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
Conflicts: core/src/mindustry/core/NetServer.java
This commit is contained in:
@@ -419,7 +419,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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user