SteamWar/FightSystem
Archiviert
13
1

Improve KitCreatorClosement

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-01-08 18:02:57 +01:00
Ursprung f8769d83a9
Commit 7bfa891b11

Datei anzeigen

@ -79,7 +79,6 @@ 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){
@ -89,7 +88,7 @@ public class PersonalKitCreator extends BasicListener {
@Override @Override
public void disable(){ public void disable(){
while(!openKitCreators.isEmpty()){ while(!openKitCreators.isEmpty()){
openKitCreators.values().iterator().next().player.closeInventory(); openKitCreators.values().iterator().next().close();
} }
super.disable(); super.disable();
} }
@ -109,11 +108,11 @@ public class PersonalKitCreator extends BasicListener {
@EventHandler @EventHandler
public void onMoveEvent(PlayerMoveEvent e){ public void onMoveEvent(PlayerMoveEvent e){
InventoryBackup backup = openKitCreators.get(e.getPlayer()); if(!openKitCreators.containsKey(e.getPlayer()))
if(backup == null)
return; return;
backup.close(); e.setCancelled(true);
toActionbar(e.getPlayer(), TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!"));
} }
@EventHandler @EventHandler