SteamWar/BauSystem2.0
Archiviert
12
0

Add 4 new GuiItems
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-01 13:56:27 +01:00
Ursprung 9c49481907
Commit 98bb9bfb77
6 geänderte Dateien mit 265 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -870,6 +870,14 @@ OBSERVER_RETRACE_NO_TRACE = §7Kein Observer Trace zum neu berechnen
OTHER_ITEMS_TELEPORT_NAME=§eTeleporter
OTHER_ITEMS_TELEPORT_GUI_NAME=Teleportieren
OTHER_ITEMS_TELEPORT_PLAYER_OFFLINE=§cDer Spieler ist Offline
OTHER_ITEMS_CLEAR_NAME=§eClear
OTHER_ITEMS_DECLUTTER_NAME=§eDeclutter
OTHER_ITEMS_GAMEMODE_NAME=§eGamemode
OTHER_ITEMS_GAMEMODE_LORE_1=§eRechts-Click§8:§7 Umschalten zwischen Creative und Spectator
OTHER_ITEMS_GAMEMODE_LORE_2=§eLinks-Click§8:§7 Umschalten zwischen Survival und Adventure
OTHER_ITEMS_KILLALL_NAME=§eKillAll
OTHER_ITEMS_KILLALL_LORE_1=§eOhne Shift§8:§7 nur die Region
OTHER_ITEMS_KILLALL_LORE_2=§eMit Shift§8:§7 Global
OTHER_SLOT_INVALID_SLOT=§cInvalider Slot
OTHER_NOCLIP_SLOT_INFO=§7Mit /slot kannst du den ausgewählten Slot ändern und einen anderen Block in den Slot nehmen.
OTHER_NOCLIP_SLOT_HELP_PICK = §8/§eslot pick §8-§7 Lege den angeguckten Block ins Inventar

Datei anzeigen

@ -56,6 +56,7 @@ public class BauGUI {
if (ITEMS.containsKey(item.getId())) {
throw new IllegalArgumentException("Duplicate Id Key: " + item.getId() + ". From Classes: " + ITEMS.get(item.getId()).getClass().getName() + " and " + item.getClass().getName());
}
System.out.println("Added Item: " + item.getId());
ITEMS.put(item.getId(), item);
}

Datei anzeigen

@ -0,0 +1,56 @@
/*
* 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.other.items;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.inventory.SWItem;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
@Linked(LinkageType.BAU_GUI_ITEM)
public class ClearBauGuiItem extends BauGuiItem {
public ClearBauGuiItem() {
super(29);
}
@Override
public ItemStack getItem(Player player) {
return new SWItem(Material.BUCKET, BauSystem.MESSAGE.parse("OTHER_ITEMS_CLEAR_NAME", player)).getItemStack();
}
@Override
public boolean click(ClickType click, Player p) {
p.closeInventory();
p.getInventory().clear();
return false;
}
@Override
public Permission permission() {
return Permission.MEMBER;
}
}

Datei anzeigen

@ -0,0 +1,60 @@
/*
* 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.other.items;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.features.other.DeclutterCommand;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.linkage.LinkedInstance;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.inventory.SWItem;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
@Linked(LinkageType.BAU_GUI_ITEM)
public class DeclutterBauGuiItem extends BauGuiItem {
@LinkedInstance
private DeclutterCommand declutterCommand;
public DeclutterBauGuiItem() {
super(30);
}
@Override
public ItemStack getItem(Player player) {
return new SWItem(Material.WATER_BUCKET, BauSystem.MESSAGE.parse("OTHER_ITEMS_DECLUTTER_NAME", player)).getItemStack();
}
@Override
public boolean click(ClickType click, Player p) {
declutterCommand.genericCommand(p);
return false;
}
@Override
public Permission permission() {
return Permission.MEMBER;
}
}

Datei anzeigen

@ -0,0 +1,72 @@
/*
* 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.other.items;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.inventory.SWItem;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
@Linked(LinkageType.BAU_GUI_ITEM)
public class GamemodeBauGuiItem extends BauGuiItem {
public GamemodeBauGuiItem() {
super(31);
}
@Override
public ItemStack getItem(Player player) {
return new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("OTHER_ITEMS_GAMEMODE_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("OTHER_ITEMS_GAMEMODE_LORE_1", player), BauSystem.MESSAGE.parse("OTHER_ITEMS_GAMEMODE_LORE_2", player)), false, clickType -> {}).getItemStack();
}
@Override
public boolean click(ClickType click, Player p) {
p.closeInventory();
GameMode gameMode = p.getGameMode();
if (click.isRightClick()) {
if (gameMode != GameMode.CREATIVE) {
p.setGameMode(GameMode.CREATIVE);
} else {
p.setGameMode(GameMode.SPECTATOR);
}
} else if (click.isLeftClick()) {
if (gameMode != GameMode.SURVIVAL) {
p.setGameMode(GameMode.SURVIVAL);
} else {
p.setGameMode(GameMode.ADVENTURE);
}
}
return false;
}
@Override
public Permission permission() {
return Permission.MEMBER;
}
}

Datei anzeigen

@ -0,0 +1,68 @@
/*
* 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.other.items;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.features.other.KillAllCommand;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.linkage.LinkedInstance;
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
import de.steamwar.bausystem.region.utils.RegionSelectionType;
import de.steamwar.inventory.SWItem;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
@Linked(LinkageType.BAU_GUI_ITEM)
public class KillAllBauGuiItem extends BauGuiItem {
@LinkedInstance
private KillAllCommand killAllCommand;
public KillAllBauGuiItem() {
super(32);
}
@Override
public ItemStack getItem(Player player) {
return new SWItem(Material.LAVA_BUCKET, BauSystem.MESSAGE.parse("OTHER_ITEMS_KILLALL_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("OTHER_ITEMS_KILLALL_LORE_1", player), BauSystem.MESSAGE.parse("OTHER_ITEMS_KILLALL_LORE_2", player)), false, clickType -> {}).getItemStack();
}
@Override
public boolean click(ClickType click, Player p) {
p.closeInventory();
if (click.isShiftClick()) {
killAllCommand.genericCommand(p, RegionSelectionType.GLOBAL);
} else {
killAllCommand.genericCommand(p, RegionSelectionType.LOCAL);
}
return false;
}
@Override
public Permission permission() {
return Permission.MEMBER;
}
}