Fix SimulatorCommand linkage
Dieser Commit ist enthalten in:
Ursprung
0e24023e78
Commit
3229e7e955
@ -23,9 +23,12 @@ package de.steamwar.bausystem.features.simulator;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@Linked(LinkageType.LISTENER)
|
||||||
public class SimulatorCommand extends SWCommand {
|
public class SimulatorCommand extends SWCommand {
|
||||||
|
|
||||||
public SimulatorCommand() {
|
public SimulatorCommand() {
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2021 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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.simulator;
|
|
||||||
|
|
||||||
public class SimulatorPosition {
|
|
||||||
}
|
|
@ -23,6 +23,8 @@ package de.steamwar.bausystem.features.simulator;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import org.bukkit.FluidCollisionMode;
|
import org.bukkit.FluidCollisionMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -39,6 +41,7 @@ import org.bukkit.util.Vector;
|
|||||||
import static de.steamwar.bausystem.features.simulator.TNTSimulator.WAND;
|
import static de.steamwar.bausystem.features.simulator.TNTSimulator.WAND;
|
||||||
import static de.steamwar.bausystem.features.simulator.TNTSimulator.get;
|
import static de.steamwar.bausystem.features.simulator.TNTSimulator.get;
|
||||||
|
|
||||||
|
@Linked(LinkageType.LISTENER)
|
||||||
public class TNTSimulatorListener implements Listener {
|
public class TNTSimulatorListener implements Listener {
|
||||||
|
|
||||||
private boolean permissionCheck(Player player) {
|
private boolean permissionCheck(Player player) {
|
||||||
|
@ -35,8 +35,7 @@ public class SimulatorEntityShowMode implements ShowMode<Position> {
|
|||||||
|
|
||||||
protected final Player player;
|
protected final Player player;
|
||||||
|
|
||||||
private final Map<RoundedPosition, AbstractSimulatorEntity> tntEntityMap = new HashMap<>();
|
private final Map<RoundedPosition, AbstractSimulatorEntity> entityMap = new HashMap<>();
|
||||||
private final Map<RoundedPosition, AbstractSimulatorEntity> updateEntityMap = new HashMap<>();
|
|
||||||
|
|
||||||
public SimulatorEntityShowMode(Player player) {
|
public SimulatorEntityShowMode(Player player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
@ -45,7 +44,7 @@ public class SimulatorEntityShowMode implements ShowMode<Position> {
|
|||||||
@Override
|
@Override
|
||||||
public void show(Position position) {
|
public void show(Position position) {
|
||||||
RoundedPosition roundedPosition = new RoundedPosition(position);
|
RoundedPosition roundedPosition = new RoundedPosition(position);
|
||||||
AbstractSimulatorEntity entity = tntEntityMap.computeIfAbsent(roundedPosition, pos -> createEntity(player, position.getLocation(), true));
|
AbstractSimulatorEntity entity = entityMap.computeIfAbsent(roundedPosition, pos -> createEntity(player, position.getLocation(), true));
|
||||||
entity.display(player);
|
entity.display(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,10 +54,8 @@ public class SimulatorEntityShowMode implements ShowMode<Position> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hide() {
|
public void hide() {
|
||||||
tntEntityMap.forEach((roundedPosition, abstractTraceEntity) -> abstractTraceEntity.hide(player, true));
|
entityMap.forEach((roundedPosition, abstractTraceEntity) -> abstractTraceEntity.hide(player, true));
|
||||||
tntEntityMap.clear();
|
entityMap.clear();
|
||||||
updateEntityMap.forEach((roundedPosition, abstractTraceEntity) -> abstractTraceEntity.hide(player, true));
|
|
||||||
updateEntityMap.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren