13
0

Elytra cleanup
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-03-10 15:02:09 +01:00
Ursprung d336893196
Commit 04a2d60fae
4 geänderte Dateien mit 3 neuen und 62 gelöschten Zeilen

Datei anzeigen

@ -52,7 +52,6 @@ public class LobbySystem extends JavaPlugin {
config = new Config(getConfig()); config = new Config(getConfig());
new PlayerSpawn(); new PlayerSpawn();
new DoubleJumpListener(); new DoubleJumpListener();
new ElytraListener();
new ParticleListener(); new ParticleListener();
new InventoryInteraction(); new InventoryInteraction();
new WorldInteraction(); new WorldInteraction();

Datei anzeigen

@ -1,59 +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.lobby.listener;
import de.steamwar.lobby.util.LobbyPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
public class ElytraListener extends BasicListener {
@EventHandler(priority = EventPriority.HIGHEST)
public void handlePlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player);
/*if (event.getMaterial() != LobbyInventory.ELYTRA_READY) return;
if(!lobbyPlayer.isFlyingElytra()) {
player.getInventory().setChestplate(new ItemStack(Material.ELYTRA));
player.setGliding(true);
player.teleport(new Location(Bukkit.getWorlds().get(0),player.getLocation().getX(),player.getLocation().getY() + 4, player.getLocation().getZ(), player.getLocation().getYaw(), player.getLocation().getPitch()));
player.setGliding(true);
lobbyPlayer.setFlyingElytra(true);
LobbyInventory.givePlayerLobbyItems(player);
}*/
}
@EventHandler
public void onMove(PlayerMoveEvent event) {
/*Player player = event.getPlayer();
LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player);
if(lobbyPlayer.isFlyingElytra() && player.isOnGround()) {
lobbyPlayer.setFlyingElytra(false);
player.getInventory().clear();
LobbyInventory.givePlayerLobbyItems(player);
}*/
}
}

Datei anzeigen

@ -38,7 +38,8 @@ public class InventoryInteraction extends BasicListener {
event.getItem().setAmount(2); event.getItem().setAmount(2);
return; return;
} }
event.setCancelled(true); if(!DebugCommand.debugging(event.getPlayer()))
event.setCancelled(true);
} }
@EventHandler @EventHandler

Datei anzeigen

@ -60,7 +60,7 @@ public class PlayerSpawn extends BasicListener {
inventory.setItem(EquipmentSlot.CHEST, ELYTRA); inventory.setItem(EquipmentSlot.CHEST, ELYTRA);
player.getInventory().setItem(4, new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build()); player.getInventory().setItem(3, new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build());
player.getInventory().setItem(5, PARTICLE); player.getInventory().setItem(5, PARTICLE);
} }