Initial commit
This commit is contained in:
3
Plugins/Old/JensCommunity2/sfs/.idea/.gitignore
generated
vendored
Normal file
3
Plugins/Old/JensCommunity2/sfs/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
1
Plugins/Old/JensCommunity2/sfs/.idea/.name
generated
Normal file
1
Plugins/Old/JensCommunity2/sfs/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
onSleep.java
|
||||
8
Plugins/Old/JensCommunity2/sfs/.idea/artifacts/JensCommunity2.xml
generated
Normal file
8
Plugins/Old/JensCommunity2/sfs/.idea/artifacts/JensCommunity2.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="JensCommunity2">
|
||||
<output-path>$PROJECT_DIR$/..</output-path>
|
||||
<root id="archive" name="JensCommunity2.jar">
|
||||
<element id="module-output" name="sfs" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
6
Plugins/Old/JensCommunity2/sfs/.idea/discord.xml
generated
Normal file
6
Plugins/Old/JensCommunity2/sfs/.idea/discord.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
</component>
|
||||
</project>
|
||||
11
Plugins/Old/JensCommunity2/sfs/.idea/libraries/craftbukkit_1_16_1.xml
generated
Normal file
11
Plugins/Old/JensCommunity2/sfs/.idea/libraries/craftbukkit_1_16_1.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="craftbukkit-1.16.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../Spigot Versions/craftbukkit-1.16.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../Spigot Versions/craftbukkit-1.16.1.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
12
Plugins/Old/JensCommunity2/sfs/.idea/misc.xml
generated
Normal file
12
Plugins/Old/JensCommunity2/sfs/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
Plugins/Old/JensCommunity2/sfs/.idea/modules.xml
generated
Normal file
8
Plugins/Old/JensCommunity2/sfs/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/sfs.iml" filepath="$PROJECT_DIR$/sfs.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
10
Plugins/Old/JensCommunity2/sfs/.idea/runConfigurations.xml
generated
Normal file
10
Plugins/Old/JensCommunity2/sfs/.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
124
Plugins/Old/JensCommunity2/sfs/.idea/uiDesigner.xml
generated
Normal file
124
Plugins/Old/JensCommunity2/sfs/.idea/uiDesigner.xml
generated
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
6
Plugins/Old/JensCommunity2/sfs/.idea/vcs.xml
generated
Normal file
6
Plugins/Old/JensCommunity2/sfs/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
12
Plugins/Old/JensCommunity2/sfs/JensCommunity2.iml
Normal file
12
Plugins/Old/JensCommunity2/sfs/JensCommunity2.iml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="spigot-1.15.2" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
1
Plugins/Old/JensCommunity2/sfs/README.md
Normal file
1
Plugins/Old/JensCommunity2/sfs/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Jens Stinkt
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20
Plugins/Old/JensCommunity2/sfs/out/production/sfs/plugin.yml
Normal file
20
Plugins/Old/JensCommunity2/sfs/out/production/sfs/plugin.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: JensCommunity2
|
||||
version: 1.16
|
||||
api-version: 1.16
|
||||
main: de.craftix.community.general.Main
|
||||
author: Craftix, CookieMC337
|
||||
commands:
|
||||
report:
|
||||
youtube:
|
||||
yt:
|
||||
twitch:
|
||||
spectator:
|
||||
creator:
|
||||
back:
|
||||
invsee:
|
||||
setprison:
|
||||
buergermeister:
|
||||
richter:
|
||||
tp:
|
||||
ec:
|
||||
gm:
|
||||
21
Plugins/Old/JensCommunity2/sfs/sfs.iml
Normal file
21
Plugins/Old/JensCommunity2/sfs/sfs.iml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="craftbukkit-1.16.1" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,17 @@
|
||||
package de.craftix.community.api;
|
||||
|
||||
import net.minecraft.server.v1_16_R1.*;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ActionBar {
|
||||
public static void show(Player p, String text){
|
||||
CraftPlayer player = (CraftPlayer) p;
|
||||
IChatBaseComponent cbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + text + "\"}");
|
||||
PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, ChatMessageType.GAME_INFO, SystemUtils.b);
|
||||
player.getHandle().playerConnection.sendPacket(ppoc);
|
||||
player.sendMessage("Debug Timer 1");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package de.craftix.community.api;
|
||||
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Rang {
|
||||
|
||||
private static FileConfiguration config = Main.getPlugin().getConfig();
|
||||
|
||||
public static void set(Player p, Rankings rang){
|
||||
config.set(Rankings.ADMIN.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.ARRESTED.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.BÜRGERMEISTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.PLAYER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.RICHTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.SPECTATOR.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.YOUTUBE.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.TWITCH.name() + "." + p.getUniqueId(), null);
|
||||
config.set(rang.name() + "." + p.getUniqueId(), true);
|
||||
Main.getPlugin().saveConfig();
|
||||
}
|
||||
|
||||
public static void remove(Player p){
|
||||
config.set(Rankings.ADMIN.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.ARRESTED.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.BÜRGERMEISTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.PLAYER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.RICHTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.SPECTATOR.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.YOUTUBE.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.TWITCH.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.PLAYER + "." + p.getUniqueId(), true);
|
||||
}
|
||||
|
||||
public static Rankings get(Player p){
|
||||
if (config.contains(Rankings.ADMIN.name() + "." + p.getUniqueId())) return Rankings.ADMIN;
|
||||
if (config.contains(Rankings.ARRESTED.name() + "." + p.getUniqueId())) return Rankings.ARRESTED;
|
||||
if (config.contains(Rankings.BÜRGERMEISTER.name() + "." + p.getUniqueId())) return Rankings.BÜRGERMEISTER;
|
||||
if (config.contains(Rankings.RICHTER.name() + "." + p.getUniqueId())) return Rankings.RICHTER;
|
||||
if (config.contains(Rankings.SPECTATOR.name() + "." + p.getUniqueId())) return Rankings.SPECTATOR;
|
||||
if (config.contains(Rankings.YOUTUBE.name() + "." + p.getUniqueId())) return Rankings.YOUTUBE;
|
||||
if (config.contains(Rankings.TWITCH.name() + "." + p.getUniqueId())) return Rankings.TWITCH;
|
||||
return Rankings.PLAYER;
|
||||
}
|
||||
|
||||
public static void setCreator(Player p, Rankings rang, String link){
|
||||
config.set(Rankings.ADMIN.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.ARRESTED.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.BÜRGERMEISTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.PLAYER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.RICHTER.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.SPECTATOR.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.YOUTUBE.name() + "." + p.getUniqueId(), null);
|
||||
config.set(Rankings.TWITCH.name() + "." + p.getUniqueId(), null);
|
||||
config.set(rang.name() + "." + p.getUniqueId(), link);
|
||||
Main.getPlugin().saveConfig();
|
||||
}
|
||||
|
||||
public static String getLink(Player p){
|
||||
String link = config.getString(Rankings.TWITCH.name() + "." + p.getUniqueId());
|
||||
if (link == null) link = config.getString(Rankings.YOUTUBE.name() + "." + p.getUniqueId());
|
||||
return link;
|
||||
}
|
||||
|
||||
public static boolean isCreator(Player p){
|
||||
if (config.contains(Rankings.YOUTUBE.name() + "." + p.getUniqueId())) return true;
|
||||
if (config.contains(Rankings.TWITCH.name() + "." + p.getUniqueId())) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasPermission(Player p, String permission){
|
||||
if (get(p).equals(Rankings.ADMIN)) return true;
|
||||
ArrayList<String> permissions = getRangPermissions(get(p), p);
|
||||
for (String s : permissions){
|
||||
if (s.equalsIgnoreCase(permission)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static ArrayList<String> getRangPermissions(Rankings rang, Player p){
|
||||
ArrayList<String> permissions = new ArrayList<>();
|
||||
if (rang.equals(Rankings.RICHTER)){
|
||||
permissions.add("game.staatsanwalt");
|
||||
permissions.add("prison.add");
|
||||
permissions.add("prison.remove");
|
||||
permissions.add("prison.list");
|
||||
permissions.add("world.setprison");
|
||||
}
|
||||
else if (rang.equals(Rankings.BÜRGERMEISTER)){
|
||||
permissions.add("game.richter");
|
||||
}
|
||||
else if (rang.equals(Rankings.SPECTATOR)){
|
||||
permissions.add("game.teleport");
|
||||
permissions.add("game.gamemode");
|
||||
permissions.add("game.report");
|
||||
}
|
||||
if (p.hasPermission("game.admin")){
|
||||
permissions.add("game.spectator");
|
||||
permissions.add("world.setprison");
|
||||
permissions.add("game.staatsanwalt");
|
||||
permissions.add("prison.add");
|
||||
permissions.add("prison.remove");
|
||||
permissions.add("prison.list");
|
||||
permissions.add("game.richter");
|
||||
permissions.add("game.teleport");
|
||||
permissions.add("game.buergermeister");
|
||||
permissions.add("game.report");
|
||||
}
|
||||
return permissions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package de.craftix.community.api;
|
||||
|
||||
public enum Rankings{
|
||||
ADMIN,
|
||||
SPECTATOR,
|
||||
RICHTER,
|
||||
BÜRGERMEISTER,
|
||||
PLAYER,
|
||||
ARRESTED,
|
||||
YOUTUBE,
|
||||
TWITCH
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Buergermeister implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
Player p = (Player)sender;
|
||||
if (Rang.hasPermission(p, "game.buergermeister")){
|
||||
if (args.length == 2){
|
||||
if (Bukkit.getPlayer(args[1]) != null){
|
||||
Player t = Bukkit.getPlayer(args[1]);
|
||||
if (args[0].equalsIgnoreCase("add")){
|
||||
Rang.set(t, Rankings.BÜRGERMEISTER);
|
||||
t.kickPlayer("§aDu bist nun ein Bürgermeister\nReconnecte, um den Rang zu erhalten");
|
||||
sender.sendMessage("§aDer spieler §6" + t.getName() + " §aist nun ein Bürgermeister");
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("remove")){
|
||||
Rang.remove(t);
|
||||
t.kickPlayer("§aDu bist kein Bürgermeister mehr\nReconnecte, um den Spieler zu werden");
|
||||
sender.sendMessage("§aDer spieler §6" + t.getName() + " §aist nun kein Bürgermeister mehr");
|
||||
}
|
||||
else {
|
||||
sender.sendMessage("§cBitte benutze §6/bürgermeister <add/remove> <player>§c!");
|
||||
}
|
||||
}else {
|
||||
sender.sendMessage("§cSpieler konnte nicht gefunden werden");
|
||||
}
|
||||
}else {
|
||||
sender.sendMessage("§cBitte benutze §6/bürgermeister <add/remove> <player>§c!");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Creator implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (args.length != 1) return true;
|
||||
Player p = null;
|
||||
try { p = Bukkit.getPlayer(args[0]); } catch (Exception e) { }
|
||||
if (p == null){
|
||||
sender.sendMessage("§cSpieler konnte nicht gefunden werden");
|
||||
return true;
|
||||
}
|
||||
if (Rang.isCreator(p)){
|
||||
sender.sendMessage("§aDer Link von §6" + p.getDisplayName() + " §alautet: §6" + Rang.getLink(p));
|
||||
}else {
|
||||
sender.sendMessage("§cDieser Spieler ist kein YouTuber/Streamer");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Enderchest implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (p.hasPermission("game.ec") && args.length == 1){
|
||||
if (Bukkit.getPlayer(args[0]) != null){
|
||||
Player t = Bukkit.getPlayer(args[0]);
|
||||
p.openInventory(t.getEnderChest());
|
||||
}else {
|
||||
p.sendMessage("§cDieser Spieler existiert nicht!");
|
||||
}
|
||||
}else {
|
||||
p.sendMessage("§cNo Permission");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Gamemode implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
Player p = (Player)sender;
|
||||
if (Rang.hasPermission(p, "game.gamemode") && args.length == 1){
|
||||
if (args[0].equalsIgnoreCase("1")){
|
||||
p.setGameMode(GameMode.CREATIVE);
|
||||
}else if (args[0].equalsIgnoreCase("0")){
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
}else if (args[0].equalsIgnoreCase("3")){
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
}else {
|
||||
p.sendMessage("§cNö");
|
||||
return false;
|
||||
}
|
||||
p.sendMessage("§aDu bist nun im Gamemode " + args[0] + "!");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Invsee implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (sender instanceof Player && sender.hasPermission("game.invsee")){
|
||||
Player p = (Player)sender;
|
||||
if (args.length == 1){
|
||||
if(Bukkit.getPlayer(args[0]) == null){
|
||||
p.sendMessage("§cSpieler konnte nicht gefunden werden");
|
||||
}
|
||||
Player t = Bukkit.getPlayer(args[0]);
|
||||
p.openInventory(t.getInventory());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PrisonPlayer{
|
||||
public static ArrayList<PrisonPlayer> players = new ArrayList<>();
|
||||
|
||||
public Player p;
|
||||
public Location loc;
|
||||
public Rankings rang;
|
||||
public PrisonPlayer(Player p, Location loc, Rankings rang){
|
||||
this.p = p;
|
||||
this.loc = loc;
|
||||
this.rang = rang;
|
||||
players.add(this);
|
||||
}
|
||||
|
||||
public static PrisonPlayer getPlayer(Player p){
|
||||
for (PrisonPlayer pp : players){
|
||||
if (pp.p == p) return pp;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void removePlayer(Player p){
|
||||
players.remove(getPlayer(p));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class Report implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String st, String[] args) {
|
||||
Main.getPlugin().reloadConfig();
|
||||
if (args.length == 2 && sender.hasPermission("report.edit") && args[0].equalsIgnoreCase("edit")){
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
boolean isFree = false;
|
||||
int reports = -1;
|
||||
while (!isFree){
|
||||
reports++;
|
||||
if (!config.contains("Reports." + reports + ".Target")) {
|
||||
isFree = true;
|
||||
}
|
||||
}
|
||||
int targetID = -1;
|
||||
boolean detected = false;
|
||||
while (!detected){
|
||||
targetID++;
|
||||
if (targetID >= reports) break;
|
||||
if (config.getString("Reports." + targetID + ".Target").equalsIgnoreCase(args[1])) detected = true;
|
||||
}
|
||||
if (!detected){
|
||||
sender.sendMessage("§7[§eReport§7] §cSpieler konnte nicht gefunden werden");
|
||||
return true;
|
||||
}
|
||||
String target = config.getString("Reports." + targetID + ".Target");
|
||||
String reportSender = config.getString("Reports." + targetID + ".Sender");
|
||||
String reason = config.getString("Reports." + targetID + ".Reason");
|
||||
sender.sendMessage("§7[§eReport§7] §aDu bearbeitest den Report §6" + targetID + "§a:");
|
||||
sender.sendMessage("§aReporteter Spieler: §6" + target);
|
||||
sender.sendMessage("§aSender: §6" + reportSender);
|
||||
sender.sendMessage("§aGrund: §6" + reason);
|
||||
for (int i = targetID; i < reports; i++){
|
||||
int plusOne = i + 1;
|
||||
String iTarget = (String) config.get("Reports." + plusOne + ".Target");
|
||||
String iSender = (String) config.get("Reports." + plusOne + ".Sender");
|
||||
String iReason = (String) config.get("Reports." + plusOne + ".Reason");
|
||||
config.set("Reports." + i + ".Target", iTarget);
|
||||
config.set("Reports." + i + ".Sender", iSender);
|
||||
config.set("Reports." + i + ".Reason", iReason);
|
||||
config.set("Reports." + plusOne + ".Target", null);
|
||||
config.set("Reports." + plusOne + ".Sender", null);
|
||||
config.set("Reports." + plusOne + ".Reason", null);
|
||||
}
|
||||
Main.getPlugin().saveConfig();
|
||||
sender.sendMessage("§7[§eReport§7] §aDer Report wurde automatisch gelöscht");
|
||||
|
||||
try {
|
||||
Player PSender = Bukkit.getPlayer(reportSender);
|
||||
PSender.sendMessage("§7[§eReport§7] §aDein Report über §6" + target + " §awird gerade bearbeitet");
|
||||
}catch (Exception e){}
|
||||
|
||||
return true;
|
||||
}
|
||||
if (args.length == 1 && sender.hasPermission("report.list") && args[0].equalsIgnoreCase("list")){
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
boolean isFree = false;
|
||||
int reports = -1;
|
||||
while (!isFree){
|
||||
reports++;
|
||||
if (!config.contains("Reports." + reports + ".Target")) {
|
||||
isFree = true;
|
||||
}
|
||||
}
|
||||
sender.sendMessage("§7[§eReport§7] §aEs gibt §6" + reports + " §aReports:");
|
||||
for (int i = 0; i < reports; i++){
|
||||
String target = config.getString("Reports." + i + ".Target");
|
||||
sender.sendMessage(target);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (args.length < 2){
|
||||
sender.sendMessage("§7[§eReport§7] §c/report <spieler> <Hacking/Griefing/Beleidigung/Abfucken/Sonstiges>");
|
||||
return true;
|
||||
}
|
||||
if (Bukkit.getPlayer(args[0]) == null){
|
||||
sender.sendMessage("§7[§eReport§7] §cSpieler konnte nicht gefunden werden");
|
||||
return true;
|
||||
}
|
||||
Player target = Bukkit.getPlayer(args[0]);
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
boolean isFree = false;
|
||||
int number = -1;
|
||||
while (!isFree){
|
||||
number++;
|
||||
if (!config.contains("Reports." + number + ".Target")) isFree = true;
|
||||
}
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 1; i < args.length; i++){
|
||||
String subString = args[i] + " ";
|
||||
sb.append(subString);
|
||||
}
|
||||
String reason = sb.toString();
|
||||
config.set("Reports." + number + ".Target", target.getName());
|
||||
config.set("Reports." + number + ".Sender", sender.getName());
|
||||
config.set("Reports." + number + ".Reason", reason);
|
||||
Main.getPlugin().saveConfig();
|
||||
sender.sendMessage("§7[§eReport§7] §aIhr Report wurde erfolgreich Gesendet");
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
if (p.hasPermission("reports.message")) p.sendMessage("§7[§eReport§7] §aDer user §4"+ target.getName() + "§a wurde Gemeldet. Grund: §4"+ reason);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Richter implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
Player p = (Player)sender;
|
||||
if (Rang.hasPermission(p, "game.richter")){
|
||||
if (args.length == 2){
|
||||
if (Bukkit.getPlayer(args[1]) != null){
|
||||
Player t = Bukkit.getPlayer(args[1]);
|
||||
if (args[0].equalsIgnoreCase("add")){
|
||||
Rang.set(t, Rankings.RICHTER);
|
||||
t.kickPlayer("§aDu bist nun ein Richter\nReconnecte, um den Rang zu erhalten");
|
||||
sender.sendMessage("§aDer spieler §6" + t.getName() + " §aist nun ein Richter");
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("remove")){
|
||||
Rang.remove(t);
|
||||
t.kickPlayer("§aDu bist kein Richter mehr\nReconnecte, um den Spieler zu werden");
|
||||
sender.sendMessage("§aDer spieler §6" + t.getName() + " §aist nun kein Richter mehr");
|
||||
}
|
||||
else {
|
||||
sender.sendMessage("§cBitte benutze §6/richter <add/remove> <player>§c!");
|
||||
}
|
||||
}else {
|
||||
sender.sendMessage("§cSpieler konnte nicht gefunden werden");
|
||||
}
|
||||
}else {
|
||||
sender.sendMessage("§cBitte benutze §6/richter <add/remove> <player>§c!");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Setprison implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String str, String[] args) {
|
||||
Player p = (Player)sender;
|
||||
if (sender instanceof Player && Rang.hasPermission(p, "world.setprison")){
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
config.set("Prison.World", p.getLocation().getWorld().getName());
|
||||
config.set("Prison.X", p.getLocation().getX());
|
||||
config.set("Prison.Y", p.getLocation().getY());
|
||||
config.set("Prison.Z", p.getLocation().getZ());
|
||||
config.set("Prison.Yaw", p.getLocation().getYaw());
|
||||
config.set("Prison.Pitch", p.getLocation().getPitch());
|
||||
p.sendMessage("§aDu hast die Gefängnisposition gesetzt");
|
||||
}
|
||||
Main.getPlugin().saveConfig();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Location getPrison(){
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
World world = Bukkit.getWorld(config.getString("Prison.World"));
|
||||
double x = config.getDouble("Prison.X");
|
||||
double y = config.getDouble("Prison.Y");
|
||||
double z = config.getDouble("Prison.Z");
|
||||
float yaw = (float) config.getDouble("Prison.Yaw");
|
||||
float pitch = (float) config.getDouble("Prison.Pitch");
|
||||
return new Location(world, x, y, z, yaw, pitch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Spectator implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {
|
||||
Player p = (Player)sender;
|
||||
if (sender instanceof Player && Rang.hasPermission(p, "game.spectator")){
|
||||
if (Rang.get(p).equals(Rankings.SPECTATOR)){
|
||||
Rang.set(p, Rankings.PLAYER);
|
||||
p.kickPlayer("§aRang wurde entfernt \nBitte reconnecte, um den Spieler Rang zu erhalten");
|
||||
}else {
|
||||
Rang.set(p, Rankings.SPECTATOR);
|
||||
p.kickPlayer("§aRang wurde registriert \nBitte reconnecte, um den Rang zu erhalten");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Teleport implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
Player p = (Player)sender;
|
||||
if (Rang.hasPermission(p, "game.teleport") && Rang.get(p).equals(Rankings.SPECTATOR)){
|
||||
if (Bukkit.getPlayer(args[0]) != null){
|
||||
Player t = Bukkit.getPlayer(args[0]);
|
||||
p.teleport(t.getLocation());
|
||||
p.sendMessage("§aDu wurdes zu §6" + t.getDisplayName() + " §ateleportiert");
|
||||
}
|
||||
}else if (args.length == 1){
|
||||
p.performCommand("tp " + args[0]);
|
||||
}else if (args.length == 2){
|
||||
p.performCommand("minecraft:tp " + args[0] + " " + args[1]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
public class Title {
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Twitch implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (args.length != 1) return false;
|
||||
Player p = (Player)sender;
|
||||
if (args[0].equalsIgnoreCase("unlink")){
|
||||
Rang.set(p, Rankings.PLAYER);
|
||||
p.kickPlayer("§aRang wurde entfernt \nBitte reconnecte, um den Spieler Rang zu erhalten");
|
||||
return true;
|
||||
}
|
||||
Rang.setCreator(p, Rankings.TWITCH, args[0]);
|
||||
Main.getPlugin().saveConfig();
|
||||
p.kickPlayer("§aRang wurde Registriert \nBitte reconnecte, um den Rang zu erhalten");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package de.craftix.community.commands;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class YouTube implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String string, String[] args) {
|
||||
if (args.length != 1) return false;
|
||||
Player p = (Player)sender;
|
||||
if (args[0].equalsIgnoreCase("unlink")){
|
||||
Rang.set(p, Rankings.TWITCH);
|
||||
p.kickPlayer("§aRang wurde entfernt \nBitte reconnecte, um den Spieler Rang zu erhalten");
|
||||
return true;
|
||||
}
|
||||
Rang.setCreator(p, Rankings.YOUTUBE, args[0]);
|
||||
Main.getPlugin().saveConfig();
|
||||
p.kickPlayer("§aRang wurde Registriert \nBitte reconnecte, um den Rang zu erhalten");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package de.craftix.community.general;
|
||||
|
||||
import de.craftix.community.api.Rankings;
|
||||
import de.craftix.community.commands.*;
|
||||
import de.craftix.community.listener.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
|
||||
private static Main plugin;
|
||||
private onDeath death = new onDeath();
|
||||
|
||||
public static Main getPlugin(){return plugin;}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
plugin = this;
|
||||
registerListener();
|
||||
registerCommands();
|
||||
//MySql.Connect();
|
||||
//MySql.Update("CREATE TABLE IF NOT EXISTS prison (UUID VARCHAR(100), time INT(200), x INT(10), y INT(10), z INT(10))");
|
||||
System.out.println("Irgendwas Geladen");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
//MySql.Disconnect();
|
||||
System.out.println("Ich halt jz mein maul");
|
||||
|
||||
}
|
||||
|
||||
private void registerCommands(){
|
||||
getCommand("report").setExecutor(new Report());
|
||||
getCommand("youtube").setExecutor(new YouTube());
|
||||
getCommand("twitch").setExecutor(new Twitch());
|
||||
getCommand("spectator").setExecutor(new Spectator());
|
||||
getCommand("creator").setExecutor(new Creator());
|
||||
getCommand("back").setExecutor(death);
|
||||
getCommand("invsee").setExecutor(new Invsee());
|
||||
//getCommand("prison").setExecutor(new Prison());
|
||||
getCommand("setprison").setExecutor(new Setprison());
|
||||
getCommand("yt").setExecutor(new YouTube());
|
||||
getCommand("buergermeister").setExecutor(new Buergermeister());
|
||||
getCommand("richter").setExecutor(new Richter());
|
||||
getCommand("tp").setExecutor(new Teleport());
|
||||
getCommand("ec").setExecutor(new Enderchest());
|
||||
getCommand("gm").setExecutor(new Gamemode());
|
||||
System.out.println("Commands Geladen");
|
||||
}
|
||||
|
||||
private void registerListener(){
|
||||
PluginManager pm = Bukkit.getPluginManager();
|
||||
pm.registerEvents(new onJoin(), this);
|
||||
pm.registerEvents(new onChat(), this);
|
||||
pm.registerEvents(new onDrop(), this);
|
||||
pm.registerEvents(new onSleep(), this);
|
||||
pm.registerEvents(death, this);
|
||||
System.out.println("Listener Geladen");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package de.craftix.community.listener;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
public class onChat implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onChatEvent(AsyncPlayerChatEvent event){
|
||||
String message = event.getMessage();
|
||||
if (message.contains("%")){
|
||||
message = message.replace('%', '§');
|
||||
}
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.SPECTATOR)){
|
||||
event.setFormat(event.getPlayer().getDisplayName() + " §7>> §4" + message);
|
||||
}else {
|
||||
event.setFormat(event.getPlayer().getDisplayName() + " §7>> §r" + message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package de.craftix.community.listener;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class onDeath implements Listener, CommandExecutor {
|
||||
|
||||
public static ArrayList<Death> deaths = new ArrayList<>();
|
||||
|
||||
@EventHandler
|
||||
public void onDeathEvent(PlayerDeathEvent event){
|
||||
deaths.remove(Death.getDeath(event.getEntity()));
|
||||
deaths.add(new Death(event.getEntity(), event.getEntity().getLocation()));
|
||||
event.getEntity().sendMessage("§aBenutze §6/back §aum zu deinem Todespunkt zurückzukehren");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {
|
||||
Death d = Death.getDeath((Player)sender);
|
||||
if (d != null){
|
||||
((Player) sender).teleport(d.loc);
|
||||
deaths.remove(d);
|
||||
sender.sendMessage("§aTeleprotiere zum Todespunkt...");
|
||||
}else sender.sendMessage("§cDu hast keinen letzten Todespunkt");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class Death{
|
||||
|
||||
public Player p;
|
||||
public Location loc;
|
||||
|
||||
public Death(Player p, Location loc){
|
||||
this.loc = loc;
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
public static Death getDeath(Player p){
|
||||
for (Death d : onDeath.deaths){
|
||||
if (d.p == p) return d;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package de.craftix.community.listener;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
|
||||
public class onDrop implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onDropEvent(PlayerDropItemEvent event){
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package de.craftix.community.listener;
|
||||
|
||||
import de.craftix.community.api.*;
|
||||
import de.craftix.community.general.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
public class onJoin implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onJoinEvent(PlayerJoinEvent event){
|
||||
event.getPlayer().setPlayerListName("§e" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§e" + event.getPlayer().getName());
|
||||
event.getPlayer().setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.YOUTUBE)){
|
||||
event.getPlayer().setPlayerListName("§d" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§d" + event.getPlayer().getName());
|
||||
}
|
||||
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.TWITCH)){
|
||||
event.getPlayer().setPlayerListName("§5" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§5" + event.getPlayer().getName());
|
||||
}
|
||||
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.SPECTATOR)){
|
||||
event.getPlayer().setPlayerListName("§7" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§7" + event.getPlayer().getName());
|
||||
event.getPlayer().setGameMode(GameMode.SPECTATOR);
|
||||
}
|
||||
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.BÜRGERMEISTER)){
|
||||
event.getPlayer().setPlayerListName("§6" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§6" + event.getPlayer().getName());
|
||||
}
|
||||
|
||||
if (Rang.get(event.getPlayer()).equals(Rankings.RICHTER)){
|
||||
event.getPlayer().setPlayerListName("§2" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§2" + event.getPlayer().getName());
|
||||
}
|
||||
//b12aa223-815c-4771-a11a-4eab26678bd6
|
||||
if (event.getPlayer().getUniqueId().toString().equalsIgnoreCase("b12aa223-815c-4771-a11a-4eab26678bd6")){
|
||||
Rang.set(event.getPlayer(), Rankings.ADMIN);
|
||||
event.getPlayer().setPlayerListName("§4" + event.getPlayer().getName());
|
||||
event.getPlayer().setDisplayName("§4" + event.getPlayer().getName());
|
||||
}
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
p.setPlayerListHeader("\n§7Spieler online: §b" + Bukkit.getOnlinePlayers().size() + "/" + Bukkit.getServer().getMaxPlayers() + "\n ");
|
||||
p.setPlayerListFooter("\n §2Plugin by §3CraftixLP §2and §4CookieMC337 \n §9§oPowered by §bCookieMC.tk §9§oHosting \n ");
|
||||
}
|
||||
|
||||
Player p = event.getPlayer();
|
||||
event.setJoinMessage("§8[§2§l+§8] §e" + p.getDisplayName());
|
||||
if (Rang.get(p).equals(Rankings.SPECTATOR)) {
|
||||
event.setJoinMessage(null);
|
||||
for (Player all : Bukkit.getOnlinePlayers()){
|
||||
if (Rang.get(all).equals(Rankings.SPECTATOR)) {
|
||||
all.showPlayer(Main.getPlugin(), p);
|
||||
}else {
|
||||
all.hidePlayer(Main.getPlugin(), p);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
for (Player all : Bukkit.getOnlinePlayers()){
|
||||
if (Rang.get(all).equals(Rankings.SPECTATOR)) {
|
||||
p.hidePlayer(Main.getPlugin(), all);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Rang.hasPermission(p, "game.report")){
|
||||
FileConfiguration config = Main.getPlugin().getConfig();
|
||||
boolean isFree = false;
|
||||
int reports = -1;
|
||||
while (!isFree){
|
||||
reports++;
|
||||
if (!config.contains("Reports." + reports + ".Target")) {
|
||||
isFree = true;
|
||||
}
|
||||
if (reports >= 100) return;
|
||||
}
|
||||
if (reports <= 0) return;
|
||||
p.sendMessage("§7[§eReport§7] §aEs gibt §6" + reports + " §aneue Reports");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onQuitEvent(PlayerQuitEvent event){
|
||||
Player p = event.getPlayer();
|
||||
event.setQuitMessage("§8[§4§l-§8] §e" + p.getDisplayName());
|
||||
if (Rang.get(p).equals(Rankings.SPECTATOR)) event.setQuitMessage(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package de.craftix.community.listener;
|
||||
|
||||
import de.craftix.community.api.Rang;
|
||||
import de.craftix.community.api.Rankings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerBedEnterEvent;
|
||||
import org.bukkit.event.player.PlayerBedLeaveEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class onSleep implements Listener {
|
||||
|
||||
private ArrayList<Player> sleepers = new ArrayList<>();
|
||||
|
||||
@EventHandler
|
||||
public void onSleepEvent(PlayerBedEnterEvent event){
|
||||
if (event.getBedEnterResult() != PlayerBedEnterEvent.BedEnterResult.OK) return;
|
||||
sleepers.add(event.getPlayer());
|
||||
double t1 = (double) sleepers.size();
|
||||
double t2 = (double) event.getBed().getLocation().getWorld().getPlayers().size();
|
||||
World w = event.getBed().getLocation().getWorld();
|
||||
for (Player specs : Bukkit.getOnlinePlayers()){
|
||||
if (Rang.get(specs).equals(Rankings.SPECTATOR) && specs.getLocation().getWorld().equals(w)) t2--;
|
||||
}
|
||||
double t3 = (t1 / t2);
|
||||
double percent = (t3 * 100);
|
||||
double result = t2 / 100;
|
||||
result = result * 35;
|
||||
if (String.valueOf(result).contains(".")) result++;
|
||||
int players = (int) result;
|
||||
if (percent >= 35){
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "time set 0");
|
||||
Bukkit.broadcastMessage("§7[§6Sleep§7] §aDie Nacht wurde übersprungen");
|
||||
sleepers.clear();
|
||||
}else {
|
||||
Bukkit.broadcastMessage("§7[§6Sleep§7] §aEs schlafen §b" + sleepers.size() + " §a/ §b" + players + " §aSpieler");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onStandUpEvent(PlayerBedLeaveEvent event){
|
||||
sleepers.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
}
|
||||
20
Plugins/Old/JensCommunity2/sfs/src/plugin.yml
Normal file
20
Plugins/Old/JensCommunity2/sfs/src/plugin.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: JensCommunity2
|
||||
version: 1.16
|
||||
api-version: 1.16
|
||||
main: de.craftix.community.general.Main
|
||||
author: Craftix, CookieMC337
|
||||
commands:
|
||||
report:
|
||||
youtube:
|
||||
yt:
|
||||
twitch:
|
||||
spectator:
|
||||
creator:
|
||||
back:
|
||||
invsee:
|
||||
setprison:
|
||||
buergermeister:
|
||||
richter:
|
||||
tp:
|
||||
ec:
|
||||
gm:
|
||||
Reference in New Issue
Block a user