SteamWar/FightSystem
Archiviert
13
1

Cancel PKC on move

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-01-08 19:23:32 +01:00
Ursprung 7bfa891b11
Commit 5035cde575

Datei anzeigen

@ -79,6 +79,7 @@ public class PersonalKitCreator extends BasicListener {
player.updateInventory(); player.updateInventory();
player.setGameMode(GameMode.CREATIVE); player.setGameMode(GameMode.CREATIVE);
toActionbar(player, TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!"));
} }
public static boolean notInKitCreator(HumanEntity player){ public static boolean notInKitCreator(HumanEntity player){
@ -108,11 +109,11 @@ public class PersonalKitCreator extends BasicListener {
@EventHandler @EventHandler
public void onMoveEvent(PlayerMoveEvent e){ public void onMoveEvent(PlayerMoveEvent e){
if(!openKitCreators.containsKey(e.getPlayer())) InventoryBackup backup = openKitCreators.get(e.getPlayer());
if(backup == null)
return; return;
e.setCancelled(true); backup.close();
toActionbar(e.getPlayer(), TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!"));
} }
@EventHandler @EventHandler