Initial commit
This commit is contained in:
3
Plugins/Old/cc-arena/.idea/.gitignore
generated
vendored
Normal file
3
Plugins/Old/cc-arena/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
8
Plugins/Old/cc-arena/.idea/artifacts/Arena.xml
generated
Normal file
8
Plugins/Old/cc-arena/.idea/artifacts/Arena.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="Arena">
|
||||
<output-path>$USER_HOME$/Desktop</output-path>
|
||||
<root id="archive" name="Arena.jar">
|
||||
<element id="module-output" name="cc-arena" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
16
Plugins/Old/cc-arena/.idea/compiler.xml
generated
Normal file
16
Plugins/Old/cc-arena/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="cc-arena" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="cc-arena" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
||||
30
Plugins/Old/cc-arena/.idea/jarRepositories.xml
generated
Normal file
30
Plugins/Old/cc-arena/.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="sonatype" />
|
||||
<option name="name" value="sonatype" />
|
||||
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="papermc-repo" />
|
||||
<option name="name" value="papermc-repo" />
|
||||
<option name="url" value="https://papermc.io/repo/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-api/1.16.4-R0.1-SNAPSHOT/paper-api-1.16.4-R0.1-20210112.232830-147.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-api/1.16.4-R0.1-SNAPSHOT/paper-api-1.16.4-R0.1-20210112.232830-147-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-api/1.16.4-R0.1-SNAPSHOT/paper-api-1.16.4-R0.1-20210112.232830-147-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.google.code.findbugs:jsr305:1.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.google.code.gson:gson:2.8.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_guava_guava_21_0.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_google_guava_guava_21_0.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.google.guava:guava:21.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/21.0/guava-21.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/21.0/guava-21.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/21.0/guava-21.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.googlecode.json-simple:json-simple:1.1.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: commons-lang:commons-lang:2.6">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__junit_junit_4_10.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__junit_junit_4_10.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: junit:junit:4.10">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.10/junit-4.10.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.10/junit-4.10-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.10/junit-4.10-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: net.md-5:bungeecord-chat:1.16-R0.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.16-R0.3/bungeecord-chat-1.16-R0.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.16-R0.3/bungeecord-chat-1.16-R0.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.16-R0.3/bungeecord-chat-1.16-R0.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.hamcrest:hamcrest-core:1.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_8_0_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_8_0_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.ow2.asm:asm:8.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/8.0.1/asm-8.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/8.0.1/asm-8.0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/8.0.1/asm-8.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_analysis_8_0_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_analysis_8_0_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.ow2.asm:asm-analysis:8.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-analysis/8.0.1/asm-analysis-8.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-analysis/8.0.1/asm-analysis-8.0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-analysis/8.0.1/asm-analysis-8.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_commons_8_0_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_commons_8_0_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.ow2.asm:asm-commons:8.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-commons/8.0.1/asm-commons-8.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-commons/8.0.1/asm-commons-8.0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-commons/8.0.1/asm-commons-8.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_tree_8_0_1.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_ow2_asm_asm_tree_8_0_1.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.ow2.asm:asm-tree:8.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-tree/8.0.1/asm-tree-8.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-tree/8.0.1/asm-tree-8.0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-tree/8.0.1/asm-tree-8.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.slf4j:slf4j-api:1.7.25">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml
generated
Normal file
13
Plugins/Old/cc-arena/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.yaml:snakeyaml:1.26">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.26/snakeyaml-1.26-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.26/snakeyaml-1.26-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
11
Plugins/Old/cc-arena/.idea/libraries/spigot_1_16_4.xml
generated
Normal file
11
Plugins/Old/cc-arena/.idea/libraries/spigot_1_16_4.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="spigot-1.16.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../spigot-1.16.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../spigot-1.16.4.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
18
Plugins/Old/cc-arena/.idea/misc.xml
generated
Normal file
18
Plugins/Old/cc-arena/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</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/cc-arena/.idea/modules.xml
generated
Normal file
8
Plugins/Old/cc-arena/.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$/cc-arena.iml" filepath="$PROJECT_DIR$/cc-arena.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
Plugins/Old/cc-arena/.idea/vcs.xml
generated
Normal file
6
Plugins/Old/cc-arena/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
11
Plugins/Old/cc-arena/cc-arena.iml
Normal file
11
Plugins/Old/cc-arena/cc-arena.iml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<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" />
|
||||
</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.
Binary file not shown.
Binary file not shown.
10
Plugins/Old/cc-arena/out/production/cc-arena/plugin.yml
Normal file
10
Plugins/Old/cc-arena/out/production/cc-arena/plugin.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
name: CC-Arena
|
||||
version: 1.0
|
||||
api-version: 1.16
|
||||
main: de.craftix.arena.Main
|
||||
|
||||
commands:
|
||||
arenasetup:
|
||||
arenakit:
|
||||
arenamenu:
|
||||
arenastats:
|
||||
114
Plugins/Old/cc-arena/src/de/craftix/arena/Main.java
Normal file
114
Plugins/Old/cc-arena/src/de/craftix/arena/Main.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package de.craftix.arena;
|
||||
|
||||
import de.craftix.arena.commands.Menu;
|
||||
import de.craftix.arena.utils.Gamemanager;
|
||||
import de.craftix.arena.utils.Kitmanager;
|
||||
import de.craftix.arena.utils.Setup;
|
||||
import de.craftix.arena.utils.SqlSaving;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
|
||||
public static Main instance;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
MySQL.connect();
|
||||
sqlInitialisation(MySQL.isConnected());
|
||||
new Setup(this);
|
||||
new Kitmanager(this);
|
||||
new Menu(this);
|
||||
new Gamemanager(this);
|
||||
if (!SqlSaving.checkSetup()) System.out.println("[Arena] Setup noch nicht abgeschlossen!");
|
||||
File dict = new File(kitFilePrefix);
|
||||
if (!dict.exists()) dict.mkdirs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
MySQL.disconnect();
|
||||
}
|
||||
|
||||
private void sqlInitialisation(boolean isConnected){
|
||||
if (!isConnected) return;
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS " + MySQL.spawns + " (Type INT(10), World VARCHAR(100), x VARCHAR(100), y VARCHAR(100), z VARCHAR(100), yaw VARCHAR(100), pitch VARCHAR(100))");
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS " + MySQL.stats + " (UUID VARCHAR(100), Kills INT(100), Deaths INT(100), PlayedGames INT(100), Wins INT(100), Looses INT(100))");
|
||||
MySQL.insert("CREATE TABLE IF NOT EXISTS " + MySQL.kits + " (ID INT(10), Name VARCHAR(100), Path VARCHAR(100), Cost INT(10), UUID VARCHAR(100))");
|
||||
}
|
||||
|
||||
public static int checkTeamSize(){
|
||||
if (!SqlSaving.checkSetup()) return -1;
|
||||
int team1size = SqlSaving.getSpawns(SqlSaving.Spawntypes.team1).size();
|
||||
int team2size = SqlSaving.getSpawns(SqlSaving.Spawntypes.team2).size();
|
||||
if (team1size < team2size) return team1size;
|
||||
return team2size;
|
||||
}
|
||||
|
||||
public static ArrayList<Player> getAllPlayerInArena(){
|
||||
if (!SqlSaving.checkSetup()) return new ArrayList<>();
|
||||
ArrayList<Player> all = new ArrayList<>();
|
||||
Location middle = SqlSaving.getSpawn(SqlSaving.Spawntypes.arenaMiddle);
|
||||
for (Player s : Bukkit.getOnlinePlayers()){
|
||||
if (middle.distanceSquared(s.getLocation()) < 50) all.add(s);
|
||||
}
|
||||
return all;
|
||||
}
|
||||
|
||||
|
||||
public static final String kitFilePrefix = "plugins//CC-Arena//Kits//";
|
||||
|
||||
public static void WriteObjectToFile(Object serObj, String filepath) {
|
||||
|
||||
try {
|
||||
|
||||
FileOutputStream fileOut = new FileOutputStream(filepath);
|
||||
ObjectOutputStream objectOut = new ObjectOutputStream(fileOut);
|
||||
objectOut.writeObject(serObj);
|
||||
objectOut.close();
|
||||
//System.out.println("[Arena] The Object was succesfully written to a file");
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object ReadObjectFromFile(String filepath) {
|
||||
|
||||
try {
|
||||
|
||||
FileInputStream fileIn = new FileInputStream(filepath);
|
||||
ObjectInputStream objectIn = new ObjectInputStream(fileIn);
|
||||
|
||||
Object obj = objectIn.readObject();
|
||||
|
||||
//System.out.println("[Arena] The Object has been read from the file");
|
||||
objectIn.close();
|
||||
return obj;
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setInv(Player p, Inventory inv){
|
||||
p.getInventory().clear();
|
||||
for (int i = 0; i < p.getInventory().getSize(); i++){
|
||||
p.getInventory().setItem(i, inv.getItem(i));
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isInArena(Location loc){
|
||||
Location middle = SqlSaving.getSpawn(SqlSaving.Spawntypes.arenaMiddle);
|
||||
return middle.distanceSquared(loc) < 50;
|
||||
}
|
||||
}
|
||||
68
Plugins/Old/cc-arena/src/de/craftix/arena/MySQL.java
Normal file
68
Plugins/Old/cc-arena/src/de/craftix/arena/MySQL.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package de.craftix.arena;
|
||||
|
||||
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 = "Arena";
|
||||
public static final String user = "Arena";
|
||||
public static final String pass = "Arena";
|
||||
private static Connection con = null;
|
||||
|
||||
public static final String spawns = "arena_Spawns";
|
||||
public static final String stats = "arena_Stats";
|
||||
public static final String kits = "arena_Kits";
|
||||
|
||||
public static boolean connect(){
|
||||
String conString = "jdbc:mysql://" + server + ":" + port + "/" + db;
|
||||
try {
|
||||
con = DriverManager.getConnection(conString, user, pass);
|
||||
System.out.println("[Arena] MySQL connected successfully");
|
||||
return true;
|
||||
}catch (SQLException e){
|
||||
System.out.println("[Arena] MySQL connection failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean disconnect(){
|
||||
if (!isConnected()) return true;
|
||||
try {
|
||||
con.close();
|
||||
con = null;
|
||||
System.out.println("[Arena] MySQL disconnected");
|
||||
return true;
|
||||
}catch (SQLException e){
|
||||
System.out.println("[Arena] MySQL disconnecting failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isConnected(){
|
||||
return con != null;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
223
Plugins/Old/cc-arena/src/de/craftix/arena/commands/Menu.java
Normal file
223
Plugins/Old/cc-arena/src/de/craftix/arena/commands/Menu.java
Normal file
@@ -0,0 +1,223 @@
|
||||
package de.craftix.arena.commands;
|
||||
|
||||
import de.craftix.arena.Main;
|
||||
import de.craftix.arena.utils.*;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.chat.hover.content.Content;
|
||||
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.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class Menu implements CommandExecutor, Listener {
|
||||
|
||||
public Menu(Main plugin){
|
||||
PluginCommand cmd = plugin.getCommand("arenamenu");
|
||||
cmd.setExecutor(this::onCommand);
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (sender instanceof Player) openMainMenu((Player)sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final String mainMenuName = "§aArena - ClymCity";
|
||||
public static void openMainMenu(Player p){
|
||||
Inventory inv = Bukkit.createInventory(null, 3*9, mainMenuName);
|
||||
for (int i = 0; i < inv.getSize(); i++) inv.setItem(i, new ItemBuilder(Material.GRAY_STAINED_GLASS_PANE).setName(" ").create());
|
||||
ItemStack kits = new ItemBuilder(Material.CHEST).setName("§aKit wählen").create();
|
||||
ItemStack create = new ItemBuilder(Material.NAME_TAG).setName("§aSpiel erstellen").create();
|
||||
ItemStack join = new ItemBuilder(Material.ENDER_PEARL).setName("§aSpiel beitreten").create();
|
||||
ItemStack spec = new ItemBuilder(Material.ENDER_EYE).setName("§aZuschauen").create();
|
||||
ItemStack leave = new ItemBuilder(Material.BARRIER).setName("§aSpiel verlassen").create();
|
||||
ItemStack start = new ItemBuilder(Material.NETHER_STAR).setName("§aSpiel starten").create();
|
||||
ItemStack invite = new ItemBuilder(Material.PLAYER_HEAD).setHeadOwner(p).setName("§aSpieler einladen").create();
|
||||
|
||||
if (Gamemanager.activeGame == null){
|
||||
inv.setItem(11, create);
|
||||
inv.setItem(15, kits);
|
||||
}else {
|
||||
if (Gamemanager.activeGame.isRunning){
|
||||
if (Gamemanager.activeGame.playerIsJoined(p)){
|
||||
inv.setItem(13, leave);
|
||||
}else {
|
||||
inv.setItem(15, kits);
|
||||
inv.setItem(11, spec);
|
||||
}
|
||||
}else {
|
||||
if (Gamemanager.activeGame.playerIsJoined(p)){
|
||||
inv.setItem(15, kits);
|
||||
inv.setItem(11, leave);
|
||||
}else {
|
||||
inv.setItem(15, kits);
|
||||
inv.setItem(11, join);
|
||||
}
|
||||
if (Gamemanager.activeGame.owner.equals(p)){
|
||||
inv.setItem(15, kits);
|
||||
inv.setItem(11, start);
|
||||
inv.setItem(13, invite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInvClick(InventoryClickEvent event){
|
||||
if (event.getClickedInventory() == null) return;
|
||||
if (event.getCurrentItem() == null) return;
|
||||
Player p = (Player) event.getWhoClicked();
|
||||
if (event.getView().getTitle().equals(mainMenuName)){
|
||||
event.setCancelled(true);
|
||||
switch (event.getCurrentItem().getItemMeta().getDisplayName()){
|
||||
case "§aKit wählen":
|
||||
Kitmanager.openListMenu(p);
|
||||
break;
|
||||
case "§aSpiel erstellen":
|
||||
openCreateGameInv(p, new Gamemanager.Game(p));
|
||||
break;
|
||||
case "§aSpiel beitreten":
|
||||
if (Gamemanager.activeGame.witherMode){
|
||||
Gamemanager.activeGame.team1.add(p);
|
||||
p.sendMessage("§aDu bist dem Spiel beigetreten");
|
||||
p.closeInventory();
|
||||
break;
|
||||
}
|
||||
openJoinGameInv(p, Gamemanager.activeGame);
|
||||
break;
|
||||
case "§aZuschauen":
|
||||
p.closeInventory();
|
||||
ArrayList<Location> spawns = SqlSaving.getSpawns(SqlSaving.Spawntypes.grandstand);
|
||||
if (spawns == null) break;
|
||||
p.teleport(spawns.get(new Random().nextInt(spawns.size() - 1)));
|
||||
break;
|
||||
case "§aSpiel verlassen":
|
||||
Gamemanager.leaveGame(p);
|
||||
p.closeInventory();
|
||||
break;
|
||||
case "§aSpiel starten":
|
||||
Gamemanager.startGame(Gamemanager.activeGame);
|
||||
p.closeInventory();
|
||||
break;
|
||||
case "§aSpieler einladen":
|
||||
openInviteInv(p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (event.getView().getTitle().equals(joinGameInvName)){
|
||||
event.setCancelled(true);
|
||||
switch (event.getCurrentItem().getItemMeta().getDisplayName()){
|
||||
case "§4Team Rot beitreten":
|
||||
if (Gamemanager.activeGame.team1.size() > Main.checkTeamSize()){
|
||||
p.sendMessage("§cDieses Team ist voll!");
|
||||
}else {
|
||||
Gamemanager.activeGame.team1.add(p);
|
||||
p.sendMessage("§aDu bist dem Team §4Rot §abeigetreten");
|
||||
}
|
||||
p.closeInventory();
|
||||
break;
|
||||
case "§9Team Blau beitreten":
|
||||
if (Gamemanager.activeGame.team2.size() > Main.checkTeamSize()){
|
||||
p.sendMessage("§cDieses Team ist voll!");
|
||||
}else {
|
||||
Gamemanager.activeGame.team2.add(p);
|
||||
p.sendMessage("§aDu bist dem Team §9Blau §abeigetreten");
|
||||
}
|
||||
p.closeInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (event.getView().getTitle().equals(createGameInvName)){
|
||||
event.setCancelled(true);
|
||||
switch (event.getCurrentItem().getItemMeta().getDisplayName()){
|
||||
case "§aWither Modus":
|
||||
Gamemanager.activeGame.witherMode = true;
|
||||
Gamemanager.activeGame.team1.add(p);
|
||||
p.closeInventory();
|
||||
p.sendMessage("§aSpiel erstellt, Lade deine Freunde über das Menü ein");
|
||||
break;
|
||||
case "§aNormaler Modus":
|
||||
Gamemanager.activeGame.witherMode = false;
|
||||
openJoinGameInv(p, Gamemanager.activeGame);
|
||||
p.sendMessage("§aSpiel erstellt, Lade deine Freunde über das Menü ein");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (event.getView().getTitle().equals(invitePlayerInvName)){
|
||||
if (event.getCurrentItem().getType().equals(Material.PLAYER_HEAD)){
|
||||
Player t = ((SkullMeta) event.getCurrentItem().getItemMeta()).getOwningPlayer().getPlayer();
|
||||
p.sendMessage("§aDu hast §6" + t.getName() + " §aeingeladen");
|
||||
p.closeInventory();
|
||||
TextComponent text = new TextComponent("§7[§aArena§7] §aEinladung erhalten von: §6" + p.getName());
|
||||
text.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arenamenu"));
|
||||
text.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Clicke zum Annehemn").create()));
|
||||
t.spigot().sendMessage(text);
|
||||
//t.sendMessage("§7[§aArena§7] §aEinladung erhalten von: §6" + p.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String createGameInvName = "§aSpiel erstellen";
|
||||
public void openCreateGameInv(Player p, Gamemanager.Game game){
|
||||
Gamemanager.activeGame = game;
|
||||
Inventory inv = Bukkit.createInventory(null, 3*9, createGameInvName);
|
||||
for (int i = 0; i < inv.getSize(); i++) inv.setItem(i, new ItemBuilder(Material.GRAY_STAINED_GLASS_PANE).setName(" ").create());
|
||||
ItemStack wither = new ItemBuilder(Material.NETHER_STAR).setName("§aWither Modus").setLore("§7Bei diesem Modus bekämpfen alle Spieler den Wither").create();
|
||||
ItemStack normal = new ItemBuilder(Material.DIAMOND_SWORD).setName("§aNormaler Modus").setLore("§7Bei diesem Modus bekämpfen sich 2 Teams").create();
|
||||
inv.setItem(11, normal);
|
||||
inv.setItem(15, wither);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
public static final String joinGameInvName = "§aSpiel beitreten - Team wählen";
|
||||
public void openJoinGameInv(Player p, Gamemanager.Game game){
|
||||
Inventory inv = Bukkit.createInventory(null, 3*9, joinGameInvName);
|
||||
for (int i = 0; i < inv.getSize(); i++) inv.setItem(i, new ItemBuilder(Material.GRAY_STAINED_GLASS_PANE).setName(" ").create());
|
||||
ItemStack red = new ItemBuilder(Material.RED_WOOL).setName("§4Team Rot beitreten").setLore("§7Spieler:").create();
|
||||
ItemStack blue = new ItemBuilder(Material.BLUE_WOOL).setName("§9Team Blau beitreten").setLore("§7Spieler:").create();
|
||||
for (Player allRed : game.team1) red = new ItemEditor(red).addLore("§7" + allRed.getName());
|
||||
for (Player allBlue : game.team2) blue = new ItemEditor(blue).addLore("§7" + allBlue.getName());
|
||||
inv.setItem(11, red);
|
||||
inv.setItem(15, blue);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
public static final String invitePlayerInvName = "§aSpieler einladen";
|
||||
public void openInviteInv(Player p){
|
||||
Inventory inv = Bukkit.createInventory(null, 6*9, invitePlayerInvName);
|
||||
ArrayList<Player> all = Main.getAllPlayerInArena();
|
||||
if (all.size() > inv.getSize()){
|
||||
for (int i = 0; i < inv.getSize(); i++){
|
||||
if (all.get(i).getUniqueId().equals(p.getUniqueId())) continue;
|
||||
inv.setItem(i, new ItemBuilder(Material.PLAYER_HEAD).setHeadOwner(all.get(i)).setName("§a" + all.get(i).getName()).create());
|
||||
}
|
||||
}else {
|
||||
int slot = 0;
|
||||
for (Player t : all){
|
||||
if (t.getUniqueId().equals(p.getUniqueId())) continue;
|
||||
inv.setItem(slot, new ItemBuilder(Material.PLAYER_HEAD).setHeadOwner(t).setName("§a" + t.getName()).create());
|
||||
slot++;
|
||||
}
|
||||
}
|
||||
p.openInventory(inv);
|
||||
}
|
||||
}
|
||||
215
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Gamemanager.java
Normal file
215
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Gamemanager.java
Normal file
@@ -0,0 +1,215 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import de.craftix.arena.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
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.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Gamemanager implements Listener {
|
||||
|
||||
public static Game activeGame;
|
||||
|
||||
public Gamemanager(Main plugin) {
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
public static class Game {
|
||||
public boolean isRunning = false;
|
||||
public boolean witherMode = false;
|
||||
public Player owner;
|
||||
|
||||
public ArrayList<Player> team1 = new ArrayList<>();
|
||||
public ArrayList<Player> team2 = new ArrayList<>();
|
||||
public HashMap<UUID, Inventory> playerInvs = new HashMap<>();
|
||||
|
||||
public Game(Player owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public boolean playerIsJoined(Player p) {
|
||||
if (team1.contains(p)) return true;
|
||||
if (team2.contains(p)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public ArrayList<Player> getAllPlayers() {
|
||||
ArrayList<Player> all = new ArrayList<>();
|
||||
all.addAll(team1);
|
||||
all.addAll(team2);
|
||||
return all;
|
||||
}
|
||||
|
||||
public void setInv(Player p) {
|
||||
Inventory inv = Bukkit.createInventory(p, 54, p.getName());
|
||||
inv.setContents(p.getInventory().getContents());
|
||||
playerInvs.put(p.getUniqueId(), inv);
|
||||
}
|
||||
|
||||
public Inventory getInv(Player p) {
|
||||
return playerInvs.get(p.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
public static void leaveGame(Player p) {
|
||||
Inventory inv = activeGame.getInv(p);
|
||||
Main.setInv(p, inv);
|
||||
p.teleport(SqlSaving.getSpawn(SqlSaving.Spawntypes.lobby));
|
||||
p.sendMessage("§cSpiel verlassen");
|
||||
activeGame.team1.remove(p);
|
||||
activeGame.team2.remove(p);
|
||||
if (activeGame.witherMode && activeGame.team1.size() == 0) {
|
||||
stopGame(0);
|
||||
return;
|
||||
}
|
||||
if (activeGame.isRunning) {
|
||||
if (activeGame.team1.size() == 0) stopGame(2);
|
||||
if (activeGame.team1.size() == 0) stopGame(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void startGame(Game game) {
|
||||
for (Player all : game.getAllPlayers()) if (!SqlSaving.hasStats(all)) SqlSaving.createStats(all);
|
||||
if ((game.team1.size() == 0 || game.team2.size() == 0) && !game.witherMode) {
|
||||
game.owner.sendMessage("§cSpiel wird nicht gestartet, Ein team hat keine Spieler!");
|
||||
return;
|
||||
}
|
||||
game.isRunning = true;
|
||||
ArrayList<Location> team1Spawns = SqlSaving.getSpawns(SqlSaving.Spawntypes.team1);
|
||||
ArrayList<Location> team2Spawns = SqlSaving.getSpawns(SqlSaving.Spawntypes.team2);
|
||||
Random rand = new Random();
|
||||
for (Player t1 : game.team1) t1.teleport(team1Spawns.get(rand.nextInt(team1Spawns.size() - 1)));
|
||||
for (Player t2 : game.team1) t2.teleport(team1Spawns.get(rand.nextInt(team2Spawns.size() - 1)));
|
||||
for (Player all : game.getAllPlayers()) {
|
||||
game.setInv(all);
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(all);
|
||||
stats.playedGames++;
|
||||
SqlSaving.setStats(stats);
|
||||
all.sendTitle("§aDas Spiel beginnt...", "", 5, 40, 4);
|
||||
Kitmanager.preparePlayer(all, SqlSaving.getPlayerKit(all));
|
||||
}
|
||||
if (game.witherMode) System.out.println("[Wither gespawnt]"); //spawn Wither
|
||||
}
|
||||
|
||||
public static void stopGame(int winnerTeamID) {
|
||||
if (activeGame.getAllPlayers().size() == 0) {
|
||||
System.out.println("[Arena] Spiel wurde wegen zu wenig Spielern abgebrochen");
|
||||
}
|
||||
for (Player all : activeGame.getAllPlayers()) {
|
||||
Main.setInv(all, activeGame.getInv(all));
|
||||
all.teleport(SqlSaving.getSpawn(SqlSaving.Spawntypes.lobby));
|
||||
}
|
||||
if (activeGame.witherMode) {
|
||||
if (winnerTeamID == -1) {
|
||||
for (Player all : activeGame.getAllPlayers()) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(all);
|
||||
stats.looses++;
|
||||
SqlSaving.setStats(stats);
|
||||
all.sendTitle("§cDer Wither hat gewonnen", "", 10, 100, 10);
|
||||
}
|
||||
} else if (winnerTeamID == -2) {
|
||||
for (Player all : activeGame.getAllPlayers()) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(all);
|
||||
stats.wins++;
|
||||
SqlSaving.setStats(stats);
|
||||
all.sendTitle("§aDie Spieler haben gewonnen", "", 10, 100, 10);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (winnerTeamID == 1) {
|
||||
for (Player p : activeGame.team1) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(p);
|
||||
stats.wins++;
|
||||
SqlSaving.setStats(stats);
|
||||
}
|
||||
for (Player p : activeGame.team2) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(p);
|
||||
stats.looses++;
|
||||
SqlSaving.setStats(stats);
|
||||
}
|
||||
for (Player all : activeGame.getAllPlayers())
|
||||
all.sendTitle("§aTeam §4Rot §ahat gewonnen", "", 10, 100, 10);
|
||||
} else {
|
||||
for (Player p : activeGame.team2) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(p);
|
||||
stats.wins++;
|
||||
SqlSaving.setStats(stats);
|
||||
}
|
||||
for (Player p : activeGame.team1) {
|
||||
SqlSaving.Stats stats = SqlSaving.getStats(p);
|
||||
stats.looses++;
|
||||
SqlSaving.setStats(stats);
|
||||
}
|
||||
for (Player all : activeGame.getAllPlayers())
|
||||
all.sendTitle("§aTeam §9Blau §ahat gewonnen", "", 10, 100, 10);
|
||||
}
|
||||
}
|
||||
activeGame = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
Player p = event.getPlayer();
|
||||
if (!SqlSaving.hasStats(p)) SqlSaving.createStats(p);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onQuit(PlayerQuitEvent event) {
|
||||
if (activeGame == null) return;
|
||||
leaveGame(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlace(BlockPlaceEvent event) {
|
||||
Block block = event.getBlock();
|
||||
if (Main.isInArena(block.getLocation())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBreak(BlockBreakEvent event) {
|
||||
Block block = event.getBlock();
|
||||
if (Main.isInArena(block.getLocation())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onExplode(BlockExplodeEvent event) {
|
||||
Block block = event.getBlock();
|
||||
if (Main.isInArena(block.getLocation())) event.blockList().clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onExplodeEntity(EntityExplodeEvent event) {
|
||||
if (Main.isInArena(event.getLocation())) event.blockList().clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
if (Main.isInArena(event.getPlayer().getLocation())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDeath(PlayerDeathEvent event) {
|
||||
if (!activeGame.getAllPlayers().contains(event.getEntity())) return;
|
||||
event.setDeathMessage(null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ItemBuilder {
|
||||
|
||||
public Material material;
|
||||
public String name;
|
||||
public int amount = 1;
|
||||
public int damage = 1;
|
||||
public HashMap<Enchantment, Integer> enchantments = new HashMap<>();
|
||||
public boolean unbreakable = false;
|
||||
public ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
private boolean isHead = false;
|
||||
private OfflinePlayer headOwner;
|
||||
|
||||
public ItemBuilder(Material mat){
|
||||
material = mat;
|
||||
}
|
||||
|
||||
public ItemBuilder(Material mat, int amount){
|
||||
material = mat;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
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 setUnbreakable(boolean value){
|
||||
unbreakable = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder setLore(String... lore){
|
||||
for (String s : lore){
|
||||
this.lore.add(s);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder setHeadOwner(OfflinePlayer p){
|
||||
isHead = true;
|
||||
headOwner = p;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack create(){
|
||||
if (isHead){
|
||||
ItemStack head = new ItemStack(material);
|
||||
SkullMeta meta = (SkullMeta) head.getItemMeta();
|
||||
meta.setOwningPlayer(headOwner);
|
||||
if (name != null) meta.setDisplayName(name);
|
||||
if (lore.size() != 0) meta.setLore(lore);
|
||||
head.setItemMeta(meta);
|
||||
return head;
|
||||
}
|
||||
ItemStack item = new ItemStack(material, amount);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
for (Enchantment e : enchantments.keySet()){
|
||||
meta.addEnchant(e, enchantments.get(e), true);
|
||||
}
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName(name);
|
||||
meta.setUnbreakable(unbreakable);
|
||||
item.setItemMeta(meta);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ItemEditor {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
public ItemEditor(ItemStack item){
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public ItemStack setGlowing(boolean value){
|
||||
if (!value) return item;
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addEnchant(Enchantment.DURABILITY, 1, true);
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public ItemStack setName(String name){
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(name.replace('&', '§'));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public ItemStack addLore(String... text){
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
ArrayList<String> lore = (ArrayList<String>) meta.getLore();
|
||||
lore.addAll(Arrays.asList(text));
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
70
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Kit.java
Normal file
70
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Kit.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Kit implements Serializable {
|
||||
|
||||
public String name;
|
||||
public String path;
|
||||
public int id;
|
||||
public int cost;
|
||||
public KitItem invItem = new KitItem();
|
||||
public KitItem helmet = new KitItem();
|
||||
public KitItem chestplate = new KitItem();
|
||||
public KitItem leggins = new KitItem();
|
||||
public KitItem boots = new KitItem();
|
||||
public HashMap<Integer, KitItem> items = new HashMap<>();
|
||||
|
||||
public Kit(String name) {this.name = name;}
|
||||
|
||||
public static class KitItem implements Serializable {
|
||||
public String matName;
|
||||
public String name;
|
||||
public HashMap<String, Integer> enchantments = new HashMap<>();
|
||||
public boolean isNull = false;
|
||||
|
||||
public KitItem convert(ItemStack item){
|
||||
if (item == null) {
|
||||
isNull = true;
|
||||
return this;
|
||||
}
|
||||
this.matName = item.getType().name();
|
||||
this.name = item.getItemMeta().getDisplayName();
|
||||
for (Enchantment e : item.getEnchantments().keySet()){
|
||||
enchantments.put(e.getKey().getKey(), item.getEnchantmentLevel(e));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack convert(){
|
||||
if (isNull) return null;
|
||||
if (Material.getMaterial(matName) == null) return null;
|
||||
ItemStack item = new ItemStack(Material.getMaterial(matName));
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(name);
|
||||
for (String e : enchantments.keySet()){
|
||||
meta.addEnchant(Enchantment.getByKey(NamespacedKey.minecraft(e)), enchantments.get(e), true);
|
||||
}
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "KitItem{" +
|
||||
"matName='" + matName + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", enchantments=" + enchantments +
|
||||
", isNull=" + isNull +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
141
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Kitmanager.java
Normal file
141
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Kitmanager.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import de.craftix.arena.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Kitmanager implements CommandExecutor, Listener {
|
||||
|
||||
public Kitmanager(Main plugin){
|
||||
PluginCommand cmd = plugin.getCommand("arenakit");
|
||||
cmd.setExecutor(this::onCommand);
|
||||
cmd.setPermission(Setup.setupPermission);
|
||||
cmd.setPermissionMessage("§cHierzu hast du keine Rechte!");
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) return true;
|
||||
Player p = (Player) sender;
|
||||
//arenakit create <name>
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("create")){
|
||||
if (SqlSaving.getKitID(args[1]) != -1){
|
||||
p.sendMessage("§cDieses Kit existiert bereits!");
|
||||
return true;
|
||||
}
|
||||
SqlSaving.setKit(new Kit(args[1]), true);
|
||||
p.sendMessage("§aDas Kit §6" + args[1] + " §awurde erstellt");
|
||||
return true;
|
||||
}
|
||||
//arenakit edit <name>
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("edit")){
|
||||
Kit kit = SqlSaving.getKit(SqlSaving.getKitID(args[1]));
|
||||
if (kit == null){
|
||||
p.sendMessage("§cDieses Kit existiert nicht!");
|
||||
return true;
|
||||
}
|
||||
kit.helmet = new Kit.KitItem().convert(p.getInventory().getHelmet());
|
||||
kit.chestplate = new Kit.KitItem().convert(p.getInventory().getChestplate());
|
||||
kit.leggins = new Kit.KitItem().convert(p.getInventory().getLeggings());
|
||||
kit.boots = new Kit.KitItem().convert(p.getInventory().getBoots());
|
||||
kit.items.clear();
|
||||
for (int i = 0; i < p.getInventory().getSize(); i++){
|
||||
kit.items.put(i, new Kit.KitItem().convert(p.getInventory().getItem(i)));
|
||||
}
|
||||
SqlSaving.setKit(kit, false);
|
||||
p.sendMessage("§aDein Inventar wurde als Kitvorlage für §6" + kit.name + " §averwendet");
|
||||
return true;
|
||||
}
|
||||
//arenakit delete <name>
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("delete")){
|
||||
Kit kit = SqlSaving.getKit(SqlSaving.getKitID(args[1]));
|
||||
if (kit == null){
|
||||
p.sendMessage("§cDieses Kit existiert nicht!");
|
||||
return true;
|
||||
}
|
||||
SqlSaving.deleteKit(kit);
|
||||
p.sendMessage("§cDas Kit wurde erfolgreich gelöscht");
|
||||
return true;
|
||||
}
|
||||
//arenakit list
|
||||
if (args.length == 1 && args[0].equalsIgnoreCase("list")){
|
||||
openListMenu(p);
|
||||
return true;
|
||||
}
|
||||
//arenakit setItem <name>
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("setitem")){
|
||||
Kit kit = SqlSaving.getKit(SqlSaving.getKitID(args[1]));
|
||||
if (kit == null){
|
||||
p.sendMessage("§cDieses Kit existiert nicht!");
|
||||
return true;
|
||||
}
|
||||
kit.invItem = new Kit.KitItem().convert(p.getInventory().getItemInMainHand());
|
||||
SqlSaving.setKit(kit, false);
|
||||
p.sendMessage("§aDas Item wurde erfolgreich zum Kit §6" + kit.name + " §ahinzugefügt");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final String listMenuName = "§6Kits";
|
||||
public static void openListMenu(Player p){
|
||||
ArrayList<Kit> kits = SqlSaving.getAllKits();
|
||||
if (kits == null || kits.size() == 0){
|
||||
p.sendMessage("§cKeine Kits vorhanden!");
|
||||
return;
|
||||
}
|
||||
int size = 3*9;
|
||||
if (kits.size() > 3*9) size = 6*9;
|
||||
Inventory inv = Bukkit.createInventory(null, size, listMenuName);
|
||||
int slot = 0;
|
||||
for (Kit kit : kits){
|
||||
inv.setItem(slot, new ItemEditor(kit.invItem.convert()).setName(kit.name));
|
||||
slot++;
|
||||
}
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInvClick(InventoryClickEvent event){
|
||||
if (event.getView() == null || event.getClickedInventory() == null) return;
|
||||
if (!event.getView().getTitle().equals(listMenuName)) return;
|
||||
Player p = (Player) event.getWhoClicked();
|
||||
if (event.getCurrentItem() == null) return;
|
||||
String kitName = event.getCurrentItem().getItemMeta().getDisplayName();
|
||||
if (kitName == null || kitName.equals(" ")) return;
|
||||
SqlSaving.setPlayerKit(p, SqlSaving.getKit(SqlSaving.getKitID(kitName)));
|
||||
p.sendMessage("§aDu hast das Kit " + kitName + " §agewählt");
|
||||
p.closeInventory();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
public static void preparePlayer(Player p, Kit kit){
|
||||
if (kit == null){
|
||||
kit = SqlSaving.getKit(0);
|
||||
if (kit == null){
|
||||
System.out.println("[Arena] Es wurde noch kein Kit erstellt, es könnte zu Fehlern beim Spiel kommen");
|
||||
}
|
||||
}
|
||||
p.getInventory().clear();
|
||||
if (kit.items != null && kit.items.size() != 0) for (Integer slot : kit.items.keySet()){
|
||||
if (kit.items.get(slot) == null) continue;
|
||||
p.getInventory().setItem(slot, kit.items.get(slot).convert());
|
||||
}
|
||||
|
||||
p.getInventory().setHelmet(kit.helmet.convert());
|
||||
p.getInventory().setChestplate(kit.chestplate.convert());
|
||||
p.getInventory().setLeggings(kit.leggins.convert());
|
||||
p.getInventory().setBoots(kit.boots.convert());
|
||||
}
|
||||
}
|
||||
104
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Setup.java
Normal file
104
Plugins/Old/cc-arena/src/de/craftix/arena/utils/Setup.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import de.craftix.arena.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
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;
|
||||
|
||||
public class Setup implements CommandExecutor, Listener {
|
||||
|
||||
public static final String setupPermission = "arena.setup";
|
||||
private static final String setupItemName = "§2Arena Setup";
|
||||
private static final String setupInvName = "§2Arena Setup";
|
||||
|
||||
|
||||
private Inventory inv;
|
||||
|
||||
public Setup(Main plugin){
|
||||
PluginCommand cmd = plugin.getCommand("arenasetup");
|
||||
cmd.setExecutor(this::onCommand);
|
||||
cmd.setPermission(setupPermission);
|
||||
cmd.setPermissionMessage("§cHierzu hast du keine Rechte!");
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
inv = Bukkit.createInventory(null, 3*9, setupInvName);
|
||||
for (int i = 0; i < inv.getSize(); i++) inv.setItem(i, new ItemBuilder(Material.GRAY_STAINED_GLASS_PANE).setName(" ").create());
|
||||
inv.setItem(10, new ItemBuilder(Material.ENDER_PEARL).setName("§aSpawns für Team 1").create());
|
||||
inv.setItem(12, new ItemBuilder(Material.FIREWORK_STAR).setName("§aArenamitte").create());
|
||||
inv.setItem(13, new ItemBuilder(Material.HEART_OF_THE_SEA).setName("§aLobby").create());
|
||||
inv.setItem(14, new ItemBuilder(Material.FIREWORK_STAR).setName("§aSpawns auf der Tribüne").create());
|
||||
inv.setItem(16, new ItemBuilder(Material.ENDER_PEARL).setName("§aSpawns für Team 2").create());
|
||||
inv.setItem(inv.getSize() - 1, new ItemBuilder(Material.BARRIER).setName("§cEinstellungen zurücksetzen").create());
|
||||
|
||||
if (SqlSaving.getSpawn(SqlSaving.Spawntypes.lobby) != null) inv.setItem(13, new ItemEditor(inv.getItem(13)).setGlowing(true));
|
||||
if (SqlSaving.getSpawn(SqlSaving.Spawntypes.grandstand) != null) inv.setItem(12, new ItemEditor(inv.getItem(12)).setGlowing(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) return false;
|
||||
Player p = (Player)sender;
|
||||
p.getInventory().addItem(new ItemBuilder(Material.NETHER_STAR).setName(setupInvName).create());
|
||||
p.sendMessage("§aSetup Item erhalten...");
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event){
|
||||
if (event.getItem() == null) return;
|
||||
if (!event.getItem().getItemMeta().getDisplayName().equals(setupItemName)) return;
|
||||
if (event.getPlayer().hasPermission(setupPermission)) event.getPlayer().openInventory(inv);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInvClick(InventoryClickEvent event){
|
||||
if (event.getView() == null) return;
|
||||
if (!event.getView().getTitle().equals(setupItemName)) return;
|
||||
event.setCancelled(true);
|
||||
Player p = (Player) event.getWhoClicked();
|
||||
switch (event.getSlot()){
|
||||
case 10:
|
||||
SqlSaving.addSpawn(p.getLocation(), SqlSaving.Spawntypes.team1);
|
||||
p.sendMessage("§aSpawn hinzugefügt!");
|
||||
p.closeInventory();
|
||||
break;
|
||||
case 12:
|
||||
SqlSaving.setSpawn(p.getLocation(), SqlSaving.Spawntypes.arenaMiddle);
|
||||
inv.setItem(event.getSlot(), new ItemEditor(inv.getItem(event.getSlot())).setGlowing(true));
|
||||
p.sendMessage("§aSpawn gesetzt!");
|
||||
p.closeInventory();
|
||||
break;
|
||||
case 13:
|
||||
SqlSaving.setSpawn(p.getLocation(), SqlSaving.Spawntypes.lobby);
|
||||
inv.setItem(event.getSlot(), new ItemEditor(inv.getItem(event.getSlot())).setGlowing(true));
|
||||
p.sendMessage("§aSpawn gesetzt!");
|
||||
p.closeInventory();
|
||||
break;
|
||||
case 14:
|
||||
SqlSaving.addSpawn(p.getLocation(), SqlSaving.Spawntypes.grandstand);
|
||||
p.sendMessage("§aSpawn hinzugefügt!");
|
||||
p.closeInventory();
|
||||
break;
|
||||
case 16:
|
||||
SqlSaving.addSpawn(p.getLocation(), SqlSaving.Spawntypes.team2);
|
||||
p.sendMessage("§aSpawn hinzugefügt!");
|
||||
p.closeInventory();
|
||||
break;
|
||||
}
|
||||
if (event.getSlot() == inv.getSize() - 1){
|
||||
SqlSaving.resetSpawns();
|
||||
inv.setItem(12, new ItemBuilder(Material.FIREWORK_STAR).setName("§aArenamitte").create());
|
||||
inv.setItem(13, new ItemBuilder(Material.HEART_OF_THE_SEA).setName("§aLobby").create());
|
||||
p.sendMessage("§aAlle Spawns zurückgesetzt!");
|
||||
p.closeInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
244
Plugins/Old/cc-arena/src/de/craftix/arena/utils/SqlSaving.java
Normal file
244
Plugins/Old/cc-arena/src/de/craftix/arena/utils/SqlSaving.java
Normal file
@@ -0,0 +1,244 @@
|
||||
package de.craftix.arena.utils;
|
||||
|
||||
import de.craftix.arena.Main;
|
||||
import de.craftix.arena.MySQL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SqlSaving {
|
||||
|
||||
//Spawns
|
||||
public static class Spawntypes {
|
||||
public static final int lobby = 0;
|
||||
public static final int arenaMiddle = 1;
|
||||
public static final int grandstand = 2;
|
||||
public static final int team1 = 3;
|
||||
public static final int team2 = 4;
|
||||
}
|
||||
|
||||
public static Location getSpawn(int type){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM " + MySQL.spawns + " WHERE Type = " + type);
|
||||
if (rs.next()){
|
||||
World world = Bukkit.getWorld(rs.getString("World"));
|
||||
double x = Double.parseDouble(rs.getString("x"));
|
||||
double y = Double.parseDouble(rs.getString("y"));
|
||||
double z = Double.parseDouble(rs.getString("z"));
|
||||
float yaw = Float.parseFloat(rs.getString("yaw"));
|
||||
float pitch = Float.parseFloat(rs.getString("pitch"));
|
||||
return new Location(world, x, y, z, yaw, pitch);
|
||||
}
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArrayList<Location> getSpawns(int type){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM " + MySQL.spawns + " WHERE Type = " + type);
|
||||
ArrayList<Location> spawns = new ArrayList<>();
|
||||
while (rs.next()){
|
||||
World world = Bukkit.getWorld(rs.getString("World"));
|
||||
double x = Double.parseDouble(rs.getString("x"));
|
||||
double y = Double.parseDouble(rs.getString("y"));
|
||||
double z = Double.parseDouble(rs.getString("z"));
|
||||
float yaw = Float.parseFloat(rs.getString("yaw"));
|
||||
float pitch = Float.parseFloat(rs.getString("pitch"));
|
||||
spawns.add(new Location(world, x, y, z, yaw, pitch));
|
||||
}
|
||||
return spawns;
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addSpawn(Location spawn, int type){
|
||||
String world = spawn.getWorld().getName();
|
||||
String x = String.valueOf(spawn.getX());
|
||||
String y = String.valueOf(spawn.getY());
|
||||
String z = String.valueOf(spawn.getZ());
|
||||
String yaw = String.valueOf(spawn.getYaw());
|
||||
String pitch = String.valueOf(spawn.getPitch());
|
||||
MySQL.insert("INSERT INTO " + MySQL.spawns + " (Type, World, x, y, z, yaw, pitch) VALUES (" + type + ", \"" + world + "\", \"" + x + "\", \"" + y + "\", \"" + z + "\", \"" + yaw + "\", \"" + pitch + "\")");
|
||||
}
|
||||
|
||||
public static void addSpawns(ArrayList<Location> spawns, int type){
|
||||
for (Location spawn : spawns){
|
||||
String world = spawn.getWorld().getName();
|
||||
String x = String.valueOf(spawn.getX());
|
||||
String y = String.valueOf(spawn.getY());
|
||||
String z = String.valueOf(spawn.getZ());
|
||||
String yaw = String.valueOf(spawn.getYaw());
|
||||
String pitch = String.valueOf(spawn.getPitch());
|
||||
MySQL.insert("INSERT INTO " + MySQL.spawns + " (Type, World, x, y, z, yaw, pitch) VALUES (" + type + ", \"" + world + "\", \"" + x + "\", \"" + y + "\", \"" + z + "\", \"" + yaw + "\", \"" + pitch + "\")"); }
|
||||
}
|
||||
|
||||
public static void setSpawn(Location spawn, int type){
|
||||
MySQL.insert("DELETE FROM " + MySQL.spawns + " WHERE Type = " + type);
|
||||
addSpawn(spawn, type);
|
||||
}
|
||||
|
||||
public static void setSpawns(ArrayList<Location> spawns, int type){
|
||||
MySQL.insert("DELETE FROM " + MySQL.spawns + " WHERE Type = " + type);
|
||||
addSpawns(spawns, type);
|
||||
}
|
||||
|
||||
public static void resetSpawns(){
|
||||
MySQL.insert("DELETE FROM " + MySQL.spawns);
|
||||
}
|
||||
|
||||
public static boolean checkSetup(){
|
||||
ArrayList<Location> spawns = new ArrayList<>();
|
||||
spawns.add(getSpawn(Spawntypes.lobby));
|
||||
spawns.add(getSpawn(Spawntypes.arenaMiddle));
|
||||
spawns.add(getSpawn(Spawntypes.grandstand));
|
||||
spawns.add(getSpawn(Spawntypes.team1));
|
||||
spawns.add(getSpawn(Spawntypes.team2));
|
||||
for (Location loc : spawns) if (loc == null) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Stats
|
||||
public static class Stats {
|
||||
public Player player;
|
||||
public int kills = 0;
|
||||
public int deaths = 0;
|
||||
public int playedGames = 0;
|
||||
public int wins = 0;
|
||||
public int looses = 0;
|
||||
|
||||
public Stats(Player p, int k, int d, int pg, int w, int l){
|
||||
player = p;
|
||||
kills = k;
|
||||
deaths = d;
|
||||
playedGames = pg;
|
||||
wins = w;
|
||||
looses = l;
|
||||
}
|
||||
public Stats(Player p) {
|
||||
player = p;
|
||||
}
|
||||
}
|
||||
|
||||
public static Stats getStats(Player p){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM " + MySQL.stats + " WHERE UUID = \"" + p.getUniqueId() + "\"");
|
||||
if (rs.next()){
|
||||
int kills = rs.getInt("Kills");
|
||||
int deaths = rs.getInt("Deaths");
|
||||
int playedgames = rs.getInt("PlayedGames");
|
||||
int wins = rs.getInt("Wins");
|
||||
int looses = rs.getInt("Looses");
|
||||
return new Stats(p, kills, deaths, playedgames, wins, looses);
|
||||
}
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setStats(Stats s){
|
||||
MySQL.insert("DELETE FROM " + MySQL.stats + " WHERE UUID = \"" + s.player.getUniqueId() + "\"");
|
||||
MySQL.insert("INSERT INTO " + MySQL.stats + " (UUID, Kills, Deaths, PlayedGames, Wins, Looses) VALUES (\"" + s.player.getUniqueId() + "\", " + s.kills + ", " + s.deaths + ", " + s.playedGames + ", " + s.wins + ", " + s.looses + ")");
|
||||
}
|
||||
|
||||
public static boolean hasStats(Player p){
|
||||
return getStats(p) != null;
|
||||
}
|
||||
|
||||
public static void createStats(Player p){
|
||||
setStats(new Stats(p));
|
||||
}
|
||||
|
||||
//Kits
|
||||
public static Kit getKit(int id){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT Path FROM " + MySQL.kits + " WHERE ID = " + id);
|
||||
if (rs.next()){
|
||||
String path = rs.getString("Path");
|
||||
Kit kit = (Kit) Main.ReadObjectFromFile(path);
|
||||
return kit;
|
||||
}
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setKit(Kit kit, boolean isNew){
|
||||
if (isNew){
|
||||
kit.id = getNextKitID();
|
||||
kit.path = Main.kitFilePrefix + kit.name + ".kit";
|
||||
}else deleteKit(kit);
|
||||
Main.WriteObjectToFile(kit, kit.path);
|
||||
MySQL.insert("INSERT INTO " + MySQL.kits + "(ID, Name, Path, Cost) VALUES (" + kit.id + ", \"" + kit.name + "\", \"" + kit.path + "\", " + kit.cost + ")");
|
||||
}
|
||||
|
||||
public static void deleteKit(Kit kit){
|
||||
MySQL.insert("DELETE FROM " + MySQL.kits + " WHERE ID = " + kit.id);
|
||||
File file = new File(kit.path);
|
||||
file.delete();
|
||||
}
|
||||
|
||||
public static int getKitID(String name){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT ID FROM " + MySQL.kits + " WHERE Name = \"" + name + "\"");
|
||||
if (rs.next()){
|
||||
return rs.getInt("ID");
|
||||
}
|
||||
}catch (Exception e) {}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static ArrayList<Kit> getAllKits(){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT * FROM " + MySQL.kits);
|
||||
ArrayList<Kit> kits = new ArrayList<>();
|
||||
while (rs.next()){
|
||||
if (kitEntryIsPlayer(rs)) continue;
|
||||
int id = rs.getInt("ID");
|
||||
Kit kit = getKit(id);
|
||||
kits.add(kit);
|
||||
}
|
||||
return kits;
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean kitEntryIsPlayer(ResultSet rs){
|
||||
try {
|
||||
String uuid = rs.getString("UUID");
|
||||
return uuid != null;
|
||||
}catch (Exception e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int getNextKitID(){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT ID FROM " + MySQL.kits);
|
||||
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;
|
||||
}
|
||||
|
||||
public static void setPlayerKit(Player p, Kit kit){
|
||||
MySQL.insert("DELETE FROM " + MySQL.kits + " WHERE UUID = \"" + p.getUniqueId() + "\"");
|
||||
MySQL.insert("INSERT INTO " + MySQL.kits + " (ID, UUID) VALUES (" + kit.id + ", \"" + p.getUniqueId() + "\")");
|
||||
}
|
||||
|
||||
public static Kit getPlayerKit(Player p){
|
||||
try {
|
||||
ResultSet rs = MySQL.getData("SELECT ID FROM " + MySQL.kits + " WHERE UUID = \"" + p.getUniqueId() + "\"");
|
||||
if (rs.next()){
|
||||
int id = rs.getInt("ID");
|
||||
return getKit(id);
|
||||
}
|
||||
}catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
10
Plugins/Old/cc-arena/src/plugin.yml
Normal file
10
Plugins/Old/cc-arena/src/plugin.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
name: CC-Arena
|
||||
version: 1.0
|
||||
api-version: 1.16
|
||||
main: de.craftix.arena.Main
|
||||
|
||||
commands:
|
||||
arenasetup:
|
||||
arenakit:
|
||||
arenamenu:
|
||||
arenastats:
|
||||
Reference in New Issue
Block a user