Fix Simulator still shown after removing item from inventory
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
ecc24470f6
Commit
0c6b1b7f68
@ -79,6 +79,16 @@ public class SimulatorCursor {
|
||||
BauSystem.MESSAGE.sendPrefixless("SIMULATOR_POSITION_ADD", player, ChatMessageType.ACTION_BAR);
|
||||
}
|
||||
|
||||
public void hide(Player player) {
|
||||
REntityServer cursor = rEntityServerMap.get(player);
|
||||
if (cursor == null) return;
|
||||
|
||||
cursor.close();
|
||||
SimulatorStorage.getSimulatorNames().forEach(s -> {
|
||||
SimulatorStorage.getSimulator(s).hide(player);
|
||||
});
|
||||
}
|
||||
|
||||
public void hide(Player player, TNTSimulator tntSimulator) {
|
||||
REntityServer cursor = rEntityServerMap.get(player);
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class TNTSimulatorListener implements Listener {
|
||||
if (ItemUtils.isItem(e.getPlayer().getInventory().getItemInMainHand(), "simulator")) {
|
||||
simulatorShowHide(e.getPlayer(), i -> null, PlayerInventory::getItemInMainHand, e.getTo());
|
||||
} else {
|
||||
simulatorShowHide(e.getPlayer(), i -> null, i -> null, e.getTo());
|
||||
SimulatorCursor.hide(e.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren