13.0 - 13.2 #9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
# User-specific stuff
|
# User-specific stuff
|
||||||
.idea/
|
.idea/
|
||||||
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
@ -96,7 +96,6 @@ $RECYCLE.BIN/
|
|||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
target/
|
target/
|
||||||
target\
|
|
||||||
|
|
||||||
pom.xml.tag
|
pom.xml.tag
|
||||||
pom.xml.releaseBackup
|
pom.xml.releaseBackup
|
||||||
|
3
.idea/.gitignore
vendored
3
.idea/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile name="Maven default annotation processors profile" enabled="true">
|
|
||||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
|
||||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
|
||||||
<outputRelativeToContentRoot value="true" />
|
|
||||||
<module name="T2CodeLib" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
<bytecodeTargetLevel>
|
|
||||||
<module name="T2CodeLib" target="1.8" />
|
|
||||||
</bytecodeTargetLevel>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="DiscordProjectSettings">
|
|
||||||
<option name="show" value="ASK" />
|
|
||||||
<option name="description" value="" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding">
|
|
||||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RemoteRepositoriesConfiguration">
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="central" />
|
|
||||||
<option name="name" value="Central Repository" />
|
|
||||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="Builders-Paradise" />
|
|
||||||
<option name="name" value="Builders-Paradise" />
|
|
||||||
<option name="url" value="https://dojagames.net:8081/repository/Builders-Paradise/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="jitpack.io" />
|
|
||||||
<option name="name" value="jitpack.io" />
|
|
||||||
<option name="url" value="https://jitpack.io" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="sonatype" />
|
|
||||||
<option name="name" value="sonatype" />
|
|
||||||
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="central" />
|
|
||||||
<option name="name" value="Maven Central repository" />
|
|
||||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="placeholderapi" />
|
|
||||||
<option name="name" value="placeholderapi" />
|
|
||||||
<option name="url" value="https://repo.extendedclip.com/content/repositories/placeholderapi/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="placeholderapi" />
|
|
||||||
<option name="name" value="placeholderapi" />
|
|
||||||
<option name="url" value="http://repo.extendedclip.com/content/repositories/placeholderapi/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="BenCodez Repo" />
|
|
||||||
<option name="name" value="BenCodez Repo" />
|
|
||||||
<option name="url" value="https://nexus.bencodez.com/repository/maven-public/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="Builders-Paradise" />
|
|
||||||
<option name="name" value="Builders-Paradise" />
|
|
||||||
<option name="url" value="https://repo.t2code.net/repository/Builders-Paradise/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="T2CodePrivat" />
|
|
||||||
<option name="name" value="T2CodePrivat" />
|
|
||||||
<option name="url" value="https://repo.t2code.net/repository/T2CodePrivat/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="T2Code" />
|
|
||||||
<option name="name" value="T2Code" />
|
|
||||||
<option name="url" value="https://repo.t2code.net/repository/T2Code/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="spigot-repo" />
|
|
||||||
<option name="name" value="spigot-repo" />
|
|
||||||
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="spigotmc-repo" />
|
|
||||||
<option name="name" value="spigotmc-repo" />
|
|
||||||
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
|
||||||
</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="bungeecord-repo" />
|
|
||||||
<option name="name" value="bungeecord-repo" />
|
|
||||||
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
|
|
||||||
</remote-repository>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,13 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: com.github.MilkBowl:VaultAPI:1.7">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/MilkBowl/VaultAPI/1.7/VaultAPI-1.7.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/MilkBowl/VaultAPI/1.7/VaultAPI-1.7-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/MilkBowl/VaultAPI/1.7/VaultAPI-1.7-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: com.googlecode.json-simple:json-simple:1.1.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: commons-lang:commons-lang:2.6">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="EntryPointsManager">
|
|
||||||
<list size="2">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="net.md_5.bungee.event.EventHandler" />
|
|
||||||
</list>
|
|
||||||
</component>
|
|
||||||
<component name="MavenProjectsManager">
|
|
||||||
<option name="originalFiles">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectType">
|
|
||||||
<option name="id" value="jpab" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/T2CodeLib.iml" filepath="$PROJECT_DIR$/T2CodeLib.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,124 +0,0 @@
|
|||||||
<?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>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="minecraft" name="Minecraft">
|
|
||||||
<configuration>
|
|
||||||
<autoDetectTypes>
|
|
||||||
<platformType>SPIGOT</platformType>
|
|
||||||
</autoDetectTypes>
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="McpModuleSettings">
|
|
||||||
<option name="srgType" value="SRG" />
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.t2code:bungee:1642" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.t2code:LuckyBox-API:4.2.7" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bencodez:votingplugin:6.9.3" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-velocity:2.2.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-base:2.2.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.bencodez:advancedcore:master-28bd248b49-1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: xyz.upperlevel.spigot.book:spigot-book-api:1.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-text-minimessage:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-api:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-key:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:examination-api:1.3.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:examination-string:1.3.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-platform-bukkit:4.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-platform-api:4.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-text-serializer-bungeecord:4.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-text-serializer-legacy:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-nbt:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-text-serializer-gson:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="RUNTIME" name="Maven: net.kyori:adventure-text-serializer-gson-legacy-impl:4.11.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="RUNTIME" name="Maven: net.kyori:adventure-platform-facet:4.1.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="RUNTIME" name="Maven: net.kyori:adventure-platform-viaversion:4.1.1" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
23
pom.xml
23
pom.xml
@ -4,21 +4,17 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<version>12.5</version>
|
|
||||||
<!-- <classifier>dev-1</classifier> -->
|
|
||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<packaging>jar</packaging>
|
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
|
<version>13.3_DEV</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>T2CodeLib</name>
|
<name>T2CodeLib</name>
|
||||||
|
|
||||||
<description>Library from T2Code Plugins</description>
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<url>T2Code.net</url>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
@ -57,6 +53,10 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype-oss-snapshots1</id>
|
||||||
|
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
<!-- Mojang / Spigot -->
|
<!-- Mojang / Spigot -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
@ -86,14 +86,21 @@
|
|||||||
<id>BenCodez Repo</id>
|
<id>BenCodez Repo</id>
|
||||||
<url>https://nexus.bencodez.com/repository/maven-public/</url>
|
<url>https://nexus.bencodez.com/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<!--Kyori MiniMessage
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>sonatype-oss-snapshots1</id>
|
||||||
|
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</repository>-->
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Mojang / Spigot-->
|
<!-- Mojang / Spigot-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.19.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -138,7 +145,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bukkit</artifactId>
|
<artifactId>adventure-platform-bukkit</artifactId>
|
||||||
<version>4.1.1</version>
|
<version>4.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
package net.t2code.lib.Bungee;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
|
||||||
import net.t2code.lib.Bungee.system.BLoad;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
|
|
||||||
public final class BMain extends Plugin {
|
|
||||||
|
|
||||||
|
|
||||||
public static Plugin plugin;
|
|
||||||
public static String Version;
|
|
||||||
private static String orgVersion;
|
|
||||||
public static String Autor;
|
|
||||||
|
|
||||||
public static String Prefix = Util.getPrefix();
|
|
||||||
public static Integer SpigotID = Util.getSpigotID();
|
|
||||||
public static Integer BstatsID = Util.getBstatsID();
|
|
||||||
public static String Spigot = Util.getSpigot();
|
|
||||||
public static String Discord = Util.getDiscord();
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
// Plugin startup logic
|
|
||||||
plugin = this;
|
|
||||||
orgVersion = plugin.getDescription().getVersion();
|
|
||||||
Autor = plugin.getDescription().getAuthor();
|
|
||||||
BLoad.onLoad(plugin, Prefix, Autor, orgVersion, Spigot, Discord, SpigotID,BstatsID);
|
|
||||||
String[] fv=orgVersion.split("_");
|
|
||||||
plugin.getDescription().setVersion(fv[0]);
|
|
||||||
Version = plugin.getDescription().getVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable() {
|
|
||||||
// Plugin shutdown logic
|
|
||||||
Bsend.console(Prefix + "§4============================= " + Prefix + " §4=============================");
|
|
||||||
Bsend.console(Prefix + " §2Autor: §6" + String.valueOf(Autor).replace("[", "").replace("]", ""));
|
|
||||||
Bsend.console(Prefix + " §2Version: §6" + Version);
|
|
||||||
Bsend.console(Prefix + " §2Spigot: §6" + Spigot);
|
|
||||||
Bsend.console(Prefix + " §2Discord: §6" + Discord);
|
|
||||||
Bsend.console(Prefix + " §4Plugin successfully disabled.");
|
|
||||||
Bsend.console(Prefix + "§4============================= " + Prefix + " §4=============================");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.messages;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.t2code.lib.Bungee.Lib.update.BUpdateAPI;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BT2CodeTemplate {
|
|
||||||
|
|
||||||
|
|
||||||
public static Long onLoadHeader(String prefix, String autor, String version, String spigot, String discord) {
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
Bsend.console(prefix + " §2Autor: §6" + autor.replace("[", "").replace("]", ""));
|
|
||||||
Bsend.console(prefix + " §2Version: §6" + version);
|
|
||||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
|
||||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
|
||||||
Bsend.console(prefix + " §8-------------------------------");
|
|
||||||
return long_;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onLoadSeparateStroke(String prefix) {
|
|
||||||
Bsend.console(prefix + " §8-------------------------------");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onLoadFooter(String prefix, Long long_) {
|
|
||||||
Bsend.console(prefix + " §8-------------------------------");
|
|
||||||
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onDisable(String prefix, String autor, String version, String spigot, String discord) {
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
Bsend.console(prefix + " §2Autor: §6" + autor.replace("[", "").replace("]", ""));
|
|
||||||
Bsend.console(prefix + " §2Version: §6" + version);
|
|
||||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
|
||||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
|
||||||
Bsend.console(prefix + " §4Plugin successfully disabled.");
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, String autor, String pluginVersion, String publicVersion) {
|
|
||||||
Bsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
|
||||||
Bsend.sender(sender, prefix + " §2Autor: §6" + autor);
|
|
||||||
if (publicVersion.equalsIgnoreCase(pluginVersion)) {
|
|
||||||
Bsend.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
|
||||||
} else {
|
|
||||||
BUpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, sender);
|
|
||||||
}
|
|
||||||
Bsend.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
|
||||||
Bsend.sender(sender, prefix + " §2Discord: §6" + discord);
|
|
||||||
Bsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.update;
|
|
||||||
|
|
||||||
public class BUpdateObject {
|
|
||||||
public String pluginName;
|
|
||||||
public String pluginVersion;
|
|
||||||
public String publicVersion;
|
|
||||||
public BUpdateObject(String pluginName, String pluginVersion, String publicVersion){
|
|
||||||
this.pluginName = pluginName;
|
|
||||||
this.pluginVersion = pluginVersion;
|
|
||||||
this.publicVersion = publicVersion;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package net.t2code.lib.Bungee.system;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
|
||||||
import net.t2code.lib.Bungee.Lib.update.BUpdateAPI;
|
|
||||||
|
|
||||||
public class BLoad {
|
|
||||||
public static void onLoad(Plugin plugin, String prefix, String autor, String version, String spigot, String discord, Integer spigotID,Integer bstatsID){
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
Bsend.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
|
||||||
Bsend.console(prefix + " §2Version: §6" + version);
|
|
||||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
|
||||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BMetrics.Bstats(plugin, bstatsID);
|
|
||||||
|
|
||||||
BUpdateAPI.onUpdateCheckTimer(plugin, prefix, spigot, discord, spigotID);
|
|
||||||
|
|
||||||
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.commands;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class Cmd {
|
|
||||||
public static void console(String cmd) {
|
|
||||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void player(Player player, String cmd) {
|
|
||||||
player.chat("/" + cmd);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,147 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.messages;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class T2CodeTemplate {
|
|
||||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord) {
|
|
||||||
return onLoadHeader(prefix, autor, version, spigot, discord, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium) {
|
|
||||||
return onLoadHeader(prefix, autor, version, spigot, discord, isPremium, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium, Boolean isVerify) {
|
|
||||||
Long long_ = System.currentTimeMillis();
|
|
||||||
// send.console(prefix +" §4===================== " + prefix + " §4=====================");
|
|
||||||
send.console(prefix + " §4 _______ §7___ §4_____ ");
|
|
||||||
send.console(prefix + " §4 |__ __|§7__ \\ §4/ ____|");
|
|
||||||
send.console(prefix + " §4 | | §7 ) §4| | ");
|
|
||||||
send.console(prefix + " §4 | | §7 / /§4| | ");
|
|
||||||
send.console(prefix + " §4 | | §7/ /_§4| |____ ");
|
|
||||||
send.console(prefix + " §4 |_| §7|____|§4\\_____|");
|
|
||||||
send.console(prefix + " §4 §e------------------");
|
|
||||||
send.console(prefix + " §4 §e| §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
|
||||||
send.console(prefix + " §4 §e| §2Version: §6" + version);
|
|
||||||
send.console(prefix + " §4 §e| §2Spigot: §6" + spigot);
|
|
||||||
send.console(prefix + " §4 §e| §2Discord: §6" + discord);
|
|
||||||
if (isPremium != null) {
|
|
||||||
if (isPremium) {
|
|
||||||
send.console(prefix + " §4 §e| §6Premium: §2true");
|
|
||||||
} else send.console(prefix + " §4 §e| §6Premium: §4false");
|
|
||||||
if (isVerify != null) {
|
|
||||||
if (isVerify) {
|
|
||||||
send.console(prefix + " §4 §e| §6Verify: §2true");
|
|
||||||
} else send.console(prefix + " §4 §e| §6Verify: §4false");
|
|
||||||
} else send.console(prefix + " §4 §e| §6Verify: §4false");
|
|
||||||
}
|
|
||||||
|
|
||||||
send.console(prefix + " §4 §e-------------------");
|
|
||||||
if (!(Util.getSnapshot() && spigot.equals(Util.getSpigot()))){
|
|
||||||
if (version.toLowerCase().contains("dev") || version.toLowerCase().contains("snapshot") || version.toLowerCase().contains("beta")) {
|
|
||||||
send.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all" +
|
|
||||||
" bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
|
||||||
send.console(prefix + " §4 §e-------------------");
|
|
||||||
try {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//onLoadSeparateStroke(prefix);
|
|
||||||
return long_;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Long onLoadHeader(String prefix) {
|
|
||||||
Long long_ = System.currentTimeMillis();
|
|
||||||
send.console(prefix + "§4===================== " + prefix + " §4=====================");
|
|
||||||
return long_;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onLoadSeparateStroke(String prefix) {
|
|
||||||
send.console(prefix + " §8-------------------------------");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onLoadFooter(String prefix, Long long_, String version) {
|
|
||||||
onLoadSeparateStroke(prefix);
|
|
||||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
// send.console(prefix +" §4===================== " + prefix + "§4=====================");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onLoadFooter(String prefix, Long long_) {
|
|
||||||
onLoadSeparateStroke(prefix);
|
|
||||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
// send.console(prefix +" §4===================== " + prefix + "§4=====================");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onDisable(String prefix, List<String> autor, String version, String spigot, String discord) {
|
|
||||||
//send.console(prefix + "§4===================== " + prefix + " §7- §6" + version + " §4=====================");
|
|
||||||
//send.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
|
||||||
//send.console(prefix + " §2Version: §6" + version);
|
|
||||||
//send.console(prefix + " §2Spigot: §6" + spigot);
|
|
||||||
//send.console(prefix + " §2Discord: §6" + discord);
|
|
||||||
//send.console(prefix + " §4Plugin successfully disabled.");
|
|
||||||
//send.console(prefix + "§4===================== " + prefix + " §7- §6" + version + " §4=====================");
|
|
||||||
send.console(prefix + " §2Version: §6" + version);
|
|
||||||
send.console(prefix + " §4Plugin successfully disabled.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List<String> autor, String pluginVersion, String publicVersion,
|
|
||||||
Boolean isPremium) {
|
|
||||||
send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
|
||||||
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
|
||||||
if (sender instanceof Player) {
|
|
||||||
Player player = (Player) sender;
|
|
||||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12 ||
|
|
||||||
MCVersion.minecraft1_13 || MCVersion.minecraft1_14 || MCVersion.minecraft1_15) {
|
|
||||||
send.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
|
||||||
} else {
|
|
||||||
TextComponent comp2 = new TextBuilder(prefix + " §2Version: §6" + pluginVersion)
|
|
||||||
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) + " - " + pluginVersion).build();
|
|
||||||
player.spigot().sendMessage(comp2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!publicVersion.equalsIgnoreCase(pluginVersion)) {
|
|
||||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, (Player) sender);
|
|
||||||
}
|
|
||||||
TextComponent comp3 = new TextBuilder(prefix + " §2Spigot: §6" + spigot)
|
|
||||||
.addHover("§8Open Spigot").addClickEvent(ClickEvent.Action.OPEN_URL, spigot).build();
|
|
||||||
|
|
||||||
player.spigot().sendMessage(comp3);
|
|
||||||
TextComponent comp4 = new TextBuilder(prefix + " §2Discord: §6" + discord)
|
|
||||||
.addHover("§8Open Discord").addClickEvent(ClickEvent.Action.OPEN_URL, discord).build();
|
|
||||||
player.spigot().sendMessage(comp4);
|
|
||||||
} else {
|
|
||||||
if (publicVersion.equalsIgnoreCase(pluginVersion)) {
|
|
||||||
send.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
|
||||||
} else {
|
|
||||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion);
|
|
||||||
}
|
|
||||||
send.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
|
||||||
send.sender(sender, prefix + " §2Discord: §6" + discord);
|
|
||||||
|
|
||||||
}
|
|
||||||
if (isPremium != null) {
|
|
||||||
if (isPremium) {
|
|
||||||
send.sender(sender, prefix + " §6Premium: §2true");
|
|
||||||
} else send.sender(sender, prefix + " §6Premium: §4false");
|
|
||||||
}
|
|
||||||
send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List<String> autor, String pluginVersion, String publicVersion) {
|
|
||||||
sendInfo(sender, prefix, spigot, discord, autor, pluginVersion, publicVersion, null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.minecraftVersion;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
public class MCVersion {
|
|
||||||
public static String isVersion;
|
|
||||||
public static String isBuckitVersion;
|
|
||||||
public static boolean minecraft1_8;
|
|
||||||
public static boolean minecraft1_9;
|
|
||||||
public static boolean minecraft1_10;
|
|
||||||
public static boolean minecraft1_11;
|
|
||||||
public static boolean minecraft1_12;
|
|
||||||
public static boolean minecraft1_13;
|
|
||||||
public static boolean minecraft1_14;
|
|
||||||
public static boolean minecraft1_15;
|
|
||||||
public static boolean minecraft1_16;
|
|
||||||
public static boolean minecraft1_17;
|
|
||||||
public static boolean minecraft1_18;
|
|
||||||
public static boolean minecraft1_19;
|
|
||||||
public static boolean minecraft1_20;
|
|
||||||
public static void onCheck(){
|
|
||||||
isVersion = Bukkit.getServer().getVersion();
|
|
||||||
isBuckitVersion = Bukkit.getServer().getBukkitVersion();
|
|
||||||
minecraft1_8 = Bukkit.getServer().getClass().getPackage().getName().contains("1_8");
|
|
||||||
minecraft1_9 = Bukkit.getServer().getClass().getPackage().getName().contains("1_9");
|
|
||||||
minecraft1_10 = Bukkit.getServer().getClass().getPackage().getName().contains("1_10");
|
|
||||||
minecraft1_11 = Bukkit.getServer().getClass().getPackage().getName().contains("1_11");
|
|
||||||
minecraft1_12 = Bukkit.getServer().getClass().getPackage().getName().contains("1_12");
|
|
||||||
minecraft1_13 = Bukkit.getServer().getClass().getPackage().getName().contains("1_13");
|
|
||||||
minecraft1_14 = Bukkit.getServer().getClass().getPackage().getName().contains("1_14");
|
|
||||||
minecraft1_15 = Bukkit.getServer().getClass().getPackage().getName().contains("1_15");
|
|
||||||
minecraft1_16 = Bukkit.getServer().getClass().getPackage().getName().contains("1_16");
|
|
||||||
minecraft1_17 = Bukkit.getServer().getClass().getPackage().getName().contains("1_17");
|
|
||||||
minecraft1_18 = Bukkit.getServer().getClass().getPackage().getName().contains("1_18");
|
|
||||||
minecraft1_19 = Bukkit.getServer().getClass().getPackage().getName().contains("1_19");
|
|
||||||
minecraft1_20 = Bukkit.getServer().getClass().getPackage().getName().contains("1_20");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.minecraftVersion;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
public class NMSVersion {
|
|
||||||
public static String isNMS;
|
|
||||||
public static boolean v1_8_R1;
|
|
||||||
public static boolean v1_8_R2;
|
|
||||||
public static boolean v1_8_R3;
|
|
||||||
public static boolean v1_9_R1;
|
|
||||||
public static boolean v1_9_R2;
|
|
||||||
public static boolean v1_10_R1;
|
|
||||||
public static boolean v1_11_R1;
|
|
||||||
public static boolean v1_12_R1;
|
|
||||||
public static boolean v1_13_R1;
|
|
||||||
public static boolean v1_13_R2;
|
|
||||||
public static boolean v1_14_R1;
|
|
||||||
public static boolean v1_15_R1;
|
|
||||||
public static boolean v1_16_R1;
|
|
||||||
public static boolean v1_16_R2;
|
|
||||||
public static boolean v1_16_R3;
|
|
||||||
public static boolean v1_17_R1;
|
|
||||||
public static boolean v1_18_R1;
|
|
||||||
public static boolean v1_18_R2;
|
|
||||||
public static boolean v1_19_R1;
|
|
||||||
public static boolean v1_19_R2;
|
|
||||||
|
|
||||||
public static void onCheck() {
|
|
||||||
isNMS = Bukkit.getServer().getClass().getPackage().getName();
|
|
||||||
v1_8_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_8_R1");
|
|
||||||
v1_8_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_8_R2");
|
|
||||||
v1_8_R3 = Bukkit.getServer().getClass().getPackage().getName().contains("1_8_R3");
|
|
||||||
v1_9_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_9_R1");
|
|
||||||
v1_9_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_9_R2");
|
|
||||||
v1_10_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_10_R1");
|
|
||||||
v1_11_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_11_R1");
|
|
||||||
v1_12_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_12_R1");
|
|
||||||
v1_13_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_13_R1");
|
|
||||||
v1_13_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_13_R2");
|
|
||||||
v1_14_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_14_R1");
|
|
||||||
v1_15_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_15_R1");
|
|
||||||
v1_16_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_16_R1");
|
|
||||||
v1_16_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_16_R2");
|
|
||||||
v1_16_R3 = Bukkit.getServer().getClass().getPackage().getName().contains("1_16_R3");
|
|
||||||
v1_17_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_17_R1");
|
|
||||||
v1_18_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_18_R1");
|
|
||||||
v1_18_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_18_R2");
|
|
||||||
v1_19_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_19_R1");
|
|
||||||
v1_19_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_19_R2");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.plugins;
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class T2CPluginManager {
|
|
||||||
|
|
||||||
public static void restart(String plugin) {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void enable(String plugin) {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void disable(String plugin) {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void restart(Plugin plugin) {
|
|
||||||
if (plugin == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(plugin);
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void enable(Plugin plugin) {
|
|
||||||
if (plugin == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void disable(Plugin plugin) {
|
|
||||||
if (plugin == null) return;
|
|
||||||
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(plugin);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,190 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.update;
|
|
||||||
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.HoverModule;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Scanner;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public class UpdateAPI {
|
|
||||||
public static HashMap<String, UpdateObject> PluginVersionen = new HashMap<>();
|
|
||||||
|
|
||||||
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
|
|
||||||
if (!SelectLibConfig.getUpdateCheckOnJoin()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String pluginVersion = plugin.getDescription().getVersion();
|
|
||||||
if (!player.hasPermission(perm) && !player.isOp()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()) == null) {
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
join(plugin, prefix, perm, player, spigot, discord);
|
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 20L);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
|
|
||||||
if (pluginVersion.equals(publicVersion)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
use(plugin, prefix, player, pluginVersion, publicVersion, spigot, discord);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, player);
|
|
||||||
}
|
|
||||||
}, 200L);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
|
||||||
send.console("§4=========== " + Prefix + " §4===========");
|
|
||||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
|
||||||
if (publicVersion.toLowerCase().contains("dev")) {
|
|
||||||
send.console("§6A new §4DEV§6 version was found!");
|
|
||||||
}
|
|
||||||
if (publicVersion.toLowerCase().contains("beta")) {
|
|
||||||
send.console("§6A new §2BETA§6 version was found!");
|
|
||||||
}
|
|
||||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
|
||||||
send.console("§6A new §eSNAPSHOT§6 version was found!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
send.console("§6A new version was found!");
|
|
||||||
}
|
|
||||||
send.console("§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion);
|
|
||||||
send.console("§6You can download it here: §e" + Spigot);
|
|
||||||
send.console("§6You can find more information on Discord: §e" + Discord);
|
|
||||||
send.console("§4=========== " + Prefix + " §4===========");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion, Player player) {
|
|
||||||
if (publicVersion.equals("§4No public version found!")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
send.player(player, Prefix);
|
|
||||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
|
||||||
if (publicVersion.toLowerCase().contains("dev")) {
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §4DEV§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
}
|
|
||||||
if (publicVersion.toLowerCase().contains("beta")) {
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §2BETA§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
}
|
|
||||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §eSNAPSHOT§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
}
|
|
||||||
HoverModule.modulePlayer(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion, "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6You can find more information on Discord.", "§e" + Discord, "OPEN_URL", Discord, player);
|
|
||||||
send.player(player, Prefix);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Boolean noUpdate = true;
|
|
||||||
|
|
||||||
public static void onUpdateCheck(Plugin plugin, String Prefix, String Spigot, int SpigotID, String Discord) {
|
|
||||||
onUpdateCheck(plugin, Prefix, Spigot, SpigotID, Discord, 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onUpdateCheck(Plugin plugin, String Prefix, String Spigot, int SpigotID, String Discord, Integer timeInMin) {
|
|
||||||
int taskID = Bukkit.getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
(new UpdateAPI((JavaPlugin) plugin, SpigotID)).getVersion((update_version) -> {
|
|
||||||
UpdateObject update = new UpdateObject(
|
|
||||||
plugin.getName(),
|
|
||||||
plugin.getDescription().getVersion(),
|
|
||||||
update_version
|
|
||||||
);
|
|
||||||
UpdateAPI.PluginVersionen.put(plugin.getName(), update);
|
|
||||||
if (!plugin.getDescription().getVersion().equalsIgnoreCase(update_version)) {
|
|
||||||
noUpdate = true;
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
sendUpdateMsg(Prefix, Spigot, Discord, plugin.getDescription().getVersion(), update_version);
|
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 600L);
|
|
||||||
} else {
|
|
||||||
if (noUpdate) {
|
|
||||||
send.console(Prefix + " §2No update found.");
|
|
||||||
noUpdate = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, Prefix, plugin.getDescription().getVersion());
|
|
||||||
}
|
|
||||||
}, 0L, timeInMin * 60 * 20L);
|
|
||||||
}
|
|
||||||
|
|
||||||
private JavaPlugin plugin;
|
|
||||||
private int resourceId;
|
|
||||||
|
|
||||||
public UpdateAPI(JavaPlugin plugin, int resourceId) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.resourceId = resourceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getVersion(Consumer<String> consumer, String Prefix, String pluginVersion) {
|
|
||||||
if (!plugin.isEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
|
||||||
try {
|
|
||||||
InputStream inputStream = (new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId)).openStream();
|
|
||||||
try {
|
|
||||||
Scanner scanner = new Scanner(inputStream);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (scanner.hasNext()) {
|
|
||||||
consumer.accept(scanner.next());
|
|
||||||
}
|
|
||||||
} catch (Throwable var8) {
|
|
||||||
try {
|
|
||||||
scanner.close();
|
|
||||||
} catch (Throwable var7) {
|
|
||||||
var8.addSuppressed(var7);
|
|
||||||
}
|
|
||||||
throw var8;
|
|
||||||
}
|
|
||||||
scanner.close();
|
|
||||||
} catch (Throwable var9) {
|
|
||||||
if (inputStream != null) {
|
|
||||||
try {
|
|
||||||
inputStream.close();
|
|
||||||
} catch (Throwable var6) {
|
|
||||||
var9.addSuppressed(var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw var9;
|
|
||||||
}
|
|
||||||
if (inputStream != null) {
|
|
||||||
inputStream.close();
|
|
||||||
}
|
|
||||||
} catch (IOException var10) {
|
|
||||||
UpdateObject update = new UpdateObject(
|
|
||||||
plugin.getName(),
|
|
||||||
pluginVersion,
|
|
||||||
"§4No public version found!"
|
|
||||||
);
|
|
||||||
UpdateAPI.PluginVersionen.put(plugin.getName(), update);
|
|
||||||
this.plugin.getLogger().severe("§4 Cannot look for updates: " + var10.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
// This claas was created by JaTiTV
|
|
||||||
|
|
||||||
package net.t2code.lib.Spigot.system;
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
|
||||||
|
|
||||||
public class JoinEvent implements Listener {
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onJoinEvent(PlayerLoginEvent event) {
|
|
||||||
UpdateAPI.join(T2CodeMain.getPlugin(), Util.getPrefix(), "t2code.lib.updatemsg", event.getPlayer(), T2CodeMain.getSpigot(), T2CodeMain.getDiscord());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,184 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system;
|
|
||||||
|
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
|
||||||
import net.milkbowl.vault.economy.Economy;
|
|
||||||
import net.milkbowl.vault.permission.Permission;
|
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
|
||||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
|
||||||
import net.t2code.lib.Spigot.system.config.ConfigCreate;
|
|
||||||
import net.t2code.lib.Spigot.system.languages.LanguagesCreate;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
||||||
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public final class T2CodeMain extends JavaPlugin {
|
|
||||||
|
|
||||||
public static File getPath() {
|
|
||||||
return plugin.getDataFolder();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BukkitAudiences adventure;
|
|
||||||
|
|
||||||
|
|
||||||
private static T2CodeMain plugin;
|
|
||||||
private static Economy eco = null;
|
|
||||||
private static Permission perm = null;
|
|
||||||
|
|
||||||
private static List<String> autor;
|
|
||||||
private static String version;
|
|
||||||
|
|
||||||
private static String prefix = Util.getPrefix();
|
|
||||||
private static Integer spigotID = Util.getSpigotID();
|
|
||||||
private static Integer bstatsID = Util.getBstatsID();
|
|
||||||
private static String spigot = Util.getSpigot();
|
|
||||||
private static String discord = Util.getDiscord();
|
|
||||||
|
|
||||||
private static Boolean load = false;
|
|
||||||
|
|
||||||
public static String getDiscord() {
|
|
||||||
return discord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T2CodeMain getPlugin() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Economy getEco() {
|
|
||||||
return eco;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setEco(Economy eco) {
|
|
||||||
T2CodeMain.eco = eco;
|
|
||||||
}
|
|
||||||
public static Permission getPerm() {
|
|
||||||
return perm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<String> getAutor() {
|
|
||||||
return autor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getPrefix() {
|
|
||||||
return prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getSpigotID() {
|
|
||||||
return spigotID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getBstatsID() {
|
|
||||||
return bstatsID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSpigot() {
|
|
||||||
return spigot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getLoad() {
|
|
||||||
return load;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setPerm(Permission perm) {
|
|
||||||
T2CodeMain.perm = perm;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
// Plugin startup logic
|
|
||||||
plugin = this;
|
|
||||||
autor = plugin.getDescription().getAuthors();
|
|
||||||
version = plugin.getDescription().getVersion();
|
|
||||||
this.adventure = BukkitAudiences.create(this);
|
|
||||||
long long_;
|
|
||||||
long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
|
||||||
if (Util.getSnapshot()) {
|
|
||||||
send.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! §4This is a trial version! §eSome features may not be working as expected." +
|
|
||||||
" Please report all bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
|
||||||
send.console(prefix + " §4 §e-------------------");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Vault.loadVault();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
NMSVersion.onCheck();
|
|
||||||
MCVersion.onCheck();
|
|
||||||
if (MCVersion.minecraft1_19) {
|
|
||||||
send.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
|
||||||
send.console(prefix );
|
|
||||||
send.warning(this, "The 1.19.* is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
|
||||||
send.console(prefix);
|
|
||||||
send.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
|
||||||
try {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ItemVersion.scan();
|
|
||||||
send.console(T2CodeMain.prefix + " §3Server run on: §6" + MCVersion.isVersion + " / " + NMSVersion.isNMS);
|
|
||||||
if (eco != null) {
|
|
||||||
String st = eco.getName();
|
|
||||||
if (eco.getName().equals("CMIEconomy")) st = "CMI";
|
|
||||||
if (Bukkit.getPluginManager().getPlugin(st) != null) {
|
|
||||||
send.console(T2CodeMain.prefix + " §3Economy: §6" + eco.getName() + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion() + " §7- §e" +
|
|
||||||
(System.currentTimeMillis() - long_) + "ms");
|
|
||||||
} else send.console(T2CodeMain.prefix + " §3Economy: §6" + eco.getName() + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
} else send.console(T2CodeMain.prefix + " §3Economy: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
|
|
||||||
if (perm != null) {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin(perm.getName()) != null) {
|
|
||||||
send.console(T2CodeMain.prefix + " §3Permission plugin: §6" + perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(perm.getName()).getDescription().getVersion()
|
|
||||||
+ " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
} else send.console(T2CodeMain.prefix + " §3Permission plugin: §6" + perm.getName() + " - §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
} else send.console(T2CodeMain.prefix + " §3Permission plugin: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
|
|
||||||
if (PluginCheck.papi()) {
|
|
||||||
send.console(T2CodeMain.prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
}
|
|
||||||
|
|
||||||
T2CodeMain.plugin.getCommand("t2code").setExecutor(new CmdExecuter());
|
|
||||||
ConfigCreate.configCreate();
|
|
||||||
LanguagesCreate.langCreate();
|
|
||||||
SelectLibConfig.onSelect();
|
|
||||||
SelectLibMsg.onSelect(prefix);
|
|
||||||
if (!Util.getSnapshot() || version.toLowerCase().contains("dev")) {
|
|
||||||
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
|
||||||
Metrics.Bstats(plugin, bstatsID);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
|
||||||
T2CodeTemplate.onLoadFooter(prefix, long_);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onDisable() {
|
|
||||||
// Plugin shutdown logic
|
|
||||||
if (SelectLibConfig.getInventoriesCloseByServerStop()) {
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
||||||
player.closeInventory();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.adventure != null) {
|
|
||||||
this.adventure.close();
|
|
||||||
this.adventure = null;
|
|
||||||
}
|
|
||||||
Vault.vaultDisable();
|
|
||||||
T2CodeTemplate.onDisable(prefix, autor, version, spigot, discord);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Scanner;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public class UpdateChecker {
|
|
||||||
private final JavaPlugin plugin;
|
|
||||||
private final int resourceId;
|
|
||||||
|
|
||||||
public UpdateChecker(JavaPlugin plugin, int resourceId) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.resourceId = resourceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getVersion(final Consumer<String> consumer) {
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
|
||||||
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream(); Scanner scanner = new Scanner(inputStream)) {
|
|
||||||
if (scanner.hasNext()) {
|
|
||||||
consumer.accept(scanner.next());
|
|
||||||
}
|
|
||||||
} catch (IOException exception) {
|
|
||||||
plugin.getLogger().info("Unable to check for updates: " + exception.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system;
|
|
||||||
|
|
||||||
import net.milkbowl.vault.economy.Economy;
|
|
||||||
import net.milkbowl.vault.permission.Permission;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
|
||||||
|
|
||||||
public class Vault {
|
|
||||||
|
|
||||||
public static Boolean vaultEnable;
|
|
||||||
public static Boolean connected;
|
|
||||||
|
|
||||||
public static void loadVault() throws InterruptedException {
|
|
||||||
long long_ = System.currentTimeMillis();
|
|
||||||
if (T2CodeMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null) {
|
|
||||||
vaultEnable = true;
|
|
||||||
RegisteredServiceProvider<Economy> eco = T2CodeMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
|
|
||||||
if (eco != null) {
|
|
||||||
T2CodeMain.setEco(eco.getProvider());
|
|
||||||
if (T2CodeMain.getEco() != null) {
|
|
||||||
connected = true;
|
|
||||||
send.console(Util.getPrefix() + " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
} else {
|
|
||||||
connected = false;
|
|
||||||
send.console(Util.getPrefix() + " §4Economy could not be connected / found! [1]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
connected = false;
|
|
||||||
send.console(Util.getPrefix() + " §4Economy could not be connected / found! [2]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
}
|
|
||||||
RegisteredServiceProvider<Permission> perm = T2CodeMain.getPlugin().getServer().getServicesManager().getRegistration(Permission.class);
|
|
||||||
if (perm != null) {
|
|
||||||
T2CodeMain.setPerm(perm.getProvider());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vaultEnable = false;
|
|
||||||
connected = false;
|
|
||||||
send.console(Util.getPrefix() + " §4Vault could not be connected! [3]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void vaultDisable() {
|
|
||||||
if (!connected) return;
|
|
||||||
connected = false;
|
|
||||||
send.console(Util.getPrefix() + " §4Vault / Economy successfully deactivated.");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system.config;
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
|
|
||||||
public class ConfigCreate {
|
|
||||||
|
|
||||||
public static void configCreate() {
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
if (new File(T2CodeMain.getPath(), "config.yml").exists()){
|
|
||||||
if (T2CodeMain.getPlugin().getConfig().getBoolean("Plugin.Debug")) send.console(T2CodeMain.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
|
||||||
} else send.console(T2CodeMain.getPrefix() + " §4config.yml are created...");
|
|
||||||
|
|
||||||
|
|
||||||
File config = new File(T2CodeMain.getPath(), "config.yml");
|
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
|
||||||
|
|
||||||
Config.set("Plugin.UpdateCheck.OnJoin", true, yamlConfiguration);
|
|
||||||
Config.set("Plugin.UpdateCheck.TimeInterval", 60, yamlConfiguration);
|
|
||||||
Config.set("Plugin.language", "english", yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("BungeeCord.Enable", false, yamlConfiguration);
|
|
||||||
Config.set("BungeeCord.ThisServer", "server", yamlConfiguration);
|
|
||||||
Config.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
|
||||||
|
|
||||||
try {
|
|
||||||
yamlConfiguration.save(config);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
send.console(T2CodeMain.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system.languages;
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class LanguagesCreate {
|
|
||||||
static Plugin plugin = T2CodeMain.getPlugin();
|
|
||||||
|
|
||||||
public static void langCreate() {
|
|
||||||
send.debug(plugin, "§4Language files are created / updated...");
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* ENGLISH
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
File messagesEN = new File(T2CodeMain.getPath(), "languages/english_messages.yml");
|
|
||||||
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
|
|
||||||
|
|
||||||
Config.set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
|
|
||||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.EN_VotingPluginNotSetUp, yamlConfigurationEN);
|
|
||||||
Config.set("Plugin.SoundNotFound", MSG.EN_SoundNotFound, yamlConfigurationEN);
|
|
||||||
|
|
||||||
try {
|
|
||||||
yamlConfigurationEN.save(messagesEN);
|
|
||||||
} catch (IOException e) {
|
|
||||||
send.warning(T2CodeMain.getPlugin(), e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* GERMAN
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
File messagesDE = new File(T2CodeMain.getPath(), "languages/german_messages.yml");
|
|
||||||
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
|
|
||||||
|
|
||||||
Config.set("Plugin.VaultNotSetUp", MSG.DE_VotingPluginNotSetUp, yamlConfigurationDE);
|
|
||||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.DE_VotingPluginNotSetUp, yamlConfigurationDE);
|
|
||||||
Config.set("Plugin.SoundNotFound", MSG.DE_SoundNotFound, yamlConfigurationDE);
|
|
||||||
|
|
||||||
try {
|
|
||||||
yamlConfigurationDE.save(messagesDE);
|
|
||||||
} catch (IOException e) {
|
|
||||||
send.warning(T2CodeMain.getPlugin(), e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* norwegian
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
File messagesNO = new File(T2CodeMain.getPath(), "languages/norwegian_messages.yml");
|
|
||||||
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
|
|
||||||
|
|
||||||
Config.set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
|
|
||||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.NO_VotingPluginNotSetUp, yamlConfigurationNO);
|
|
||||||
Config.set("Plugin.SoundNotFound", MSG.NO_SoundNotFound, yamlConfigurationNO);
|
|
||||||
|
|
||||||
try {
|
|
||||||
yamlConfigurationNO.save(messagesNO);
|
|
||||||
} catch (IOException e) {
|
|
||||||
send.warning(T2CodeMain.getPlugin(), e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
send.console(T2CodeMain.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package net.t2code.lib.Spigot.system.languages;
|
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class SelectLibMsg {
|
|
||||||
private static Plugin plugin = T2CodeMain.getPlugin();
|
|
||||||
private static String prefix = T2CodeMain.getPrefix();
|
|
||||||
|
|
||||||
public static String selectMSG;
|
|
||||||
|
|
||||||
public static String vaultNotSetUp;
|
|
||||||
public static String votingPluginNotSetUp;
|
|
||||||
public static String soundNotFound;
|
|
||||||
|
|
||||||
public static void onSelect(String Prefix) {
|
|
||||||
|
|
||||||
send.debug(plugin, "§4Select language...");
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
|
|
||||||
File msg;
|
|
||||||
|
|
||||||
msg = new File(T2CodeMain.getPath(), "languages/" + SelectLibConfig.getLanguage() + "_messages.yml");
|
|
||||||
if (!msg.isFile()) {
|
|
||||||
send.console(Prefix);
|
|
||||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
||||||
send.console(Prefix + " §4The selected §c" + SelectLibConfig.getLanguage() + " §4language file was not found.");
|
|
||||||
send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
|
||||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
||||||
send.console(Prefix);
|
|
||||||
msg = new File(T2CodeMain.getPath(), "languages/" + "english_messages.yml");
|
|
||||||
selectMSG = "english";
|
|
||||||
} else selectMSG = SelectLibConfig.getLanguage();
|
|
||||||
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
|
||||||
|
|
||||||
vaultNotSetUp = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VaultNotSetUp"));
|
|
||||||
votingPluginNotSetUp = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VotingPluginNotSetUp"));
|
|
||||||
soundNotFound = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.SoundNotFound"));
|
|
||||||
|
|
||||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
package net.t2code.lib;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Util {
|
|
||||||
private static Boolean Snapshot = false;
|
|
||||||
|
|
||||||
private static String Prefix = "§8[§4T2Code§5Lib§8]";
|
|
||||||
private static Integer SpigotID = 96388;
|
|
||||||
private static Integer BstatsID = 12518;
|
|
||||||
private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
|
||||||
private static String Discord = "http://dc.t2code.net";
|
|
||||||
|
|
||||||
public static String getPrefix() {
|
|
||||||
return Prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getSpigotID() {
|
|
||||||
return SpigotID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getBstatsID() {
|
|
||||||
return BstatsID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSpigot() {
|
|
||||||
return Spigot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDiscord() {
|
|
||||||
return Discord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getSnapshot(){
|
|
||||||
return Snapshot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<String> getT2cPlugins() {
|
|
||||||
return t2cPlugins;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<String> t2cPlugins =
|
|
||||||
Arrays.asList(
|
|
||||||
"T2C-LuckyBox",
|
|
||||||
"WonderBagShop",
|
|
||||||
"CommandGUI",
|
|
||||||
"OPSecurity",
|
|
||||||
"PaPiTest",
|
|
||||||
"PlotSquaredGUI",
|
|
||||||
"T2C-Alias",
|
|
||||||
"T2C-AutoResponse",
|
|
||||||
"LoreEditor",
|
|
||||||
"Booster",
|
|
||||||
"AntiMapCopy",
|
|
||||||
"AntiCopy"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,9 +1,9 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.commands;
|
package net.t2code.t2codelib.BUNGEE.api.commands;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
public class Bcmd {
|
public class T2CBcmd {
|
||||||
public static void Console(String cmd){
|
public static void Console(String cmd){
|
||||||
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), cmd);
|
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), cmd);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.commands;
|
package net.t2code.t2codelib.BUNGEE.api.commands;
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
@ -9,7 +9,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BTab {
|
public class T2CBtab {
|
||||||
public static Iterable<String> tab(CommandSender sender, String[] args, String perm,Boolean onlinePlayer){
|
public static Iterable<String> tab(CommandSender sender, String[] args, String perm,Boolean onlinePlayer){
|
||||||
List<String> matches = new ArrayList<>();
|
List<String> matches = new ArrayList<>();
|
||||||
Iterator var6 = ProxyServer.getInstance().getPlayers().iterator();
|
Iterator var6 = ProxyServer.getInstance().getPlayers().iterator();
|
||||||
@ -53,7 +53,6 @@ public class BTab {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean hasPermission(CommandSender sender, String permission) {
|
public static boolean hasPermission(CommandSender sender, String permission) {
|
||||||
String[] Permissions = permission.split(";");
|
String[] Permissions = permission.split(";");
|
||||||
for (String perm : Permissions) {
|
for (String perm : Permissions) {
|
@ -1,9 +1,9 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.replace;
|
package net.t2code.t2codelib.BUNGEE.api.messages;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BReplace {
|
public class T2CBreplace {
|
||||||
|
|
||||||
public static String replace(String prefix, String Text) {
|
public static String replace(String prefix, String Text) {
|
||||||
return Text.replace("[prefix]", prefix).replace("&", "§").replace("[ue]", "ü")
|
return Text.replace("[prefix]", prefix).replace("&", "§").replace("[ue]", "ü")
|
||||||
@ -11,8 +11,6 @@ public class BReplace {
|
|||||||
.replace("[ae]", "ä").replace("[AE]", "Ä");
|
.replace("[ae]", "ä").replace("[AE]", "Ä");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static List<String> replace(String prefix, List<String> Text) {
|
public static List<String> replace(String prefix, List<String> Text) {
|
||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
for (String input : Text) {
|
for (String input : Text) {
|
@ -1,4 +1,4 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.messages;
|
package net.t2code.t2codelib.BUNGEE.api.messages;
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
@ -6,10 +6,9 @@ import net.md_5.bungee.api.Title;
|
|||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class Bsend {
|
public class T2CBsend {
|
||||||
public static void console(String msg) {
|
public static void console(String msg) {
|
||||||
ProxyServer.getInstance().getConsole().sendMessage(msg);
|
ProxyServer.getInstance().getConsole().sendMessage(msg);
|
||||||
}
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.api.messages;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.update.T2CBupdateAPI;
|
||||||
|
|
||||||
|
public class T2CBtemplate {
|
||||||
|
|
||||||
|
|
||||||
|
public static Long onLoadHeader(String prefix, String autor, String version, String spigot, String discord) {
|
||||||
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
T2CBsend.console(prefix + " §2Autor: §6" + autor.replace("[", "").replace("]", ""));
|
||||||
|
T2CBsend.console(prefix + " §2Version: §6" + version);
|
||||||
|
T2CBsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||||
|
T2CBsend.console(prefix + " §2Discord: §6" + discord);
|
||||||
|
T2CBsend.console(prefix + " §8-------------------------------");
|
||||||
|
return long_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onLoadSeparateStroke(String prefix) {
|
||||||
|
T2CBsend.console(prefix + " §8-------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onLoadFooter(String prefix, Long long_) {
|
||||||
|
T2CBsend.console(prefix + " §8-------------------------------");
|
||||||
|
T2CBsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onDisable(String prefix, String autor, String version, String spigot, String discord) {
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
T2CBsend.console(prefix + " §2Autor: §6" + autor.replace("[", "").replace("]", ""));
|
||||||
|
T2CBsend.console(prefix + " §2Version: §6" + version);
|
||||||
|
T2CBsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||||
|
T2CBsend.console(prefix + " §2Discord: §6" + discord);
|
||||||
|
T2CBsend.console(prefix + " §4Plugin successfully disabled.");
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendInfo(CommandSender sender, Plugin plugin, String prefix, String spigot, String discord, String autor) {
|
||||||
|
String publicVersion = T2CBupdateAPI.bungeePluginVersins.get(plugin.getDescription().getName()).publicVersion;
|
||||||
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
T2CBsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||||
|
T2CBsend.sender(sender, prefix + " §2Autor: §6" + autor);
|
||||||
|
if (publicVersion.equalsIgnoreCase(pluginVersion)) {
|
||||||
|
T2CBsend.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
||||||
|
} else {
|
||||||
|
T2CBupdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, sender);
|
||||||
|
}
|
||||||
|
T2CBsend.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
||||||
|
T2CBsend.sender(sender, prefix + " §2Discord: §6" + discord);
|
||||||
|
T2CBsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.plugins;
|
package net.t2code.t2codelib.BUNGEE.api.plugins;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.t2code.lib.Bungee.BMain;
|
import net.t2code.t2codelib.BUNGEE.system.T2CodeBMain;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class BPluginCheck {
|
public class T2CBpluginCheck {
|
||||||
public static Boolean pluginCheck(String pluginName){
|
public static Boolean pluginCheck(String pluginName){
|
||||||
return (ProxyServer.getInstance().getPluginManager().getPlugin(pluginName) != null);
|
return (ProxyServer.getInstance().getPluginManager().getPlugin(pluginName) != null);
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ public class BPluginCheck {
|
|||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||||
BMain.plugin.getProxy().getPluginManager().getPlugin(plugin.getDescription().getName()).onDisable();
|
T2CodeBMain.getPlugin().getProxy().getPluginManager().getPlugin(plugin.getDescription().getName()).onDisable();
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.update;
|
package net.t2code.t2codelib.BUNGEE.api.update;
|
||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateObject;
|
|
||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -15,44 +13,44 @@ import java.util.Scanner;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class BUpdateAPI {
|
public class T2CBupdateAPI {
|
||||||
public static HashMap<String, UpdateObject> bungeePluginVersionen = new HashMap<String, UpdateObject>();
|
public static HashMap<String, T2CBupdateObject> bungeePluginVersins = new HashMap<String, T2CBupdateObject>();
|
||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version) {
|
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version) {
|
||||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
T2CBsend.console("§4=========== " + Prefix + " §4===========");
|
||||||
Bsend.console("§6A new version was found!");
|
T2CBsend.console("§6A new version was found!");
|
||||||
Bsend.console("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
T2CBsend.console("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
||||||
Bsend.console("§6You can download it here: §e" + Spigot);
|
T2CBsend.console("§6You can download it here: §e" + Spigot);
|
||||||
Bsend.console("§6You can find more information on Discord: §e" + Discord);
|
T2CBsend.console("§6You can find more information on Discord: §e" + Discord);
|
||||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
T2CBsend.console("§4=========== " + Prefix + " §4===========");
|
||||||
}
|
}
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version, CommandSender sender) {
|
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version, CommandSender sender) {
|
||||||
Bsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
T2CBsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
||||||
Bsend.sender(sender,"§6A new version was found!");
|
T2CBsend.sender(sender,"§6A new version was found!");
|
||||||
Bsend.sender(sender,"§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
T2CBsend.sender(sender,"§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
||||||
Bsend.sender(sender,"§6You can download it here: §e" + Spigot);
|
T2CBsend.sender(sender,"§6You can download it here: §e" + Spigot);
|
||||||
Bsend.sender(sender,"§6You can find more information on Discord: §e" + Discord);
|
T2CBsend.sender(sender,"§6You can find more information on Discord: §e" + Discord);
|
||||||
Bsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
T2CBsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
||||||
}
|
}
|
||||||
private static Boolean noUpdate = true;
|
private static Boolean noUpdate = true;
|
||||||
private static String pluginVersion;
|
private static String pluginVersion;
|
||||||
public static void onUpdateCheckTimer(Plugin plugin, String Prefix, String Spigot, String Discord, Integer SpigotID) {
|
public static void onUpdateCheckTimer(Plugin plugin, String Prefix, String Spigot, String Discord, Integer SpigotID) {
|
||||||
ProxyServer.getInstance().getScheduler().schedule(plugin, new Runnable() {
|
ProxyServer.getInstance().getScheduler().schedule(plugin, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
(new BUpdateAPI(plugin, SpigotID)).getVersion((update_version) -> {
|
(new T2CBupdateAPI(plugin, SpigotID)).getVersion((update_version) -> {
|
||||||
pluginVersion = plugin.getDescription().getVersion();
|
pluginVersion = plugin.getDescription().getVersion();
|
||||||
UpdateObject update = new UpdateObject(
|
T2CBupdateObject update = new T2CBupdateObject(
|
||||||
plugin.getDescription().getName(),
|
plugin.getDescription().getName(),
|
||||||
pluginVersion,
|
pluginVersion,
|
||||||
update_version
|
update_version
|
||||||
);
|
);
|
||||||
bungeePluginVersionen.put(plugin.getDescription().getName(), update);
|
bungeePluginVersins.put(plugin.getDescription().getName(), update);
|
||||||
if (!pluginVersion.replace("_Bungee", "").equalsIgnoreCase(update_version)) {
|
if (!pluginVersion.replace("_Bungee", "").equalsIgnoreCase(update_version)) {
|
||||||
sendUpdateMsg(Prefix, Spigot, Discord, pluginVersion, update_version);
|
sendUpdateMsg(Prefix, Spigot, Discord, pluginVersion, update_version);
|
||||||
noUpdate = true;
|
noUpdate = true;
|
||||||
} else {
|
} else {
|
||||||
if (noUpdate) {
|
if (noUpdate) {
|
||||||
Bsend.console(Prefix + " §2No update found.");
|
T2CBsend.console(Prefix + " §2No update found.");
|
||||||
noUpdate = false;
|
noUpdate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +61,7 @@ public class BUpdateAPI {
|
|||||||
private Plugin plugin;
|
private Plugin plugin;
|
||||||
private int resourceId;
|
private int resourceId;
|
||||||
|
|
||||||
public BUpdateAPI(Plugin plugin, int resourceId) {
|
public T2CBupdateAPI(Plugin plugin, int resourceId) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
}
|
}
|
||||||
@ -102,12 +100,12 @@ public class BUpdateAPI {
|
|||||||
inputStream.close();
|
inputStream.close();
|
||||||
}
|
}
|
||||||
} catch (IOException var10) {
|
} catch (IOException var10) {
|
||||||
UpdateObject update = new UpdateObject(
|
T2CBupdateObject update = new T2CBupdateObject(
|
||||||
plugin.getDescription().getName(),
|
plugin.getDescription().getName(),
|
||||||
pluginVersion,
|
pluginVersion,
|
||||||
"§4No public version found!"
|
"§4No public version found!"
|
||||||
);
|
);
|
||||||
bungeePluginVersionen.put(plugin.getDescription().getName(), update);
|
bungeePluginVersins.put(plugin.getDescription().getName(), update);
|
||||||
this.plugin.getLogger().severe(Prefix + "§4 Cannot look for updates: " + var10.getMessage());
|
this.plugin.getLogger().severe(Prefix + "§4 Cannot look for updates: " + var10.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -1,12 +1,10 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.update;
|
package net.t2code.t2codelib.BUNGEE.api.update;
|
||||||
|
|
||||||
public class UpdateObject {
|
|
||||||
|
|
||||||
|
public class T2CBupdateObject {
|
||||||
public String pluginName;
|
public String pluginName;
|
||||||
public String pluginVersion;
|
public String pluginVersion;
|
||||||
public String publicVersion;
|
public String publicVersion;
|
||||||
|
public T2CBupdateObject(String pluginName, String pluginVersion, String publicVersion){
|
||||||
public UpdateObject(String pluginName, String pluginVersion, String publicVersion) {
|
|
||||||
this.pluginName = pluginName;
|
this.pluginName = pluginName;
|
||||||
this.pluginVersion = pluginVersion;
|
this.pluginVersion = pluginVersion;
|
||||||
this.publicVersion = publicVersion;
|
this.publicVersion = publicVersion;
|
@ -1,12 +1,12 @@
|
|||||||
package net.t2code.lib.Bungee.Lib.yamlConfiguration;
|
package net.t2code.t2codelib.BUNGEE.api.yaml;
|
||||||
|
|
||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBreplace;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BConfig {
|
public class T2CBconfig {
|
||||||
public static void set(String path, String value, Configuration configuration) {
|
public static void set(String path, String value, Configuration configuration) {
|
||||||
if (!configuration.contains(path)) {
|
if (!configuration.contains(path)) {
|
||||||
configuration.set(path, value);
|
configuration.set(path, value);
|
||||||
@ -43,7 +43,7 @@ public class BConfig {
|
|||||||
|
|
||||||
|
|
||||||
public static String select(String prefix, String path, Configuration configuration) {
|
public static String select(String prefix, String path, Configuration configuration) {
|
||||||
return Replace.replace(prefix, configuration.getString(path));
|
return T2CBreplace.replace(prefix, configuration.getString(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public class BConfig {
|
|||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
List<String> input = configuration.getStringList(path);
|
List<String> input = configuration.getStringList(path);
|
||||||
for (String st : input) {
|
for (String st : input) {
|
||||||
output.add(Replace.replace(prefix, st));
|
output.add(T2CBreplace.replace(prefix, st));
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ public class BConfig {
|
|||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
List<String> input = configuration.getStringList(path);
|
List<String> input = configuration.getStringList(path);
|
||||||
for (String st : input) {
|
for (String st : input) {
|
||||||
output.add(Replace.replace(prefix, st));
|
output.add(T2CBreplace.replace(prefix, st));
|
||||||
}
|
}
|
||||||
value = output;
|
value = output;
|
||||||
}
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.update.T2CBupdateAPI;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.bstats.T2CBmetrics;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.config.T2CBlibConfig;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.T2CplmsgBcmd;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.autoResponse.T2CapiAutoResponse;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.commandgui.T2CapiCGUI;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.pluginMessaging.opSecurity.T2CapiOpSecurity;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class T2CBload {
|
||||||
|
public static void onLoad(Plugin plugin, String prefix, String autor, String version, String spigot, String discord, Integer spigotID, Integer bstatsID) {
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
T2CBsend.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||||
|
T2CBsend.console(prefix + " §2Version: §6" + version);
|
||||||
|
T2CBsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||||
|
T2CBsend.console(prefix + " §2Discord: §6" + discord);
|
||||||
|
|
||||||
|
T2CBmetrics.Bstats(plugin, bstatsID);
|
||||||
|
try {
|
||||||
|
T2CBlibConfig.create();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
T2CBlibConfig.select();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
T2CBupdateAPI.onUpdateCheckTimer(plugin, prefix, spigot, discord, spigotID);
|
||||||
|
|
||||||
|
//API
|
||||||
|
plugin.getProxy().registerChannel("t2c:bcmd");
|
||||||
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CplmsgBcmd());
|
||||||
|
|
||||||
|
if (T2CBlibConfig.getApiCommandGUIEnable()) {
|
||||||
|
plugin.getProxy().registerChannel("t2c:cgui");
|
||||||
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CapiCGUI());
|
||||||
|
T2CapiCGUI.sendToSpigotDeleteAll();
|
||||||
|
}
|
||||||
|
if (T2CBlibConfig.getApiAutoResponse()) {
|
||||||
|
plugin.getProxy().registerChannel("t2c:aresp");
|
||||||
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CapiAutoResponse());
|
||||||
|
}
|
||||||
|
if (T2CBlibConfig.getApiAutoResponse()) {
|
||||||
|
plugin.getProxy().registerChannel("t2c:t2c:opsec");
|
||||||
|
plugin.getProxy().getPluginManager().registerListener(plugin, new T2CapiOpSecurity());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
T2CBsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
T2CBsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
|
||||||
|
public class T2CodeBMain extends Plugin {
|
||||||
|
|
||||||
|
private static Plugin plugin;
|
||||||
|
|
||||||
|
public static Plugin getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String version;
|
||||||
|
private static String orgVersion;
|
||||||
|
private static String autor;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
// Plugin startup logic
|
||||||
|
plugin = this;
|
||||||
|
orgVersion = plugin.getDescription().getVersion();
|
||||||
|
autor = plugin.getDescription().getAuthor();
|
||||||
|
T2CBload.onLoad(plugin, Util.getPrefix(), autor, orgVersion, Util.getSpigot(), Util.getDiscord(), Util.getSpigotID(), Util.getBstatsID());
|
||||||
|
String[] fv = orgVersion.split("_");
|
||||||
|
plugin.getDescription().setVersion(fv[0]);
|
||||||
|
version = plugin.getDescription().getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
// Plugin shutdown logic
|
||||||
|
T2CBsend.console(Util.getPrefix() + "§4============================= " + Util.getPrefix() + " §4=============================");
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §2Autor: §6" + String.valueOf(plugin.getDescription().getAuthor()).replace("[", "").replace("]", ""));
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §2Version: §6" + version);
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §4Plugin successfully disabled.");
|
||||||
|
T2CBsend.console(Util.getPrefix() + "§4============================= " + Util.getPrefix() + " §4=============================");
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package net.t2code.lib.Bungee.system;
|
package net.t2code.t2codelib.BUNGEE.system.bstats;
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
@ -21,11 +21,11 @@ import java.util.logging.Level;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
|
|
||||||
public class BMetrics {
|
public class T2CBmetrics {
|
||||||
|
|
||||||
public static void Bstats(Plugin plugin, int bstatsID) {
|
public static void Bstats(Plugin plugin, int bstatsID) {
|
||||||
int pluginId = bstatsID; // <-- Replace with the id of your plugin!
|
int pluginId = bstatsID; // <-- Replace with the id of your plugin!
|
||||||
BMetrics metrics = new BMetrics(plugin, pluginId);
|
T2CBmetrics metrics = new T2CBmetrics(plugin, pluginId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Plugin plugin;
|
private final Plugin plugin;
|
||||||
@ -49,7 +49,7 @@ public class BMetrics {
|
|||||||
* @param serviceId The id of the service. It can be found at <a
|
* @param serviceId The id of the service. It can be found at <a
|
||||||
* href="https://bstats.org/what-is-my-plugin-id">What is my plugin id?</a>
|
* href="https://bstats.org/what-is-my-plugin-id">What is my plugin id?</a>
|
||||||
*/
|
*/
|
||||||
public BMetrics(Plugin plugin, int serviceId) {
|
public T2CBmetrics(Plugin plugin, int serviceId) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
try {
|
try {
|
||||||
loadConfig();
|
loadConfig();
|
@ -0,0 +1,56 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system.config;
|
||||||
|
|
||||||
|
import net.md_5.bungee.config.Configuration;
|
||||||
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.yaml.T2CBconfig;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.system.T2CodeBMain;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class T2CBlibConfig {
|
||||||
|
|
||||||
|
public static void create() throws IOException {
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
File config = new File(T2CodeBMain.getPlugin().getDataFolder(), "config.yml");
|
||||||
|
if (!T2CodeBMain.getPlugin().getDataFolder().exists()) T2CodeBMain.getPlugin().getDataFolder().mkdir();
|
||||||
|
if (!config.exists()) {
|
||||||
|
config.createNewFile();
|
||||||
|
}
|
||||||
|
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(config);
|
||||||
|
T2CBconfig.set("API.CommandGUI.Enable", false, configuration);
|
||||||
|
T2CBconfig.set("API.AutoResponse.Enable", false, configuration);
|
||||||
|
T2CBconfig.set("API.OPSecurity.Enable", false, configuration);
|
||||||
|
|
||||||
|
ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, config);
|
||||||
|
T2CBsend.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void select() throws IOException {
|
||||||
|
File config = new File(T2CodeBMain.getPlugin().getDataFolder(), "config.yml");
|
||||||
|
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(config);
|
||||||
|
|
||||||
|
apiCommandGUIEnable = configuration.getBoolean("API.CommandGUI.Enable");
|
||||||
|
apiAutoResponse = configuration.getBoolean("API.AutoResponse.Enable");
|
||||||
|
apiOpSecurity = configuration.getBoolean("API.OPSecurity.Enable");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Boolean apiCommandGUIEnable;
|
||||||
|
private static Boolean apiAutoResponse;
|
||||||
|
private static Boolean apiOpSecurity;
|
||||||
|
|
||||||
|
public static Boolean getApiCommandGUIEnable() {
|
||||||
|
return apiCommandGUIEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getApiAutoResponse() {
|
||||||
|
return apiAutoResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getApiOpSecurity() {
|
||||||
|
return apiOpSecurity;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system.pluginMessaging;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class T2CplmsgBcmd implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
|
if (event.getTag().equalsIgnoreCase("t2c:bcmd")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
try {
|
||||||
|
String channel = stream.readUTF();
|
||||||
|
String input = stream.readUTF();
|
||||||
|
if (channel.equals("T2Code-Console")) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage("Command Console: "+ input);
|
||||||
|
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), input);
|
||||||
|
} else {
|
||||||
|
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(channel);
|
||||||
|
if (player != null) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage("Command " + player +": "+ input);
|
||||||
|
ProxyServer.getInstance().getPluginManager().dispatchCommand(player, input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system.pluginMessaging.autoResponse;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class T2CapiAutoResponse implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
|
if (event.getTag().equalsIgnoreCase("t2c:aresp")) {
|
||||||
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
event.setCancelled(true);
|
||||||
|
try {
|
||||||
|
String channel = stream.readUTF();
|
||||||
|
String input = stream.readUTF();
|
||||||
|
|
||||||
|
switch (channel) {
|
||||||
|
case "ConC":
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage("Command Console: " + input);
|
||||||
|
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), input);
|
||||||
|
break;
|
||||||
|
case "ALLPMSG":
|
||||||
|
for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
|
||||||
|
T2CBsend.player(player, input);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(channel);
|
||||||
|
if (player != null) {
|
||||||
|
ProxyServer.getInstance().getConsole().sendMessage("Command " + player + ": " + input);
|
||||||
|
ProxyServer.getInstance().getPluginManager().dispatchCommand(player, input);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system.pluginMessaging.commandgui;
|
||||||
|
|
||||||
|
import net.md_5.bungee.BungeeCord;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||||
|
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class T2CapiCGUI implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoin(PostLoginEvent e) {
|
||||||
|
ProxiedPlayer player = e.getPlayer();
|
||||||
|
sendToSpigotPlayer(player.getName(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDisconnect(PlayerDisconnectEvent e) {
|
||||||
|
ProxiedPlayer player = e.getPlayer();
|
||||||
|
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendToSpigotPlayer(String name, Boolean join) {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
if (join) {
|
||||||
|
output.writeUTF("join");
|
||||||
|
} else {
|
||||||
|
output.writeUTF("left");
|
||||||
|
}
|
||||||
|
output.writeUTF(name);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.getLogger(e.getMessage());
|
||||||
|
}
|
||||||
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
|
|
||||||
|
server.sendData("t2c:cguiopl", stream.toByteArray());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendToSpigotDeleteAll() {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
output.writeUTF("clear");
|
||||||
|
output.writeUTF("");
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.getLogger(e.getMessage());
|
||||||
|
}
|
||||||
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
|
server.sendData("t2c:cguiopl", stream.toByteArray());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package net.t2code.t2codelib.BUNGEE.system.pluginMessaging.opSecurity;
|
||||||
|
|
||||||
|
import net.md_5.bungee.BungeeCord;
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import net.t2code.t2codelib.BUNGEE.api.messages.T2CBsend;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class T2CapiOpSecurity implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
|
if (event.getTag().equalsIgnoreCase("t2c:opsec")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
|
try {
|
||||||
|
String channel = stream.readUTF();
|
||||||
|
String mode = stream.readUTF();
|
||||||
|
String information = stream.readUTF();
|
||||||
|
if (channel.equals("T2Cconsole")) {
|
||||||
|
sendToSpigotPlayer(channel,mode,information);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendToSpigotPlayer(String channel,String mode,String information) {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
output.writeUTF(channel);
|
||||||
|
output.writeUTF(mode);
|
||||||
|
output.writeUTF(information);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.getLogger(e.getMessage());
|
||||||
|
}
|
||||||
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
|
server.sendData("t2c:opsec", stream.toByteArray());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.commands;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.BCommandSenderReciver;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class T2Ccmd {
|
||||||
|
public static void console(String cmd) {
|
||||||
|
if (cmd.contains("!onBungee")){
|
||||||
|
BCommandSenderReciver.sendToBungee(null, cmd.replace("!onBungee", ""), true);
|
||||||
|
}else Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void player(Player player, String cmd) {
|
||||||
|
if (cmd.contains("!asConsole")) {
|
||||||
|
if (cmd.contains("!onBungee")) {
|
||||||
|
BCommandSenderReciver.sendToBungee(player, cmd.replace("!asConsole", "").replace("!onBungee", ""), true);
|
||||||
|
} else console(cmd.replace("!asConsole", ""));
|
||||||
|
} else {
|
||||||
|
if (cmd.contains("!onBungee")) {
|
||||||
|
BCommandSenderReciver.sendToBungee(player, cmd.replace("!onBungee", ""), false);
|
||||||
|
} else player.chat("/" + cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,4 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.commands;
|
package net.t2code.t2codelib.SPIGOT.api.commands;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -7,39 +6,30 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Tab {
|
public class T2Ctab {
|
||||||
|
|
||||||
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, String perm, Boolean onlinePlayer) {
|
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, String perm, Boolean onlinePlayer) {
|
||||||
if (args.length == arg + 1) {
|
if (args.length != arg + 1) return;
|
||||||
Iterator var6 = Bukkit.getOnlinePlayers().iterator();
|
for (Player player1 : Bukkit.getOnlinePlayers()) {
|
||||||
while (var6.hasNext()) {
|
|
||||||
Player player1 = (Player) var6.next();
|
|
||||||
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
|
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
|
||||||
matches.add(player1.getName());
|
matches.add(player1.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, String perm, Boolean onlinePlayer) {
|
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, String perm, Boolean onlinePlayer) {
|
||||||
if (args.length == arg + 1) {
|
if (args.length != arg + 1) return;
|
||||||
if (args[argEquals].toLowerCase().equals(equalsValue)) {
|
if (!args[argEquals].toLowerCase().equals(equalsValue)) return;
|
||||||
Iterator var6 = Bukkit.getOnlinePlayers().iterator();
|
for (Player player1 : Bukkit.getOnlinePlayers()) {
|
||||||
while (var6.hasNext()) {
|
|
||||||
Player player1 = (Player) var6.next();
|
|
||||||
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
|
if (passend(player1.getName(), args[arg]) && hasPermission(sender, perm)) {
|
||||||
matches.add(player1.getName());
|
matches.add(player1.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap, Boolean onlinePlayer, String permForPlayer) {
|
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap, Boolean onlinePlayer, String permForPlayer) {
|
||||||
if (args.length == arg + 1) {
|
if (args.length != arg + 1) return;
|
||||||
for (String command : permMap.keySet()) {
|
for (String command : permMap.keySet()) {
|
||||||
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
|
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
|
||||||
matches.add(command);
|
matches.add(command);
|
||||||
@ -48,23 +38,20 @@ public class Tab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap) {
|
public static void tab(List<String> matches, CommandSender sender, int arg, String[] args, HashMap<String, String> permMap) {
|
||||||
tab(matches, sender, arg, args, permMap, null, null);
|
tab(matches, sender, arg, args, permMap, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, HashMap<String, String> permMap) {
|
public static void tab(List<String> matches, CommandSender sender, int argEquals, String equalsValue, int arg, String[] args, HashMap<String, String> permMap) {
|
||||||
if (args.length == arg + 1) {
|
if (args.length != arg + 1) return;
|
||||||
if (args[argEquals].toLowerCase().equals(equalsValue)) {
|
if (!args[argEquals].toLowerCase().equals(equalsValue)) return;
|
||||||
for (String command : permMap.keySet()) {
|
for (String command : permMap.keySet()) {
|
||||||
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
|
if (hasPermission(sender, permMap.get(command)) && passend(command, args[arg])) {
|
||||||
matches.add(command);
|
matches.add(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<String> tab(CommandSender sender, int arg, String[] args, String perm, String command) {
|
public static List<String> tab(CommandSender sender, int arg, String[] args, String perm, String command) {
|
||||||
List<String> matches = new ArrayList<>();
|
List<String> matches = new ArrayList<>();
|
||||||
@ -74,7 +61,6 @@ public class Tab {
|
|||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Boolean passend(String command, String arg) {
|
public static Boolean passend(String command, String arg) {
|
||||||
for (int i = 0; i < arg.toUpperCase().length(); i++) {
|
for (int i = 0; i < arg.toUpperCase().length(); i++) {
|
||||||
if (arg.toUpperCase().length() >= command.toUpperCase().length()) {
|
if (arg.toUpperCase().length() >= command.toUpperCase().length()) {
|
||||||
@ -88,7 +74,6 @@ public class Tab {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean hasPermission(CommandSender sender, String permission) {
|
public static boolean hasPermission(CommandSender sender, String permission) {
|
||||||
String[] Permissions = permission.split(";");
|
String[] Permissions = permission.split(";");
|
||||||
for (String perm : Permissions) {
|
for (String perm : Permissions) {
|
@ -1,36 +1,34 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.eco;
|
package net.t2code.t2codelib.SPIGOT.api.eco;
|
||||||
|
|
||||||
import com.bencodez.votingplugin.VotingPluginMain;
|
import com.bencodez.votingplugin.VotingPluginMain;
|
||||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
import net.t2code.t2codelib.SPIGOT.system.config.languages.SelectLibMsg;
|
||||||
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class Eco {
|
public class T2Ceco {
|
||||||
|
|
||||||
public static boolean moneyRemove(String prefix, Player player, Double price) {
|
public static boolean moneyRemove(String prefix, Player player, Double price) {
|
||||||
if (vault(prefix, player)) {
|
if (vault(prefix, player)) {
|
||||||
return T2CodeMain.getEco().withdrawPlayer(player, price).transactionSuccess();
|
return T2CodeLibMain.getEco().withdrawPlayer(player, price).transactionSuccess();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean moneyAdd(String prefix, Player player, Double price) {
|
public static boolean moneyAdd(String prefix, Player player, Double price) {
|
||||||
if (vault(prefix, player)) {
|
if (vault(prefix, player)) {
|
||||||
return T2CodeMain.getEco().depositPlayer(player, price).transactionSuccess();
|
return T2CodeLibMain.getEco().depositPlayer(player, price).transactionSuccess();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean vault(String prefix, Player player) {
|
private static boolean vault(String prefix, Player player) {
|
||||||
if (T2CodeMain.getEco() == null) {
|
if (T2CodeLibMain.getEco() == null) {
|
||||||
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
|
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
|
||||||
send.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
|
T2Csend.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
|
||||||
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
|
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
|
||||||
}
|
}
|
||||||
player.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
|
player.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
|
||||||
@ -56,8 +54,7 @@ public class Eco {
|
|||||||
return have;
|
return have;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean itemAdd(Player player, String item, int amount) {
|
public static boolean itemAdd(Player player, ItemStack itemStack, int amount) {
|
||||||
ItemStack itemStack = new ItemStack(Material.valueOf(item.toUpperCase()));
|
|
||||||
boolean empty = false;
|
boolean empty = false;
|
||||||
for (int i = 0; i < player.getInventory().getSize() - 5; i++) {
|
for (int i = 0; i < player.getInventory().getSize() - 5; i++) {
|
||||||
if (player.getInventory().getItem(i) == null) {
|
if (player.getInventory().getItem(i) == null) {
|
||||||
@ -78,13 +75,12 @@ public class Eco {
|
|||||||
public static boolean votePointsRemove(String prefix, Player player, Integer amount) {
|
public static boolean votePointsRemove(String prefix, Player player, Integer amount) {
|
||||||
if (votePlugin(prefix, player)) {
|
if (votePlugin(prefix, player)) {
|
||||||
return VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).removePoints(amount);
|
return VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).removePoints(amount);
|
||||||
|
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean votePointsAdd(String prefix, Player player, Integer amount) {
|
public static boolean votePointsAdd(String prefix, Player player, Integer amount) {
|
||||||
if (votePlugin(prefix, player)) {
|
if (votePlugin(prefix, player)) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(T2CodeMain.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(T2CodeLibMain.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).addPoints(amount);
|
VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).addPoints(amount);
|
||||||
@ -95,8 +91,8 @@ public class Eco {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean votePlugin(String prefix, Player player) {
|
private static boolean votePlugin(String prefix, Player player) {
|
||||||
if (PluginCheck.votingPlugin()) return true;
|
if (T2CpluginCheck.votingPlugin()) return true;
|
||||||
send.console(prefix + " §4\n" + prefix + " §4VotingPlugin could not be found! §9Please download it here: " +
|
T2Csend.console(prefix + " §4\n" + prefix + " §4VotingPlugin could not be found! §9Please download it here: " +
|
||||||
"§6https://www.spigotmc.org/resources/votingplugin.15358/§4\n" + prefix);
|
"§6https://www.spigotmc.org/resources/votingplugin.15358/§4\n" + prefix);
|
||||||
player.sendMessage(prefix + "\n" + SelectLibMsg.votingPluginNotSetUp + "\n" + prefix);
|
player.sendMessage(prefix + "\n" + SelectLibMsg.votingPluginNotSetUp + "\n" + prefix);
|
||||||
return false;
|
return false;
|
@ -1,10 +1,10 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.items;
|
package net.t2code.t2codelib.SPIGOT.api.items;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class ItemVersion {
|
public class T2CitemVersion {
|
||||||
private static Material Head;
|
private static Material Head;
|
||||||
private static ItemStack HeadIS;
|
private static ItemStack HeadIS;
|
||||||
private static ItemStack CRAFTING_TABLE;
|
private static ItemStack CRAFTING_TABLE;
|
||||||
@ -16,7 +16,7 @@ public class ItemVersion {
|
|||||||
private static ItemStack RED_STAINED_GLASS_PANE;
|
private static ItemStack RED_STAINED_GLASS_PANE;
|
||||||
|
|
||||||
public static void scan() {
|
public static void scan() {
|
||||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||||
Head = Material.valueOf("SKULL_ITEM");
|
Head = Material.valueOf("SKULL_ITEM");
|
||||||
YELLOW_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
|
YELLOW_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
|
||||||
ORANGE_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
|
ORANGE_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
|
@ -1,41 +1,36 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.messages;
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class HoverModule {
|
public class T2ChoverModule {
|
||||||
|
|
||||||
public static void modulePlayer(String text, String hover, String action, String actionValue, Player player) {
|
public static void modulePlayer(String text, String hover, String action, String actionValue, Player player) {
|
||||||
modulePlayer((text != null ? text : "null") + "/*/" + (hover != null ? hover : "null") + "/*/" + (action != null ? action : "null")
|
modulePlayer((text != null ? text : "null") + "/*/" + (hover != null ? hover : "null") + "/*/" + (action != null ? action : "null")
|
||||||
+ "/*/" + (actionValue != null ? actionValue : "null"), player);
|
+ "/*/" + (actionValue != null ? actionValue : "null"), player);
|
||||||
}
|
}
|
||||||
private static final MiniMessage mm = MiniMessage.miniMessage();
|
|
||||||
|
|
||||||
public static void modulePlayer(String msg, Player player) {
|
public static void modulePlayer(String msg, Player player) {
|
||||||
if (msg.contains("/*/")) {
|
if (msg.contains("/*/")) {
|
||||||
t2cmodule(msg, player);
|
t2cmodule(msg, player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
miniMessage(msg,player);
|
T2CminiMessage.miniMessage(msg, player);
|
||||||
}
|
|
||||||
public static void moduleSender(String msg, CommandSender sender) {
|
|
||||||
miniMessage(msg,sender);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void miniMessage(String msg, Player player){
|
public static void moduleSender(String msg, CommandSender sender) {
|
||||||
Component parsed = mm.deserialize(Replace.convertColorCode(msg));
|
T2CminiMessage.miniMessage(msg, sender);
|
||||||
T2CodeMain.adventure.player(player).sendMessage(parsed);
|
|
||||||
}
|
}
|
||||||
public static void miniMessage(String msg, CommandSender sender){
|
|
||||||
Component parsed = mm.deserialize(Replace.convertColorCode(msg));
|
public static void moduleConsole(String msg) {
|
||||||
T2CodeMain.adventure.sender(sender).sendMessage(parsed);
|
if (T2CodeLibMain.getNmIsLoad()) {
|
||||||
|
T2CminiMessage.sendMiniMessage(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bukkit.getConsoleSender().sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void t2cmodule(String msg, Player player) {
|
private static void t2cmodule(String msg, Player player) {
|
||||||
@ -50,7 +45,7 @@ public class HoverModule {
|
|||||||
if (i > 2) action = split[2];
|
if (i > 2) action = split[2];
|
||||||
if (i > 3) actionValue = split[3];
|
if (i > 3) actionValue = split[3];
|
||||||
|
|
||||||
TextBuilder textBuilder = new TextBuilder(text);
|
T2CtextBuilder textBuilder = new T2CtextBuilder(text);
|
||||||
if (hover != null && !hover.equals("null")) {
|
if (hover != null && !hover.equals("null")) {
|
||||||
textBuilder.addHover(hover);
|
textBuilder.addHover(hover);
|
||||||
}
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class T2CminiMessage {
|
||||||
|
|
||||||
|
public static void miniMessage(String msg, CommandSender sender) {
|
||||||
|
T2CodeLibMain.adventure().sender(sender).sendMessage(replace(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendMiniMessage(String msg) {
|
||||||
|
T2CodeLibMain.adventure().console().sendMessage(replace(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void miniMessage(String msg, Player player) {
|
||||||
|
T2CodeLibMain.adventure().player(player).sendMessage(replace(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static Component replace(String text) {
|
||||||
|
return MiniMessage.miniMessage().deserialize(T2Creplace.convertColorCode(text));
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,13 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.replace;
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Replace {
|
public class T2Creplace {
|
||||||
|
|
||||||
public static String replace(String prefix, String Text) {
|
public static String replace(String prefix, String Text) {
|
||||||
|
|
@ -1,13 +1,14 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.messages;
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class send {
|
public class T2Csend {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spigot
|
* Spigot
|
||||||
@ -15,36 +16,32 @@ public class send {
|
|||||||
|
|
||||||
public static void console(String msg) {
|
public static void console(String msg) {
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
Bukkit.getConsoleSender().sendMessage(msg);
|
T2ChoverModule.moduleConsole(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void player( Player player, String msg) {
|
public static void player(Player player, String msg) {
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
HoverModule.modulePlayer(msg, player);
|
T2ChoverModule.modulePlayer(msg, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void title( Player player, String msg, String msg2) {
|
public static void title(Player player, @Nullable String title, @Nullable String subtitle) {
|
||||||
|
player.sendTitle(title, subtitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void title(Player player, @Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut) {
|
||||||
|
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sender(CommandSender sender, String msg) {
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
if (msg == null || msg.contains("[empty]")) return;
|
||||||
if (msg2 == null || msg2.contains("[empty]")) return;
|
T2ChoverModule.moduleSender(msg, sender);
|
||||||
player.sendTitle(msg, msg2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void title( Player player, String msg, String msg2, int i, int i1, int i2) {
|
public static void debug(Plugin plugin, String msg) {
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
|
||||||
if (msg2 == null || msg2.contains("[empty]")) return;
|
|
||||||
player.sendTitle(msg, msg2, i, i1, i2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sender( CommandSender sender, String msg) {
|
|
||||||
if (msg == null || msg.contains("[empty]")) return;
|
|
||||||
HoverModule.moduleSender(msg, sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug( Plugin plugin, String msg) {
|
|
||||||
debug(plugin, msg, null);
|
debug(plugin, msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void debug( Plugin plugin, String msg, Integer stage) {
|
public static void debug(Plugin plugin, String msg, Integer stage) {
|
||||||
// if (!new File(Main.getPath(), "config.yml").exists()) return;
|
// if (!new File(Main.getPath(), "config.yml").exists()) return;
|
||||||
if (stage == null) {
|
if (stage == null) {
|
||||||
if (plugin.getConfig().getBoolean("Plugin.Debug"))
|
if (plugin.getConfig().getBoolean("Plugin.Debug"))
|
||||||
@ -56,19 +53,19 @@ public class send {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void debugmsg(Plugin plugin, String msg) {
|
public static void debugmsg(Plugin plugin, String msg) {
|
||||||
warning(plugin, "");
|
warning(plugin,"");
|
||||||
Bukkit.getConsoleSender().sendMessage("§e[" + plugin.getDescription().getPrefix() + "] §5DEBUG-MSG: §6" + msg);
|
Bukkit.getConsoleSender().sendMessage("§e[" + plugin.getDescription().getPrefix() + "] §5DEBUG-MSG: §6" + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void info( Plugin plugin, String msg) {
|
public static void info(Plugin plugin, String msg) {
|
||||||
plugin.getLogger().log(Level.INFO, msg);
|
plugin.getLogger().log(Level.INFO, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void warning( Plugin plugin, String msg) {
|
public static void warning(Plugin plugin, String msg) {
|
||||||
plugin.getLogger().log(Level.WARNING, msg);
|
plugin.getLogger().log(Level.WARNING, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void error( Plugin plugin, String msg) {
|
public static void error(Plugin plugin, String msg) {
|
||||||
plugin.getLogger().log(Level.SEVERE, msg);
|
plugin.getLogger().log(Level.SEVERE, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class T2Ctemplate {
|
||||||
|
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||||
|
return onLoadHeader(prefix, autor, version, spigot, discord, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium) {
|
||||||
|
return onLoadHeader(prefix, autor, version, spigot, discord, isPremium, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium, Boolean isVerify) {
|
||||||
|
Long long_ = System.currentTimeMillis();
|
||||||
|
T2Csend.console(prefix + " <dark_red> _______ </dark_red><gray>___ </gray><dark_red>_____ </dark_red>");
|
||||||
|
T2Csend.console(prefix + " <dark_red> |__ __|</dark_red><gray>__ \\ </gray><dark_red>/ ____|</dark_red>");
|
||||||
|
T2Csend.console(prefix + " <dark_red> | | </dark_red><gray> ) </gray><dark_red>| | </dark_red>");
|
||||||
|
T2Csend.console(prefix + " <dark_red> | | </dark_red><gray> / /</gray><dark_red>| | </dark_red>");
|
||||||
|
T2Csend.console(prefix + " <dark_red> | | </dark_red><gray>/ /_</gray><dark_red>| |____ </dark_red>");
|
||||||
|
T2Csend.console(prefix + " <dark_red> |_| </dark_red><gray>|____|</gray><dark_red>\\_____|</dark_red>");
|
||||||
|
T2Csend.console(prefix + " §4 §e------------------");
|
||||||
|
T2Csend.console(prefix + " §4 §e| §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||||
|
T2Csend.console(prefix + " §4 §e| §2Version: §6" + version);
|
||||||
|
T2Csend.console(prefix + " §4 §e| §2Spigot: §6" + spigot);
|
||||||
|
T2Csend.console(prefix + " §4 §e| §2Discord: §6" + discord);
|
||||||
|
if (isPremium != null) {
|
||||||
|
if (isPremium) {
|
||||||
|
T2Csend.console(prefix + " §4 §e| §6Premium: §2true");
|
||||||
|
} else T2Csend.console(prefix + " §4 §e| §6Premium: §4false");
|
||||||
|
if (isVerify != null) {
|
||||||
|
if (isVerify) {
|
||||||
|
T2Csend.console(prefix + " §4 §e| §6Verify: §2true");
|
||||||
|
} else T2Csend.console(prefix + " §4 §e| §6Verify: §4false");
|
||||||
|
} else T2Csend.console(prefix + " §4 §e| §6Verify: §4false");
|
||||||
|
}
|
||||||
|
|
||||||
|
T2Csend.console(prefix + " §4 §e-------------------");
|
||||||
|
if (version.toLowerCase().contains("dev") || version.toLowerCase().contains("snapshot") || version.toLowerCase().contains("beta")) {
|
||||||
|
T2Csend.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all" +
|
||||||
|
" bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
||||||
|
T2Csend.console(prefix + " §4 §e-------------------");
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return long_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long onLoadHeader(String prefix) {
|
||||||
|
Long long_ = System.currentTimeMillis();
|
||||||
|
T2Csend.console(prefix + "§4===================== " + prefix + " §4=====================");
|
||||||
|
return long_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onLoadSeparateStroke(String prefix) {
|
||||||
|
T2Csend.console(prefix + " §8-------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onLoadFooter(String prefix, Long long_, String version) {
|
||||||
|
onLoadSeparateStroke(prefix);
|
||||||
|
T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onLoadFooter(String prefix, Long long_) {
|
||||||
|
onLoadSeparateStroke(prefix);
|
||||||
|
T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onDisable(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||||
|
T2Csend.console(prefix + " §2Version: §6" + version);
|
||||||
|
T2Csend.console(prefix + " §4Plugin successfully disabled.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, Boolean premiumVerified, String text) {
|
||||||
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
String publicVersion = T2CupdateAPI.pluginVersions.get(plugin.getName()).publicVersion;
|
||||||
|
boolean update = !publicVersion.equalsIgnoreCase(pluginVersion);
|
||||||
|
boolean player = sender instanceof Player;
|
||||||
|
|
||||||
|
String stPlugin = "<dark_red>|</dark_red> <yellow>Plugin:</yellow> <gold>[pl]</gold>".replace("[pl]", plugin.getName());
|
||||||
|
String stVersion = "<dark_red>|</dark_red> <yellow>Version:</yellow> <gold>[ver]</gold>".replace("[ver]", pluginVersion);
|
||||||
|
String stAutor = "<dark_red>|</dark_red> <yellow>Autor(s):</yellow> <gold>[autor]</gold>".replace("[autor]", plugin.getDescription().getAuthors().toString());
|
||||||
|
String stNVersion = "<dark_red>|</dark_red> <yellow>Newest Version:</yellow> <gold>[nver]</gold>".replace("[nver]", publicVersion);
|
||||||
|
String stStable = "<dark_red>|</dark_red> <yellow>Stable version available:</yellow> [up]".replace("[up]", update ? "<dark_green>YES</dark_green>" : "<red>no</red>");
|
||||||
|
String stLinkPlayer = "<dark_red>|</dark_red> <yellow><hover:show_text:'<green>Go to the Spigot page</green>'><click:open_url:'[slink]'>Spigot</click></hover></yellow> "
|
||||||
|
.replace("[slink]", "https://www.spigotmc.org/resources/" + spigotID)
|
||||||
|
+ "<dark_red>-</dark_red> <dark_purple><hover:show_text:'<green>Go to the T2Code Support Discord</green>'><click:open_url:'[dlink]'>Discord</click></hover></dark_purple>"
|
||||||
|
.replace("[dlink]", discord);
|
||||||
|
String stLinkConsole = "<dark_red>|</dark_red> <yellow>Spigot:</yellow> <gold>https://www.spigotmc.org/resources/" + spigotID + "</gold>"
|
||||||
|
+ "<br><dark_red>|</dark_red> <yellow>Discord:</yellow> <gold>" + discord + "</gold>";
|
||||||
|
String stLink = player ? stLinkPlayer : stLinkConsole;
|
||||||
|
String pr = premiumVerified != null ? "<br><dark_red>|</dark_red> <yellow>Premium verified:</yellow> [pr]".replace("[pr]", premiumVerified ? "<dark_green>YES</dark_green>" : "<red>NO</red>") : "";
|
||||||
|
|
||||||
|
String stMSG = text == null || text.equals("") ? "" : "<br><dark_red>|</dark_red> " + text + "<br>";
|
||||||
|
T2Csend.sender(sender, "<dark_red>---------------------</dark_red>"
|
||||||
|
+ "<br>" + stPlugin
|
||||||
|
+ stMSG
|
||||||
|
+ stVersion
|
||||||
|
+ "<br>" + stAutor
|
||||||
|
+ "<br>" + stNVersion
|
||||||
|
+ "<br>" + stStable
|
||||||
|
+ "<br>" + stLink
|
||||||
|
+ pr
|
||||||
|
+ "<br><dark_red>---------------------</dark_red>");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, String text) {
|
||||||
|
sendInfo(sender, plugin, spigotID, discord, null, text);
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +1,27 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.messages;
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
|
||||||
public class TextBuilder {
|
public class T2CtextBuilder {
|
||||||
|
|
||||||
private final String text;
|
private final String text;
|
||||||
private String hover;
|
private String hover;
|
||||||
private String click;
|
private String click;
|
||||||
private ClickEvent.Action action;
|
private ClickEvent.Action action;
|
||||||
|
|
||||||
public TextBuilder(String text) {
|
public T2CtextBuilder(String text) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextBuilder addHover(String hover) {
|
public T2CtextBuilder addHover(String hover) {
|
||||||
this.hover = hover;
|
this.hover = hover;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextBuilder addClickEvent(ClickEvent.Action clickEventAction, String value) {
|
public T2CtextBuilder addClickEvent(ClickEvent.Action clickEventAction, String value) {
|
||||||
this.action = clickEventAction;
|
this.action = clickEventAction;
|
||||||
this.click = value;
|
this.click = value;
|
||||||
return this;
|
return this;
|
@ -0,0 +1,234 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.minecraftVersion;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
public class T2CmcVersion {
|
||||||
|
|
||||||
|
public static void onCheck() {
|
||||||
|
mcVersion = Bukkit.getServer().getVersion();
|
||||||
|
bukkitVersion = Bukkit.getServer().getBukkitVersion();
|
||||||
|
nms = Bukkit.getServer().getClass().getPackage().getName();
|
||||||
|
mc1_8 = nms.contains("1_8");
|
||||||
|
mc1_9 = nms.contains("1_9");
|
||||||
|
mc1_10 = nms.contains("1_10");
|
||||||
|
mc1_11 = nms.contains("1_11");
|
||||||
|
mc1_12 = nms.contains("1_12");
|
||||||
|
mc1_13 = nms.contains("1_13");
|
||||||
|
mc1_14 = nms.contains("1_14");
|
||||||
|
mc1_15 = nms.contains("1_15");
|
||||||
|
mc1_16 = nms.contains("1_16");
|
||||||
|
mc1_17 = nms.contains("1_17");
|
||||||
|
mc1_18 = nms.contains("1_18");
|
||||||
|
mc1_19 = nms.contains("1_19");
|
||||||
|
mc1_20 = nms.contains("1_20");
|
||||||
|
|
||||||
|
nms1_8_R1 = nms.contains("1_8_R1");
|
||||||
|
nms1_8_R2 = nms.contains("1_8_R2");
|
||||||
|
nms1_8_R3 = nms.contains("1_8_R3");
|
||||||
|
nms1_9_R1 = nms.contains("1_9_R1");
|
||||||
|
nms1_9_R2 = nms.contains("1_9_R2");
|
||||||
|
nms1_10_R1 = nms.contains("1_10_R1");
|
||||||
|
nms1_11_R1 = nms.contains("1_11_R1");
|
||||||
|
nms1_12_R1 = nms.contains("1_12_R1");
|
||||||
|
nms1_13_R1 = nms.contains("1_13_R1");
|
||||||
|
nms1_13_R2 = nms.contains("1_13_R2");
|
||||||
|
nms1_14_R1 = nms.contains("1_14_R1");
|
||||||
|
nms1_15_R1 = nms.contains("1_15_R1");
|
||||||
|
nms1_16_R1 = nms.contains("1_16_R1");
|
||||||
|
nms1_16_R2 = nms.contains("1_16_R2");
|
||||||
|
nms1_16_R3 = nms.contains("1_16_R3");
|
||||||
|
nms1_17_R1 = nms.contains("1_17_R1");
|
||||||
|
nms1_18_R1 = nms.contains("1_18_R1");
|
||||||
|
nms1_18_R2 = nms.contains("1_18_R2");
|
||||||
|
nms1_19_R1 = nms.contains("1_19_R1");
|
||||||
|
nms1_19_R2 = nms.contains("1_19_R2");
|
||||||
|
nms1_20_R1 = nms.contains("1_20_R1");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String mcVersion;
|
||||||
|
private static String bukkitVersion;
|
||||||
|
private static boolean mc1_8;
|
||||||
|
private static boolean mc1_9;
|
||||||
|
private static boolean mc1_10;
|
||||||
|
private static boolean mc1_11;
|
||||||
|
private static boolean mc1_12;
|
||||||
|
private static boolean mc1_13;
|
||||||
|
private static boolean mc1_14;
|
||||||
|
private static boolean mc1_15;
|
||||||
|
private static boolean mc1_16;
|
||||||
|
private static boolean mc1_17;
|
||||||
|
private static boolean mc1_18;
|
||||||
|
private static boolean mc1_19;
|
||||||
|
private static boolean mc1_20;
|
||||||
|
|
||||||
|
private static String nms;
|
||||||
|
private static boolean nms1_8_R1;
|
||||||
|
private static boolean nms1_8_R2;
|
||||||
|
private static boolean nms1_8_R3;
|
||||||
|
private static boolean nms1_9_R1;
|
||||||
|
private static boolean nms1_9_R2;
|
||||||
|
private static boolean nms1_10_R1;
|
||||||
|
private static boolean nms1_11_R1;
|
||||||
|
private static boolean nms1_12_R1;
|
||||||
|
private static boolean nms1_13_R1;
|
||||||
|
private static boolean nms1_13_R2;
|
||||||
|
private static boolean nms1_14_R1;
|
||||||
|
private static boolean nms1_15_R1;
|
||||||
|
private static boolean nms1_16_R1;
|
||||||
|
private static boolean nms1_16_R2;
|
||||||
|
private static boolean nms1_16_R3;
|
||||||
|
private static boolean nms1_17_R1;
|
||||||
|
private static boolean nms1_18_R1;
|
||||||
|
private static boolean nms1_18_R2;
|
||||||
|
private static boolean nms1_19_R1;
|
||||||
|
private static boolean nms1_19_R2;
|
||||||
|
private static boolean nms1_20_R1;
|
||||||
|
|
||||||
|
public static String getMcVersion() {
|
||||||
|
return mcVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getBukkitVersion() {
|
||||||
|
return bukkitVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_8() {
|
||||||
|
return mc1_8;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_9() {
|
||||||
|
return mc1_9;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_10() {
|
||||||
|
return mc1_10;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_11() {
|
||||||
|
return mc1_11;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_12() {
|
||||||
|
return mc1_12;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_13() {
|
||||||
|
return mc1_13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_14() {
|
||||||
|
return mc1_14;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_15() {
|
||||||
|
return mc1_15;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_16() {
|
||||||
|
return mc1_16;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_17() {
|
||||||
|
return mc1_17;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_18() {
|
||||||
|
return mc1_18;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_19() {
|
||||||
|
return mc1_19;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMc1_20() {
|
||||||
|
return mc1_20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getNms() {
|
||||||
|
return nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_8_R1() {
|
||||||
|
return nms1_8_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_8_R2() {
|
||||||
|
return nms1_8_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_8_R3() {
|
||||||
|
return nms1_8_R3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_9_R1() {
|
||||||
|
return nms1_9_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_9_R2() {
|
||||||
|
return nms1_9_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_10_R1() {
|
||||||
|
return nms1_10_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_11_R1() {
|
||||||
|
return nms1_11_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_12_R1() {
|
||||||
|
return nms1_12_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_13_R1() {
|
||||||
|
return nms1_13_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_13_R2() {
|
||||||
|
return nms1_13_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_14_R1() {
|
||||||
|
return nms1_14_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_15_R1() {
|
||||||
|
return nms1_15_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_16_R1() {
|
||||||
|
return nms1_16_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_16_R2() {
|
||||||
|
return nms1_16_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_16_R3() {
|
||||||
|
return nms1_16_R3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_17_R1() {
|
||||||
|
return nms1_17_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_18_R1() {
|
||||||
|
return nms1_18_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_18_R2() {
|
||||||
|
return nms1_18_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_19_R1() {
|
||||||
|
return nms1_19_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_19_R2() {
|
||||||
|
return nms1_19_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNms1_20_R1() {
|
||||||
|
return nms1_20_R1;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.player;
|
package net.t2code.t2codelib.SPIGOT.api.player;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@ -14,8 +14,7 @@ import java.net.URL;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class T2CnameHistory {
|
||||||
public class NameHistory {
|
|
||||||
public static class NameLookup {
|
public static class NameLookup {
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,12 +1,12 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.plugins;
|
package net.t2code.t2codelib.SPIGOT.api.plugins;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class PluginCheck {
|
public class T2CpluginCheck {
|
||||||
public static Boolean pluginCheck(String pluginName){
|
public static Boolean pluginCheck(String pluginName){
|
||||||
return Bukkit.getPluginManager().getPlugin(pluginName) != null;
|
return Bukkit.getPluginManager().getPlugin(pluginName) != null;
|
||||||
}
|
}
|
||||||
@ -55,6 +55,9 @@ public class PluginCheck {
|
|||||||
public static Boolean opSec(){
|
public static Boolean opSec(){
|
||||||
return Bukkit.getPluginManager().getPlugin("OPSecurity") != null;
|
return Bukkit.getPluginManager().getPlugin("OPSecurity") != null;
|
||||||
}
|
}
|
||||||
|
public static Boolean T2COPSecurity(){
|
||||||
|
return Bukkit.getPluginManager().getPlugin("T2C-OPSecurity") != null;
|
||||||
|
}
|
||||||
public static Boolean papiTest(){
|
public static Boolean papiTest(){
|
||||||
return Bukkit.getPluginManager().getPlugin("PaPiTest") != null;
|
return Bukkit.getPluginManager().getPlugin("PaPiTest") != null;
|
||||||
}
|
}
|
||||||
@ -79,7 +82,7 @@ public class PluginCheck {
|
|||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||||
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(T2CodeMain.getPlugin());
|
T2CodeLibMain.getPlugin().getPluginLoader().disablePlugin(T2CodeLibMain.getPlugin());
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.plugins;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class T2CpluginManager {
|
||||||
|
|
||||||
|
public static void restart(String plugin) {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void enable(String plugin) {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void disable(String plugin) {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void restart(Plugin plugin) {
|
||||||
|
if (plugin == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().disablePlugin(plugin);
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().enablePlugin(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void enable(Plugin plugin) {
|
||||||
|
if (plugin == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().enablePlugin(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void disable(Plugin plugin) {
|
||||||
|
if (plugin == null) return;
|
||||||
|
T2CodeLibMain.getPlugin().getPluginLoader().disablePlugin(plugin);
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.register;
|
package net.t2code.t2codelib.SPIGOT.api.register;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.permissions.Permission;
|
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
public class Register {
|
public class T2Cregister {
|
||||||
public static void listener(Listener listener, Plugin plugin) {
|
public static void listener(Listener listener, Plugin plugin) {
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
|
Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
|
||||||
}
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.update;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class T2CupdateAPI {
|
||||||
|
public static HashMap<String, T2CupdateObject> pluginVersions = new HashMap<>();
|
||||||
|
|
||||||
|
public static void join(Plugin plugin, String prefix, String perm, Player player, Integer spigotID, String discord) {
|
||||||
|
if (!SelectLibConfig.getUpdateCheckOnJoin()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!player.hasPermission(perm) && !player.isOp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pluginVersions.get(plugin.getName()) == null) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
join(plugin, prefix, perm, player, spigotID, discord);
|
||||||
|
}
|
||||||
|
}.runTaskLaterAsynchronously(plugin, 20L);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String publicVersion = pluginVersions.get(plugin.getName()).publicVersion;
|
||||||
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
if (pluginVersion.equals(publicVersion)) return;
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
sendUpdateMsg(prefix, spigotID, discord, plugin, player);
|
||||||
|
}
|
||||||
|
}.runTaskLaterAsynchronously(T2CodeLibMain.getPlugin(), 200L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendUpdateMsg(String prefix, Integer spigotID, String discord, Plugin plugin, Player player) {
|
||||||
|
String publicVersion = pluginVersions.get(plugin.getName()).publicVersion;
|
||||||
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
if (publicVersion.equals("§4No public version found!")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String st = "[prefix]<br>" +
|
||||||
|
"<click:open_url:'[link]'><hover:show_text:'<gold>You can download it here: <yellow>[link]</yellow></gold>'>[prefix] <gold>A new</gold> [value]<gold>version was found!</gold></hover></click><br>" +
|
||||||
|
"<click:open_url:'[link]'><hover:show_text:'<gold>You can download it here: <yellow>[link]</yellow></gold>'>[prefix] <red>[plv]</red> <gray>-></gray> <green>[puv]</green></hover></click><br>" +
|
||||||
|
"<click:open_url:'[dc]'><hover:show_text:'<yellow>[dc]</yellow>'>[prefix] <gold>You can find more information on Discord.</gold></hover></click><br>" +
|
||||||
|
"[prefix]";
|
||||||
|
String value = "";
|
||||||
|
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
|
if (publicVersion.toLowerCase().contains("dev")) {
|
||||||
|
value = "<dark_red>DEV </dark_red>";
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("beta")) {
|
||||||
|
value = "<green>BETA </green>";
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
|
value = "<yellow>SNAPSHOT </yellow>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
T2Csend.player(player, st.replace("[prefix]", prefix).replace("[value]", value).replace("[link]", "https://www.spigotmc.org/resources/" + spigotID)
|
||||||
|
.replace("[plv]", pluginVersion).replace("[puv]", publicVersion).replace("[dc]", discord));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendUpdateMsg(String prefix, Integer spigot, String discord, Plugin plugin) {
|
||||||
|
String publicVersion = pluginVersions.get(plugin.getName()).publicVersion;
|
||||||
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
String h = "§4=========== " + prefix + " §4===========";
|
||||||
|
String s1 = "";
|
||||||
|
String s2 = "§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion;
|
||||||
|
String s3 = "§6You can download it here: §ehttps://www.spigotmc.org/resources/" + spigot;
|
||||||
|
String s4 = "§6You can find more information on Discord: §e" + discord;
|
||||||
|
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
|
if (publicVersion.toLowerCase().contains("dev")) {
|
||||||
|
s1 = "§6A new §4DEV§6 version was found!§r";
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("beta")) {
|
||||||
|
s1 = "§6A new §2BETA§6 version was found!§r";
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
|
s1 = "§6A new §eSNAPSHOT§6 version was found!§r";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
s1 = "§6A new version was found!§r";
|
||||||
|
}
|
||||||
|
String text = "<br>" + h + "<br>" + s1 + "<br>" + s2 + "<br>" + s3 + "<br>" + s4 + "<br>" + h;
|
||||||
|
T2Csend.console(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onUpdateCheck(Plugin plugin, String prefix, int spigotID, String discord) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
(new T2CupdateChecker((JavaPlugin) plugin, spigotID)).getVersion((update_version) -> {
|
||||||
|
T2CupdateObject update = new T2CupdateObject(
|
||||||
|
plugin.getName(),
|
||||||
|
plugin.getDescription().getVersion(),
|
||||||
|
update_version,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
pluginVersions.put(plugin.getName(), update);
|
||||||
|
if (!plugin.getDescription().getVersion().equalsIgnoreCase(update_version)) {
|
||||||
|
if (!update.load) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
update.load = true;
|
||||||
|
sendUpdateMsg(prefix, spigotID, discord, plugin);
|
||||||
|
}
|
||||||
|
}.runTaskLaterAsynchronously(plugin, 600L);
|
||||||
|
} else sendUpdateMsg(prefix, spigotID, discord, plugin);
|
||||||
|
} else {
|
||||||
|
if (!update.load){
|
||||||
|
T2Csend.console(prefix + " §2No update found.");
|
||||||
|
update.load = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, prefix, plugin.getDescription().getVersion());
|
||||||
|
}
|
||||||
|
}.runTaskTimerAsynchronously(plugin, 0L, SelectLibConfig.getUpdateCheckTimeInterval() * 60 * 20L);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.update;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public class T2CupdateChecker {
|
||||||
|
private JavaPlugin plugin;
|
||||||
|
private int resourceId;
|
||||||
|
|
||||||
|
public T2CupdateChecker(JavaPlugin plugin, int resourceId) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.resourceId = resourceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getVersion(Consumer<String> consumer, String Prefix, String pluginVersion) {
|
||||||
|
if (!plugin.isEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||||
|
try {
|
||||||
|
InputStream inputStream = (new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId)).openStream();
|
||||||
|
try {
|
||||||
|
Scanner scanner = new Scanner(inputStream);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (scanner.hasNext()) {
|
||||||
|
consumer.accept(scanner.next());
|
||||||
|
}
|
||||||
|
} catch (Throwable var8) {
|
||||||
|
try {
|
||||||
|
scanner.close();
|
||||||
|
} catch (Throwable var7) {
|
||||||
|
var8.addSuppressed(var7);
|
||||||
|
}
|
||||||
|
throw var8;
|
||||||
|
}
|
||||||
|
scanner.close();
|
||||||
|
} catch (Throwable var9) {
|
||||||
|
if (inputStream != null) {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (Throwable var6) {
|
||||||
|
var9.addSuppressed(var6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw var9;
|
||||||
|
}
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException var10) {
|
||||||
|
Boolean load = false;
|
||||||
|
if (T2CupdateAPI.pluginVersions.containsKey(plugin.getName())){
|
||||||
|
load = T2CupdateAPI.pluginVersions.get(plugin.getName()).load;
|
||||||
|
}
|
||||||
|
|
||||||
|
T2CupdateObject update = new T2CupdateObject(
|
||||||
|
plugin.getName(),
|
||||||
|
pluginVersion,
|
||||||
|
null,
|
||||||
|
load
|
||||||
|
);
|
||||||
|
T2CupdateAPI.pluginVersions.put(plugin.getName(), update);
|
||||||
|
this.plugin.getLogger().severe("§4 Cannot look for updates: " + var10.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.api.update;
|
||||||
|
|
||||||
|
|
||||||
|
public class T2CupdateObject {
|
||||||
|
|
||||||
|
public String pluginName;
|
||||||
|
public String pluginVersion;
|
||||||
|
public String publicVersion;
|
||||||
|
public Boolean load;
|
||||||
|
|
||||||
|
public T2CupdateObject(String pluginName,
|
||||||
|
String pluginVersion,
|
||||||
|
String publicVersion,
|
||||||
|
Boolean load) {
|
||||||
|
this.pluginName = pluginName;
|
||||||
|
this.pluginVersion = pluginVersion;
|
||||||
|
this.publicVersion = publicVersion;
|
||||||
|
this.load = load;
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.yamlConfiguration;
|
package net.t2code.t2codelib.SPIGOT.api.yaml;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||||
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
|
import net.t2code.t2codelib.SPIGOT.system.config.languages.SelectLibMsg;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Config {
|
public class T2Cconfig {
|
||||||
public static void set(String path, String value, YamlConfiguration YamlConfiguration) {
|
public static void set(String path, String value, YamlConfiguration YamlConfiguration) {
|
||||||
if (!YamlConfiguration.contains(path)) {
|
if (!YamlConfiguration.contains(path)) {
|
||||||
YamlConfiguration.set(path, value);
|
YamlConfiguration.set(path, value);
|
||||||
@ -53,28 +53,28 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setSound(String soundName, String sound1_8, String sound1_9, String sound1_13, YamlConfiguration yamlConfiguration) {
|
public static void setSound(String soundName, String sound1_8, String sound1_9, String sound1_13, YamlConfiguration yamlConfiguration) {
|
||||||
Config.set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
||||||
String sound;
|
String sound;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (T2CmcVersion.isMc1_8()) {
|
||||||
sound = sound1_8.toString();
|
sound = sound1_8.toString();
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||||
sound = sound1_9.toString();
|
sound = sound1_9.toString();
|
||||||
} else sound = sound1_13.toString();
|
} else sound = sound1_13.toString();
|
||||||
Config.set("Sound." + soundName + ".Sound", sound, yamlConfiguration);
|
set("Sound." + soundName + ".Sound", sound, yamlConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSound(String soundName, String sound1_8, String sound1_13, YamlConfiguration yamlConfiguration) {
|
public static void setSound(String soundName, String sound1_8, String sound1_13, YamlConfiguration yamlConfiguration) {
|
||||||
Config.set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
||||||
String sound;
|
String sound;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (T2CmcVersion.isMc1_8()) {
|
||||||
sound = sound1_8.toString();
|
sound = sound1_8.toString();
|
||||||
} else sound = sound1_13.toString();
|
} else sound = sound1_13.toString();
|
||||||
Config.set("Sound." + soundName + ".Sound", sound, yamlConfiguration);
|
set("Sound." + soundName + ".Sound", sound, yamlConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSound(String soundName, String sound, YamlConfiguration yamlConfiguration) {
|
public static void setSound(String soundName, String sound, YamlConfiguration yamlConfiguration) {
|
||||||
Config.set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
set("Sound." + soundName + ".Enable", true, yamlConfiguration);
|
||||||
Config.set("Sound." + soundName + ".Sound", sound.toString(), yamlConfiguration);
|
set("Sound." + soundName + ".Sound", sound.toString(), yamlConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean selectSoundEnable(String soundName, YamlConfiguration yamlConfiguration) {
|
public static boolean selectSoundEnable(String soundName, YamlConfiguration yamlConfiguration) {
|
||||||
@ -87,9 +87,9 @@ public class Config {
|
|||||||
|
|
||||||
public static Sound checkSound(String sound1_8, String sound1_9, String sound1_13, String selectSoundFromConfig, String prefix) {
|
public static Sound checkSound(String sound1_8, String sound1_9, String sound1_13, String selectSoundFromConfig, String prefix) {
|
||||||
String SOUND;
|
String SOUND;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (T2CmcVersion.isMc1_8()) {
|
||||||
SOUND = sound1_8;
|
SOUND = sound1_8;
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||||
SOUND = sound1_9;
|
SOUND = sound1_9;
|
||||||
} else SOUND = sound1_13;
|
} else SOUND = sound1_13;
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ public class Config {
|
|||||||
|
|
||||||
public static Sound checkSound(String sound1_8, String sound1_13, String selectSoundFromConfig, String prefix) {
|
public static Sound checkSound(String sound1_8, String sound1_13, String selectSoundFromConfig, String prefix) {
|
||||||
String SOUND;
|
String SOUND;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (T2CmcVersion.isMc1_8()) {
|
||||||
SOUND = sound1_8;
|
SOUND = sound1_8;
|
||||||
} else SOUND = sound1_13;
|
} else SOUND = sound1_13;
|
||||||
|
|
||||||
@ -109,14 +109,14 @@ public class Config {
|
|||||||
try {
|
try {
|
||||||
return Sound.valueOf(selectSoundFromConfig);
|
return Sound.valueOf(selectSoundFromConfig);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
send.console("§4\n§4\n§4\n" + SelectLibMsg.soundNotFound.replace("[prefix]", prefix)
|
T2Csend.console("§4\n§4\n§4\n" + SelectLibMsg.soundNotFound.replace("[prefix]", prefix)
|
||||||
.replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n");
|
.replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n");
|
||||||
return Sound.valueOf(sound);
|
return Sound.valueOf(sound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String select(String prefix, String path, YamlConfiguration yamlConfiguration) {
|
public static String select(String prefix, String path, YamlConfiguration yamlConfiguration) {
|
||||||
return Replace.replace(prefix, yamlConfiguration.getString(path));
|
return T2Creplace.replace(prefix, yamlConfiguration.getString(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ public class Config {
|
|||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
List<String> input = yamlConfiguration.getStringList(path);
|
List<String> input = yamlConfiguration.getStringList(path);
|
||||||
for (String st : input) {
|
for (String st : input) {
|
||||||
output.add(Replace.replace(prefix, st));
|
output.add(T2Creplace.replace(prefix, st));
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ public class Config {
|
|||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
List<String> input = yamlConfiguration.getStringList(path);
|
List<String> input = yamlConfiguration.getStringList(path);
|
||||||
for (String st : input) {
|
for (String st : input) {
|
||||||
output.add(Replace.replace(prefix, st));
|
output.add(T2Creplace.replace(prefix, st));
|
||||||
}
|
}
|
||||||
value = output;
|
value = output;
|
||||||
}
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class BCommandSenderReciver {
|
||||||
|
|
||||||
|
public static void sendToBungee(CommandSender sender, String information, Boolean console) {
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream output = new DataOutputStream(stream);
|
||||||
|
try {
|
||||||
|
if (console) {
|
||||||
|
output.writeUTF("T2Code-Console");
|
||||||
|
} else {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
output.writeUTF(sender.getName());
|
||||||
|
} else {
|
||||||
|
output.writeUTF("T2Code-Console");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
output.writeUTF(information);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
Player player = (Player) sender;
|
||||||
|
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bcmd", stream.toByteArray());
|
||||||
|
}else {
|
||||||
|
for(Player player : Bukkit.getOnlinePlayers()){
|
||||||
|
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bcmd", stream.toByteArray());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,28 +1,30 @@
|
|||||||
package net.t2code.lib.Spigot.system;
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
import net.t2code.t2codelib.SPIGOT.system.CreateReportLog;
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
import net.t2code.lib.Util;
|
import net.t2code.t2codelib.Util;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.TabCompleter;
|
import org.bukkit.command.TabCompleter;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter implements CommandExecutor, TabCompleter {
|
public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (!sender.hasPermission("t2code.admin")) {
|
if (!sender.hasPermission("t2code.admin")) {
|
||||||
send.sender(sender, "§4No Permission §8t2code.admin");
|
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), T2CodeMain.getAutor(), T2CodeMain.getVersion(), UpdateAPI.PluginVersionen.get(T2CodeMain.getPlugin().getName()).publicVersion);
|
T2Ctemplate.sendInfo(sender,T2CodeLibMain.getPlugin(), Util.getSpigotID(),Util.getDiscord(),null, Util.getInfoText());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
@ -31,28 +33,27 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
case "pl":
|
case "pl":
|
||||||
case "version":
|
case "version":
|
||||||
case "ver":
|
case "ver":
|
||||||
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), T2CodeMain.getAutor(), T2CodeMain.getVersion(), UpdateAPI.PluginVersionen.get(T2CodeMain.getPerm().getName()).publicVersion);
|
T2Ctemplate.sendInfo(sender,T2CodeLibMain.getPlugin(), Util.getSpigotID(),Util.getDiscord(),null, Util.getInfoText());
|
||||||
return false;
|
return false;
|
||||||
case "reloadconfig":
|
case "reloadconfig":
|
||||||
SelectLibConfig.onSelect();
|
SelectLibConfig.onSelect();
|
||||||
return false;
|
return false;
|
||||||
case "debug":
|
case "debug":
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ("createreportlog".equals(args[1].toLowerCase())) {
|
if ("createreportlog".equals(args[1].toLowerCase())) {
|
||||||
CreateReportLog.create(sender);
|
CreateReportLog.create(sender);
|
||||||
} else send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
} else T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//TabCompleter
|
//TabCompleter
|
||||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||||
put("debug", "t2code.admin");
|
put("debug", "t2code.admin");
|
||||||
@ -99,7 +100,6 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean hasPermission(Player player, String permission) {
|
public static boolean hasPermission(Player player, String permission) {
|
||||||
if (player.isOp()) {
|
if (player.isOp()) {
|
||||||
return true;
|
return true;
|
@ -1,11 +1,10 @@
|
|||||||
package net.t2code.lib.Spigot.system;
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import net.t2code.luckyBox.api.LuckyBoxAPI;
|
import net.t2code.luckyBox.api.LuckyBoxAPI;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -21,24 +20,24 @@ import java.util.zip.ZipOutputStream;
|
|||||||
|
|
||||||
public class CreateReportLog {
|
public class CreateReportLog {
|
||||||
protected static void create(CommandSender sender) {
|
protected static void create(CommandSender sender) {
|
||||||
send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog is created...");
|
T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog is created...");
|
||||||
String timeStampFile = new SimpleDateFormat("HH_mm_ss-dd_MM_yyyy").format(Calendar.getInstance().getTime());
|
String timeStampFile = new SimpleDateFormat("HH_mm_ss-dd_MM_yyyy").format(Calendar.getInstance().getTime());
|
||||||
|
|
||||||
File directory = new File(T2CodeMain.getPath() + "/DebugLogs");
|
File directory = new File(T2CodeLibMain.getPath() + "/DebugLogs");
|
||||||
if (!directory.exists()) {
|
if (!directory.exists()) {
|
||||||
directory.mkdir();
|
directory.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = new File(T2CodeMain.getPath(), "/DebugLogs/T2CodeLog.txt");
|
File file = new File(T2CodeLibMain.getPath(), "/DebugLogs/T2CodeLog.txt");
|
||||||
PrintWriter pWriter = null;
|
PrintWriter pWriter = null;
|
||||||
try {
|
try {
|
||||||
pWriter = new PrintWriter(new FileWriter(file.getPath()));
|
pWriter = new PrintWriter(new FileWriter(file.getPath()));
|
||||||
String timeStamp = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy").format(Calendar.getInstance().getTime());
|
String timeStamp = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy").format(Calendar.getInstance().getTime());
|
||||||
pWriter.println("Created on: " + timeStamp);
|
pWriter.println("Created on: " + timeStamp);
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
pWriter.println("Server Bukkit version: " + MCVersion.isBuckitVersion);
|
pWriter.println("Server Bukkit version: " + T2CmcVersion.getBukkitVersion());
|
||||||
pWriter.println("Server run on: " + MCVersion.isVersion);
|
pWriter.println("Server run on: " + T2CmcVersion.getMcVersion());
|
||||||
pWriter.println("Server NMS: " + NMSVersion.isNMS);
|
pWriter.println("Server NMS: " + T2CmcVersion.getNms());
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
pWriter.println("Online Mode: " + Bukkit.getOnlineMode());
|
pWriter.println("Online Mode: " + Bukkit.getOnlineMode());
|
||||||
pWriter.println("Worlds: " + Bukkit.getWorlds());
|
pWriter.println("Worlds: " + Bukkit.getWorlds());
|
||||||
@ -48,19 +47,21 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
if (Vault.vaultEnable) {
|
if (Vault.vaultEnable) {
|
||||||
pWriter.println("Vault: " + Bukkit.getPluginManager().getPlugin("Vault").getName() + " - " + Bukkit.getPluginManager().getPlugin("Vault").getDescription().getVersion());
|
pWriter.println("Vault: " + Bukkit.getPluginManager().getPlugin("Vault").getName() + " - " + Bukkit.getPluginManager().getPlugin("Vault")
|
||||||
|
.getDescription().getVersion());
|
||||||
} else pWriter.println("Vault: not connected");
|
} else pWriter.println("Vault: not connected");
|
||||||
if (T2CodeMain.getEco() != null) {
|
if (T2CodeLibMain.getEco() != null) {
|
||||||
String st = T2CodeMain.getEco().getName();
|
String st = T2CodeLibMain.getEco().getName();
|
||||||
if (T2CodeMain.getEco().getName().equals("CMIEconomy")) st = "CMI";
|
if (T2CodeLibMain.getEco().getName().equals("CMIEconomy")) st = "CMI";
|
||||||
if (Bukkit.getPluginManager().getPlugin(st) != null) {
|
if (Bukkit.getPluginManager().getPlugin(st) != null) {
|
||||||
pWriter.println("Economy: " + T2CodeMain.getEco().isEnabled() + " - " + st + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion());
|
pWriter.println("Economy: " + T2CodeLibMain.getEco().isEnabled() + " - " + st + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion());
|
||||||
} else pWriter.println("Economy: " + T2CodeMain.getEco().isEnabled() + " - " + st);
|
} else pWriter.println("Economy: " + T2CodeLibMain.getEco().isEnabled() + " - " + st);
|
||||||
} else pWriter.println("Economy: not connected via vault");
|
} else pWriter.println("Economy: not connected via vault");
|
||||||
if (T2CodeMain.getPerm() != null) {
|
if (T2CodeLibMain.getPerm() != null) {
|
||||||
if (Bukkit.getPluginManager().getPlugin(T2CodeMain.getPerm().getName()) != null) {
|
if (Bukkit.getPluginManager().getPlugin(T2CodeLibMain.getPerm().getName()) != null) {
|
||||||
pWriter.println("Permission: " + T2CodeMain.getPerm().isEnabled() + " - " + T2CodeMain.getPerm().getName() + " - " + Bukkit.getPluginManager().getPlugin(T2CodeMain.getPerm().getName()).getDescription().getVersion());
|
pWriter.println("Permission: " + T2CodeLibMain.getPerm().isEnabled() + " - " + T2CodeLibMain.getPerm().getName() + " - " + Bukkit.getPluginManager()
|
||||||
} else pWriter.println("Permission: " + T2CodeMain.getPerm().isEnabled() + " - " + T2CodeMain.getPerm().getName());
|
.getPlugin(T2CodeLibMain.getPerm().getName()).getDescription().getVersion());
|
||||||
|
} else pWriter.println("Permission: " + T2CodeLibMain.getPerm().isEnabled() + " - " + T2CodeLibMain.getPerm().getName());
|
||||||
} else pWriter.println("Permission: not connected via vault");
|
} else pWriter.println("Permission: not connected via vault");
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
pWriter.println("Java: " + System.getProperty("java.version"));
|
pWriter.println("Java: " + System.getProperty("java.version"));
|
||||||
@ -68,9 +69,9 @@ public class CreateReportLog {
|
|||||||
pWriter.println("System: " + System.getProperty("os.version"));
|
pWriter.println("System: " + System.getProperty("os.version"));
|
||||||
pWriter.println("User Home: " + System.getProperty("user.home"));
|
pWriter.println("User Home: " + System.getProperty("user.home"));
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
pWriter.println("T2CodeLib: " + T2CodeMain.getPlugin().getDescription().getVersion());
|
pWriter.println("T2CodeLib: " + T2CodeLibMain.getPlugin().getDescription().getVersion());
|
||||||
pWriter.println();
|
pWriter.println();
|
||||||
if (PluginCheck.luckyBox()) {
|
if (T2CpluginCheck.luckyBox()) {
|
||||||
pWriter.println("T2C-PremiumPlugins: ");
|
pWriter.println("T2C-PremiumPlugins: ");
|
||||||
pWriter.println("T2C-LuckyBox UID: " + LuckyBoxAPI.getUID());
|
pWriter.println("T2C-LuckyBox UID: " + LuckyBoxAPI.getUID());
|
||||||
pWriter.println("T2C-LuckyBox RID: " + LuckyBoxAPI.getRID());
|
pWriter.println("T2C-LuckyBox RID: " + LuckyBoxAPI.getRID());
|
||||||
@ -81,7 +82,8 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
pWriter.println("Plugins: ");
|
pWriter.println("Plugins: ");
|
||||||
for (Plugin pl : Bukkit.getPluginManager().getPlugins()) {
|
for (Plugin pl : Bukkit.getPluginManager().getPlugins()) {
|
||||||
pWriter.println(" - " + pl.getName() + " - " + pl.getDescription().getVersion() + " - Enabled: " + pl.isEnabled() + " - Autors: " + pl.getDescription().getAuthors() + " - Website: " + pl.getDescription().getWebsite());
|
pWriter.println(" - " + pl.getName() + " - " + pl.getDescription().getVersion() + " - Enabled: " + pl.isEnabled() + " - Autors: " + pl.getDescription()
|
||||||
|
.getAuthors() + " - Website: " + pl.getDescription().getWebsite());
|
||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
ioe.printStackTrace();
|
ioe.printStackTrace();
|
||||||
@ -92,7 +94,7 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String filePath = T2CodeMain.getPath() + "/DebugLogs/T2CodeLog.txt";
|
String filePath = T2CodeLibMain.getPath() + "/DebugLogs/T2CodeLog.txt";
|
||||||
String log = "logs/latest.log";
|
String log = "logs/latest.log";
|
||||||
String zipPath = "plugins/T2CodeLib/DebugLogs/T2CLog-" + timeStampFile + ".zip";
|
String zipPath = "plugins/T2CodeLib/DebugLogs/T2CLog-" + timeStampFile + ".zip";
|
||||||
try (ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(zipPath))) {
|
try (ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(zipPath))) {
|
||||||
@ -102,24 +104,9 @@ public class CreateReportLog {
|
|||||||
|
|
||||||
addFileToZip("", "logs/latest.log", zip, false);
|
addFileToZip("", "logs/latest.log", zip, false);
|
||||||
|
|
||||||
for (String pl : Util.getT2cPlugins()){
|
for (String pl : Util.getT2cPlugins()) {
|
||||||
pluginToDebug(pl, zip);
|
pluginToDebug(pl, zip);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pluginToDebug("T2C-LuckyBox", zip);
|
|
||||||
//pluginToDebug("WonderBagShop", zip);
|
|
||||||
//pluginToDebug("CommandGUI", zip);
|
|
||||||
//pluginToDebug("OPSecurity", zip);
|
|
||||||
//pluginToDebug("PaPiTest", zip);
|
|
||||||
//pluginToDebug("PlotSquaredGUI", zip);
|
|
||||||
//pluginToDebug("T2C-Alias", zip);
|
|
||||||
//pluginToDebug("T2C-AutoResponse", zip);
|
|
||||||
//
|
|
||||||
//pluginToDebug("LoreEditor", zip);
|
|
||||||
//pluginToDebug("Booster", zip);
|
|
||||||
//pluginToDebug("AntiMapCopy", zip);
|
|
||||||
//pluginToDebug("AntiCopy", zip);
|
|
||||||
|
|
||||||
zip.closeEntry();
|
zip.closeEntry();
|
||||||
zip.close();
|
zip.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -127,14 +114,14 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
file.delete();
|
file.delete();
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
||||||
send.console(T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
||||||
} else send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
} else T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void pluginToDebug(String pluginName, ZipOutputStream zip) throws IOException {
|
private static void pluginToDebug(String pluginName, ZipOutputStream zip) throws IOException {
|
||||||
if (PluginCheck.pluginCheck(pluginName)) {
|
if (T2CpluginCheck.pluginCheck(pluginName)) {
|
||||||
Plugin plugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
Plugin plugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
||||||
File plConfigs = new File(plugin.getDataFolder().getPath());
|
File plConfigs = new File(plugin.getDataFolder().getPath());
|
||||||
if (plConfigs.exists()) {
|
if (plConfigs.exists()) {
|
@ -0,0 +1,17 @@
|
|||||||
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
|
||||||
|
public class JoinEvent implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoinEvent(PlayerLoginEvent event) {
|
||||||
|
T2CupdateAPI.join(T2CodeLibMain.getPlugin(), Util.getPrefix(),"t2code.lib.updatemsg",event.getPlayer(),Util.getSpigotID(),Util.getDiscord());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,169 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.bstats.Metrics;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.ConfigCreate;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.languages.LanguagesCreate;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.languages.SelectLibMsg;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public final class T2CodeLibMain extends JavaPlugin {
|
||||||
|
private static T2CodeLibMain plugin;
|
||||||
|
private static Economy eco = null;
|
||||||
|
private static Permission perm = null;
|
||||||
|
|
||||||
|
private static List<String> autor;
|
||||||
|
private static String version;
|
||||||
|
|
||||||
|
private static Boolean nmIsLoad = true;
|
||||||
|
private static Boolean load = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
// Plugin startup logic
|
||||||
|
plugin = this;
|
||||||
|
autor = plugin.getDescription().getAuthors();
|
||||||
|
version = plugin.getDescription().getVersion();
|
||||||
|
this.adventure = BukkitAudiences.create(this);
|
||||||
|
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
|
String prefix = Util.getPrefix();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Vault.loadVault();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
T2CmcVersion.onCheck();
|
||||||
|
|
||||||
|
if (T2CmcVersion.isMc1_20()) {
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
T2Csend.warning(plugin, "The 1.20.* is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
T2Csend.console(prefix + " §3Server run on: §6" + T2CmcVersion.getMcVersion() + " / " + T2CmcVersion.getNms());
|
||||||
|
if (eco != null) {
|
||||||
|
String st = eco.getName();
|
||||||
|
if (eco.getName().equals("CMIEconomy")) st = "CMI";
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(st) != null) {
|
||||||
|
T2Csend.console(prefix + " §3Economy: §6" + eco.getName() + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion() + " §7- §e" +
|
||||||
|
(System.currentTimeMillis() - long_) + "ms");
|
||||||
|
} else T2Csend.console(prefix + " §3Economy: §6" + eco.getName() + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
} else T2Csend.console(prefix + " §3Economy: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
|
||||||
|
if (perm != null) {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(perm.getName()) != null) {
|
||||||
|
T2Csend.console(prefix + " §3Permission plugin: §6" + perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(perm.getName()).getDescription().getVersion()
|
||||||
|
+ " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
} else T2Csend.console(prefix + " §3Permission plugin: §6" + perm.getName() + " - §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
} else T2Csend.console(prefix + " §3Permission plugin: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
|
||||||
|
if (T2CpluginCheck.papi()) {
|
||||||
|
T2Csend.console(prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin.getCommand("t2code").setExecutor(new CmdExecuter());
|
||||||
|
ConfigCreate.configCreate();
|
||||||
|
T2CitemVersion.scan();
|
||||||
|
LanguagesCreate.langCreate();
|
||||||
|
SelectLibConfig.onSelect();
|
||||||
|
SelectLibMsg.onSelect();
|
||||||
|
|
||||||
|
T2CupdateAPI.onUpdateCheck(plugin, prefix, Util.getSpigotID(), Util.getDiscord());
|
||||||
|
Metrics.Bstats(plugin, Util.getBstatsID());
|
||||||
|
if (SelectLibConfig.getBungee()){
|
||||||
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
|
||||||
|
}
|
||||||
|
|
||||||
|
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
||||||
|
T2Ctemplate.onLoadFooter(prefix, long_);
|
||||||
|
load = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
// Plugin shutdown logic
|
||||||
|
if (!load) return;
|
||||||
|
if (SelectLibConfig.getInventoriesCloseByServerStop()) {
|
||||||
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Vault.vaultDisable();
|
||||||
|
T2Ctemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
|
if (nmIsLoad) {
|
||||||
|
if (this.adventure != null) {
|
||||||
|
this.adventure.close();
|
||||||
|
this.adventure = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getPath() {
|
||||||
|
return plugin.getDataFolder();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setEco(Economy eco) {
|
||||||
|
T2CodeLibMain.eco = eco;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setPerm(Permission perm) {
|
||||||
|
T2CodeLibMain.perm = perm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T2CodeLibMain getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Economy getEco() {
|
||||||
|
return eco;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Permission getPerm() {
|
||||||
|
return perm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getAutor() {
|
||||||
|
return autor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static BukkitAudiences adventure;
|
||||||
|
|
||||||
|
public static BukkitAudiences adventure() {
|
||||||
|
if (adventure == null) {
|
||||||
|
throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
|
||||||
|
}
|
||||||
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " Adventure load");
|
||||||
|
return adventure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getNmIsLoad() {
|
||||||
|
return nmIsLoad;
|
||||||
|
}
|
||||||
|
}
|
48
src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java
Normal file
48
src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system;
|
||||||
|
|
||||||
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
|
||||||
|
public class Vault {
|
||||||
|
|
||||||
|
public static Boolean vaultEnable;
|
||||||
|
public static Boolean connected;
|
||||||
|
|
||||||
|
public static void loadVault() throws InterruptedException {
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null) {
|
||||||
|
vaultEnable = true;
|
||||||
|
RegisteredServiceProvider<Economy> eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
|
||||||
|
if (eco != null) {
|
||||||
|
T2CodeLibMain.setEco(eco.getProvider());
|
||||||
|
if (T2CodeLibMain.getEco() != null) {
|
||||||
|
connected = true;
|
||||||
|
T2Csend.console(Util.getPrefix() + " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
} else {
|
||||||
|
connected = false;
|
||||||
|
T2Csend.console(Util.getPrefix() + " §4Economy could not be connected / found! [1]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
connected = false;
|
||||||
|
T2Csend.console(Util.getPrefix() + " §4Economy could not be connected / found! [2]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
RegisteredServiceProvider<Permission> perm = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Permission.class);
|
||||||
|
if (perm != null) {
|
||||||
|
T2CodeLibMain.setPerm(perm.getProvider());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vaultEnable = false;
|
||||||
|
connected = false;
|
||||||
|
T2Csend.console(Util.getPrefix() + " §4Vault could not be connected! [3]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void vaultDisable() {
|
||||||
|
if (!connected) return;
|
||||||
|
connected = false;
|
||||||
|
T2Csend.console(Util.getPrefix() + " §4Vault / Economy successfully deactivated.");
|
||||||
|
}
|
||||||
|
}
|
@ -1,14 +1,14 @@
|
|||||||
// This claas was created by JaTiTV
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
|
|
||||||
package net.t2code.lib.Spigot.system;
|
package net.t2code.t2codelib.SPIGOT.system.bstats;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
@ -0,0 +1,40 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system.config.config;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
|
public class ConfigCreate {
|
||||||
|
|
||||||
|
public static void configCreate() {
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
if (new File(T2CodeLibMain.getPath(), "config.yml").exists()){
|
||||||
|
if (T2CodeLibMain.getPlugin().getConfig().getBoolean("Plugin.Debug")) T2Csend.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||||
|
} else T2Csend.console(Util.getPrefix() + " §4config.yml are created...");
|
||||||
|
|
||||||
|
|
||||||
|
File config = new File(T2CodeLibMain.getPath(), "config.yml");
|
||||||
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
|
T2Cconfig.set("Plugin.UpdateCheck.OnJoin", true, yamlConfiguration);
|
||||||
|
T2Cconfig.set("Plugin.UpdateCheck.TimeInterval", 60, yamlConfiguration);
|
||||||
|
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
|
||||||
|
|
||||||
|
T2Cconfig.set("BungeeCord.Enable", false, yamlConfiguration);
|
||||||
|
T2Cconfig.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
||||||
|
|
||||||
|
try {
|
||||||
|
yamlConfiguration.save(config);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
T2Csend.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +1,22 @@
|
|||||||
package net.t2code.lib.Spigot.system.config;
|
package net.t2code.t2codelib.SPIGOT.system.config.config;
|
||||||
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class SelectLibConfig {
|
public class SelectLibConfig {
|
||||||
|
|
||||||
|
|
||||||
private static Boolean UpdateCheckOnJoin;
|
private static Boolean UpdateCheckOnJoin;
|
||||||
private static Boolean t2cTestDevelopment;
|
private static Boolean t2cTestDevelopment;
|
||||||
private static Integer UpdateCheckTimeInterval;
|
private static Integer UpdateCheckTimeInterval;
|
||||||
private static Boolean Debug;
|
private static Boolean Debug;
|
||||||
private static String language;
|
private static String language;
|
||||||
|
private static Boolean bungee;
|
||||||
private static Boolean InventoriesCloseByServerStop;
|
private static Boolean InventoriesCloseByServerStop;
|
||||||
|
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
File config = new File(T2CodeMain.getPath(), "config.yml");
|
File config = new File(T2CodeLibMain.getPath(), "config.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheck.OnJoin");
|
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheck.OnJoin");
|
||||||
@ -24,6 +24,7 @@ public class SelectLibConfig {
|
|||||||
UpdateCheckTimeInterval = yamlConfiguration.getInt("Plugin.UpdateCheck.TimeInterval");
|
UpdateCheckTimeInterval = yamlConfiguration.getInt("Plugin.UpdateCheck.TimeInterval");
|
||||||
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
||||||
language = yamlConfiguration.getString("Plugin.language");
|
language = yamlConfiguration.getString("Plugin.language");
|
||||||
|
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||||
InventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
InventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +48,10 @@ public class SelectLibConfig {
|
|||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Boolean getBungee() {
|
||||||
|
return bungee;
|
||||||
|
}
|
||||||
|
|
||||||
public static Boolean getInventoriesCloseByServerStop() {
|
public static Boolean getInventoriesCloseByServerStop() {
|
||||||
return InventoriesCloseByServerStop;
|
return InventoriesCloseByServerStop;
|
||||||
}
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system.config.languages;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class LanguagesCreate {
|
||||||
|
static Plugin plugin = T2CodeLibMain.getPlugin();
|
||||||
|
|
||||||
|
public static void langCreate() {
|
||||||
|
T2Csend.debug(plugin, "§4Language files are created / updated...");
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
||||||
|
setFile("english", MSG.EN_VaultNotSetUp, MSG.EN_VotingPluginNotSetUp, MSG.EN_SoundNotFound);
|
||||||
|
|
||||||
|
setFile("german", MSG.DE_VaultNotSetUp, MSG.DE_VotingPluginNotSetUp, MSG.DE_SoundNotFound);
|
||||||
|
|
||||||
|
setFile("norwegian", MSG.NO_VaultNotSetUp, MSG.NO_VotingPluginNotSetUp, MSG.NO_SoundNotFound);
|
||||||
|
|
||||||
|
T2Csend.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setFile(String language, String vaultNotSetUp, String votingPluginNotSetUp, String soundNotFound) {
|
||||||
|
File messages = new File(T2CodeLibMain.getPath(), "languages/" + language + ".yml");
|
||||||
|
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messages);
|
||||||
|
|
||||||
|
T2Cconfig.set("Plugin.VaultNotSetUp", vaultNotSetUp, yamlConfigurationNO);
|
||||||
|
T2Cconfig.set("Plugin.VotingPluginNotSetUp", votingPluginNotSetUp, yamlConfigurationNO);
|
||||||
|
T2Cconfig.set("Plugin.SoundNotFound", soundNotFound, yamlConfigurationNO);
|
||||||
|
|
||||||
|
try {
|
||||||
|
yamlConfigurationNO.save(messages);
|
||||||
|
} catch (IOException e) {
|
||||||
|
T2Csend.warning(plugin, e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
// This claas was created by JaTiTV
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
package net.t2code.lib.Spigot.system.languages;
|
package net.t2code.t2codelib.SPIGOT.system.config.languages;
|
||||||
|
|
||||||
public class MSG {
|
public class MSG {
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ public class MSG {
|
|||||||
|
|
||||||
|
|
||||||
// DE
|
// DE
|
||||||
public static String DE_VaultPluginNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||||
public static String DE_VotingPluginNotSetUp = "[prefix] &4VotingPlugin ist auf dem Server nicht vorhanden!";
|
public static String DE_VotingPluginNotSetUp = "[prefix] &4VotingPlugin ist auf dem Server nicht vorhanden!";
|
||||||
public static String DE_SoundNotFound = "[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe die Einstellungen.";
|
public static String DE_SoundNotFound = "[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe die Einstellungen.";
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
package net.t2code.t2codelib.SPIGOT.system.config.languages;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class SelectLibMsg {
|
||||||
|
private static Plugin plugin = T2CodeLibMain.getPlugin();
|
||||||
|
|
||||||
|
public static String selectMSG;
|
||||||
|
|
||||||
|
public static String vaultNotSetUp;
|
||||||
|
public static String votingPluginNotSetUp;
|
||||||
|
public static String soundNotFound;
|
||||||
|
|
||||||
|
public static void onSelect() {
|
||||||
|
String prefix = Util.getPrefix();
|
||||||
|
|
||||||
|
T2Csend.debug(plugin, "§4Select language...");
|
||||||
|
long long_ = System.currentTimeMillis();
|
||||||
|
|
||||||
|
File msg;
|
||||||
|
|
||||||
|
msg = new File(T2CodeLibMain.getPath(), "languages/" + SelectLibConfig.getLanguage() + ".yml");
|
||||||
|
if (!msg.isFile()) {
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
T2Csend.console(prefix + " §4The selected §c" + SelectLibConfig.getLanguage() + " §4language file was not found.");
|
||||||
|
T2Csend.console(prefix + " §6The default language §eEnglish §6is used!");
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
msg = new File(T2CodeLibMain.getPath(), "languages/" + "english.yml");
|
||||||
|
selectMSG = "english";
|
||||||
|
} else selectMSG = SelectLibConfig.getLanguage();
|
||||||
|
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
||||||
|
|
||||||
|
vaultNotSetUp = T2Creplace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VaultNotSetUp"));
|
||||||
|
votingPluginNotSetUp = T2Creplace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VotingPluginNotSetUp"));
|
||||||
|
soundNotFound = T2Creplace.replace(prefix, yamlConfiguration_msg.getString("Plugin.SoundNotFound"));
|
||||||
|
|
||||||
|
T2Csend.console(prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
|
}
|
||||||
|
}
|
49
src/main/java/net/t2code/t2codelib/Util.java
Normal file
49
src/main/java/net/t2code/t2codelib/Util.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package net.t2code.t2codelib;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Util {
|
||||||
|
|
||||||
|
public static String getInfoText() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPrefix() {
|
||||||
|
return "§8[§4T2Code§5Lib§8]";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getSpigotID() {
|
||||||
|
return 96388;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getBstatsID() {
|
||||||
|
return 12518;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSpigot() {
|
||||||
|
return "https://www.spigotmc.org/resources/" + getSpigotID();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDiscord() {
|
||||||
|
return "http://dc.t2code.net";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getT2cPlugins() {
|
||||||
|
return Arrays.asList(
|
||||||
|
"T2CodeLib",
|
||||||
|
"T2C-LuckyBox",
|
||||||
|
"WonderBagShop",
|
||||||
|
"CommandGUI",
|
||||||
|
"T2C-OPSecurity",
|
||||||
|
"OPSecurity",
|
||||||
|
"PaPiTest",
|
||||||
|
"T2C-Alias",
|
||||||
|
"T2C-AutoResponse",
|
||||||
|
"LoreEditor",
|
||||||
|
"Booster",
|
||||||
|
"AntiMapCopy",
|
||||||
|
"AntiCopy"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
name: T2CodeLib
|
name: T2CodeLib
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
main: net.t2code.lib.Bungee.BMain
|
main: net.t2code.t2codelib.BUNGEE.system.T2CodeBMain
|
||||||
author: JaTiTV, Jkobs
|
author: JaTiTV, Jkobs
|
||||||
description: Library from T2Code Plugins
|
description: Library from T2Code Plugins
|
@ -1,12 +1,13 @@
|
|||||||
name: T2CodeLib
|
name: T2CodeLib
|
||||||
version: ${project.version}
|
version: '${project.version}'
|
||||||
main: net.t2code.lib.Spigot.system.T2CodeMain
|
main: net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
prefix: T2CodeLib
|
prefix: T2CodeLib
|
||||||
authors: [ JaTiTV, Jkobs ]
|
authors: [ JaTiTV, Jkobs ]
|
||||||
description: Library from T2Code Plugins
|
description: Library from T2Code Plugins
|
||||||
website: T2Code.net
|
website: T2Code.net
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
|
|
||||||
softdepend:
|
softdepend:
|
||||||
- VotingPlugin
|
- VotingPlugin
|
||||||
- PlaceholderAPI
|
- PlaceholderAPI
|
||||||
@ -19,7 +20,7 @@ softdepend:
|
|||||||
|
|
||||||
loadbefore:
|
loadbefore:
|
||||||
- T2C-Alias
|
- T2C-Alias
|
||||||
- CommandGUI
|
- T2C-CommandGUI
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
t2code:
|
t2code:
|
||||||
|
Loading…
Reference in New Issue
Block a user