Initial commit
This commit is contained in:
3
Plugins/Old/Necro-Cores/.idea/.gitignore
generated
vendored
Normal file
3
Plugins/Old/Necro-Cores/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
8
Plugins/Old/Necro-Cores/.idea/artifacts/Cores.xml
generated
Normal file
8
Plugins/Old/Necro-Cores/.idea/artifacts/Cores.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="Cores">
|
||||
<output-path>$USER_HOME$/Desktop</output-path>
|
||||
<root id="archive" name="Cores.jar">
|
||||
<element id="module-output" name="Necro-Cores" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
11
Plugins/Old/Necro-Cores/.idea/libraries/spigot_1_8_8.xml
generated
Normal file
11
Plugins/Old/Necro-Cores/.idea/libraries/spigot_1_8_8.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="spigot 1.8.8">
|
||||
<CLASSES>
|
||||
<root url="jar://E:/Tools/Sicherung/Plugins/Spigot Versions/spigot 1.8.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://E:/Tools/Sicherung/Plugins/Spigot Versions/spigot 1.8.8.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
11
Plugins/Old/Necro-Cores/.idea/misc.xml
generated
Normal file
11
Plugins/Old/Necro-Cores/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
Plugins/Old/Necro-Cores/.idea/modules.xml
generated
Normal file
8
Plugins/Old/Necro-Cores/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Necro-Cores.iml" filepath="$PROJECT_DIR$/Necro-Cores.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
21
Plugins/Old/Necro-Cores/Necro-Cores.iml
Normal file
21
Plugins/Old/Necro-Cores/Necro-Cores.iml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>SPIGOT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="spigot 1.8.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
name: Cores
|
||||
version: 1.0
|
||||
api-version: 1.8
|
||||
main: de.craftix.cores.Main
|
||||
|
||||
commands:
|
||||
start:
|
||||
stats:
|
||||
inv:
|
||||
defaultmap:
|
||||
addarena:
|
||||
delarena:
|
||||
arenen:
|
||||
setup:
|
||||
65
Plugins/Old/Necro-Cores/src/de/craftix/cores/Main.java
Normal file
65
Plugins/Old/Necro-Cores/src/de/craftix/cores/Main.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package de.craftix.cores;
|
||||
|
||||
import de.craftix.cores.utils.Arena;
|
||||
import de.craftix.cores.utils.Lobbymanager;
|
||||
import de.craftix.cores.utils.Setup;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
|
||||
public static final String prefix = "§7[§bCores§7] §r";
|
||||
|
||||
public static ArrayList<Player> team1 = new ArrayList<>(); //Rot
|
||||
public static ArrayList<Player> team2 = new ArrayList<>(); //Blau
|
||||
public static ArrayList<Player> spectator = new ArrayList<>();
|
||||
|
||||
private static Main instance;
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
MySQL.connect();
|
||||
createDB(MySQL.isConnected());
|
||||
Setup setup = new Setup();
|
||||
Lobbymanager.activeGame = Arena.getArena("default");
|
||||
|
||||
Lobbymanager.lobby = Arena.getSpawn(Arena.SpawnType.LOBBY, null);
|
||||
Lobbymanager.lobbyOptions();
|
||||
|
||||
getCommand("addarena").setExecutor(setup);
|
||||
getCommand("delarena").setExecutor(setup);
|
||||
getCommand("arenen").setExecutor(setup);
|
||||
getCommand("setup").setExecutor(setup);
|
||||
|
||||
PluginManager pm = Bukkit.getPluginManager();
|
||||
pm.registerEvents(setup, this);
|
||||
pm.registerEvents(new Lobbymanager(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
MySQL.disconnect();
|
||||
for (Player p : Bukkit.getOnlinePlayers()) p.kickPlayer(null);
|
||||
}
|
||||
|
||||
private void createDB(boolean isConnected){
|
||||
if (isConnected){
|
||||
//Spawns Types: 0=Lobby 1=Team1 2=Team2 3=CoreTeam1 4=CoreTeam2; ArenaID; Location
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS Spawns (Type INT(10), ArenaID INT(100), X VARCHAR(100), Y VARCHAR(100), Z VARCHAR(100), YAW VARCHAR(100), PITCH VARCHAR(100), World VARCHAR(100))");
|
||||
//Arenas Name; ID; InvMat; InvName
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS Arenas (Name VARCHAR(100), ID VARCHAR(100), InvMat VARCHAR(100), InvName VARCHAR(100), InvDMG INT(10))");
|
||||
//Stats UUID; Kills; Deaths; PlayedGames; DestroyedCores
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS Stats (UUID VARCHAR(100), Kills INT(10), Deaths INT(10), PlayedGames INT(10), DestroyedCores INT(10))");
|
||||
}
|
||||
}
|
||||
|
||||
public static Main getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
64
Plugins/Old/Necro-Cores/src/de/craftix/cores/MySQL.java
Normal file
64
Plugins/Old/Necro-Cores/src/de/craftix/cores/MySQL.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package de.craftix.cores;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MySQL {
|
||||
|
||||
public static final String server = "localhost";
|
||||
public static final Integer port = 3306;
|
||||
public static final String db = "Cores";
|
||||
public static final String user = "Cores";
|
||||
public static final String pass = "Cores";
|
||||
private static Connection con = null;
|
||||
|
||||
public static boolean connect(){
|
||||
String conString = "jdbc:mysql://" + server + ":" + port + "/" + db;
|
||||
try {
|
||||
con = DriverManager.getConnection(conString, user, pass);
|
||||
System.out.println("[Cores] MySQL connected successfully");
|
||||
return true;
|
||||
}catch (SQLException e){
|
||||
System.out.println("[Cores] MySQL connection failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean disconnect(){
|
||||
if (!isConnected()) return true;
|
||||
try {
|
||||
con.close();
|
||||
con = null;
|
||||
System.out.println("[Cores] MySQL disconnected");
|
||||
return true;
|
||||
}catch (SQLException e){
|
||||
System.out.println("[Cores] MySQL disconnecting failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isConnected(){
|
||||
if (con == null) return false;
|
||||
else return true;
|
||||
}
|
||||
|
||||
public static void insert(String qry){
|
||||
try {
|
||||
con.prepareStatement(qry).executeUpdate();
|
||||
}catch (SQLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static ResultSet getData(String qry){
|
||||
try {
|
||||
return con.prepareStatement(qry).executeQuery();
|
||||
}catch (SQLException e){
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
219
Plugins/Old/Necro-Cores/src/de/craftix/cores/utils/Arena.java
Normal file
219
Plugins/Old/Necro-Cores/src/de/craftix/cores/utils/Arena.java
Normal file
@@ -0,0 +1,219 @@
|
||||
package de.craftix.cores.utils;
|
||||
|
||||
import de.craftix.cores.Main;
|
||||
import de.craftix.cores.MySQL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Arena {
|
||||
public String name;
|
||||
public int id;
|
||||
public ItemStack invItem;
|
||||
public ArrayList<ArenaSpawn> spawns = new ArrayList<>();
|
||||
public Team teamRed;
|
||||
public Team teamBlue;
|
||||
|
||||
public static Arena getArena(int id){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Arenas WHERE ID = " + id);
|
||||
if (rs.next()){
|
||||
String name = rs.getString("Name");
|
||||
String invMat = rs.getString("InvMat");
|
||||
String invName = rs.getString("InvName");
|
||||
int dmg = rs.getInt("InvDMG");
|
||||
return new Arena(name, id, invMat, invName, dmg);
|
||||
}
|
||||
}catch (Exception e) { return null; }
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Arena getArena(String name){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Arenas WHERE Name = \"" + name + "\"");
|
||||
if (rs.next()){
|
||||
int id = rs.getInt("ID");
|
||||
String invMat = rs.getString("InvMat");
|
||||
String invName = rs.getString("InvName");
|
||||
int dmg = rs.getInt("InvDMG");
|
||||
return new Arena(name, id, invMat, invName, dmg);
|
||||
}
|
||||
}catch (Exception e) { return null; }
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArrayList<Arena> getAllArenas(){
|
||||
ArrayList<Arena> arenas = new ArrayList<>();
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Arenas");
|
||||
while (rs.next()){
|
||||
String name = rs.getString("Name");
|
||||
int id = rs.getInt("ID");
|
||||
String invMat = rs.getString("InvMat");
|
||||
String invName = rs.getString("InvName");
|
||||
int dmg = rs.getInt("InvDMG");
|
||||
arenas.add(new Arena(name, id, invMat, invName, dmg));
|
||||
}
|
||||
return arenas;
|
||||
}catch (Exception e) { return null; }
|
||||
}
|
||||
|
||||
public static ArrayList<ArenaSpawn> getArenaSpawns(Arena arena){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Spawns WHERE ArenaID = " + arena.id);
|
||||
ArrayList<ArenaSpawn> spawns = new ArrayList<>();
|
||||
while (rs.next()){
|
||||
int type = rs.getInt("Type");
|
||||
String x = rs.getString("X");
|
||||
String y = rs.getString("Y");
|
||||
String z = rs.getString("Z");
|
||||
String yaw = rs.getString("YAW");
|
||||
String pitch = rs.getString("PITCH");
|
||||
String world = rs.getString("World");
|
||||
spawns.add(new ArenaSpawn(type, arena, x, y, z, yaw, pitch, world).addToArena());
|
||||
}
|
||||
}catch (Exception e) { return null; }
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Location getSpawn(SpawnType type, Arena arena){
|
||||
if (type == SpawnType.LOBBY){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Spawns WHERE Type = 0");
|
||||
if (rs.next()){
|
||||
String x = rs.getString("X");
|
||||
String y = rs.getString("Y");
|
||||
String z = rs.getString("Z");
|
||||
String yaw = rs.getString("YAW");
|
||||
String pitch = rs.getString("PITCH");
|
||||
String world = rs.getString("World");
|
||||
return new Location(Bukkit.getWorld(world), Double.parseDouble(x), Double.parseDouble(y), Double.parseDouble(z), Float.parseFloat(yaw), Float.parseFloat(pitch));
|
||||
}
|
||||
}catch (Exception e) { return null; }
|
||||
}
|
||||
if (type == SpawnType.TEAM1){ //Type = 1
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 1) return spawn.loc;
|
||||
}
|
||||
}
|
||||
if (type == SpawnType.TEAM2){ //Type = 2
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 2) return spawn.loc;
|
||||
}
|
||||
}
|
||||
if (type == SpawnType.CORE1TEAM1){ //Type = 3
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 3) return spawn.loc;
|
||||
}
|
||||
}
|
||||
if (type == SpawnType.CORE1TEAM2){ //Type = 4
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 4) return spawn.loc;
|
||||
}
|
||||
}
|
||||
if (type == SpawnType.CORE2TEAM1){ //Type = 5
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 5) return spawn.loc;
|
||||
}
|
||||
}
|
||||
if (type == SpawnType.CORE2TEAM2){ //Type = 6
|
||||
for (ArenaSpawn spawn : arena.spawns){
|
||||
if (spawn.type == 6) return spawn.loc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Arena(String name, int id, String invMat, String invName, int dmg){
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
ItemStack item = new ItemStack(Material.getMaterial(invMat), 1, (short) dmg);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(new ArrayList<>());
|
||||
meta.setDisplayName(invName);
|
||||
item.setItemMeta(meta);
|
||||
this.invItem = item;
|
||||
this.spawns = getArenaSpawns(this);
|
||||
setTeams();
|
||||
}
|
||||
|
||||
public Arena(String name){
|
||||
this.name = name;
|
||||
invItem = new ItemBuilder(Material.BARRIER).setName("§cKein Item vorhanden").create();
|
||||
setTeams();
|
||||
}
|
||||
|
||||
private void setTeams(){
|
||||
teamRed = new Team("§cRot §7| §r", "§cRot");
|
||||
teamBlue = new Team("§9Blau §7| §r", "§9Blau");
|
||||
}
|
||||
|
||||
public Team getWinnerTeam(){
|
||||
teamRed.players = Main.team1;
|
||||
teamBlue.players = Main.team2;
|
||||
if (teamRed.leftCore || teamRed.rightCore || Main.team1.size() > 0) return teamRed;
|
||||
if (teamBlue.leftCore || teamBlue.rightCore || Main.team2.size() > 0) return teamBlue;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Team getLooserTeam(){
|
||||
teamRed.players = Main.team1;
|
||||
teamBlue.players = Main.team2;
|
||||
if (!teamRed.leftCore && !teamRed.rightCore || Main.team1.size() == 0) return teamRed;
|
||||
if (!teamBlue.leftCore && !teamBlue.rightCore || Main.team2.size() == 0) return teamRed;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static class ArenaSpawn{
|
||||
public int type;
|
||||
public Arena arena;
|
||||
public Location loc;
|
||||
|
||||
public ArenaSpawn(int type, Arena arena, String x, String y, String z, String yaw, String pitch, String world){
|
||||
this.type = type;
|
||||
this.arena = arena;
|
||||
this.loc = new Location(Bukkit.getWorld(world), Double.parseDouble(x), Double.parseDouble(x), Double.parseDouble(x), Float.parseFloat(yaw), Float.parseFloat(pitch));
|
||||
}
|
||||
|
||||
public ArenaSpawn(int type, Arena arena, Location loc){
|
||||
this.type = type;
|
||||
this.arena = arena;
|
||||
this.loc = loc;
|
||||
}
|
||||
|
||||
public ArenaSpawn addToArena() {
|
||||
arena.spawns.add(this);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public class Team {
|
||||
public String prefix;
|
||||
public String name;
|
||||
public boolean rightCore = true;
|
||||
public boolean leftCore = true;
|
||||
public ArrayList<Player> players;
|
||||
|
||||
public Team(String prefix, String name){
|
||||
this.prefix = prefix;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum SpawnType {
|
||||
LOBBY,
|
||||
TEAM1,
|
||||
TEAM2,
|
||||
CORE1TEAM1,
|
||||
CORE2TEAM1,
|
||||
CORE1TEAM2,
|
||||
CORE2TEAM2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package de.craftix.cores.utils;
|
||||
|
||||
public class Gamemanager {
|
||||
private static Arena arena;
|
||||
|
||||
public static void handleStartGame(final Arena a){
|
||||
arena = a;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package de.craftix.cores.utils;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ItemBuilder {
|
||||
|
||||
public Material material;
|
||||
public String name;
|
||||
public int amount = 1;
|
||||
public short damage = 0;
|
||||
public HashMap<Enchantment, Integer> enchantments = new HashMap<>();
|
||||
public ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
public ItemBuilder(Material mat){
|
||||
material = mat;
|
||||
}
|
||||
|
||||
public ItemBuilder(Material mat, int amount){
|
||||
material = mat;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public ItemBuilder(Material mat, int amount, int damage){
|
||||
material = mat;
|
||||
this.amount = amount;
|
||||
this.damage = (short) damage;
|
||||
}
|
||||
|
||||
public ItemBuilder setName(String name){
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder addEnchantment(Enchantment e, int level){
|
||||
enchantments.put(e, level);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder setLore(String... lore){
|
||||
for (String s : lore){
|
||||
this.lore.add(s);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack create(){
|
||||
ItemStack item = new ItemStack(material, amount, damage);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
for (Enchantment e : enchantments.keySet()){
|
||||
meta.addEnchant(e, enchantments.get(e), true);
|
||||
}
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName(name);
|
||||
item.setItemMeta(meta);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
package de.craftix.cores.utils;
|
||||
|
||||
import de.craftix.cores.Main;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockExplodeEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
|
||||
public class Lobbymanager implements Listener {
|
||||
|
||||
public static void lobbyOptions(){
|
||||
if (lobby == null) return;
|
||||
World world = lobby.getWorld();
|
||||
world.setPVP(false);
|
||||
world.setAnimalSpawnLimit(0);
|
||||
world.setMonsterSpawnLimit(0);
|
||||
world.setDifficulty(Difficulty.PEACEFUL);
|
||||
world.setAmbientSpawnLimit(0);
|
||||
world.setTime(6000);
|
||||
world.setGameRuleValue("doDaylightCycle", "false");
|
||||
world.setGameRuleValue("randomTickSpeed", "0");
|
||||
world.setGameRuleValue("announceAchievements", "false");
|
||||
world.setGameRuleValue("doMobSpawning", "false");
|
||||
world.setGameRuleValue("doFireTick", "false");
|
||||
for (Entity entity : world.getEntities()) if ((entity instanceof LivingEntity) && !(entity instanceof Player)) entity.remove();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWeatherChange(WeatherChangeEvent event) {event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onBuild(BlockPlaceEvent event) {if (state != Gamestate.INGAME) event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onBreak(BlockBreakEvent event) {if (state != Gamestate.INGAME) event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onExplode(BlockExplodeEvent event) {event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event) {event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onDamage(EntityDamageEvent event) {if (state != Gamestate.INGAME) event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onDrop(PlayerDropItemEvent event) {if (state != Gamestate.INGAME) event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onPickUp(PlayerPickupItemEvent event) {if (state != Gamestate.INGAME) event.setCancelled(true);}
|
||||
@EventHandler
|
||||
public void onInvClick(InventoryClickEvent event) {if (state != Gamestate.INGAME && event.getClickedInventory().equals(event.getWhoClicked().getInventory())) event.setCancelled(true);}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent event){
|
||||
event.setJoinMessage(null);
|
||||
if (state == Gamestate.RESTART) event.getPlayer().kickPlayer(null);
|
||||
Player p = event.getPlayer();
|
||||
if (state == Gamestate.INGAME){
|
||||
Main.spectator.add(p);
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
Location spawn = Arena.getSpawn(Arena.SpawnType.TEAM1, activeGame);
|
||||
p.teleport(spawn);
|
||||
}
|
||||
if (state == Gamestate.LOBBY){
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
p.teleport(lobby);
|
||||
p.setDisplayName("§7" + p.getDisplayName());
|
||||
giveInv(p);
|
||||
event.setJoinMessage(Main.prefix + "§aDer Spieler " + p.getDisplayName() + " §ahat das Spiel betreten");
|
||||
if (checkPlayerCount()) scheduleTimer(30, 0, "§aDas Spiel startet in §6TIME §aSekunden");
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void onQuit(PlayerQuitEvent event){
|
||||
event.setQuitMessage(null);
|
||||
Player p = event.getPlayer();
|
||||
if (state == Gamestate.LOBBY || Main.team1.contains(p) || Main.team2.contains(p)) event.setQuitMessage(Main.prefix + "§cDer Spieler " + p.getDisplayName() + " §chat das Spiel verlassen!");
|
||||
Main.team1.remove(p);
|
||||
Main.team2.remove(p);
|
||||
Main.spectator.remove(p);
|
||||
if (Main.team1.size() == 0 || Main.team2.size() == 0) initialiseEndSequence();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event){
|
||||
if (state != Gamestate.INGAME) event.setCancelled(true);
|
||||
if (state != Gamestate.LOBBY) return;
|
||||
switch (event.getItem().getType()){
|
||||
case BED:
|
||||
openBedGUI(event.getPlayer());
|
||||
break;
|
||||
case DIAMOND:
|
||||
scheduleTimer(30, 0, "§aDas Spiel startet in §6TIME §aSekunden");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void onBedInv(InventoryClickEvent event){
|
||||
if (!event.getClickedInventory().getTitle().equals("§cTeam wählen")) return;
|
||||
Player p = (Player) event.getWhoClicked();
|
||||
if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§cTeam Rot")){
|
||||
event.setCancelled(true);
|
||||
Main.team2.remove(p);
|
||||
Main.team1.remove(p);
|
||||
Main.team1.add(p);
|
||||
p.setDisplayName(activeGame.teamRed.prefix + p.getDisplayName());
|
||||
p.closeInventory();
|
||||
}else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§9Team Blau")){
|
||||
event.setCancelled(true);
|
||||
Main.team2.remove(p);
|
||||
Main.team1.remove(p);
|
||||
Main.team2.add(p);
|
||||
p.setDisplayName(activeGame.teamBlue.prefix + p.getDisplayName());
|
||||
p.closeInventory();
|
||||
}else event.setCancelled(true);
|
||||
}
|
||||
|
||||
public static Gamestate state = Gamestate.LOBBY;
|
||||
public static Location lobby;
|
||||
public static Arena activeGame;
|
||||
public static final int teamSize = 4;
|
||||
|
||||
private static void openBedGUI(Player p){
|
||||
Inventory inv = Bukkit.createInventory(null, 9*3, "§cTeam wählen");
|
||||
for (int i = 0; i < inv.getSize(); i++){
|
||||
ItemStack glass = new ItemBuilder(Material.STAINED_GLASS_PANE, 1, 15).setName(" ").create();
|
||||
inv.setItem(i, glass);
|
||||
}
|
||||
ItemStack red = new ItemBuilder(Material.WOOL, 1, 14).setName("§cTeam Rot").create();
|
||||
ItemStack blue = new ItemBuilder(Material.WOOL, 1, 11).setName("§9Team Blau").create();
|
||||
inv.setItem(11, red);
|
||||
inv.setItem(15, blue);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
private static boolean checkPlayerCount(){
|
||||
int minPlayer = ((teamSize * 2) / 4) * 2;
|
||||
if (lobby.getWorld().getPlayers().size() >= minPlayer) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
private static int timerID;
|
||||
private static void scheduleTimer(int seconds, int type, String msg){
|
||||
timerID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance(), new Runnable() {
|
||||
private int uptime = 0;
|
||||
@Override
|
||||
public void run() {
|
||||
int sec = seconds - uptime;
|
||||
if (sec == 0 && type == 0) startGame();
|
||||
if (sec == 0 && type == 1) stopGame();
|
||||
switch (sec){
|
||||
case 30: case 15: case 10: case 5: case 4: case 3: case 2: case 1:
|
||||
Bukkit.broadcastMessage(msg.replaceAll("TIME", String.valueOf(sec)));
|
||||
}
|
||||
uptime++;
|
||||
}
|
||||
}, 1, 20);
|
||||
}
|
||||
|
||||
public static void initialiseEndSequence(){
|
||||
if (activeGame == null) {
|
||||
Bukkit.getServer().shutdown();
|
||||
return;
|
||||
}
|
||||
for (Player all : Bukkit.getOnlinePlayers()){
|
||||
all.teleport(lobby);
|
||||
all.setGameMode(GameMode.SURVIVAL);
|
||||
state = Gamestate.RESTART;
|
||||
//set Rewards + Stats
|
||||
Arena.Team winner = activeGame.getWinnerTeam();
|
||||
if (winner == null) Bukkit.getServer().shutdown();
|
||||
all.sendTitle("§aTeam " + winner.name + " §ahat gewonnen", null);
|
||||
all.playSound(all.getLocation(), Sound.LEVEL_UP, 100, 1);
|
||||
scheduleTimer(15, 1, "§aDer Server startet in §6TIME §aSekunden neu");
|
||||
}
|
||||
}
|
||||
|
||||
public static void startGame(){
|
||||
Bukkit.getScheduler().cancelTask(timerID);
|
||||
state = Gamestate.INGAME;
|
||||
if (activeGame == null) activeGame = Arena.getArena("default");
|
||||
Gamemanager.handleStartGame(activeGame);
|
||||
}
|
||||
|
||||
public static void stopGame(){
|
||||
Bukkit.getScheduler().cancelTask(timerID);
|
||||
for (Player all : Bukkit.getOnlinePlayers()) all.kickPlayer(null);
|
||||
Bukkit.getServer().shutdown();
|
||||
}
|
||||
|
||||
private static void giveInv(Player p){
|
||||
p.getInventory().clear();
|
||||
p.getInventory().setHelmet(null);
|
||||
p.getInventory().setChestplate(null);
|
||||
p.getInventory().setLeggings(null);
|
||||
p.getInventory().setBoots(null);
|
||||
ItemStack team = new ItemBuilder(Material.BED).setName("§cTeam wählen").create();
|
||||
p.getInventory().setItem(0, team);
|
||||
if (p.hasPermission("cores.admin")){
|
||||
ItemStack start = new ItemBuilder(Material.DIAMOND).setName("§aSpiel Starten").create();
|
||||
p.getInventory().setItem(8, start);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Gamestate{
|
||||
LOBBY,
|
||||
INGAME,
|
||||
RESTART
|
||||
}
|
||||
}
|
||||
291
Plugins/Old/Necro-Cores/src/de/craftix/cores/utils/Setup.java
Normal file
291
Plugins/Old/Necro-Cores/src/de/craftix/cores/utils/Setup.java
Normal file
@@ -0,0 +1,291 @@
|
||||
package de.craftix.cores.utils;
|
||||
|
||||
|
||||
import de.craftix.cores.MySQL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Setup implements CommandExecutor, Listener {
|
||||
|
||||
public static ArrayList<Arena> setupArenas = new ArrayList<>();
|
||||
|
||||
public static void saveLobby(Location loc){
|
||||
MySQL.insert("DELETE FROM Spawns WHERE Type = 0");
|
||||
String x = "" + loc.getX();
|
||||
String y = "" + loc.getY();
|
||||
String z = "" + loc.getZ();
|
||||
String yaw = "" + loc.getYaw();
|
||||
String pitch = "" + loc.getPitch();
|
||||
String world = "" + loc.getWorld().getName();
|
||||
MySQL.insert("INSERT INTO Spawns (Type, X, Y, Z, YAW, PITCH, World) VALUES (0, \"" + x + "\", \"" + y + "\", \"" + z + "\", \"" + yaw + "\", \"" + pitch + "\", \"" + world + "\")");
|
||||
}
|
||||
|
||||
public static void saveArena(Arena arena){
|
||||
MySQL.insert("DELETE FROM Arenas WHERE ID = " + arena.id);
|
||||
MySQL.insert("DELETE FROM Spawns WHERE ArenaID = " + arena.id);
|
||||
arena.id = getNextArenaID();
|
||||
String invMat = arena.invItem.getType().name();
|
||||
String name = arena.invItem.getItemMeta().getDisplayName();
|
||||
if (name == null) name = arena.invItem.getType().name().toLowerCase();
|
||||
name.replace('&', '§');
|
||||
name.replace('_', ' ');
|
||||
String invName = name;
|
||||
MySQL.insert("INSERT INTO Arenas (Name, ID, InvMat, InvName, InvDMG) VALUES (\"" + arena.name + "\", " + arena.id + ", \"" + invMat + "\", \"" + invName + "\", " + arena.invItem.getDurability() + ")");
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns){
|
||||
Location loc = spawn.loc;
|
||||
String x = "" + loc.getX();
|
||||
String y = "" + loc.getY();
|
||||
String z = "" + loc.getZ();
|
||||
String yaw = "" + loc.getYaw();
|
||||
String pitch = "" + loc.getPitch();
|
||||
String world = "" + loc.getWorld().getName();
|
||||
MySQL.insert("INSERT INTO Spawns (Type, ArenaID, X, Y, Z, YAW, PITCH, World) VALUES (" + spawn.type + "," + arena.id + ", \"" + x + "\", \"" + y + "\", \"" + z + "\", \"" + yaw + "\", \"" + pitch + "\", \"" + world + "\")");
|
||||
}
|
||||
}
|
||||
|
||||
private static int getNextArenaID(){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM Arenas");
|
||||
ArrayList<Integer> ids = new ArrayList<>();
|
||||
while (rs.next()){
|
||||
ids.add(rs.getInt("ID"));
|
||||
}
|
||||
int id = 0;
|
||||
while (ids.contains(id)) id++;
|
||||
return id;
|
||||
}catch (Exception e) {}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private HashMap<Player, Arena> setupPlayer = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if ((sender instanceof Player) && sender.hasPermission("cores.setup")){
|
||||
Player p = (Player)sender;
|
||||
//setup <arena>
|
||||
if (command.getName().equals("setup") && args.length <= 1){
|
||||
if (setupPlayer.containsKey(p)){ //SaveArena
|
||||
Arena arena = setupPlayer.get(p);
|
||||
if (arena.spawns == null || arena.spawns.size() < 6) {
|
||||
p.sendMessage("§cDas Setup wurde noch nicht abgeschlossen!");
|
||||
return true;
|
||||
}
|
||||
if (arena != null) saveArena(arena);
|
||||
setupPlayer.remove(p);
|
||||
setupArenas.remove(arena);
|
||||
playerInvs.remove(p);
|
||||
p.getInventory().clear();
|
||||
p.sendMessage("§aEinstellungen gespeichert!");
|
||||
}else { //giveInv
|
||||
if (args.length == 1){
|
||||
Arena arena = Arena.getArena(args[0]);
|
||||
if (arena == null) for (Arena all : setupArenas) if (all.name.equals(args[0])) arena = all;
|
||||
if (arena == null) {
|
||||
p.sendMessage("§cDiese Arena existiert nicht!");
|
||||
return true;
|
||||
}
|
||||
setupPlayer.put(p, arena);
|
||||
giveSetupInv(p, 0);
|
||||
}else {
|
||||
giveSetupInv(p, 2);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//addarena <name>
|
||||
if (command.getName().equalsIgnoreCase("addarena") && args.length == 1){
|
||||
boolean contains = false;
|
||||
for (Arena all : setupArenas){
|
||||
if (all.name.equals(args[0])) contains = true;
|
||||
}
|
||||
if (contains){
|
||||
p.sendMessage("§cDiese Arena wird bereits bearbeitet!");
|
||||
return true;
|
||||
}
|
||||
setupArenas.add(new Arena(args[0]));
|
||||
p.sendMessage("§aDie Arena wurde erstellt!");
|
||||
return true;
|
||||
}
|
||||
//delarena <name>
|
||||
if (command.getName().equals("delarena") && args.length == 1){
|
||||
Arena arena = null;
|
||||
for (Arena all : setupArenas){
|
||||
if (all.name.equals(args[0])) arena = all;
|
||||
}
|
||||
if (arena == null){
|
||||
arena = Arena.getArena(args[0]);
|
||||
}else{
|
||||
setupArenas.remove(arena);
|
||||
p.sendMessage("§aSetup abgebrochen!");
|
||||
return true;
|
||||
}
|
||||
if (arena != null){
|
||||
MySQL.insert("DELETE FROM Arenas WHERE ID = " + arena.id);
|
||||
MySQL.insert("DELETE FROM Spawns WHERE ArenaID = " + arena.id);
|
||||
p.sendMessage("§aArena gelöscht!");
|
||||
return true;
|
||||
}
|
||||
p.sendMessage("§cDiese Arena existiert nicht!");
|
||||
return true;
|
||||
}
|
||||
//arenen
|
||||
if (command.getName().equals("arenen")){
|
||||
ArrayList<Arena> arenas = Arena.getAllArenas();
|
||||
if (arenas.size() == 0){
|
||||
p.sendMessage("§cEs gibt noch keine Arenen!");
|
||||
return true;
|
||||
}
|
||||
Inventory inv = Bukkit.createInventory(null, 9*3, "§aArena Liste");
|
||||
if (arenas.size() >= 9*3){
|
||||
for (int i = 0; i < inv.getSize(); i++){
|
||||
inv.setItem(i, arenas.get(i).invItem);
|
||||
}
|
||||
}else {
|
||||
for (int i = 0; i < arenas.size(); i++){
|
||||
inv.setItem(i, arenas.get(i).invItem);
|
||||
}
|
||||
}
|
||||
p.openInventory(inv);
|
||||
return true;
|
||||
}
|
||||
|
||||
p.sendMessage("§cDu benutzt den Command falsch!");
|
||||
}else sender.sendMessage("§cDu hast keine Rechte, diesen Befehl zu benutzen!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private HashMap<Player, Inventory> playerInvs = new HashMap<>();
|
||||
|
||||
@EventHandler
|
||||
public void onInvClick(InventoryClickEvent event){
|
||||
if (event.getClickedInventory() == null) return;
|
||||
if (event.getCurrentItem() == null) return;
|
||||
if (event.getClickedInventory().getTitle().equals("§aArena Liste")) event.setCancelled(true);
|
||||
if (event.getClickedInventory().getTitle().equals(invName)){
|
||||
Player p = (Player) event.getWhoClicked();
|
||||
Arena arena = setupPlayer.get(p);
|
||||
|
||||
if (event.getSlot() == 13 && arena != null && event.getCurrentItem() != null){
|
||||
arena.invItem = event.getCursor();
|
||||
event.setCurrentItem(null);
|
||||
return;
|
||||
}else {
|
||||
if (event.getCurrentItem() == null) return;
|
||||
event.setCancelled(true);
|
||||
p.closeInventory();
|
||||
}
|
||||
|
||||
if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aLobby")){
|
||||
saveLobby(p.getLocation());
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aSpawn für Team 1")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 1) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(1, arena, p.getLocation()));
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aSpawn für Team 2")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 2) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(2, arena, p.getLocation()));
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aRechter Core für Team 1")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 3) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(3, arena, p.getLocation()));
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aLinker Core für Team 1")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 4) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(4, arena, p.getLocation()));
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aRechter Core für Team 2")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 5) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(5, arena, p.getLocation()));
|
||||
}
|
||||
else if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§aLinker Core für Team 2")){
|
||||
for (Arena.ArenaSpawn spawn : arena.spawns) if (spawn.type == 6) arena.spawns.remove(spawn);
|
||||
arena.spawns.add(new Arena.ArenaSpawn(6, arena, p.getLocation()));
|
||||
}
|
||||
ItemStack item = event.getCurrentItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addEnchant(Enchantment.DURABILITY, 1, true);
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(meta);
|
||||
event.setCurrentItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event){
|
||||
if (!setupPlayer.containsKey(event.getPlayer())) return;
|
||||
if (event.getItem().getItemMeta().getDisplayName().equals(invName)) giveSetupInv(event.getPlayer(), 1);
|
||||
}
|
||||
|
||||
private final String invName = "§6Setup";
|
||||
public void giveSetupInv(Player p, int type){
|
||||
if (type == 0){ //Hotbar
|
||||
ItemStack setup = new ItemBuilder(Material.NETHER_STAR).setName(invName).create();
|
||||
p.getInventory().setItem(4, setup);
|
||||
}
|
||||
else if (type == 1){ //Inv
|
||||
if (playerInvs.containsKey(p)){
|
||||
p.openInventory(playerInvs.get(p));
|
||||
return;
|
||||
}
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 9*3, invName);
|
||||
|
||||
for (int i = 0; i < inv.getSize(); i++){
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, 1, 15).setName("").create());
|
||||
}
|
||||
|
||||
ItemStack team1 = new ItemBuilder(Material.ENDER_PEARL).setName("§aSpawn für Team 1").create();
|
||||
ItemStack team2 = new ItemBuilder(Material.ENDER_PEARL).setName("§aSpawn für Team 2").create();
|
||||
ItemStack core1team1 = new ItemBuilder(Material.BEACON).setName("§aRechter Core für Team 1").create();
|
||||
ItemStack core2team1 = new ItemBuilder(Material.BEACON).setName("§aLinker Core für Team 1").create();
|
||||
ItemStack core1team2 = new ItemBuilder(Material.BEACON).setName("§aRechter Core für Team 1").create();
|
||||
ItemStack core2team2 = new ItemBuilder(Material.BEACON).setName("§aLinker Core für Team 1").create();
|
||||
ItemStack replace = new ItemBuilder(Material.BARRIER).setName("§7Placeholder").setLore("§7Ersetzte dieses Item mit dem Item,", "§7was in der GUI angezeigt werden soll.").create();
|
||||
|
||||
inv.setItem(9, core2team1);
|
||||
inv.setItem(10, team1);
|
||||
inv.setItem(11, core1team1);
|
||||
|
||||
inv.setItem(15, core2team2);
|
||||
inv.setItem(16, team2);
|
||||
inv.setItem(17, core1team2);
|
||||
|
||||
inv.setItem(13, replace);
|
||||
|
||||
p.openInventory(inv);
|
||||
|
||||
playerInvs.put(p, inv);
|
||||
}
|
||||
else if (type == 2){
|
||||
Inventory inv = Bukkit.createInventory(null, 9*3, invName);
|
||||
|
||||
for (int i = 0; i < inv.getSize(); i++){
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, 1, 15).setName("").create());
|
||||
}
|
||||
ItemStack lobby = new ItemBuilder(Material.NETHER_STAR).setName("§aLobby").create();
|
||||
inv.setItem(13, lobby);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Plugins/Old/Necro-Cores/src/plugin.yml
Normal file
14
Plugins/Old/Necro-Cores/src/plugin.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
name: Cores
|
||||
version: 1.0
|
||||
api-version: 1.8
|
||||
main: de.craftix.cores.Main
|
||||
|
||||
commands:
|
||||
start:
|
||||
stats:
|
||||
inv:
|
||||
defaultmap:
|
||||
addarena:
|
||||
delarena:
|
||||
arenen:
|
||||
setup:
|
||||
Reference in New Issue
Block a user