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:
Anuken
2022-03-28 15:18:13 -04:00
14 changed files with 66 additions and 39 deletions

View File

@@ -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)));
}