13
0

Teleporter #12

Zusammengeführt
Lixfel hat 12 Commits von Teleporter nach master 2022-03-26 16:51:55 +01:00 zusammengeführt
2 geänderte Dateien mit 39 neuen und 10 gelöschten Zeilen
Nur Änderungen aus Commit 9fde17cb71 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -36,9 +36,9 @@ import org.bukkit.inventory.PlayerInventory;
public class PlayerSpawn extends BasicListener { public class PlayerSpawn extends BasicListener {
public static final int FIREWORK_SLOT = 3; public static final int FIREWORK_SLOT = 2;
public static final ItemStack FIREWORK = new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build(); public static final ItemStack FIREWORK = new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build();
public static final int PARTICLE_SLOT = 5; public static final int PARTICLE_SLOT = 6;
public static final int NETHER_STAR_SLOT = 4; public static final int NETHER_STAR_SLOT = 4;
public static final ItemStack PARTICLE = new ItemBuilder(Material.NAME_TAG).setDisplayName("§6Partikel").setUnbreakable(true).removeAllAttributes().build(); public static final ItemStack PARTICLE = new ItemBuilder(Material.NAME_TAG).setDisplayName("§6Partikel").setUnbreakable(true).removeAllAttributes().build();
private static final ItemStack ELYTRA = new ItemBuilder(Material.ELYTRA).setDisplayName("§5Elytra").setUnbreakable(true).removeAllAttributes().build(); private static final ItemStack ELYTRA = new ItemBuilder(Material.ELYTRA).setDisplayName("§5Elytra").setUnbreakable(true).removeAllAttributes().build();

Datei anzeigen

@ -1,19 +1,31 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2022 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; package de.steamwar.lobby.listener;
import de.steamwar.inventory.SWInventory;
import de.steamwar.inventory.SWItem;
import de.steamwar.inventory.SWListInv;
import de.steamwar.lobby.Config;
import de.steamwar.lobby.particle.SpecialParticle;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
@ -29,6 +41,8 @@ public class TeleporterListener extends BasicListener{
private static final Location spawn = world.getSpawnLocation().clone().add(0.5, 0, 0.5); private static final Location spawn = world.getSpawnLocation().clone().add(0.5, 0, 0.5);
private static final Location team = new Location(world,1524,55,1440); private static final Location team = new Location(world,1524,55,1440);
private static final Location map = new Location(world,2337,38,1424); private static final Location map = new Location(world,2337,38,1424);
private static final Location bau = new Location(world,1951,66,1337);
private static final Location arenen = new Location(world,2255,21,1448);
static { static {
inventory = createInventory(); inventory = createInventory();
@ -56,13 +70,22 @@ public class TeleporterListener extends BasicListener{
player.teleport(team); player.teleport(team);
}else if(item.getType() == Material.MAP) { }else if(item.getType() == Material.MAP) {
player.teleport(map); player.teleport(map);
}else if(item.getType() == Material.WOODEN_AXE) {
player.teleport(bau);
}else if(item.getType() == Material.CLOCK) {
player.teleport(arenen);
} }
} }
private static Inventory createInventory() { private static Inventory createInventory() {
Inventory inv = Bukkit.createInventory(null, InventoryType.HOPPER, "§6Teleporter"); Inventory inv = Bukkit.createInventory(null, InventoryType.HOPPER, "§6Teleporter");
ItemStack item = new ItemStack(Material.WOODEN_AXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("§eBaubereich");
item.setItemMeta(meta);
inv.setItem(0, item);
ItemStack item1 = new ItemStack(Material.MAGMA_CREAM, 1); ItemStack item1 = new ItemStack(Material.MAGMA_CREAM, 1);
ItemMeta meta1 = item1.getItemMeta(); ItemMeta meta1 = item1.getItemMeta();
meta1.setDisplayName("§eSpawn"); meta1.setDisplayName("§eSpawn");
@ -81,6 +104,12 @@ public class TeleporterListener extends BasicListener{
item3.setItemMeta(meta3); item3.setItemMeta(meta3);
inv.setItem(3, item3); inv.setItem(3, item3);
ItemStack item4 = new ItemStack(Material.CLOCK, 1);
ItemMeta meta4 = item4.getItemMeta();
meta4.setDisplayName("§eArenen");
item4.setItemMeta(meta4);
inv.setItem(4, item4);
return inv; return inv;
} }