Archived
Private
Public Access
1
0

Initial commit

This commit is contained in:
2022-09-04 12:45:01 +02:00
commit f4a01d6a69
11601 changed files with 4206660 additions and 0 deletions

3
Plugins/Old/Signtp/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@@ -0,0 +1,6 @@
<component name="ArtifactManager">
<artifact type="jar" name="SignTP">
<output-path>Z:/Plugins</output-path>
<root id="archive" name="SignTP.jar" />
</artifact>
</component>

7
Plugins/Old/Signtp/.idea/discord.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="DISABLE" />
<option name="description" value="" />
</component>
</project>

View File

@@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="spigot 1.8.8">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../Spigot Versions/spigot 1.8.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/../Spigot Versions/spigot 1.8.8.jar!/" />
</SOURCES>
</library>
</component>

11
Plugins/Old/Signtp/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
</list>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
Plugins/Old/Signtp/.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Signtp.iml" filepath="$PROJECT_DIR$/Signtp.iml" />
</modules>
</component>
</project>

View 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>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="spigot 1.8.8" level="project" />
</component>
</module>

View File

@@ -0,0 +1,27 @@
package de.craftix.signtp;
import de.craftix.signtp.commands.*;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
private static Main plugin;
@Override
public void onEnable() {
plugin = this;
registerCommands();
registerListener();
}
private void registerCommands(){
getCommand("createsign").setExecutor(new Createsign());
}
private void registerListener(){
}
public static Main getPlugin(){
return plugin;
}
}

View File

@@ -0,0 +1,64 @@
package de.craftix.signtp;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import java.util.ArrayList;
public class SignAPI {
public static ArrayList<WarpSign> signs = new ArrayList<>();
public static void createSign(Location loc, World world){
signs.add(new WarpSign(WarpSign.getFreeID(), loc, world));
}
public static void removeSign(WarpSign warpSign){
signs.remove(warpSign);
}
public static WarpSign getSign(int id){
for (WarpSign all : signs){
if (all.id == id) return all;
}
return null;
}
public static WarpSign getSign(Location loc){
for (WarpSign all : signs){
if (all.loc == loc) return all;
}
return null;
}
public static void loadSigns(){
signs.clear();
FileConfiguration config = Main.getPlugin().getConfig();
int ids = WarpSign.getFreeID() - 1;
for (int i = 0; i <= ids; i++){
WarpSign ws = new WarpSign();
ws.id = i;
ws.world = Bukkit.getWorld(config.getString("Sign." + i + "World"));
double x = config.getDouble("Sign." + i + "Loc.X");
double y = config.getDouble("Sign." + i + "Loc.Y");
double z = config.getDouble("Sign." + i + "Loc.Z");
World w = Bukkit.getWorld(config.getString("Sign." + i + "Loc.World"));
ws.loc = new Location(w, x, y, z);
signs.add(ws);
}
}
public static void saveSigns(){
FileConfiguration config = Main.getPlugin().getConfig();
for (WarpSign all : signs){
config.set("Sign." + all.id + "World", all.world.getName());
config.set("Sign." + all.id + "Loc.X", all.loc.getX());
config.set("Sign." + all.id + "Loc.Y", all.loc.getY());
config.set("Sign." + all.id + "Loc.Z", all.loc.getZ());
config.set("Sign." + all.id + "Loc.World", all.loc.getWorld().getName());
}
signs.clear();
}
}

View File

@@ -0,0 +1,30 @@
package de.craftix.signtp;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
public class WarpSign {
public int id;
public Location loc;
public World world;
public WarpSign() {}
public WarpSign(int id, Location loc, World world){
this.id = id;
this.loc = loc;
this.world = world;
}
public static int getFreeID(){
FileConfiguration config = Main.getPlugin().getConfig();
int id = -1;
boolean isFree = false;
while (!isFree){
id++;
if (config.contains("Sign." + id + "World")) isFree = true;
}
return id;
}
}

View File

@@ -0,0 +1,41 @@
package de.craftix.signtp.commands;
import de.craftix.signtp.SignAPI;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Createsign implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
if (sender instanceof Player){
Player p = (Player)sender;
if (!p.hasPermission("signtp.admin")){
p.sendMessage("§cHierzu hast du keine Rechte");
return true;
}
if (args.length != 1){
p.sendMessage("§cFalscher Syntax");
return true;
}
Location loc = p.getEyeLocation().getBlock().getLocation();
if (!loc.getBlock().getType().equals(Material.SIGN)){
p.sendMessage("§cDu musst ein Schild angucken du spaßt!");
return true;
}
if (Bukkit.getWorld(args[0]) == null){
p.sendMessage("§cdiese Welt existeiert nicht");
}
World world = Bukkit.getWorld(args[0]);
SignAPI.createSign(loc, world);
}else {
sender.sendMessage("§cNur Spieler du Spaßt!");
}
return true;
}
}

View File

@@ -0,0 +1,13 @@
package de.craftix.signtp.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class Removesign implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
return true;
}
}

View File

@@ -0,0 +1,28 @@
package de.craftix.signtp.listener;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
public class onJoin implements Listener {
@EventHandler
public void onJoinEvent(PlayerJoinEvent event){
Player p = event.getPlayer();
//Ranks
if (p.hasPermission("rank.owner")){
p.setDisplayName("§4Owner §7| §c" + p.getName());
}else if (p.hasPermission("rank.admin")){
p.setDisplayName("§cAdmin §7| §c" + p.getName());
}else {
p.setDisplayName("§7Spieler §7| §7" + p.getName());
}
p.setPlayerListName(p.getDisplayName());
p.setCustomName(p.getDisplayName());
p.setCustomNameVisible(true);
}
}

View File

@@ -0,0 +1,7 @@
main: de.craftix.signtp.Main
version: 1.8
name: SignTP
commands:
createsign:
removesign: