mirror of
https://github.com/Lugamii/Escomar-PotSG
synced 2024-11-14 03:11:32 +01:00
uploaded
fuck escomar
This commit is contained in:
parent
514bcb0fab
commit
8c8662bd05
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
13
.idea/artifacts/PotSG_jar.xml
Normal file
13
.idea/artifacts/PotSG_jar.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="PotSG:jar">
|
||||||
|
<output-path>$PROJECT_DIR$/out/artifacts/PotSG_jar</output-path>
|
||||||
|
<root id="archive" name="PotSG.jar">
|
||||||
|
<element id="module-output" name="PotSG" />
|
||||||
|
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/commons/commons-text/1.8/commons-text-1.8.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/co/aikar/taskchain-bukkit/3.7.2/taskchain-bukkit-3.7.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/co/aikar/taskchain-core/3.7.2/taskchain-core-3.7.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar" path-in-jar="/" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
14
.idea/compiler.xml
Normal file
14
.idea/compiler.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="true" />
|
||||||
|
<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="PotSG-Scenarios" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/discord.xml
Normal file
6
.idea/discord.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="PROJECT_FILES" />
|
||||||
|
</component>
|
||||||
|
</project>
|
55
.idea/jarRepositories.xml
Normal file
55
.idea/jarRepositories.xml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="vault-repo" />
|
||||||
|
<option name="name" value="vault-repo" />
|
||||||
|
<option name="url" value="http://nexus.hc.to/content/repositories/pub_releases" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="google-gson" />
|
||||||
|
<option name="name" value="google-gson" />
|
||||||
|
<option name="url" value="https://mvnrepository.com/artifact/com.google.code.gson/gson" />
|
||||||
|
</remote-repository>
|
||||||
|
<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="aikar" />
|
||||||
|
<option name="name" value="aikar" />
|
||||||
|
<option name="url" value="https://repo.aikar.co/content/groups/aikar/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="spigot" />
|
||||||
|
<option name="name" value="spigot" />
|
||||||
|
<option name="url" value="https://hub.spigotmc.org/nexus/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="apache-commons-lang" />
|
||||||
|
<option name="name" value="apache-commons-lang" />
|
||||||
|
<option name="url" value="https://mvnrepository.com/artifact/org.apache.commons/commons-lang3" />
|
||||||
|
</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>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="dmulloy2-repo" />
|
||||||
|
<option name="name" value="dmulloy2-repo" />
|
||||||
|
<option name="url" value="http://repo.dmulloy2.net/nexus/repository/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="apache-commons-text" />
|
||||||
|
<option name="name" value="apache-commons-text" />
|
||||||
|
<option name="url" value="https://mvnrepository.com/artifact/org.apache.commons/commons-text" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/libraries/Ziggurat_1_0_SNAPSHOT.xml
Normal file
9
.idea/libraries/Ziggurat_1_0_SNAPSHOT.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Ziggurat-1.0-SNAPSHOT">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/libs/Ziggurat-1.0-SNAPSHOT.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
11
.idea/libraries/craftbukkit_1_7_10.xml
Normal file
11
.idea/libraries/craftbukkit_1_7_10.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="craftbukkit-1.7.10">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/libs/craftbukkit-1.7.10.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/libs/craftbukkit-1.7.10.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
19
.idea/misc.xml
Normal file
19
.idea/misc.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?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="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<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" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
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$/PotSG-Scenarios.iml" filepath="$PROJECT_DIR$/PotSG-Scenarios.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
124
.idea/uiDesigner.xml
Normal file
124
.idea/uiDesigner.xml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Palette2">
|
||||||
|
<group name="Swing">
|
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Button" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="RadioButton" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="CheckBox" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Label" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||||
|
<preferred-size width="-1" height="20" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
</group>
|
||||||
|
</component>
|
||||||
|
</project>
|
12
PotSG-Scenarios.iml
Normal file
12
PotSG-Scenarios.iml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="minecraft" name="Minecraft">
|
||||||
|
<configuration>
|
||||||
|
<autoDetectTypes>
|
||||||
|
<platformType>BUKKIT</platformType>
|
||||||
|
</autoDetectTypes>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
</module>
|
2
PotSG.iml
Normal file
2
PotSG.iml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4" />
|
BIN
libs/ProtocolLib-3.4.0.jar
Normal file
BIN
libs/ProtocolLib-3.4.0.jar
Normal file
Binary file not shown.
BIN
libs/Ziggurat-1.0-SNAPSHOT.jar
Normal file
BIN
libs/Ziggurat-1.0-SNAPSHOT.jar
Normal file
Binary file not shown.
BIN
libs/craftbukkit-1.7.10.jar
Normal file
BIN
libs/craftbukkit-1.7.10.jar
Normal file
Binary file not shown.
BIN
libs/lombok.jar
Normal file
BIN
libs/lombok.jar
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Dec 05 15:42:22 EST 2018
|
||||||
|
honcho-1.0-SNAPSHOT.pom>=
|
||||||
|
honcho-1.0-SNAPSHOT.jar>=
|
BIN
libs/mvn/com/qrakn/honcho/1.0-SNAPSHOT/honcho-1.0-SNAPSHOT.jar
Normal file
BIN
libs/mvn/com/qrakn/honcho/1.0-SNAPSHOT/honcho-1.0-SNAPSHOT.jar
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Dec 06 19:17:54 CET 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1544120274155
|
@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>honcho</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>dmulloy2-repo</id>
|
||||||
|
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
|
<artifactId>ProtocolLib-v1_7_R4</artifactId>
|
||||||
|
<version>3.7.0-BETA</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
<compilerArgument>-parameters</compilerArgument>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Dec 06 19:17:53 CET 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1544120273880
|
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata modelVersion="1.1.0">
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>honcho</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<versioning>
|
||||||
|
<snapshot>
|
||||||
|
<localCopy>true</localCopy>
|
||||||
|
</snapshot>
|
||||||
|
<lastUpdated>20181205204222</lastUpdated>
|
||||||
|
<snapshotVersions>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>jar</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20181205204222</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>pom</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20181205204222</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
</snapshotVersions>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
@ -0,0 +1,18 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Aug 28 16:25:24 CEST 2019
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1561206761216
|
||||||
|
maven-metadata-sk89q-snapshots.xml.lastUpdated=1555091181644
|
||||||
|
maven-metadata-vault-repo.xml.error=
|
||||||
|
maven-metadata-spigot.xml.error=
|
||||||
|
maven-metadata-fawe-repo.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.lastUpdated=1567002324908
|
||||||
|
maven-metadata-placeholderapi.xml.error=
|
||||||
|
maven-metadata-aikar.xml.error=
|
||||||
|
maven-metadata-aikar.xml.lastUpdated=1566830524738
|
||||||
|
maven-metadata-md5-repo.xml.lastUpdated=1543628811135
|
||||||
|
maven-metadata-fawe-repo.xml.lastUpdated=1554928060497
|
||||||
|
maven-metadata-md5-repo.xml.error=
|
||||||
|
maven-metadata-placeholderapi.xml.lastUpdated=1561206761220
|
||||||
|
maven-metadata-sk89q-snapshots.xml.error=
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
||||||
|
maven-metadata-spigot.xml.lastUpdated=1567002324892
|
11
libs/mvn/com/qrakn/honcho/maven-metadata-local.xml
Normal file
11
libs/mvn/com/qrakn/honcho/maven-metadata-local.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>honcho</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<versions>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20181205204222</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Oct 30 17:14:34 EDT 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1540934074026
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1540934074159
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Oct 30 17:14:33 EDT 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1540934073643
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1540934073883
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Sep 20 04:27:40 PDT 2018
|
||||||
|
phoenix-lang-1.0-SNAPSHOT.jar>=
|
||||||
|
phoenix-lang-1.0-SNAPSHOT.pom>=
|
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata modelVersion="1.1.0">
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>phoenix-lang</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<versioning>
|
||||||
|
<snapshot>
|
||||||
|
<localCopy>true</localCopy>
|
||||||
|
</snapshot>
|
||||||
|
<lastUpdated>20180920112740</lastUpdated>
|
||||||
|
<snapshotVersions>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>jar</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20180920112740</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>pom</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20180920112740</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
</snapshotVersions>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Dec 06 19:17:47 CET 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1544120267050
|
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>phoenix</artifactId>
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>phoenix-lang</artifactId>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>md5-repo</id>
|
||||||
|
<url>http://repo.md-5.net/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.7.10-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Dec 06 19:17:46 CET 2018
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1544120266767
|
@ -0,0 +1,20 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Aug 28 16:25:25 CEST 2019
|
||||||
|
maven-metadata-fawe-repo.xml.lastUpdated=1554928060699
|
||||||
|
maven-metadata-placeholderapi.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.lastUpdated=1567002325153
|
||||||
|
maven-metadata-md5-repo.xml.error=
|
||||||
|
maven-metadata-md5-repo.xml.lastUpdated=1543628810804
|
||||||
|
maven-metadata-dmulloy2-repo.xml.lastUpdated=1558733574445
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1561206761474
|
||||||
|
maven-metadata-spigot.xml.lastUpdated=1567002325130
|
||||||
|
maven-metadata-sk89q-snapshots.xml.lastUpdated=1555091182166
|
||||||
|
maven-metadata-placeholderapi.xml.lastUpdated=1561206761435
|
||||||
|
maven-metadata-dmulloy2-repo.xml.error=
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
||||||
|
maven-metadata-spigot.xml.error=
|
||||||
|
maven-metadata-fawe-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.lastUpdated=1566830526101
|
||||||
|
maven-metadata-sk89q-snapshots.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.error=
|
11
libs/mvn/com/qrakn/phoenix-lang/maven-metadata-local.xml
Normal file
11
libs/mvn/com/qrakn/phoenix-lang/maven-metadata-local.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>phoenix-lang</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<versions>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20180920112740</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Sep 04 13:09:43 PDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091783147
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1536091783477
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Sep 04 13:09:32 PDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091772234
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1536091772466
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
BIN
libs/mvn/com/qrakn/phoenix/.DS_Store
vendored
Normal file
BIN
libs/mvn/com/qrakn/phoenix/.DS_Store
vendored
Normal file
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu Sep 20 04:27:38 PDT 2018
|
||||||
|
phoenix-1.0-SNAPSHOT.pom>=
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata modelVersion="1.1.0">
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>phoenix</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<versioning>
|
||||||
|
<snapshot>
|
||||||
|
<localCopy>true</localCopy>
|
||||||
|
</snapshot>
|
||||||
|
<lastUpdated>20180920112738</lastUpdated>
|
||||||
|
<snapshotVersions>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>pom</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20180920112738</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
</snapshotVersions>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>phoenix</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>phoenix-lang</module>
|
||||||
|
<module>phoenix-command</module>
|
||||||
|
<module>phoenix-utils</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.14.8</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Sep 04 13:02:56 PDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091376967
|
@ -0,0 +1,20 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Aug 28 16:25:25 CEST 2019
|
||||||
|
maven-metadata-fawe-repo.xml.lastUpdated=1554928060905
|
||||||
|
maven-metadata-placeholderapi.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.lastUpdated=1567002325385
|
||||||
|
maven-metadata-md5-repo.xml.error=
|
||||||
|
maven-metadata-md5-repo.xml.lastUpdated=1567002325478
|
||||||
|
maven-metadata-dmulloy2-repo.xml.lastUpdated=1558733574689
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1561206761712
|
||||||
|
maven-metadata-spigot.xml.lastUpdated=1567002325378
|
||||||
|
maven-metadata-sk89q-snapshots.xml.lastUpdated=1555091182604
|
||||||
|
maven-metadata-placeholderapi.xml.lastUpdated=1561206761695
|
||||||
|
maven-metadata-dmulloy2-repo.xml.error=
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
||||||
|
maven-metadata-spigot.xml.error=
|
||||||
|
maven-metadata-fawe-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.lastUpdated=1566830527942
|
||||||
|
maven-metadata-sk89q-snapshots.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.error=
|
11
libs/mvn/com/qrakn/phoenix/maven-metadata-local.xml
Normal file
11
libs/mvn/com/qrakn/phoenix/maven-metadata-local.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>com.qrakn</groupId>
|
||||||
|
<artifactId>phoenix</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<versions>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20180920112738</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
BIN
libs/mvn/com/qrakn/phoenix/phoenix-lang/.DS_Store
vendored
Normal file
BIN
libs/mvn/com/qrakn/phoenix/phoenix-lang/.DS_Store
vendored
Normal file
Binary file not shown.
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Oct 30 17:13:29 EDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1540934009226
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091590022
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Oct 30 17:13:29 EDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.lastUpdated=1540934009086
|
||||||
|
https\://hub.spigotmc.org/nexus/content/repositories/snapshots/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091589755
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Oct 30 17:13:28 EDT 2018
|
||||||
|
maven-metadata-md5-repo.xml.error=
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1540934008957
|
||||||
|
maven-metadata-md5-repo.xml.lastUpdated=1536091588462
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Sep 04 13:07:58 PDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091677549
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1536091678759
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
@ -0,0 +1,6 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Tue Sep 04 13:07:57 PDT 2018
|
||||||
|
http\://repo.md-5.net/content/groups/public/.error=
|
||||||
|
http\://repo.md-5.net/content/groups/public/.lastUpdated=1536091674647
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1536091677204
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
BIN
libs/mvn/com/qrakn/qrakn.rar
Normal file
BIN
libs/mvn/com/qrakn/qrakn.rar
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Sat Jun 01 14:29:43 CEST 2019
|
||||||
|
hubcore-1.0-SNAPSHOT.jar>=
|
||||||
|
hubcore-1.0-SNAPSHOT.pom>=
|
BIN
libs/mvn/me/allen/hubcore/1.0-SNAPSHOT/hubcore-1.0-SNAPSHOT.jar
Normal file
BIN
libs/mvn/me/allen/hubcore/1.0-SNAPSHOT/hubcore-1.0-SNAPSHOT.jar
Normal file
Binary file not shown.
147
libs/mvn/me/allen/hubcore/1.0-SNAPSHOT/hubcore-1.0-SNAPSHOT.pom
Normal file
147
libs/mvn/me/allen/hubcore/1.0-SNAPSHOT/hubcore-1.0-SNAPSHOT.pom
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>hubcore</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<build>
|
||||||
|
<finalName>HubCore</finalName>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>8</source>
|
||||||
|
<target>8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactSet>
|
||||||
|
<excludes>
|
||||||
|
<exclude>io.netty.*</exclude>
|
||||||
|
</excludes>
|
||||||
|
</artifactSet>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>vault-repo</id>
|
||||||
|
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>placeholderapi</id>
|
||||||
|
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>mvdw-software</id>
|
||||||
|
<name>MVdW Public Repositories</name>
|
||||||
|
<url>http://repo.mvdw-software.be/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot</artifactId>
|
||||||
|
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/server.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>Ziggurat</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.joeleoli</groupId>
|
||||||
|
<artifactId>portal</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/Portal.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>land.potion</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>0.0.4-DEV</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/Core.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
|
<artifactId>VaultAPI</artifactId>
|
||||||
|
<version>1.7</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>ru.tehkode</groupId>
|
||||||
|
<artifactId>PermissionsEx</artifactId>
|
||||||
|
<version>1.22</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/PermissionsEx.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.lucko.luckperms</groupId>
|
||||||
|
<artifactId>luckperms-api</artifactId>
|
||||||
|
<version>4.3</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.clip</groupId>
|
||||||
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
<version>2.9.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>be.maximvdw</groupId>
|
||||||
|
<artifactId>MVdWPlaceholderAPI</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>19.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata modelVersion="1.1.0">
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>hubcore</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<versioning>
|
||||||
|
<snapshot>
|
||||||
|
<localCopy>true</localCopy>
|
||||||
|
</snapshot>
|
||||||
|
<lastUpdated>20190601122943</lastUpdated>
|
||||||
|
<snapshotVersions>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>jar</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20190601122943</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>pom</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20190601122943</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
</snapshotVersions>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
11
libs/mvn/me/allen/hubcore/maven-metadata-local.xml
Normal file
11
libs/mvn/me/allen/hubcore/maven-metadata-local.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>hubcore</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<versions>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20190601122943</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
10
libs/mvn/me/allen/npclib/1.0.0/npclib-1.0.0.jar.lastUpdated
Normal file
10
libs/mvn/me/allen/npclib/1.0.0/npclib-1.0.0.jar.lastUpdated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu May 30 16:19:04 CEST 2019
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.lastUpdated=1559225944188
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.lastUpdated=1559225943075
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1559225944485
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.lastUpdated=1559225943502
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.error=
|
10
libs/mvn/me/allen/npclib/1.0.0/npclib-1.0.0.pom.lastUpdated
Normal file
10
libs/mvn/me/allen/npclib/1.0.0/npclib-1.0.0.pom.lastUpdated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu May 30 16:18:58 CEST 2019
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.lastUpdated=1559225938178
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.lastUpdated=1559225937909
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1559225938229
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.lastUpdated=1559225938117
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.error=
|
BIN
libs/mvn/me/allen/ziggurat.rar
Normal file
BIN
libs/mvn/me/allen/ziggurat.rar
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Dec 12 19:08:01 CET 2018
|
||||||
|
ziggurat-1.0-SNAPSHOT.pom>=
|
||||||
|
ziggurat-1.0-SNAPSHOT.jar>=
|
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata modelVersion="1.1.0">
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>ziggurat</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<versioning>
|
||||||
|
<snapshot>
|
||||||
|
<localCopy>true</localCopy>
|
||||||
|
</snapshot>
|
||||||
|
<lastUpdated>20181212180801</lastUpdated>
|
||||||
|
<snapshotVersions>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>jar</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20181212180801</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
<snapshotVersion>
|
||||||
|
<extension>pom</extension>
|
||||||
|
<value>1.0-SNAPSHOT</value>
|
||||||
|
<updated>20181212180801</updated>
|
||||||
|
</snapshotVersion>
|
||||||
|
</snapshotVersions>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
@ -0,0 +1,22 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Aug 28 16:25:24 CEST 2019
|
||||||
|
maven-metadata-fawe-repo.xml.lastUpdated=1554928059235
|
||||||
|
maven-metadata-placeholderapi.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.lastUpdated=1567002324668
|
||||||
|
maven-metadata-sk89q-repo.xml.error=
|
||||||
|
maven-metadata-sk89q-repo.xml.lastUpdated=1548021212883
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1555091178317
|
||||||
|
maven-metadata-spigot.xml.lastUpdated=1567002324601
|
||||||
|
maven-metadata-sk89q-snapshots.xml.lastUpdated=1555091178396
|
||||||
|
maven-metadata-placeholderapi.xml.lastUpdated=1559392167913
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
||||||
|
maven-metadata-spigot.xml.error=
|
||||||
|
maven-metadata-fawe-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.lastUpdated=1566830522373
|
||||||
|
maven-metadata-sk89q-snapshots.xml.error=
|
||||||
|
maven-metadata-qrakn-repo.xml.error=
|
||||||
|
maven-metadata-qrakn-repo.xml.lastUpdated=1548515991361
|
||||||
|
maven-metadata-mvdw-software.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.error=
|
||||||
|
maven-metadata-aikar.xml.error=
|
||||||
|
maven-metadata-mvdw-software.xml.lastUpdated=1559392167782
|
Binary file not shown.
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>ziggurat</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<description>POM was created from install:install-file</description>
|
||||||
|
</project>
|
@ -0,0 +1,10 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu May 30 16:19:04 CEST 2019
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.lastUpdated=1559225944182
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.lastUpdated=1559225943071
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1559225944482
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.lastUpdated=1559225943497
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.error=
|
@ -0,0 +1,10 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu May 30 16:18:57 CEST 2019
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.lastUpdated=1559225937530
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.lastUpdated=1559225936769
|
||||||
|
http\://repo.mvdw-software.be/content/groups/public/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1559225937678
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.lastUpdated=1559225936973
|
||||||
|
http\://repo.extendedclip.com/content/repositories/placeholderapi/.error=
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
||||||
|
http\://nexus.hc.to/content/repositories/pub_releases/.error=
|
11
libs/mvn/me/allen/ziggurat/maven-metadata-local.xml
Normal file
11
libs/mvn/me/allen/ziggurat/maven-metadata-local.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>me.allen</groupId>
|
||||||
|
<artifactId>ziggurat</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<versions>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20181212180801</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
12
libs/mvn/me/allen/ziggurat/resolver-status.properties
Normal file
12
libs/mvn/me/allen/ziggurat/resolver-status.properties
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Thu May 30 16:23:13 CEST 2019
|
||||||
|
maven-metadata-spigot-repo.xml.lastUpdated=1559226193242
|
||||||
|
maven-metadata-mvdw-software.xml.error=
|
||||||
|
maven-metadata-mvdw-software.xml.lastUpdated=1559226151665
|
||||||
|
maven-metadata-vault-repo.xml.error=
|
||||||
|
maven-metadata-vault-repo.xml.lastUpdated=1559226151724
|
||||||
|
maven-metadata-placeholderapi.xml.error=
|
||||||
|
maven-metadata-placeholderapi.xml.lastUpdated=1559226151703
|
||||||
|
maven-metadata-spigot-repo.xml.error=
|
||||||
|
maven-metadata-central.xml.lastUpdated=1559226151624
|
||||||
|
maven-metadata-central.xml.error=
|
@ -0,0 +1,8 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Dec 12 19:08:30 CET 2018
|
||||||
|
http\://maven.sk89q.com/repo/.error=
|
||||||
|
http\://maven.sk89q.com/repo/.lastUpdated=1544638109971
|
||||||
|
http\://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/.error=
|
||||||
|
http\://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/.lastUpdated=1544638110502
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1544638110662
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
@ -0,0 +1,8 @@
|
|||||||
|
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||||
|
#Wed Dec 12 19:08:29 CET 2018
|
||||||
|
http\://maven.sk89q.com/repo/.error=
|
||||||
|
http\://maven.sk89q.com/repo/.lastUpdated=1544638108852
|
||||||
|
http\://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/.error=
|
||||||
|
http\://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/.lastUpdated=1544638109426
|
||||||
|
https\://repo.maven.apache.org/maven2/.lastUpdated=1544638109658
|
||||||
|
https\://repo.maven.apache.org/maven2/.error=
|
BIN
libs/paperspigot-api.jar
Normal file
BIN
libs/paperspigot-api.jar
Normal file
Binary file not shown.
BIN
out/artifacts/PotSG_jar/PotSG.jar
Normal file
BIN
out/artifacts/PotSG_jar/PotSG.jar
Normal file
Binary file not shown.
161
pom.xml
Normal file
161
pom.xml
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>me.m69.scenarios</groupId>
|
||||||
|
<artifactId>PotSG-Scenarios</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>vault-repo</id>
|
||||||
|
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>aikar</id>
|
||||||
|
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>spigot</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>dmulloy2-repo</id>
|
||||||
|
<url>http://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>apache-commons-lang</id>
|
||||||
|
<url>https://mvnrepository.com/artifact/org.apache.commons/commons-lang3</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>apache-commons-text</id>
|
||||||
|
<url>https://mvnrepository.com/artifact/org.apache.commons/commons-text</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>google-gson</id>
|
||||||
|
<url>https://mvnrepository.com/artifact/com.google.code.gson/gson</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>co.aikar</groupId>
|
||||||
|
<artifactId>taskchain-bukkit</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.16.16</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.hylist</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.7.10-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.hylist</groupId>
|
||||||
|
<artifactId>spigot-server</artifactId>
|
||||||
|
<version>1.7.10-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mongo shit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mongodb</groupId>
|
||||||
|
<artifactId>mongo-java-driver</artifactId>
|
||||||
|
<version>3.9.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
|
<artifactId>VaultAPI</artifactId>
|
||||||
|
<version>1.7</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
|
<artifactId>ProtocolLib</artifactId>
|
||||||
|
<version>3.4.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/libs/ProtocolLib-3.4.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
|
<artifactId>ProtocolLib</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-text</artifactId>
|
||||||
|
<version>1.8</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.8.5</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>clean install</defaultGoal>
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
90
src/main/java/me/missionary/board/BoardManager.java
Normal file
90
src/main/java/me/missionary/board/BoardManager.java
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
package me.missionary.board;
|
||||||
|
|
||||||
|
import me.missionary.board.board.Board;
|
||||||
|
import me.missionary.board.board.tasks.BoardUpdateTask;
|
||||||
|
import me.missionary.board.settings.BoardSettings;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 3/23/2018
|
||||||
|
*/
|
||||||
|
public class BoardManager implements Listener {
|
||||||
|
|
||||||
|
private final JavaPlugin plugin;
|
||||||
|
private BoardSettings boardSettings;
|
||||||
|
private Map<UUID, Board> scoreboards;
|
||||||
|
private BukkitTask updateTask;
|
||||||
|
|
||||||
|
public BoardManager(JavaPlugin plugin, BoardSettings boardSettings) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.boardSettings = boardSettings;
|
||||||
|
this.scoreboards = new ConcurrentHashMap<>();
|
||||||
|
this.updateTask = new BoardUpdateTask(this).runTaskTimer(plugin, 10L, 10L);
|
||||||
|
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||||
|
plugin.getServer().getOnlinePlayers().forEach(this::setup);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoardSettings(BoardSettings boardSettings) {
|
||||||
|
this.boardSettings = boardSettings;
|
||||||
|
scoreboards.values().forEach(board -> board.setBoardSettings(boardSettings));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasBoard(Player player) {
|
||||||
|
return scoreboards.containsKey(player.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<Board> getBoard(Player player) {
|
||||||
|
return Optional.ofNullable(scoreboards.get(player.getUniqueId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setup(Player player) {
|
||||||
|
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::resetScoreboard);
|
||||||
|
if (player.getScoreboard() == Bukkit.getScoreboardManager().getMainScoreboard()) {
|
||||||
|
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
|
||||||
|
}
|
||||||
|
scoreboards.put(player.getUniqueId(), new Board(player, boardSettings));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void remove(Player player) {
|
||||||
|
Optional.ofNullable(scoreboards.remove(player.getUniqueId())).ifPresent(Board::remove);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<UUID, Board> getScoreboards() {
|
||||||
|
return Collections.unmodifiableMap(scoreboards);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoin(final PlayerJoinEvent e) {
|
||||||
|
plugin.getServer().getScheduler().runTaskLater(plugin, () -> {
|
||||||
|
if (e.getPlayer().isOnline()) { // Set this up 2 ticks later.
|
||||||
|
setup(e.getPlayer());
|
||||||
|
}
|
||||||
|
}, 2L);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(final PlayerQuitEvent e) {
|
||||||
|
this.remove(e.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDisable() {
|
||||||
|
updateTask.cancel();
|
||||||
|
plugin.getServer().getOnlinePlayers().forEach(this::remove);
|
||||||
|
scoreboards.clear();
|
||||||
|
}
|
||||||
|
}
|
131
src/main/java/me/missionary/board/board/Board.java
Normal file
131
src/main/java/me/missionary/board/board/Board.java
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
package me.missionary.board.board;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.Setter;
|
||||||
|
import me.missionary.board.settings.BoardSettings;
|
||||||
|
import me.missionary.board.settings.ScoreDirection;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scoreboard.DisplaySlot;
|
||||||
|
import org.bukkit.scoreboard.Objective;
|
||||||
|
import org.bukkit.scoreboard.Scoreboard;
|
||||||
|
import org.bukkit.scoreboard.Team;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 3/23/2018
|
||||||
|
*/
|
||||||
|
public class Board {
|
||||||
|
|
||||||
|
private static final String[] CACHED_ENTRIES = new String[ChatColor.values().length];
|
||||||
|
|
||||||
|
private static final Function<String, String> APPLY_COLOR_TRANSLATION = s -> ChatColor.translateAlternateColorCodes('&', s);
|
||||||
|
|
||||||
|
static {
|
||||||
|
IntStream.range(0, 15).forEach(i -> CACHED_ENTRIES[i] = ChatColor.values()[i].toString() + ChatColor.RESET);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Player player;
|
||||||
|
private final Objective objective;
|
||||||
|
private final Team team;
|
||||||
|
@Setter private BoardSettings boardSettings;
|
||||||
|
private boolean ready;
|
||||||
|
|
||||||
|
public Board(@NonNull final Player player, final BoardSettings boardSettings) {
|
||||||
|
this.player = player;
|
||||||
|
this.boardSettings = boardSettings;
|
||||||
|
this.objective = this.getScoreboard().getObjective("board") == null ? this.getScoreboard().registerNewObjective("board", "dummy") : this.getScoreboard().getObjective("board");
|
||||||
|
this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
|
this.team = this.getScoreboard().getTeam("board") == null ? this.getScoreboard().registerNewTeam("board") : this.getScoreboard().getTeam("board");
|
||||||
|
this.team.setAllowFriendlyFire(true);
|
||||||
|
this.team.setCanSeeFriendlyInvisibles(false);
|
||||||
|
this.team.setPrefix("");
|
||||||
|
this.team.setSuffix("");
|
||||||
|
this.ready = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Scoreboard getScoreboard() {
|
||||||
|
return (player != null) ? player.getScoreboard() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove() {
|
||||||
|
this.resetScoreboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update() {
|
||||||
|
// Checking if we are ready to start updating the Scoreboard.
|
||||||
|
if (!ready) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Making sure the player is connected.
|
||||||
|
if (!player.isOnline()) {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Making sure the Scoreboard Provider is set.
|
||||||
|
if (boardSettings == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getting their Scoreboard display from the Scoreboard Provider.
|
||||||
|
final List<String> entries = boardSettings.getBoardProvider().getLines(player).stream().map(APPLY_COLOR_TRANSLATION).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (boardSettings.getScoreDirection() == ScoreDirection.UP) {
|
||||||
|
Collections.reverse(entries);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setting the Scoreboard title
|
||||||
|
String title = boardSettings.getBoardProvider().getTitle(player);
|
||||||
|
if (title.length() > 32) {
|
||||||
|
Bukkit.getLogger().warning("The title " + title + " is over 32 characters in length, substringing to prevent errors.");
|
||||||
|
title = title.substring(0, 32);
|
||||||
|
}
|
||||||
|
objective.setDisplayName(ChatColor.translateAlternateColorCodes('&', title));
|
||||||
|
|
||||||
|
// Clearing previous Scoreboard values if entry sizes don't match.
|
||||||
|
if (this.getScoreboard().getEntries().size() != entries.size())
|
||||||
|
this.getScoreboard().getEntries().forEach(this::removeEntry);
|
||||||
|
|
||||||
|
// Setting Scoreboard lines.
|
||||||
|
for (int i = 0; i < entries.size(); i++) {
|
||||||
|
String str = entries.get(i);
|
||||||
|
BoardEntry entry = BoardEntry.translateToEntry(str);
|
||||||
|
Team team = getScoreboard().getTeam(CACHED_ENTRIES[i]);
|
||||||
|
|
||||||
|
if (team == null) {
|
||||||
|
team = this.getScoreboard().registerNewTeam(CACHED_ENTRIES[i]);
|
||||||
|
team.addEntry(team.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
team.setPrefix(entry.getPrefix());
|
||||||
|
team.setSuffix(entry.getSuffix());
|
||||||
|
|
||||||
|
switch (boardSettings.getScoreDirection()) {
|
||||||
|
case UP:
|
||||||
|
objective.getScore(team.getName()).setScore(1 + i);
|
||||||
|
break;
|
||||||
|
case DOWN:
|
||||||
|
objective.getScore(team.getName()).setScore(15 - i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeEntry(String id) {
|
||||||
|
this.getScoreboard().resetScores(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetScoreboard() {
|
||||||
|
ready = false;
|
||||||
|
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||||
|
}
|
||||||
|
}
|
40
src/main/java/me/missionary/board/board/BoardEntry.java
Normal file
40
src/main/java/me/missionary/board/board/BoardEntry.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package me.missionary.board.board;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 3/29/2018
|
||||||
|
*/
|
||||||
|
public class BoardEntry {
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String prefix, suffix;
|
||||||
|
|
||||||
|
private BoardEntry(final String prefix, final String suffix) {
|
||||||
|
this.prefix = prefix;
|
||||||
|
this.suffix = suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BoardEntry translateToEntry(String input) {
|
||||||
|
if (input.isEmpty()) {
|
||||||
|
return new BoardEntry("", "");
|
||||||
|
}
|
||||||
|
if (input.length() <= 16) {
|
||||||
|
return new BoardEntry(input, "");
|
||||||
|
} else {
|
||||||
|
String prefix = input.substring(0, 16);
|
||||||
|
String suffix = "";
|
||||||
|
|
||||||
|
if (prefix.endsWith("\u00a7")) {
|
||||||
|
prefix = prefix.substring(0, prefix.length() - 1);
|
||||||
|
suffix = "\u00a7" + suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
suffix = StringUtils.left(ChatColor.getLastColors(prefix) + suffix + input.substring(16), 16);
|
||||||
|
return new BoardEntry(prefix, suffix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package me.missionary.board.board.tasks;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import me.missionary.board.BoardManager;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 5/31/2018
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BoardUpdateTask extends BukkitRunnable {
|
||||||
|
|
||||||
|
private static final Predicate<UUID> PLAYER_IS_ONLINE = uuid -> Bukkit.getPlayer(uuid) != null;
|
||||||
|
|
||||||
|
private final BoardManager boardManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
boardManager.getScoreboards().entrySet().stream().filter(entrySet -> PLAYER_IS_ONLINE.test(entrySet.getKey())).forEach(entrySet -> entrySet.getValue().update());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package me.missionary.board.provider;
|
||||||
|
|
||||||
|
import me.missionary.board.board.Board;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scoreboard.Objective;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface BoardProvider {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the title for {@link Objective#getDisplayName()}
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to supply
|
||||||
|
* @return The title for the objective
|
||||||
|
*/
|
||||||
|
String getTitle(Player player);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the contents to be displayed on the {@link Board}
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to supply
|
||||||
|
* @return The {@link List} of contents
|
||||||
|
*/
|
||||||
|
List<String> getLines(Player player);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package me.missionary.board.settings;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import me.missionary.board.provider.BoardProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 5/31/2018
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Builder
|
||||||
|
public class BoardSettings {
|
||||||
|
|
||||||
|
private BoardProvider boardProvider;
|
||||||
|
|
||||||
|
private ScoreDirection scoreDirection;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package me.missionary.board.settings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Missionary (missionarymc@gmail.com)
|
||||||
|
* @since 5/31/2018
|
||||||
|
*/
|
||||||
|
public enum ScoreDirection {
|
||||||
|
UP,
|
||||||
|
DOWN
|
||||||
|
}
|
10
src/main/java/me/weebo/GameState.java
Normal file
10
src/main/java/me/weebo/GameState.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package me.weebo;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There are 3 game states.
|
||||||
|
*/
|
||||||
|
public enum GameState {
|
||||||
|
|
||||||
|
IDLE, WAITING, STARTED
|
||||||
|
|
||||||
|
}
|
518
src/main/java/me/weebo/PotionSG.java
Normal file
518
src/main/java/me/weebo/PotionSG.java
Normal file
@ -0,0 +1,518 @@
|
|||||||
|
package me.weebo;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import me.missionary.board.BoardManager;
|
||||||
|
import me.missionary.board.settings.BoardSettings;
|
||||||
|
import me.missionary.board.settings.ScoreDirection;
|
||||||
|
import me.weebo.commands.staff.*;
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.inventory.Recipe;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
import me.weebo.barrier.ProtocolLibHook;
|
||||||
|
import me.weebo.barrier.VisualiseHandler;
|
||||||
|
import me.weebo.border.Border;
|
||||||
|
import me.weebo.commands.GameInfoCommand;
|
||||||
|
import me.weebo.commands.host.CancelCmd;
|
||||||
|
import me.weebo.commands.host.HostCommand;
|
||||||
|
import me.weebo.commands.host.StartCmd;
|
||||||
|
import me.weebo.listeners.InventoryListener;
|
||||||
|
import me.weebo.listeners.PlayerListeners;
|
||||||
|
import me.weebo.listeners.WallBorderListener;
|
||||||
|
import me.weebo.listeners.WorldListeners;
|
||||||
|
import me.weebo.managers.Managers;
|
||||||
|
import me.weebo.managers.scenarios.InventoryManager;
|
||||||
|
import me.weebo.managers.scenarios.ScenarioManager;
|
||||||
|
import me.weebo.managers.types.SidebarManager;
|
||||||
|
import me.weebo.managers.types.TasksManager;
|
||||||
|
import me.weebo.managers.types.UpdatedInventoryManager;
|
||||||
|
import me.weebo.menu.MenuListener;
|
||||||
|
import me.weebo.menu.Page;
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
import me.weebo.utilities.LocationUtils;
|
||||||
|
import me.weebo.utilities.PlayerUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The main class of the plugin.
|
||||||
|
*/
|
||||||
|
public class PotionSG extends JavaPlugin {
|
||||||
|
|
||||||
|
public static final String PERM_ACCESS = "potionsg.access";
|
||||||
|
public static final String PERM_MOD = "potionsg.mod";
|
||||||
|
public static final String PERM_HOST = "potionsg.host";
|
||||||
|
public static final String PERM_BUILD = "potionsg.build";
|
||||||
|
public static final String PERM_ADMIN = "potionsg.admin";
|
||||||
|
public int port = Bukkit.getPort();
|
||||||
|
static PotionSG potsgscen;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private static PotionSG inst;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private GameState state;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private int startTimer, pvpTimer, feastTimer, rad, borderTimer, feastRad, cooldownTimer, targetRad, gameTimer;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private boolean pvp;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private VisualiseHandler visualiseHandler;
|
||||||
|
private BoardManager manager;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
String arena;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
TasksManager tasksManager;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
ScenarioManager scenarioManager;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
InventoryManager inventoryManager;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
Map<UUID, Page> playerMenu;
|
||||||
|
|
||||||
|
public static PotionSG getInstance() {
|
||||||
|
return potsgscen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
//ProtocolLib
|
||||||
|
if(this.getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||||
|
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.RED + "ProtocolLib depend not found!");
|
||||||
|
Bukkit.shutdown();
|
||||||
|
//Registred ProtocolLib
|
||||||
|
} else {
|
||||||
|
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "ProtocolLib found!");
|
||||||
|
}
|
||||||
|
//Multiverse-Core
|
||||||
|
if(this.getServer().getPluginManager().getPlugin("Multiverse-Core") == null) {
|
||||||
|
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.RED + "Multiverse-Core depend not found!");
|
||||||
|
Bukkit.shutdown();
|
||||||
|
//Registered Multiverse
|
||||||
|
} else {
|
||||||
|
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Multiverse-Core found!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//GameTask gametask;
|
||||||
|
//if(PotionSG.getInstance().isStarted()) {
|
||||||
|
//gametask = new GameTask();
|
||||||
|
//gametask.runTaskTimer(this, 0, 1 * 20);
|
||||||
|
//}
|
||||||
|
potsgscen = this;
|
||||||
|
inst = this;
|
||||||
|
state = GameState.IDLE;
|
||||||
|
arena = "";
|
||||||
|
scenarioManager = new ScenarioManager();
|
||||||
|
regEvents();
|
||||||
|
regCmds();
|
||||||
|
registerManagers();
|
||||||
|
getConfig().options().copyDefaults(true);
|
||||||
|
saveConfig();
|
||||||
|
manager = new BoardManager(this, BoardSettings.builder().boardProvider(new SidebarManager()).scoreDirection(ScoreDirection.UP).build());
|
||||||
|
visualiseHandler = new VisualiseHandler();
|
||||||
|
playerMenu = new ConcurrentHashMap<UUID, Page>();
|
||||||
|
new UpdatedInventoryManager();
|
||||||
|
Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Recipe rec = it.next();
|
||||||
|
if (rec.getResult().getType() == Material.CHEST || rec.getResult().getType() == Material.ENDER_CHEST || rec.getResult().getType() == Material.TRAPPED_CHEST)
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
|
Managers.getProfileManager().createProfile(p);
|
||||||
|
PlayerUtils.lobbyItems(p);
|
||||||
|
}
|
||||||
|
ProtocolLibHook.hook();
|
||||||
|
Managers.getMapManager().loadArenas();
|
||||||
|
for (World w : Bukkit.getWorlds()) w.setDifficulty(Difficulty.NORMAL);
|
||||||
|
Bukkit.broadcastMessage(C.c("&a&l\u24D8 &aPotionSG has been enabled."));
|
||||||
|
//hostGame(Bukkit.getConsoleSender().getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
manager.onDisable();
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers()) p.kickPlayer("PotionSG is reloading / restarting");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerConfigs() {
|
||||||
|
saveDefaultConfig();
|
||||||
|
|
||||||
|
}
|
||||||
|
private void regEvents() {
|
||||||
|
List<Listener> l = new ArrayList<>();
|
||||||
|
l.add(new PlayerListeners());
|
||||||
|
l.add(new WorldListeners());
|
||||||
|
l.add(new WallBorderListener());
|
||||||
|
l.add(new MenuListener());
|
||||||
|
l.add(new InventoryListener());
|
||||||
|
l.forEach(li -> Bukkit.getPluginManager().registerEvents(li, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void regCmds() {
|
||||||
|
Map<String, CommandExecutor> m = new HashMap<>();
|
||||||
|
m.put("build", new BuildCmd());
|
||||||
|
m.put("setlobbyspawn", new SetLobbySpawnCmd());
|
||||||
|
m.put("arena", new ArenaCmd());
|
||||||
|
m.put("cancel", new CancelCmd());
|
||||||
|
m.put("start", new StartCmd());
|
||||||
|
m.put("freeze", new FreezeCmd());
|
||||||
|
m.put("host", new HostCommand());
|
||||||
|
m.put("gameinfo", new GameInfoCommand());
|
||||||
|
m.put("setslots", new SetSlotsCommand());
|
||||||
|
m.forEach((s, c) -> getCommand(s).setExecutor(c));
|
||||||
|
}
|
||||||
|
private void registerManagers() {
|
||||||
|
scenarioManager = new ScenarioManager();
|
||||||
|
inventoryManager = new InventoryManager();
|
||||||
|
tasksManager = new TasksManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Player> getPlayersInGame() {
|
||||||
|
List<Player> l = new ArrayList<>();
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
|
if (Managers.getProfileManager().getProfile(p.getUniqueId()).isInGame()) l.add(p);
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Player> getPlayersWaiting() {
|
||||||
|
List<Player> l = new ArrayList<>();
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
|
if (Managers.getProfileManager().getProfile(p.getUniqueId()).isWaiting()) l.add(p);
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Player> getSpectators() {
|
||||||
|
List<Player> l = new ArrayList<>();
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
|
if (Managers.getProfileManager().getProfile(p.getUniqueId()).isSpectating()) l.add(p);
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void msgAll(String m) {
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers()) C.c(p, m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void msg(String m) {
|
||||||
|
if (isStarted()) {
|
||||||
|
for (Player p : getPlayersInGame()) C.c(p, m);
|
||||||
|
for (Player p : getSpectators()) C.c(p, m);
|
||||||
|
} else if (isWaiting()) for (Player p : getPlayersWaiting()) C.c(p, m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sound(Sound s, int v, int pi) {
|
||||||
|
if (isStarted()) {
|
||||||
|
for (Player p : getPlayersInGame()) p.playSound(p.getLocation(), s, v, pi);
|
||||||
|
for (Player p : getSpectators()) p.playSound(p.getLocation(), s, v, pi);
|
||||||
|
} else if (isWaiting()) for (Player p : getPlayersWaiting()) p.playSound(p.getLocation(), s, v, pi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hide(Player player) {
|
||||||
|
if (isStarted()) for (Player p : getPlayersInGame()) p.hidePlayer(player);
|
||||||
|
else if (isWaiting()) for (Player p : getPlayersWaiting()) p.hidePlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void show(Player player) {
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers()) p.showPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaiting() {
|
||||||
|
state = GameState.WAITING;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStarted() {
|
||||||
|
state = GameState.STARTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdle() {
|
||||||
|
state = GameState.IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStarted() {
|
||||||
|
return state == GameState.STARTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIdle() {
|
||||||
|
return state == GameState.IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaiting() {
|
||||||
|
return state == GameState.WAITING;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInCooldown() {
|
||||||
|
return state == GameState.IDLE && cooldownTimer > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void cancel(Player p) {
|
||||||
|
for (Player pl : getPlayersWaiting()) leaveGame(pl);
|
||||||
|
setIdle();
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
Bukkit.broadcastMessage(C.c("&c&l\u26A0 Game Cancelled"));
|
||||||
|
Bukkit.broadcastMessage("");
|
||||||
|
Bukkit.broadcastMessage(C.c("&7The game has been cancelled by " + p.getName() + "."));
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
for (Player pl : Bukkit.getOnlinePlayers()) pl.playSound(pl.getLocation(), Sound.ZOMBIE_UNFECT, 5, 2);
|
||||||
|
setHost(null);
|
||||||
|
arena = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
setStarted();
|
||||||
|
rad = 500;
|
||||||
|
startTimer = 30;
|
||||||
|
pvpTimer = 0;
|
||||||
|
gameTimer = 0;
|
||||||
|
feastTimer = 0;
|
||||||
|
borderTimer = 0;
|
||||||
|
targetRad = 30;
|
||||||
|
pvp = false;
|
||||||
|
new Border();
|
||||||
|
for (Player p : getPlayersInGame()) PlayerUtils.reset(p);
|
||||||
|
msg("");
|
||||||
|
msg("&e\u26A0 &cFrom now on, you will not be able to join the game again if you leave.");
|
||||||
|
msg("");
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (isStarted() && startTimer >= 0) {
|
||||||
|
if (startTimer % 5 == 0 || startTimer <= 5) {
|
||||||
|
msg(startTimer > 0 ? C.CHAT_SECONDARY + "The game starts in " + C.MAIN + startTimer + C.CHAT_SECONDARY + "..." : "&aThe game has started.");
|
||||||
|
sound(startTimer > 0 ? Sound.CLICK : Sound.ZOMBIE_REMEDY, 5, 1);
|
||||||
|
}
|
||||||
|
if (startTimer == 0)
|
||||||
|
for (Player p : getPlayersInGame()) {
|
||||||
|
PlayerUtils.reset(p);
|
||||||
|
Location loc1 = LocationUtils.readGameSpawn().clone();
|
||||||
|
loc1.setPitch(p.getLocation().getPitch());
|
||||||
|
loc1.setYaw(p.getLocation().getYaw());
|
||||||
|
p.teleport(loc1);
|
||||||
|
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 600, 1));
|
||||||
|
}
|
||||||
|
startTimer--;
|
||||||
|
} else {
|
||||||
|
cancel();
|
||||||
|
if (isStarted()) startPvP();
|
||||||
|
if (isStarted()) startGameTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.runTaskTimer(PotionSG.getInst(), 0L, 20L);
|
||||||
|
}
|
||||||
|
public void startPvP() {
|
||||||
|
pvpTimer = 180;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (isStarted() && pvpTimer >= 0) {
|
||||||
|
if (pvpTimer != 0 && pvpTimer % 60 == 0)
|
||||||
|
msg(C.CHAT_SECONDARY + "PvP will be enabled in " + C.MAIN + pvpTimer / 60 + (pvpTimer / 60 > 1 ? " minutes" : " minute") + C.CHAT_SECONDARY + "...");
|
||||||
|
else if (pvpTimer == 10 || pvpTimer <= 5)
|
||||||
|
msg(pvpTimer > 0 ? C.CHAT_SECONDARY + "PvP will be enabled in " + C.MAIN + pvpTimer + C.CHAT_SECONDARY + "..." : C.CHAT_SECONDARY + "PvP protection has expired!");
|
||||||
|
if (pvpTimer == 0) {
|
||||||
|
sound(Sound.FIREWORK_BLAST, 5, 1);
|
||||||
|
pvp = true;
|
||||||
|
}
|
||||||
|
pvpTimer--;
|
||||||
|
} else {
|
||||||
|
cancel();
|
||||||
|
if (isStarted()) startFeast();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.runTaskTimer(PotionSG.getInst(), 0L, 20L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startFeast() {
|
||||||
|
feastTimer = 420;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (isStarted() && feastTimer >= 0) {
|
||||||
|
if (feastTimer != 0 && feastTimer % 60 == 0)
|
||||||
|
msg(C.CHAT_SECONDARY + "The feast will spawn at [0, 0] in " + C.MAIN + feastTimer / 60 + (feastTimer / 60 > 1 ? " minutes" : " minute") + C.CHAT_SECONDARY + "...");
|
||||||
|
else if (feastTimer == 10 || feastTimer <= 5)
|
||||||
|
msg(feastTimer > 0 ? C.CHAT_SECONDARY + "The feast will spawn at [0, 0] in " + C.MAIN + feastTimer + C.CHAT_SECONDARY + "..." : C.CHAT_SECONDARY + "The feast has spawned at [0, 0]!");
|
||||||
|
if (feastTimer == 0) {
|
||||||
|
feast();
|
||||||
|
sound(Sound.FIREWORK_BLAST, 5, 1);
|
||||||
|
}
|
||||||
|
feastTimer--;
|
||||||
|
} else {
|
||||||
|
cancel();
|
||||||
|
if (isStarted()) startBorder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.runTaskTimer(PotionSG.getInst(), 0L, 20L);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void feast() {
|
||||||
|
feastRad = 10;
|
||||||
|
Location lo = LocationUtils.readGameSpawn();
|
||||||
|
int x1 = lo.getBlockX() + feastRad;
|
||||||
|
int z1 = lo.getBlockZ() + feastRad;
|
||||||
|
int x2 = lo.getBlockX() - feastRad;
|
||||||
|
int z2 = lo.getBlockZ() - feastRad;
|
||||||
|
int y = lo.getBlockY();
|
||||||
|
World w = lo.getWorld();
|
||||||
|
Location[] loc = new Location[]{
|
||||||
|
new Location(w, x1 - 2, y, z1),
|
||||||
|
new Location(w, x1, y, z1 - 2),
|
||||||
|
new Location(w, x2 + 2, y, z1),
|
||||||
|
new Location(w, x2, y, z1 - 2),
|
||||||
|
new Location(w, x1 - 2, y, z2),
|
||||||
|
new Location(w, x1, y, z2 + 2),
|
||||||
|
new Location(w, x2 + 2, y, z2),
|
||||||
|
new Location(w, x2, y, z2 + 2)};
|
||||||
|
Location[] loc2 = new Location[]{
|
||||||
|
new Location(w, lo.getX() - 2, y, lo.getZ()),
|
||||||
|
new Location(w, lo.getX(), y, lo.getZ() - 2),
|
||||||
|
new Location(w, lo.getX(), y, lo.getZ() + 2),
|
||||||
|
new Location(w, lo.getX() + 2, y, lo.getZ())};
|
||||||
|
w.getBlockAt(lo).setType(Material.ENCHANTMENT_TABLE);
|
||||||
|
for (Location l : loc) w.getBlockAt(l).setType(Material.ENDER_CHEST);
|
||||||
|
for (Location l : loc2) w.getBlockAt(l).setType(Material.BOOKSHELF);
|
||||||
|
}
|
||||||
|
public void startGameTimer() {
|
||||||
|
gameTimer = 0;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
gameTimer++;
|
||||||
|
}
|
||||||
|
}.runTaskTimer(this, 0L, 20L);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void startBorder() {
|
||||||
|
msg(C.CHAT_SECONDARY + "The border will be shrinking by " + C.MAIN + "50 blocks" + C.CHAT_SECONDARY + " every minute.");
|
||||||
|
sound(Sound.WITHER_IDLE, 5, 1);
|
||||||
|
borderTimer = 60;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (isStarted() && rad > targetRad) {
|
||||||
|
if (borderTimer == 0) {
|
||||||
|
rad -= (rad == 50 ? 20 : 50);
|
||||||
|
borderTimer = 60;
|
||||||
|
}
|
||||||
|
borderTimer--;
|
||||||
|
} else cancel();
|
||||||
|
}
|
||||||
|
}.runTaskTimer(PotionSG.getInst(), 0L, 20L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void check() {
|
||||||
|
if (getPlayersInGame().size() == 1) {
|
||||||
|
for (Player p : getSpectators()) stopSpectating(p, false);
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
Bukkit.broadcastMessage(C.c(C.MAIN + "&l\u26A0 Game Ended"));
|
||||||
|
Bukkit.broadcastMessage("");
|
||||||
|
Bukkit.broadcastMessage(C.c("&6" + getPlayersInGame().get(0).getName() + " has won the game!"));
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
for (Player p : getPlayersInGame()) {
|
||||||
|
Managers.getPearlManager().removePearlCooldown(p, false);
|
||||||
|
leaveGame(p);
|
||||||
|
Managers.getLeaderboardManager().addWin(p.getUniqueId());
|
||||||
|
}
|
||||||
|
for (Player pl : Bukkit.getOnlinePlayers()) pl.playSound(pl.getLocation(), Sound.LEVEL_UP, 5, 1);
|
||||||
|
Bukkit.broadcastMessage(C.c("&eThe world is going to be reset so... expect lag."));
|
||||||
|
Managers.getMapManager().resetMap(LocationUtils.readGameSpawn());
|
||||||
|
arena = "";
|
||||||
|
setIdle();
|
||||||
|
startCooldown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void leaveGame(Player p) {
|
||||||
|
Managers.getProfileManager().getProfile(p.getUniqueId()).setInLobby();
|
||||||
|
p.teleport(LocationUtils.readLobbySpawn());
|
||||||
|
PlayerUtils.lobbyItems(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spectate(Player p, boolean b) {
|
||||||
|
hide(p);
|
||||||
|
p.teleport(LocationUtils.readGameSpawn());
|
||||||
|
PlayerUtils.spectateItems(p);
|
||||||
|
p.setGameMode(GameMode.CREATIVE);
|
||||||
|
Managers.getProfileManager().getProfile(p.getUniqueId()).setSpectating();
|
||||||
|
if (b) msg(C.MAIN + p.getName() + C.CHAT_SECONDARY + " is now spectating.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopSpectating(Player p, boolean b) {
|
||||||
|
if (b) msg(C.MAIN + p.getName() + C.CHAT_SECONDARY + " is no longer spectating.");
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
|
Managers.getProfileManager().getProfile(p.getUniqueId()).setInLobby();
|
||||||
|
p.teleport(LocationUtils.readLobbySpawn());
|
||||||
|
show(p);
|
||||||
|
PlayerUtils.lobbyItems(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startCooldown() {
|
||||||
|
cooldownTimer = 60;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (cooldownTimer == 0) {
|
||||||
|
hostGame(Bukkit.getConsoleSender().getName());
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
cooldownTimer--;
|
||||||
|
}
|
||||||
|
}.runTaskTimer(this, 0L, 20L);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void hostGame(String host) {
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
Bukkit.broadcastMessage(C.c(C.MAIN + "&l\u24D8 New PotionSG Game"));
|
||||||
|
Bukkit.broadcastMessage("");
|
||||||
|
Bukkit.broadcastMessage(C.c("&7A new game has been hosted by " + host + "."));
|
||||||
|
Bukkit.broadcastMessage(C.c("&7&m--------------------------------------------------"));
|
||||||
|
for (Player pl : Bukkit.getOnlinePlayers()) pl.playSound(pl.getLocation(), Sound.ZOMBIE_METAL, 5, 1);
|
||||||
|
setHost(host);
|
||||||
|
arena = Managers.getMapManager().getArenas().get(new Random().nextInt(Managers.getMapManager().getArenas().size()));
|
||||||
|
setWaiting();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getBorderLocation2() {
|
||||||
|
return new Location(LocationUtils.readGameSpawn().getWorld(), LocationUtils.readGameSpawn().getX() + rad, 0, LocationUtils.readGameSpawn().getZ() + rad);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getBorderLocation1() {
|
||||||
|
return new Location(LocationUtils.readGameSpawn().getWorld(), LocationUtils.readGameSpawn().getX() - rad, 0, LocationUtils.readGameSpawn().getZ() - rad);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void join(Player p) {
|
||||||
|
Managers.getProfileManager().getProfile(p.getUniqueId()).setInGame();
|
||||||
|
PlayerUtils.waitingItems(p);
|
||||||
|
p.teleport(LocationUtils.readGameSpawn());
|
||||||
|
p.playSound(p.getLocation(), Sound.NOTE_PLING, 5, 1);
|
||||||
|
PotionSG.getInst().msgAll(C.MAIN + p.getName() + C.CHAT_SECONDARY + " joined the game.");
|
||||||
|
p.setGameMode(GameMode.CREATIVE);
|
||||||
|
Managers.getHostManager().check();
|
||||||
|
}
|
||||||
|
}
|
25
src/main/java/me/weebo/barrier/BlockFiller.java
Normal file
25
src/main/java/me/weebo/barrier/BlockFiller.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
abstract class BlockFiller {
|
||||||
|
@Deprecated
|
||||||
|
VisualBlockData generate(Player player, World world, int x, int y, int z) {
|
||||||
|
return generate(player, new Location(world, x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract VisualBlockData generate(Player paramPlayer, Location paramLocation);
|
||||||
|
|
||||||
|
ArrayList<VisualBlockData> bulkGenerate(Player player, Iterable<Location> locations) {
|
||||||
|
ArrayList<VisualBlockData> data = new ArrayList<>(Iterables.size(locations));
|
||||||
|
for (Location location : locations) {
|
||||||
|
data.add(generate(player, location));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
130
src/main/java/me/weebo/barrier/ProtocolLibHook.java
Normal file
130
src/main/java/me/weebo/barrier/ProtocolLibHook.java
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.PacketType;
|
||||||
|
import com.comphenix.protocol.PacketType.Play.Client;
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
import com.comphenix.protocol.ProtocolManager;
|
||||||
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
|
import com.comphenix.protocol.events.PacketAdapter;
|
||||||
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
|
import com.comphenix.protocol.reflect.FieldAccessException;
|
||||||
|
import com.comphenix.protocol.reflect.StructureModifier;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_7_R4.EntityPlayer;
|
||||||
|
|
||||||
|
public class ProtocolLibHook {
|
||||||
|
public static void hook() {
|
||||||
|
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
|
protocolManager.addPacketListener(new PacketAdapter(PotionSG.getInst(), ListenerPriority.NORMAL, new PacketType[]{Client.BLOCK_PLACE}) {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
PacketContainer packet = event.getPacket();
|
||||||
|
StructureModifier<Integer> modifier = packet.getIntegers();
|
||||||
|
final Player player = event.getPlayer();
|
||||||
|
try {
|
||||||
|
if ((modifier.size() < 4) || (((Integer) modifier.read(3)).intValue() == 255)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int face2 = 0;
|
||||||
|
final Location location = new Location(player.getWorld(), ((Integer) modifier.read(0)).intValue(), ((Integer) modifier.read(1)).intValue(), ((Integer) modifier.read(2)).intValue());
|
||||||
|
VisualBlock visualBlock = PotionSG.getInst().getVisualiseHandler().getVisualBlockAt(player, location);
|
||||||
|
if (visualBlock == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (face2) {
|
||||||
|
case 0:
|
||||||
|
location.add(0.0D, -1.0D, 0.0D);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
location.add(0.0D, 1.0D, 0.0D);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
location.add(0.0D, 0.0D, -1.0D);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
location.add(0.0D, 0.0D, 1.0D);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
location.add(-1.0D, 0.0D, 0.0D);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
location.add(1.0D, 0.0D, 0.0D);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
ItemStack stack = (ItemStack) packet.getItemModifier().read(0);
|
||||||
|
if ((stack != null) && ((stack.getType().isBlock()) || (ProtocolLibHook.isLiquidSource(stack.getType())))) {
|
||||||
|
player.setItemInHand(player.getItemInHand());
|
||||||
|
}
|
||||||
|
visualBlock = PotionSG.getInst().getVisualiseHandler().getVisualBlockAt(player, location);
|
||||||
|
if (visualBlock != null) {
|
||||||
|
VisualBlockData visualBlockData = visualBlock.getBlockData();
|
||||||
|
player.sendBlockChange(location, visualBlockData.getBlockType(), visualBlockData.getData());
|
||||||
|
} else {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
public void run() {
|
||||||
|
org.bukkit.block.Block block = location.getBlock();
|
||||||
|
player.sendBlockChange(location, block.getType(), block.getData());
|
||||||
|
}
|
||||||
|
}.runTask(PotionSG.getInst());
|
||||||
|
}
|
||||||
|
} catch (FieldAccessException localFieldAccessException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
protocolManager.addPacketListener(new PacketAdapter(PotionSG.getInst(), ListenerPriority.NORMAL, new PacketType[]{Client.BLOCK_DIG}) {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
PacketContainer packet = event.getPacket();
|
||||||
|
StructureModifier<Integer> modifier = packet.getIntegers();
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
try {
|
||||||
|
int status = ((Integer) modifier.read(4)).intValue();
|
||||||
|
if ((status == 0) || (status == 2)) {
|
||||||
|
int x = ((Integer) modifier.read(0)).intValue();
|
||||||
|
int y = ((Integer) modifier.read(1)).intValue();
|
||||||
|
int z = ((Integer) modifier.read(2)).intValue();
|
||||||
|
Location location = new Location(player.getWorld(), x, y, z);
|
||||||
|
VisualBlock visualBlock = PotionSG.getInst().getVisualiseHandler().getVisualBlockAt(player, location);
|
||||||
|
if (visualBlock == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
VisualBlockData data = visualBlock.getBlockData();
|
||||||
|
if (status == 2) {
|
||||||
|
player.sendBlockChange(location, data.getBlockType(), data.getData());
|
||||||
|
} else if (status == 0) {
|
||||||
|
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||||
|
if ((player.getGameMode() == GameMode.CREATIVE) || (net.minecraft.server.v1_7_R4.Block.getById(data.getItemTypeId()).getDamage(entityPlayer, entityPlayer.world, x, y, z) > 1.0F)) {
|
||||||
|
player.sendBlockChange(location, data.getBlockType(), data.getData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FieldAccessException localFieldAccessException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
private static boolean isLiquidSource(Material material) {
|
||||||
|
switch (material) {
|
||||||
|
case RED_ROSE:
|
||||||
|
case WORKBENCH:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
27
src/main/java/me/weebo/barrier/VisualBlock.java
Normal file
27
src/main/java/me/weebo/barrier/VisualBlock.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
|
||||||
|
public class VisualBlock {
|
||||||
|
private VisualType visualType;
|
||||||
|
private VisualBlockData blockData;
|
||||||
|
private Location location;
|
||||||
|
|
||||||
|
public VisualBlock(VisualType visualType, VisualBlockData blockData, Location location) {
|
||||||
|
this.visualType = visualType;
|
||||||
|
this.blockData = blockData;
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VisualType getVisualType() {
|
||||||
|
return this.visualType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VisualBlockData getBlockData() {
|
||||||
|
return this.blockData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getLocation() {
|
||||||
|
return this.location;
|
||||||
|
}
|
||||||
|
}
|
36
src/main/java/me/weebo/barrier/VisualBlockData.java
Normal file
36
src/main/java/me/weebo/barrier/VisualBlockData.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
|
public class VisualBlockData
|
||||||
|
extends MaterialData {
|
||||||
|
public VisualBlockData(Material type) {
|
||||||
|
super(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public VisualBlockData(Material type, byte data) {
|
||||||
|
super(type, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Material getBlockType() {
|
||||||
|
return getItemType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public Material getItemType() {
|
||||||
|
return super.getItemType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public ItemStack toItemStack() {
|
||||||
|
throw new UnsupportedOperationException("This is a VisualBlock data");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public ItemStack toItemStack(int amount) {
|
||||||
|
throw new UnsupportedOperationException("This is a VisualBlock data");
|
||||||
|
}
|
||||||
|
}
|
25
src/main/java/me/weebo/barrier/VisualType.java
Normal file
25
src/main/java/me/weebo/barrier/VisualType.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public enum VisualType {
|
||||||
|
|
||||||
|
WORLD_BORDER() {
|
||||||
|
private final BlockFiller blockFiller = new BlockFiller() {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
VisualBlockData generate(Player player, Location location) {
|
||||||
|
return new VisualBlockData(Material.STAINED_GLASS, DyeColor.PINK.getData());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
BlockFiller blockFiller() {
|
||||||
|
return blockFiller;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
abstract BlockFiller blockFiller();
|
||||||
|
}
|
253
src/main/java/me/weebo/barrier/VisualiseHandler.java
Normal file
253
src/main/java/me/weebo/barrier/VisualiseHandler.java
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
package me.weebo.barrier;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.collect.HashBasedTable;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.google.common.collect.Table;
|
||||||
|
import me.weebo.cuboid.Cuboid;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.CraftChunk;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class VisualiseHandler {
|
||||||
|
|
||||||
|
private final Table<UUID, Location, VisualBlock> storedVisualises = HashBasedTable.create();
|
||||||
|
|
||||||
|
public Table<UUID, Location, VisualBlock> getStoredVisualises() {
|
||||||
|
return storedVisualises;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public VisualBlock getVisualBlockAt(Player player, int x, int y, int z) throws NullPointerException {
|
||||||
|
return this.getVisualBlockAt(player, new Location(player.getWorld(), x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a {@link VisualBlock} for a {@link Player}.
|
||||||
|
*
|
||||||
|
* @param player the {@link Player} to get for
|
||||||
|
* @param location the {@link Location} to get at
|
||||||
|
* @return the {@link VisualBlock} or none
|
||||||
|
* @throws NullPointerException if player or location is null
|
||||||
|
*/
|
||||||
|
public VisualBlock getVisualBlockAt(Player player, Location location) throws NullPointerException {
|
||||||
|
Preconditions.checkNotNull(player, "Player cannot be null");
|
||||||
|
Preconditions.checkNotNull(location, "Location cannot be null");
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
return storedVisualises.get(player.getUniqueId(), location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current {@link VisualBlock}s to their {@link Location}s that are shown to a {@link Player} of a specific {@link VisualType}.
|
||||||
|
*
|
||||||
|
* @param player the {@link Player} to get for
|
||||||
|
* @return copied map of {@link VisualBlock}s shown to a {@link Player}.
|
||||||
|
*/
|
||||||
|
public Map<Location, VisualBlock> getVisualBlocks(Player player) {
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
return new HashMap<>(storedVisualises.row(player.getUniqueId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current {@link VisualBlock}s to their {@link Location}s that are shown to a {@link Player} of a specific {@link VisualType}.
|
||||||
|
*
|
||||||
|
* @param player the {@link Player} to get for
|
||||||
|
* @param visualType the {@link VisualType} to get for
|
||||||
|
* @return copied map of {@link VisualBlock}s shown to a {@link Player}.
|
||||||
|
*/
|
||||||
|
public Map<Location, VisualBlock> getVisualBlocks(Player player, VisualType visualType) {
|
||||||
|
return Maps.filterValues(this.getVisualBlocks(player), new Predicate<VisualBlock>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(VisualBlock visualBlock) {
|
||||||
|
return visualType == visualBlock.getVisualType();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedHashMap<Location, VisualBlockData> generate(Player player, Cuboid cuboid, VisualType visualType, boolean canOverwrite) {
|
||||||
|
Collection<Location> locations = new HashSet<>(cuboid.getSizeX() * cuboid.getSizeY() * cuboid.getSizeZ());
|
||||||
|
Iterator<Location> iterator = cuboid.locationIterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
locations.add(iterator.next());
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.generate(player, locations, visualType, canOverwrite);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedHashMap<Location, VisualBlockData> generateAsync(Player player, Cuboid cuboid, VisualType visualType, boolean canOverwrite) {
|
||||||
|
Collection<Location> locations = new HashSet<>(cuboid.getSizeX() * cuboid.getSizeY() * cuboid.getSizeZ());
|
||||||
|
Iterator<Location> iterator = cuboid.locationIterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
locations.add(iterator.next());
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.generateAsync(player, locations, visualType, canOverwrite);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public LinkedHashMap<Location, VisualBlockData> generate(Player player, Iterable<Location> locations, VisualType visualType, boolean canOverwrite) {
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
LinkedHashMap<Location, VisualBlockData> results = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
ArrayList<VisualBlockData> filled = visualType.blockFiller().bulkGenerate(player, locations);
|
||||||
|
if (filled != null) {
|
||||||
|
int count = 0;
|
||||||
|
for (Location location : locations) {
|
||||||
|
if (!canOverwrite && storedVisualises.contains(player.getUniqueId(), location)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Material previousType = location.getBlock().getType();
|
||||||
|
if (previousType.isSolid() || previousType != Material.AIR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
VisualBlockData visualBlockData = filled.get(count++);
|
||||||
|
results.put(location, visualBlockData);
|
||||||
|
player.sendBlockChange(location, visualBlockData.getBlockType(), visualBlockData.getData());
|
||||||
|
storedVisualises.put(player.getUniqueId(), location, new VisualBlock(visualType, visualBlockData, location));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedHashMap<Location, VisualBlockData> generateAsync(Player player, Iterable<Location> locations, VisualType visualType, boolean canOverwrite) {
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
LinkedHashMap<Location, VisualBlockData> results = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
ArrayList<VisualBlockData> filled = visualType.blockFiller().bulkGenerate(player, locations);
|
||||||
|
if (filled != null) {
|
||||||
|
for (Location location : locations) {
|
||||||
|
if (!canOverwrite && storedVisualises.contains(player.getUniqueId(), location)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
location.getWorld().getChunkAtAsync(location, new World.ChunkLoadCallback() {
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
public void onLoad(Chunk chunk) {
|
||||||
|
Material previousType = CraftMagicNumbers.getMaterial(((CraftChunk) chunk).getHandle().getType(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
|
||||||
|
if (previousType.isSolid() || previousType != Material.AIR) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
VisualBlockData visualBlockData = filled.get(count++);
|
||||||
|
results.put(location, visualBlockData);
|
||||||
|
player.sendBlockChange(location, visualBlockData.getBlockType(), visualBlockData.getData());
|
||||||
|
storedVisualises.put(player.getUniqueId(), location, new VisualBlock(visualType, visualBlockData, location));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears a visual block at a given location for a player.
|
||||||
|
*
|
||||||
|
* @param player the player to clear for
|
||||||
|
* @param location the location to clear at
|
||||||
|
* @return if the visual block was shown in the first place
|
||||||
|
*/
|
||||||
|
public boolean clearVisualBlock(Player player, Location location) {
|
||||||
|
return this.clearVisualBlock(player, location, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears a visual block at a given location for a player.
|
||||||
|
*
|
||||||
|
* @param player the player to clear for
|
||||||
|
* @param location the location to clear at
|
||||||
|
* @param sendRemovalPacket if a packet to send a block change should be sent (this is used to prevent unnecessary packets sent when disconnecting or changing worlds, for example)
|
||||||
|
* @return if the visual block was shown in the first place
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public boolean clearVisualBlock(Player player, Location location, boolean sendRemovalPacket) {
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
VisualBlock visualBlock = this.storedVisualises.remove(player.getUniqueId(), location);
|
||||||
|
if (sendRemovalPacket && visualBlock != null) {
|
||||||
|
// Have to send a packet to the original block type, don't send if the fake block has the same data properties though.
|
||||||
|
Block block = location.getBlock();
|
||||||
|
VisualBlockData visualBlockData = visualBlock.getBlockData();
|
||||||
|
if (visualBlockData.getBlockType() != block.getType() || visualBlockData.getData() != block.getData()) {
|
||||||
|
player.sendBlockChange(location, block.getType(), block.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all visual blocks that are shown to a player.
|
||||||
|
*
|
||||||
|
* @param player the player to clear for
|
||||||
|
* @return mapping of the removed visualises
|
||||||
|
*/
|
||||||
|
public Map<Location, VisualBlock> clearVisualBlocks(Player player) {
|
||||||
|
return this.clearVisualBlocks(player, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all visual blocks that are shown to a player of a given VisualType.
|
||||||
|
*
|
||||||
|
* @param player the player to clear for
|
||||||
|
* @param visualType the visual type
|
||||||
|
* @param predicate the predicate to filter to
|
||||||
|
* @return mapping of the removed visualises
|
||||||
|
*/
|
||||||
|
public Map<Location, VisualBlock> clearVisualBlocks(Player player, @Nullable VisualType visualType, @Nullable Predicate<VisualBlock> predicate) {
|
||||||
|
return this.clearVisualBlocks(player, visualType, predicate, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all visual blocks that are shown to a player of a given VisualType.
|
||||||
|
*
|
||||||
|
* @param player the player to clear for
|
||||||
|
* @param visualType the visual type
|
||||||
|
* @param predicate the predicate to filter to
|
||||||
|
* @param sendRemovalPackets if a packet to send a block change should be sent (this is used to prevent unnecessary packets sent when disconnecting or changing worlds, for example)
|
||||||
|
* @return mapping of the removed visualises
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public Map<Location, VisualBlock> clearVisualBlocks(Player player, @Nullable VisualType visualType, @Nullable Predicate<VisualBlock> predicate, boolean sendRemovalPackets) {
|
||||||
|
|
||||||
|
synchronized (storedVisualises) {
|
||||||
|
if (!this.storedVisualises.containsRow(player.getUniqueId()))
|
||||||
|
return Collections.emptyMap();
|
||||||
|
Map<Location, VisualBlock> results = new HashMap<>(this.storedVisualises.row(player.getUniqueId())); // copy to prevent commodification
|
||||||
|
Map<Location, VisualBlock> removed = new HashMap<>();
|
||||||
|
for (Map.Entry<Location, VisualBlock> entry : results.entrySet()) {
|
||||||
|
VisualBlock visualBlock = entry.getValue();
|
||||||
|
|
||||||
|
if ((predicate == null || predicate.apply(visualBlock)) && (visualType == null || visualBlock.getVisualType() == visualType)) {
|
||||||
|
Location location = entry.getKey();
|
||||||
|
if (removed.put(location, visualBlock) == null) { // not really necessary, but might as well
|
||||||
|
this.clearVisualBlock(player, location, sendRemovalPackets); // this will call remove on storedVisualises.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return removed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
51
src/main/java/me/weebo/border/Border.java
Normal file
51
src/main/java/me/weebo/border/Border.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package me.weebo.border;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
import me.weebo.utilities.LocationUtils;
|
||||||
|
|
||||||
|
public class Border extends BukkitRunnable {
|
||||||
|
|
||||||
|
public Border() {
|
||||||
|
runTaskTimer(PotionSG.getInst(), 0L, 5L);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (PotionSG.getInst().isStarted()) {
|
||||||
|
List<Player> list = PotionSG.getInst().getPlayersInGame();
|
||||||
|
list.addAll(PotionSG.getInst().getSpectators());
|
||||||
|
for (Player p : list) {
|
||||||
|
if (PotionSG.getInst().getArena() != null) {
|
||||||
|
if (p.getWorld().equals(LocationUtils.readGameSpawn().getWorld())) {
|
||||||
|
Location loc = p.getLocation().clone();
|
||||||
|
if (p.getLocation().getX() < PotionSG.getInst().getBorderLocation1().getX()) loc.setX(PotionSG.getInst().getBorderLocation1().getX() + 2);
|
||||||
|
if (p.getLocation().getX() > PotionSG.getInst().getBorderLocation2().getX()) loc.setX(PotionSG.getInst().getBorderLocation2().getX() - 2);
|
||||||
|
if (p.getLocation().getZ() < PotionSG.getInst().getBorderLocation1().getZ()) loc.setZ(PotionSG.getInst().getBorderLocation1().getZ() + 2);
|
||||||
|
if (p.getLocation().getZ() > PotionSG.getInst().getBorderLocation2().getZ()) loc.setZ(PotionSG.getInst().getBorderLocation2().getZ() - 2);
|
||||||
|
if (!p.getLocation().equals(loc)) {
|
||||||
|
loc.setY(getHighestBlockYAt(loc));
|
||||||
|
p.teleport(loc);
|
||||||
|
C.c(p, "&e\u26A0 &cYou have reached the edge of the world.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHighestBlockYAt(Location loc) {
|
||||||
|
for (int y = 0; y < 256; y++) {
|
||||||
|
Material m = loc.getWorld().getBlockAt(loc.getBlockX(), y, loc.getBlockZ()).getType();
|
||||||
|
if (m == Material.AIR || m == Material.LONG_GRASS) return y;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
20
src/main/java/me/weebo/commands/GameInfoCommand.java
Normal file
20
src/main/java/me/weebo/commands/GameInfoCommand.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package me.weebo.commands;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class GameInfoCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
PotionSG.getInst().getInventoryManager().createScen(p, 2);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
src/main/java/me/weebo/commands/host/CancelCmd.java
Normal file
28
src/main/java/me/weebo/commands/host/CancelCmd.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package me.weebo.commands.host;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
|
||||||
|
public class CancelCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_HOST) || p.hasPermission(PotionSG.PERM_MOD) || p.hasPermission(PotionSG.PERM_ACCESS)) {
|
||||||
|
if (p.getName().equalsIgnoreCase(PotionSG.getInst().getHost())) {
|
||||||
|
if (PotionSG.getInst().isWaiting()) PotionSG.getInst().cancel(p);
|
||||||
|
else if (PotionSG.getInst().isStarted()) C.c(p, "&cThe game has already started!");
|
||||||
|
else C.c(p, "&cThere is no game available.");
|
||||||
|
} else C.c(p, "&cYou cannot cancel the game as you are not the host.");
|
||||||
|
} else C.c(p, "&cYou do not have permissions to cancel events.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
24
src/main/java/me/weebo/commands/host/HostCommand.java
Normal file
24
src/main/java/me/weebo/commands/host/HostCommand.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package me.weebo.commands.host;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class HostCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_MOD) || p.hasPermission(PotionSG.PERM_ACCESS)) {
|
||||||
|
PotionSG.getInst().getInventoryManager().createScen(p, 1);
|
||||||
|
} else {
|
||||||
|
p.sendMessage("No Permissions!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
30
src/main/java/me/weebo/commands/host/StartCmd.java
Normal file
30
src/main/java/me/weebo/commands/host/StartCmd.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package me.weebo.commands.host;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
|
||||||
|
public class StartCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_HOST) || p.hasPermission(PotionSG.PERM_MOD) || p.hasPermission(PotionSG.PERM_ACCESS)) {
|
||||||
|
if (p.getName().equalsIgnoreCase(PotionSG.getInst().getHost())) {
|
||||||
|
if (PotionSG.getInst().isWaiting()) {
|
||||||
|
if (PotionSG.getInst().getPlayersWaiting().size() > 1) PotionSG.getInst().start();
|
||||||
|
else C.c(p, "&cThere must be at least 2 players joined to start the game.");
|
||||||
|
} else if (PotionSG.getInst().isStarted()) C.c(p, "&e\u26A0 &cThe game has already started!");
|
||||||
|
else C.c(p, "&cThere is no game available.");
|
||||||
|
} else C.c(p, "&cYou cannot start the game as you are not the host.");
|
||||||
|
} else C.c(p, "&cYou do not have permissions to start events.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
47
src/main/java/me/weebo/commands/staff/ArenaCmd.java
Normal file
47
src/main/java/me/weebo/commands/staff/ArenaCmd.java
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package me.weebo.commands.staff;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import me.weebo.managers.Managers;
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
|
||||||
|
public class ArenaCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_ACCESS)) {
|
||||||
|
if (arg.length == 1) {
|
||||||
|
if (arg[0].equalsIgnoreCase("list")) list(p);
|
||||||
|
else help(p);
|
||||||
|
} else if (arg.length == 2) {
|
||||||
|
if (arg[0].equalsIgnoreCase("create")) Managers.getMapManager().addArena(arg[1], p);
|
||||||
|
else if (arg[0].equalsIgnoreCase("delete")) Managers.getMapManager().removeArena(arg[1], p);
|
||||||
|
else help(p);
|
||||||
|
} else help(p);
|
||||||
|
} else C.c(p, "&cYou do not have permissions to manage arenas.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void list(Player p) {
|
||||||
|
C.c(p, "&7&m--------------------------------------------------", C.MAIN + "&lArenas:");
|
||||||
|
for (String a : Managers.getMapManager().getArenas()) C.c(p, C.CHAT_SECONDARY + "* " + C.MAIN + a);
|
||||||
|
C.c(p, "&7&m--------------------------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void help(Player p) {
|
||||||
|
C.c(p,
|
||||||
|
"&7&m--------------------------------------------------",
|
||||||
|
C.MAIN + "&lSub-commands of \"" + C.CHAT_SECONDARY + "/arenas" + C.MAIN + "&l\":",
|
||||||
|
C.MAIN + "/arena create <name> &7- Create an arena",
|
||||||
|
C.MAIN + "/arena delete <name> &7- Delete an arena",
|
||||||
|
C.MAIN + "/arena list &7- List all arenas",
|
||||||
|
"&7&m--------------------------------------------------");
|
||||||
|
}
|
||||||
|
}
|
36
src/main/java/me/weebo/commands/staff/BuildCmd.java
Normal file
36
src/main/java/me/weebo/commands/staff/BuildCmd.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package me.weebo.commands.staff;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import me.weebo.managers.Managers;
|
||||||
|
import me.weebo.players.Profile;
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
import me.weebo.utilities.PlayerUtils;
|
||||||
|
|
||||||
|
public class BuildCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_BUILD)) {
|
||||||
|
Profile pr = Managers.getProfileManager().getProfile(p.getUniqueId());
|
||||||
|
if (pr.isInLobby()) {
|
||||||
|
p.setGameMode(pr.isBuild() ? GameMode.SURVIVAL : GameMode.CREATIVE);
|
||||||
|
if (!pr.isBuild()) {
|
||||||
|
p.getInventory().clear();
|
||||||
|
p.updateInventory();
|
||||||
|
} else PlayerUtils.lobbyItems(p);
|
||||||
|
C.c(p, "&aBuild mode has been " + (pr.isBuild() ? "disabled" : "enabled") + ".");
|
||||||
|
pr.setBuild(!pr.isBuild());
|
||||||
|
} else C.c(p, "&cYou must be in lobby to toggle build mode.");
|
||||||
|
} else C.c(p, "&cYou do not have permissions to toggle build mode.");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
68
src/main/java/me/weebo/commands/staff/FreezeCmd.java
Normal file
68
src/main/java/me/weebo/commands/staff/FreezeCmd.java
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
package me.weebo.commands.staff;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import me.weebo.managers.Managers;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
import me.weebo.utilities.C;
|
||||||
|
|
||||||
|
public class FreezeCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_MOD) || p.hasPermission(PotionSG.PERM_ACCESS)) {
|
||||||
|
if (arg.length == 0 || arg.length > 1) C.c(p, "&e\u26A0 &cUsage: /freeze <player>");
|
||||||
|
else {
|
||||||
|
if (Bukkit.getPlayer(arg[0]) != null) {
|
||||||
|
Player t = Bukkit.getPlayer(arg[0]);
|
||||||
|
if (Managers.getProfileManager().getProfile(t.getUniqueId()).isFrozen()) {
|
||||||
|
allowMovement(t);
|
||||||
|
C.c(p, "&aYou unfroze " + t.getName() + ".");
|
||||||
|
C.c(t, "&aYou have been unfrozen.");
|
||||||
|
} else {
|
||||||
|
denyMovement(t);
|
||||||
|
C.c(p, "&aYou froze " + t.getName() + ".");
|
||||||
|
C.c(t, "",
|
||||||
|
"&f\u2588\u2588\u2588\u2588&c\u2588&f\u2588\u2588\u2588\u2588",
|
||||||
|
"&f\u2588\u2588\u2588&c\u2588&6\u2588&c\u2588&f\u2588\u2588\u2588",
|
||||||
|
"&f\u2588\u2588&c\u2588&6\u2588&0\u2588&6\u2588&c\u2588&f\u2588\u2588 &c&lYou have been frozen!",
|
||||||
|
"&f\u2588\u2588&c\u2588&6\u2588&0\u2588&6\u2588&c\u2588&f\u2588\u2588",
|
||||||
|
"&f\u2588&c\u2588&6\u2588\u2588&0\u2588&6\u2588\u2588&c\u2588&f\u2588 &7Please join " + C.MAIN + "discord.nekros.club",
|
||||||
|
"&f\u2588&c\u2588&6\u2588\u2588\u2588\u2588\u2588&c\u2588&f\u2588 &7in 3 minutes or you will be banned",
|
||||||
|
"&c\u2588&6\u2588\u2588\u2588&0\u2588&6\u2588\u2588\u2588&c\u2588",
|
||||||
|
"&c\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
|
||||||
|
"");
|
||||||
|
}
|
||||||
|
Managers.getProfileManager().getProfile(t.getUniqueId()).toggleFreeze();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void denyMovement(Player player) {
|
||||||
|
player.setWalkSpeed(0.0F);
|
||||||
|
player.setFlySpeed(0.0F);
|
||||||
|
player.setFoodLevel(0);
|
||||||
|
player.setSprinting(false);
|
||||||
|
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 200));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void allowMovement(Player player) {
|
||||||
|
player.setWalkSpeed(0.2F);
|
||||||
|
player.setFlySpeed(0.0001F);
|
||||||
|
player.setFoodLevel(20);
|
||||||
|
player.setSprinting(true);
|
||||||
|
player.removePotionEffect(PotionEffectType.JUMP);
|
||||||
|
}
|
||||||
|
}
|
22
src/main/java/me/weebo/commands/staff/SetLobbySpawnCmd.java
Normal file
22
src/main/java/me/weebo/commands/staff/SetLobbySpawnCmd.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package me.weebo.commands.staff;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import me.weebo.utilities.LocationUtils;
|
||||||
|
|
||||||
|
public class SetLobbySpawnCmd implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender s, Command cmd, String label, String[] arg) {
|
||||||
|
if (s instanceof Player) {
|
||||||
|
Player p = (Player) s;
|
||||||
|
if (p.hasPermission(PotionSG.PERM_ACCESS)) LocationUtils.saveLobbySpawn(p);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
35
src/main/java/me/weebo/commands/staff/SetSlotsCommand.java
Normal file
35
src/main/java/me/weebo/commands/staff/SetSlotsCommand.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package me.weebo.commands.staff;
|
||||||
|
|
||||||
|
import me.weebo.PotionSG;
|
||||||
|
import me.weebo.utilities.BukkitReflection;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
public class SetSlotsCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||||
|
if (!sender.hasPermission(PotionSG.PERM_ADMIN)) {
|
||||||
|
sender.sendMessage("§cInsufficient permissions");
|
||||||
|
return true;
|
||||||
|
} else if (args.length != 1) {
|
||||||
|
sender.sendMessage("§c/setslots <slots>");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
Integer slots;
|
||||||
|
try {
|
||||||
|
slots = Integer.parseInt(args[0]);
|
||||||
|
} catch (Exception var6) {
|
||||||
|
sender.sendMessage("§cNot a valid number.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
BukkitReflection.setMaxPlayers(Bukkit.getServer(), slots);
|
||||||
|
sender.sendMessage(String.format("§aSuccessfully set the slots to §2%s§a.", slots));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
482
src/main/java/me/weebo/cuboid/Cuboid.java
Normal file
482
src/main/java/me/weebo/cuboid/Cuboid.java
Normal file
@ -0,0 +1,482 @@
|
|||||||
|
package me.weebo.cuboid;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class Cuboid
|
||||||
|
implements Iterable<Block>, Cloneable, ConfigurationSerializable {
|
||||||
|
protected String worldName;
|
||||||
|
protected int x1;
|
||||||
|
protected int y1;
|
||||||
|
protected int z1;
|
||||||
|
protected int x2;
|
||||||
|
protected int y2;
|
||||||
|
protected int z2;
|
||||||
|
|
||||||
|
public Cuboid(Map<String, Object> map) {
|
||||||
|
this.worldName = ((String) map.get("worldName"));
|
||||||
|
this.x1 = ((Integer) map.get("x1")).intValue();
|
||||||
|
this.y1 = ((Integer) map.get("y1")).intValue();
|
||||||
|
this.z1 = ((Integer) map.get("z1")).intValue();
|
||||||
|
this.x2 = ((Integer) map.get("x2")).intValue();
|
||||||
|
this.y2 = ((Integer) map.get("y2")).intValue();
|
||||||
|
this.z2 = ((Integer) map.get("z2")).intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid(World world, int x1, int y1, int z1, int x2, int y2, int z2) {
|
||||||
|
this(((World) Preconditions.checkNotNull(world)).getName(), x1, y1, z1, x2, y2, z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Cuboid(String worldName, int x1, int y1, int z1, int x2, int y2, int z2) {
|
||||||
|
Preconditions.checkNotNull(worldName, "World name cannot be null");
|
||||||
|
this.worldName = worldName;
|
||||||
|
this.x1 = Math.min(x1, x2);
|
||||||
|
this.y1 = Math.min(y1, y2);
|
||||||
|
this.z1 = Math.min(z1, z2);
|
||||||
|
this.x2 = Math.max(x1, x2);
|
||||||
|
this.y2 = Math.max(y1, y2);
|
||||||
|
this.z2 = Math.max(z1, z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid(Location first, Location second) {
|
||||||
|
Preconditions.checkNotNull(first, "Location 1 cannot be null");
|
||||||
|
Preconditions.checkNotNull(second, "Location 2 cannot be null");
|
||||||
|
Preconditions.checkArgument(first.getWorld().equals(second.getWorld()), "Locations must be on the same world");
|
||||||
|
this.worldName = first.getWorld().getName();
|
||||||
|
this.x1 = Math.min(first.getBlockX(), second.getBlockX());
|
||||||
|
this.y1 = Math.min(first.getBlockY(), second.getBlockY());
|
||||||
|
this.z1 = Math.min(first.getBlockZ(), second.getBlockZ());
|
||||||
|
this.x2 = Math.max(first.getBlockX(), second.getBlockX());
|
||||||
|
this.y2 = Math.max(first.getBlockY(), second.getBlockY());
|
||||||
|
this.z2 = Math.max(first.getBlockZ(), second.getBlockZ());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid(Location location) {
|
||||||
|
this(location, location);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid(Cuboid other) {
|
||||||
|
this(other.getWorld().getName(), other.x1, other.y1, other.z1, other.x2, other.y2, other.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> serialize() {
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("worldName", this.worldName);
|
||||||
|
map.put("x1", Integer.valueOf(this.x1));
|
||||||
|
map.put("y1", Integer.valueOf(this.y1));
|
||||||
|
map.put("z1", Integer.valueOf(this.z1));
|
||||||
|
map.put("x2", Integer.valueOf(this.x2));
|
||||||
|
map.put("y2", Integer.valueOf(this.y2));
|
||||||
|
map.put("z2", Integer.valueOf(this.z2));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasBothPositionsSet() {
|
||||||
|
return (getMinimumPoint() != null) && (getMaximumPoint() != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinimumX() {
|
||||||
|
return Math.min(this.x1, this.x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinimumZ() {
|
||||||
|
return Math.min(this.z1, this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaximumX() {
|
||||||
|
return Math.max(this.x1, this.x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaximumZ() {
|
||||||
|
return Math.max(this.z1, this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Vector> edges() {
|
||||||
|
return edges(-1, -1, -1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Vector> edges(int fixedMinX, int fixedMaxX, int fixedMinZ, int fixedMaxZ) {
|
||||||
|
Vector v1 = getMinimumPoint().toVector();
|
||||||
|
Vector v2 = getMaximumPoint().toVector();
|
||||||
|
int minX = v1.getBlockX();
|
||||||
|
int maxX = v2.getBlockX();
|
||||||
|
int minZ = v1.getBlockZ();
|
||||||
|
int maxZ = v2.getBlockZ();
|
||||||
|
int capacity = (maxX - minX) * 4 + (maxZ - minZ) * 4;
|
||||||
|
capacity += 4;
|
||||||
|
List<Vector> result = new ArrayList<>(capacity);
|
||||||
|
if (capacity <= 0) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int minY = v1.getBlockY();
|
||||||
|
int maxY = v1.getBlockY();
|
||||||
|
for (int x = minX; x <= maxX; x++) {
|
||||||
|
result.add(new Vector(x, minY, minZ));
|
||||||
|
result.add(new Vector(x, minY, maxZ));
|
||||||
|
result.add(new Vector(x, maxY, minZ));
|
||||||
|
result.add(new Vector(x, maxY, maxZ));
|
||||||
|
}
|
||||||
|
for (int z = minZ; z <= maxZ; z++) {
|
||||||
|
result.add(new Vector(minX, minY, z));
|
||||||
|
result.add(new Vector(minX, maxY, z));
|
||||||
|
result.add(new Vector(maxX, minY, z));
|
||||||
|
result.add(new Vector(maxX, maxY, z));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public Set<Player> getPlayers() {
|
||||||
|
Set<Player> players = new HashSet<Player>();
|
||||||
|
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if (contains(player)) {
|
||||||
|
players.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return players;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getLowerNE() {
|
||||||
|
return new Location(getWorld(), this.x1, this.y1, this.z1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getUpperSW() {
|
||||||
|
return new Location(getWorld(), this.x2, this.y2, this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getCenter() {
|
||||||
|
int x1 = this.x2 + 1;
|
||||||
|
int y1 = this.y2 + 1;
|
||||||
|
int z1 = this.z2 + 1;
|
||||||
|
return new Location(getWorld(), this.x1 + (x1 - this.x1) / 2.0D, this.y1 + (y1 - this.y1) / 2.0D, this.z1 + (z1 - this.z1) / 2.0D);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorldName() {
|
||||||
|
return this.worldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public World getWorld() {
|
||||||
|
return Bukkit.getWorld(this.worldName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSizeX() {
|
||||||
|
return this.x2 - this.x1 + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSizeY() {
|
||||||
|
return this.y2 - this.y1 + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSizeZ() {
|
||||||
|
return this.z2 - this.z1 + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getX1() {
|
||||||
|
return this.x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setX1(int x1) {
|
||||||
|
this.x1 = x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY1() {
|
||||||
|
return this.y1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setY1(int y1) {
|
||||||
|
this.y1 = y1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZ1() {
|
||||||
|
return this.z1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZ1(int z1) {
|
||||||
|
this.z1 = z1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getX2() {
|
||||||
|
return this.x2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY2() {
|
||||||
|
return this.y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setY2(int y2) {
|
||||||
|
this.y2 = y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZ2() {
|
||||||
|
return this.z2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location[] getCornerLocations() {
|
||||||
|
Location[] result = new Location[8];
|
||||||
|
Block[] cornerBlocks = getCornerBlocks();
|
||||||
|
for (int i = 0; i < cornerBlocks.length; i++) {
|
||||||
|
result[i] = cornerBlocks[i].getLocation();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block[] getCornerBlocks() {
|
||||||
|
Block[] result = new Block[8];
|
||||||
|
World world = getWorld();
|
||||||
|
result[0] = world.getBlockAt(this.x1, this.y1, this.z1);
|
||||||
|
result[1] = world.getBlockAt(this.x1, this.y1, this.z2);
|
||||||
|
result[2] = world.getBlockAt(this.x1, this.y2, this.z1);
|
||||||
|
result[3] = world.getBlockAt(this.x1, this.y2, this.z2);
|
||||||
|
result[4] = world.getBlockAt(this.x2, this.y1, this.z1);
|
||||||
|
result[5] = world.getBlockAt(this.x2, this.y1, this.z2);
|
||||||
|
result[6] = world.getBlockAt(this.x2, this.y2, this.z1);
|
||||||
|
result[7] = world.getBlockAt(this.x2, this.y2, this.z2);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid shift(CuboidDirection direction, int amount)
|
||||||
|
throws IllegalArgumentException {
|
||||||
|
return expand(direction, amount).expand(direction.opposite(), -amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid inset(CuboidDirection direction, int amount)
|
||||||
|
throws IllegalArgumentException {
|
||||||
|
return outset(direction, -amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public Cuboid expand(CuboidDirection direction, int amount)
|
||||||
|
throws IllegalArgumentException {
|
||||||
|
switch (direction) {
|
||||||
|
case BOTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1 - amount, this.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case EAST:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2 + amount, this.y2, this.z2);
|
||||||
|
case DOWN:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1 - amount, this.x2, this.y2, this.z2);
|
||||||
|
case HORIZONTAL:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, this.y2, this.z2 + amount);
|
||||||
|
case SOUTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1 - amount, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case NORTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, this.y2 + amount, this.z2);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid direction " + direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public Cuboid outset(CuboidDirection direction, int amount)
|
||||||
|
throws IllegalArgumentException {
|
||||||
|
switch (direction) {
|
||||||
|
case UNKNOWN:
|
||||||
|
return expand(CuboidDirection.NORTH, amount).expand(CuboidDirection.SOUTH, amount).expand(CuboidDirection.EAST, amount).expand(CuboidDirection.WEST, amount);
|
||||||
|
case UP:
|
||||||
|
return expand(CuboidDirection.DOWN, amount).expand(CuboidDirection.UP, amount);
|
||||||
|
case VERTICAL:
|
||||||
|
return outset(CuboidDirection.HORIZONTAL, amount).outset(CuboidDirection.VERTICAL, amount);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid direction " + direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(Cuboid cuboid) {
|
||||||
|
return (contains(cuboid.getMinimumPoint())) || (contains(cuboid.getMaximumPoint()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(Player player) {
|
||||||
|
return contains(player.getLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(World world, int x, int z) {
|
||||||
|
return ((world == null) || (getWorld().equals(world))) && (x >= this.x1) && (x <= this.x2) && (z >= this.z1) && (z <= this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(int x, int y, int z) {
|
||||||
|
return (x >= this.x1) && (x <= this.x2) && (y >= this.y1) && (y <= this.y2) && (z >= this.z1) && (z <= this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(Block block) {
|
||||||
|
return contains(block.getLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(Location location) {
|
||||||
|
if ((location == null) || (this.worldName == null)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
World world = location.getWorld();
|
||||||
|
return (world != null) && (this.worldName.equals(location.getWorld().getName())) && (contains(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVolume() {
|
||||||
|
return getSizeX() * getSizeY() * getSizeZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getArea() {
|
||||||
|
Location min = getMinimumPoint();
|
||||||
|
Location max = getMaximumPoint();
|
||||||
|
return (max.getBlockX() - min.getBlockX() + 1) * (max.getBlockZ() - min.getBlockZ() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getAverageLightLevel() {
|
||||||
|
long total = 0L;
|
||||||
|
int count = 0;
|
||||||
|
for (Block block : this) {
|
||||||
|
if (block.isEmpty()) {
|
||||||
|
total += block.getLightLevel();
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count > 0 ? (byte) (int) (total / count) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getMinimumPoint() {
|
||||||
|
return new Location(getWorld(), Math.min(this.x1, this.x2), Math.min(this.y1, this.y2), Math.min(this.z1, this.z2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getMaximumPoint() {
|
||||||
|
return new Location(getWorld(), Math.max(this.x1, this.x2), Math.max(this.y1, this.y2), Math.max(this.z1, this.z2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWidth() {
|
||||||
|
return getMaximumPoint().getBlockX() - getMinimumPoint().getBlockX();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return getMaximumPoint().getBlockY() - getMinimumPoint().getBlockY();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLength() {
|
||||||
|
return getMaximumPoint().getBlockZ() - getMinimumPoint().getBlockZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid contract() {
|
||||||
|
return contract(CuboidDirection.DOWN).contract(CuboidDirection.SOUTH).contract(CuboidDirection.EAST).contract(CuboidDirection.UP).contract(CuboidDirection.NORTH).contract(CuboidDirection.WEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public Cuboid contract(CuboidDirection direction) {
|
||||||
|
Cuboid face = getFace(direction.opposite());
|
||||||
|
switch (direction) {
|
||||||
|
case SOUTH:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.y1 > this.y1)) {
|
||||||
|
face = face.shift(CuboidDirection.DOWN, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, face.y2, this.z2);
|
||||||
|
case NORTH:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.y2 < this.y2)) {
|
||||||
|
face = face.shift(CuboidDirection.UP, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, this.x1, face.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case BOTH:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.x1 > this.x1)) {
|
||||||
|
face = face.shift(CuboidDirection.NORTH, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, face.x2, this.y2, this.z2);
|
||||||
|
case EAST:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.x2 < this.x2)) {
|
||||||
|
face = face.shift(CuboidDirection.SOUTH, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, face.x1, this.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case DOWN:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.z1 > this.z1)) {
|
||||||
|
face = face.shift(CuboidDirection.EAST, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, this.y2, face.z2);
|
||||||
|
case HORIZONTAL:
|
||||||
|
while ((face.containsOnly(Material.AIR)) && (face.z2 < this.z2)) {
|
||||||
|
face = face.shift(CuboidDirection.WEST, 1);
|
||||||
|
}
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, face.z1, this.x2, this.y2, this.z2);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid direction " + direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public Cuboid getFace(CuboidDirection direction) {
|
||||||
|
switch (direction) {
|
||||||
|
case SOUTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, this.y1, this.z2);
|
||||||
|
case NORTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y2, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case BOTH:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x1, this.y2, this.z2);
|
||||||
|
case EAST:
|
||||||
|
return new Cuboid(this.worldName, this.x2, this.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
case DOWN:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z1, this.x2, this.y2, this.z1);
|
||||||
|
case HORIZONTAL:
|
||||||
|
return new Cuboid(this.worldName, this.x1, this.y1, this.z2, this.x2, this.y2, this.z2);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid direction " + direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsOnly(Material material) {
|
||||||
|
for (Block block : this) {
|
||||||
|
if (block.getType() != material) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid getBoundingCuboid(Cuboid other) {
|
||||||
|
if (other == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
int xMin = Math.min(this.x1, other.x1);
|
||||||
|
int yMin = Math.min(this.y1, other.y1);
|
||||||
|
int zMin = Math.min(this.z1, other.z1);
|
||||||
|
int xMax = Math.max(this.x2, other.x2);
|
||||||
|
int yMax = Math.max(this.y2, other.y2);
|
||||||
|
int zMax = Math.max(this.z2, other.z2);
|
||||||
|
return new Cuboid(this.worldName, xMin, yMin, zMin, xMax, yMax, zMax);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block getRelativeBlock(int x, int y, int z) {
|
||||||
|
return getWorld().getBlockAt(this.x1 + x, this.y1 + y, this.z1 + z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block getRelativeBlock(World world, int x, int y, int z) {
|
||||||
|
return world.getBlockAt(this.x1 + x, this.y1 + y, this.z1 + z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Chunk> getChunks() {
|
||||||
|
World world = getWorld();
|
||||||
|
int x1 = this.x1 & 0xFFFFFFF0;
|
||||||
|
int x2 = this.x2 & 0xFFFFFFF0;
|
||||||
|
int z1 = this.z1 & 0xFFFFFFF0;
|
||||||
|
int z2 = this.z2 & 0xFFFFFFF0;
|
||||||
|
List<Chunk> result = new ArrayList<>(x2 - x1 + 16 + (z2 - z1) * 16);
|
||||||
|
for (int x3 = x1; x3 <= x2; x3 += 16) {
|
||||||
|
for (int z3 = z1; z3 <= z2; z3 += 16) {
|
||||||
|
result.add(world.getChunkAt(x3 >> 4, z3 >> 4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Iterator<Block> iterator() {
|
||||||
|
return new CuboidBlockIterator(getWorld(), this.x1, this.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Iterator<Location> locationIterator() {
|
||||||
|
return new CuboidLocationIterator(getWorld(), this.x1, this.y1, this.z1, this.x2, this.y2, this.z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cuboid clone() {
|
||||||
|
try {
|
||||||
|
return (Cuboid) super.clone();
|
||||||
|
} catch (CloneNotSupportedException ex) {
|
||||||
|
throw new RuntimeException("This could never happen", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "Cuboid: " + this.worldName + ',' + this.x1 + ',' + this.y1 + ',' + this.z1 + "=>" + this.x2 + ',' + this.y2 + ',' + this.z2;
|
||||||
|
}
|
||||||
|
}
|
54
src/main/java/me/weebo/cuboid/CuboidBlockIterator.java
Normal file
54
src/main/java/me/weebo/cuboid/CuboidBlockIterator.java
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package me.weebo.cuboid;
|
||||||
|
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
public class CuboidBlockIterator
|
||||||
|
implements Iterator<Block> {
|
||||||
|
private World world;
|
||||||
|
private int baseX;
|
||||||
|
private int baseY;
|
||||||
|
private int baseZ;
|
||||||
|
private int sizeX;
|
||||||
|
private int sizeY;
|
||||||
|
private int sizeZ;
|
||||||
|
private int x;
|
||||||
|
private int y;
|
||||||
|
private int z;
|
||||||
|
|
||||||
|
public CuboidBlockIterator(World world, int x1, int y1, int z1, int x2, int y2, int z2) {
|
||||||
|
this.world = world;
|
||||||
|
this.baseX = x1;
|
||||||
|
this.baseY = y1;
|
||||||
|
this.baseZ = z1;
|
||||||
|
this.sizeX = (Math.abs(x2 - x1) + 1);
|
||||||
|
this.sizeY = (Math.abs(y2 - y1) + 1);
|
||||||
|
this.sizeZ = (Math.abs(z2 - z1) + 1);
|
||||||
|
this.z = 0;
|
||||||
|
this.y = 0;
|
||||||
|
this.x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasNext() {
|
||||||
|
return (this.x < this.sizeX) && (this.y < this.sizeY) && (this.z < this.sizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block next() {
|
||||||
|
Block block = this.world.getBlockAt(this.baseX + this.x, this.baseY + this.y, this.baseZ + this.z);
|
||||||
|
if (++this.x >= this.sizeX) {
|
||||||
|
this.x = 0;
|
||||||
|
if (++this.y >= this.sizeY) {
|
||||||
|
this.y = 0;
|
||||||
|
this.z += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove()
|
||||||
|
throws UnsupportedOperationException {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
}
|
55
src/main/java/me/weebo/cuboid/CuboidDirection.java
Normal file
55
src/main/java/me/weebo/cuboid/CuboidDirection.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package me.weebo.cuboid;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
|
||||||
|
public enum CuboidDirection {
|
||||||
|
NORTH, EAST, SOUTH, WEST, UP, DOWN, HORIZONTAL, VERTICAL, BOTH, UNKNOWN;
|
||||||
|
|
||||||
|
private CuboidDirection() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public CuboidDirection opposite() {
|
||||||
|
switch (this) {
|
||||||
|
case BOTH:
|
||||||
|
return SOUTH;
|
||||||
|
case DOWN:
|
||||||
|
return WEST;
|
||||||
|
case EAST:
|
||||||
|
return NORTH;
|
||||||
|
case HORIZONTAL:
|
||||||
|
return EAST;
|
||||||
|
case UNKNOWN:
|
||||||
|
return VERTICAL;
|
||||||
|
case UP:
|
||||||
|
return HORIZONTAL;
|
||||||
|
case NORTH:
|
||||||
|
return DOWN;
|
||||||
|
case SOUTH:
|
||||||
|
return UP;
|
||||||
|
case VERTICAL:
|
||||||
|
return BOTH;
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public BlockFace toBukkitDirection() {
|
||||||
|
switch (this) {
|
||||||
|
case BOTH:
|
||||||
|
return BlockFace.NORTH;
|
||||||
|
case DOWN:
|
||||||
|
return BlockFace.EAST;
|
||||||
|
case EAST:
|
||||||
|
return BlockFace.SOUTH;
|
||||||
|
case HORIZONTAL:
|
||||||
|
return BlockFace.WEST;
|
||||||
|
case NORTH:
|
||||||
|
return BlockFace.UP;
|
||||||
|
case SOUTH:
|
||||||
|
return BlockFace.DOWN;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user