From 5ea2b5298592efd3d3abe2ec90c3291ca3685ea4 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 2 Sep 2023 16:24:21 +0200 Subject: [PATCH] Fix TNTSimulatorListener.hideShow for SimulatorCursor Remove prewview for 1.20 Signed-off-by: yoyosource --- .../simulator/preview/Simulator20.java | 34 +++++++++++++++++++ .../simulator/TNTSimulatorListener.java | 5 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 BauSystem_20/src/de/steamwar/bausystem/features/simulator/preview/Simulator20.java diff --git a/BauSystem_20/src/de/steamwar/bausystem/features/simulator/preview/Simulator20.java b/BauSystem_20/src/de/steamwar/bausystem/features/simulator/preview/Simulator20.java new file mode 100644 index 00000000..089674fd --- /dev/null +++ b/BauSystem_20/src/de/steamwar/bausystem/features/simulator/preview/Simulator20.java @@ -0,0 +1,34 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2023 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.features.simulator.preview; + +import de.steamwar.bausystem.features.simulator.TNTData; +import de.steamwar.bausystem.shared.Pair; + +import java.util.List; +import java.util.Map; + +public class Simulator20 implements Simulator { + + @Override + public PreviewRecord run(Pair>>>> toCalculate) { + return null; + } +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index 1d66457e..edeb0479 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -79,7 +79,10 @@ public class TNTSimulatorListener implements Listener { TNTSimulator tntSimulator = currentSimulator.remove(player); if (tntSimulator == simulator) return; if (tntSimulator != null) tntSimulator.hide(player); - if (simulator == null) return; + if (simulator == null) { + SimulatorCursor.hide(player); + return; + } currentSimulator.put(player, simulator); simulator.show(player); SimulatorCursor.show(player, simulator, trace(player, player.getLocation(), simulator));