Innitial update
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
13
.idea/compiler.xml
generated
Normal file
13
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?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="InsaneDuels" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="PROJECT_FILES" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/discordrp.xml
generated
Normal file
8
.idea/discordrp.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="io.github.pandier.intellijdiscordrp.settings.project.DiscordProjectSettingsComponent">
|
||||||
|
<option name="buttonEnabled" value="true" />
|
||||||
|
<option name="buttonText" value="Download Ultimate" />
|
||||||
|
<option name="buttonUrl" value="https://www.jetbrains.com/idea/buy/" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?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>
|
||||||
30
.idea/jarRepositories.xml
generated
Normal file
30
.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="sonatype" />
|
||||||
|
<option name="name" value="sonatype" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="papermc-repo" />
|
||||||
|
<option name="name" value="papermc-repo" />
|
||||||
|
<option name="url" value="https://repo.papermc.io/repository/maven-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="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
14
.idea/misc.xml
generated
Normal file
14
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.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$/InsaneDuels.iml" filepath="$PROJECT_DIR$/InsaneDuels.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.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="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
13
InsaneDuels.iml
Normal file
13
InsaneDuels.iml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="minecraft" name="Minecraft">
|
||||||
|
<configuration>
|
||||||
|
<autoDetectTypes>
|
||||||
|
<platformType>PAPER</platformType>
|
||||||
|
</autoDetectTypes>
|
||||||
|
<projectReimportVersion>1</projectReimportVersion>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
61
dependency-reduced-pom.xml
Normal file
61
dependency-reduced-pom.xml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>lnmpro</groupId>
|
||||||
|
<artifactId>InsaneDuels</artifactId>
|
||||||
|
<name>InsaneDuels</name>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<build>
|
||||||
|
<defaultGoal>clean package</defaultGoal>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>papermc-repo</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.papermc.paper</groupId>
|
||||||
|
<artifactId>paper-api</artifactId>
|
||||||
|
<version>1.21-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
77
pom.xml
Normal file
77
pom.xml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>lnmpro</groupId>
|
||||||
|
<artifactId>InsaneDuels</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>InsaneDuels</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>clean package</defaultGoal>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>papermc-repo</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.papermc.paper</groupId>
|
||||||
|
<artifactId>paper-api</artifactId>
|
||||||
|
<version>1.21-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mojang</groupId>
|
||||||
|
<artifactId>authlib</artifactId>
|
||||||
|
<version>1.5.25</version> <!-- vagy másik verzió, pl. 1.6.25 -->
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
45
src/main/java/lnmpro/Commands/AcceptDuelCommand.java
Normal file
45
src/main/java/lnmpro/Commands/AcceptDuelCommand.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package lnmpro.Commands;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.command.TabCompleter;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class AcceptDuelCommand implements CommandExecutor, TabCompleter {
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public AcceptDuelCommand(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
if (player.hasMetadata("DueledBy")) {
|
||||||
|
UUID targetUUID = UUID.fromString(player.getMetadata("DueledBy").get(0).asString());
|
||||||
|
Player enemy = Bukkit.getPlayer(targetUUID);
|
||||||
|
String gamemode = player.getMetadata("DueledWithGamemode").get(0).asString();
|
||||||
|
enemy.sendMessage("cica " + gamemode);
|
||||||
|
player.sendMessage("cica " + gamemode);
|
||||||
|
player.removeMetadata("DueledBy", plugin);
|
||||||
|
player.removeMetadata("DueledWithGamemode", plugin);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("nem vagy player nem fog sikerulni");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/main/java/lnmpro/Commands/DenyDuelCommand.java
Normal file
45
src/main/java/lnmpro/Commands/DenyDuelCommand.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package lnmpro.Commands;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.command.TabCompleter;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class DenyDuelCommand implements CommandExecutor, TabCompleter {
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public DenyDuelCommand(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
if (player.hasMetadata("DueledBy")) {
|
||||||
|
UUID targetUUID = UUID.fromString(player.getMetadata("DueledBy").get(0).asString());
|
||||||
|
Player enemy = Bukkit.getPlayer(targetUUID);
|
||||||
|
String gamemode = player.getMetadata("DueledWithGamemode").get(0).asString();
|
||||||
|
enemy.sendMessage("nem cica " + gamemode);
|
||||||
|
player.sendMessage("nem cica " + gamemode);
|
||||||
|
player.removeMetadata("DueledBy", plugin);
|
||||||
|
player.removeMetadata("DueledWithGamemode", plugin);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("nem vagy player nem fog sikerulni");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
196
src/main/java/lnmpro/Commands/DuelsCommand.java
Normal file
196
src/main/java/lnmpro/Commands/DuelsCommand.java
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
package lnmpro.Commands;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.command.TabCompleter;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import com.mojang.authlib.properties.Property;
|
||||||
|
import org.bukkit.profile.PlayerProfile;
|
||||||
|
import org.bukkit.profile.PlayerTextures;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
public class DuelsCommand implements CommandExecutor, TabCompleter {
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public DuelsCommand(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
|
||||||
|
if (args.length != 1) {
|
||||||
|
player.sendMessage("§a Használat");
|
||||||
|
player.sendMessage("§a----------------------------------------");
|
||||||
|
player.sendMessage("§a/duel [játékos] » Meghívás egy párbajra"); //valew ez rohadtul ainak hangzik ird mar at
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player target = Bukkit.getPlayer(args[0]);
|
||||||
|
if (target == null || !target.isOnline()) {
|
||||||
|
player.sendMessage("§7[§9§lInsane§e§lDuels§7] §7» §cA megadott játékos nem elérhető");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (target.hasMetadata("DueledBy") && target.getMetadata("DueledBy").get(0).asString().equals(player.getUniqueId().toString())) {
|
||||||
|
player.sendMessage(target.getName() + "-nek má' kűté' duel rikvesztet");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Inventory gui = Bukkit.createInventory(null, 36, "Játékmód Választás");
|
||||||
|
ItemStack vanilla = new ItemStack(Material.END_CRYSTAL);
|
||||||
|
ItemMeta vanillaMeta = vanilla.getItemMeta();
|
||||||
|
vanillaMeta.setDisplayName("§dVanilla");
|
||||||
|
|
||||||
|
ItemStack uhc = new ItemStack(Material.LAVA_BUCKET);
|
||||||
|
ItemMeta uhcMeta = uhc.getItemMeta();
|
||||||
|
uhcMeta.setDisplayName("§cUHC");
|
||||||
|
uhc.setItemMeta(uhcMeta);
|
||||||
|
|
||||||
|
ItemStack pot = new ItemStack(Material.POTION);
|
||||||
|
PotionMeta potMeta = (PotionMeta) pot.getItemMeta();
|
||||||
|
potMeta.setDisplayName("§cPot");
|
||||||
|
potMeta.addCustomEffect(new PotionEffect(PotionEffectType.INSTANT_HEALTH, 20, 0), true);
|
||||||
|
pot.setItemMeta(potMeta);
|
||||||
|
|
||||||
|
ItemStack nethpot = new ItemStack(Material.NETHERITE_HELMET);
|
||||||
|
nethpot.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
ItemMeta nethpotMeta = nethpot.getItemMeta();
|
||||||
|
nethpotMeta.setDisplayName("§5NethPot");
|
||||||
|
nethpot.setItemMeta(nethpotMeta);
|
||||||
|
|
||||||
|
ItemStack smp = new ItemStack(Material.ENDER_PEARL);
|
||||||
|
ItemMeta smpMeta = smp.getItemMeta();
|
||||||
|
smpMeta.setDisplayName("§2SMP");
|
||||||
|
smp.setItemMeta(smpMeta);
|
||||||
|
|
||||||
|
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
|
ItemMeta swordMeta = sword.getItemMeta();
|
||||||
|
swordMeta.setDisplayName("§bSword");
|
||||||
|
sword.setItemMeta(swordMeta);
|
||||||
|
|
||||||
|
ItemStack axe = new ItemStack(Material.DIAMOND_AXE);
|
||||||
|
ItemMeta axeMeta = axe.getItemMeta();
|
||||||
|
axeMeta.setDisplayName("§bAxe");
|
||||||
|
axe.setItemMeta(axeMeta);
|
||||||
|
|
||||||
|
ItemStack mace = new ItemStack(Material.MACE);
|
||||||
|
ItemMeta maceMeta = mace.getItemMeta();
|
||||||
|
maceMeta.setDisplayName("§7Mace");
|
||||||
|
mace.setItemMeta(maceMeta);
|
||||||
|
|
||||||
|
ItemStack cart = new ItemStack(Material.TNT_MINECART);
|
||||||
|
ItemMeta cartMeta = cart.getItemMeta();
|
||||||
|
cartMeta.setDisplayName("§cCart");
|
||||||
|
cart.setItemMeta(cartMeta);
|
||||||
|
|
||||||
|
ItemStack diasmp = new ItemStack(Material.CHORUS_FRUIT);
|
||||||
|
ItemMeta diasmpMeta = diasmp.getItemMeta();
|
||||||
|
diasmpMeta.setDisplayName("§dDiaSMP");
|
||||||
|
diasmp.setItemMeta(diasmpMeta);
|
||||||
|
|
||||||
|
ItemStack shieldlessuhc = new ItemStack(Material.PLAYER_HEAD);
|
||||||
|
SkullMeta skullMeta = (SkullMeta) shieldlessuhc.getItemMeta();
|
||||||
|
|
||||||
|
PlayerProfile profile = Bukkit.createProfile(UUID.randomUUID(), "Schicsial");
|
||||||
|
|
||||||
|
try {
|
||||||
|
PlayerTextures textures = profile.getTextures();
|
||||||
|
|
||||||
|
textures.setSkin(new URL("https://textures.minecraft.net/texture/566a87460173adf067cb356ae200d030504378c552e3428b4774c4c11a599c24"));
|
||||||
|
|
||||||
|
profile.setTextures(textures);
|
||||||
|
|
||||||
|
skullMeta.setPlayerProfile((com.destroystokyo.paper.profile.PlayerProfile) profile);
|
||||||
|
|
||||||
|
skullMeta.setDisplayName("§eShieldlessUHC");
|
||||||
|
shieldlessuhc.setItemMeta(skullMeta);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack pirosuveg = new ItemStack(Material.RED_STAINED_GLASS_PANE);
|
||||||
|
ItemMeta pirosuvegMeta = pirosuveg.getItemMeta();
|
||||||
|
pirosuvegMeta.setDisplayName("§cItt még nincs játékmód!");
|
||||||
|
pirosuveg.setItemMeta(pirosuvegMeta);
|
||||||
|
|
||||||
|
ItemStack kekuveg = new ItemStack(Material.BLUE_STAINED_GLASS_PANE);
|
||||||
|
ItemMeta kekuvegMeta = kekuveg.getItemMeta();
|
||||||
|
kekuvegMeta.setDisplayName(" ");
|
||||||
|
kekuveg.setItemMeta(kekuvegMeta);
|
||||||
|
|
||||||
|
gui.setItem(0, kekuveg);
|
||||||
|
gui.setItem(1, kekuveg);
|
||||||
|
gui.setItem(2, kekuveg);
|
||||||
|
gui.setItem(3, kekuveg);
|
||||||
|
gui.setItem(4, kekuveg);
|
||||||
|
gui.setItem(5, kekuveg);
|
||||||
|
gui.setItem(6, kekuveg);
|
||||||
|
gui.setItem(7, kekuveg);
|
||||||
|
gui.setItem(8, kekuveg);
|
||||||
|
gui.setItem(9, kekuveg);
|
||||||
|
gui.setItem(10, vanilla);
|
||||||
|
gui.setItem(11, uhc);
|
||||||
|
gui.setItem(12, pot);
|
||||||
|
gui.setItem(13, nethpot);
|
||||||
|
gui.setItem(14, smp);
|
||||||
|
gui.setItem(15, sword);
|
||||||
|
gui.setItem(16, axe);
|
||||||
|
gui.setItem(17, kekuveg);
|
||||||
|
gui.setItem(18, kekuveg);
|
||||||
|
gui.setItem(19, mace);
|
||||||
|
gui.setItem(20, cart);
|
||||||
|
gui.setItem(21, diasmp);
|
||||||
|
gui.setItem(22, shieldlessuhc);
|
||||||
|
gui.setItem(23, pirosuveg);
|
||||||
|
gui.setItem(24, pirosuveg);
|
||||||
|
gui.setItem(25, pirosuveg);
|
||||||
|
gui.setItem(26, kekuveg);
|
||||||
|
gui.setItem(27, kekuveg);
|
||||||
|
gui.setItem(28, kekuveg);
|
||||||
|
gui.setItem(29, kekuveg);
|
||||||
|
gui.setItem(30, kekuveg);
|
||||||
|
gui.setItem(31, kekuveg);
|
||||||
|
gui.setItem(32, kekuveg);
|
||||||
|
gui.setItem(33, kekuveg);
|
||||||
|
gui.setItem(34, kekuveg);
|
||||||
|
gui.setItem(35, kekuveg);
|
||||||
|
|
||||||
|
player.openInventory(gui);
|
||||||
|
player.setMetadata("DuelRequest", new FixedMetadataValue(plugin, target.getUniqueId().toString()));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("szia nem vagy player ez nem vicces");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> onTabComplete(CommandSender sender, Command command, String s, String[] args) {
|
||||||
|
if (args.length == 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
91
src/main/java/lnmpro/Listeners/DuelRequestListener.java
Normal file
91
src/main/java/lnmpro/Listeners/DuelRequestListener.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package lnmpro.Listeners;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class DuelRequestListener implements Listener {
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public DuelRequestListener(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
|
if (!(event.getWhoClicked() instanceof Player player)) return;
|
||||||
|
|
||||||
|
if (event.getView().getTitle().equals("Játékmód Választás")) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDuelRequest(InventoryClickEvent e) {
|
||||||
|
Player player = (Player) e.getWhoClicked();
|
||||||
|
|
||||||
|
if (!e.getView().getTitle().equals("Játékmód Választás")) return;
|
||||||
|
|
||||||
|
if (e.getClick() != ClickType.LEFT) return;
|
||||||
|
|
||||||
|
ItemStack clickedItem = e.getCurrentItem();
|
||||||
|
if (clickedItem == null || clickedItem.getType() == Material.AIR) return;
|
||||||
|
|
||||||
|
if (clickedItem.getType() == Material.RED_STAINED_GLASS_PANE || clickedItem.getType() == Material.BLUE_STAINED_GLASS_PANE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (player.hasMetadata("DuelRequest")) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
|
||||||
|
UUID targetUUID = UUID.fromString(player.getMetadata("DuelRequest").get(0).asString());
|
||||||
|
Player target = Bukkit.getPlayer(targetUUID);
|
||||||
|
|
||||||
|
if (target == null) {
|
||||||
|
player.sendMessage("§cA meghívott játékos nincs jelen a szerveren.");
|
||||||
|
player.removeMetadata("DuelRequest", plugin);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player.removeMetadata("DuelRequest", plugin);
|
||||||
|
|
||||||
|
TextComponent accept = new TextComponent("§a[fogadd el]");
|
||||||
|
accept.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/acceptduel"));
|
||||||
|
accept.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||||
|
new ComponentBuilder("de fogadd baby").create()));
|
||||||
|
|
||||||
|
TextComponent decline = new TextComponent("[ne]");
|
||||||
|
decline.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/denyduel"));
|
||||||
|
decline.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||||
|
new ComponentBuilder("nefgoasdel").create()));
|
||||||
|
|
||||||
|
TextComponent fullMessage = new TextComponent("higy elfogadd kerlek ");
|
||||||
|
fullMessage.addExtra(accept);
|
||||||
|
fullMessage.addExtra(" vagy ");
|
||||||
|
fullMessage.addExtra(decline);
|
||||||
|
fullMessage.addExtra(" koszi!");
|
||||||
|
|
||||||
|
target.sendMessage("szia §f" + player.getName() + " fájtolni akar veled!");
|
||||||
|
target.spigot().sendMessage(fullMessage);
|
||||||
|
target.sendMessage("duel takemod amit valasztot:" + clickedItem.getItemMeta().getDisplayName().toLowerCase());
|
||||||
|
|
||||||
|
target.setMetadata("DueledBy", new FixedMetadataValue(plugin, player.getUniqueId().toString()));
|
||||||
|
target.setMetadata("DueledWithGamemode", new FixedMetadataValue(plugin, clickedItem.getItemMeta().getDisplayName().toLowerCase()));
|
||||||
|
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
src/main/java/lnmpro/Listeners/KitListener.java
Normal file
116
src/main/java/lnmpro/Listeners/KitListener.java
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
package lnmpro.Listeners;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class KitListener implements Listener {
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public KitListener(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (plugin.getConfig().getString("kits.sword." + player.getUniqueId()) == null) {
|
||||||
|
Map<String, Object> kit = new HashMap<>();
|
||||||
|
kit.put("sword", 0);
|
||||||
|
plugin.getConfig().set("kits.sword." + player.getUniqueId(), kit);
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.reloadConfig();
|
||||||
|
}
|
||||||
|
if (plugin.getConfig().getString("kits.uhc." + player.getUniqueId()) == null) {
|
||||||
|
Map<String, Object> kit = new HashMap<>();
|
||||||
|
int[] shield = new int[]{13, 40};
|
||||||
|
int[] water = new int[]{6, 22, 23, 24};
|
||||||
|
int[] lava = new int[]{2, 21};
|
||||||
|
kit.put("axe", 0);
|
||||||
|
kit.put("sword", 1);
|
||||||
|
kit.put("lava", lava);
|
||||||
|
kit.put("cobweb", 3);
|
||||||
|
kit.put("cobblestone", 4);
|
||||||
|
kit.put("goldenapple", 5);
|
||||||
|
kit.put("water", water);
|
||||||
|
kit.put("crossbow", 7);
|
||||||
|
kit.put("bow", 8);
|
||||||
|
kit.put("arrow", 9);
|
||||||
|
kit.put("planks", 17);
|
||||||
|
kit.put("pickaxe", 20);
|
||||||
|
kit.put("shield", shield);
|
||||||
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId(), kit);
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.reloadConfig();
|
||||||
|
}
|
||||||
|
if (plugin.getConfig().getString("kits.mace." + player.getUniqueId()) == null) {
|
||||||
|
Map<String, Object> kit = new HashMap<>();
|
||||||
|
int[] strength = new int[]{10, 11, 12, 13, 14, 15, 16, 28, 29, 30};
|
||||||
|
int[] speed = new int[]{19, 20, 21, 22, 23, 24, 25, 31, 32, 33};
|
||||||
|
int[] totem = new int[]{35, 40};
|
||||||
|
int[] enderpearl = new int[]{2, 9, 18, 27};
|
||||||
|
int[] goldenapple = new int[]{5, 17};
|
||||||
|
int[] windcharge = new int[]{7, 34};
|
||||||
|
kit.put("axe", 0);
|
||||||
|
kit.put("sword", 1);
|
||||||
|
kit.put("enderpearl", enderpearl);
|
||||||
|
kit.put("shield", 3);
|
||||||
|
kit.put("density", 4);
|
||||||
|
kit.put("goldenapple", goldenapple);
|
||||||
|
kit.put("breach", 6);
|
||||||
|
kit.put("windcharge", windcharge);
|
||||||
|
kit.put("elytra", 8);
|
||||||
|
kit.put("strength", strength);
|
||||||
|
kit.put("speed", speed);
|
||||||
|
kit.put("totem", totem);
|
||||||
|
kit.put("shulker", 26);
|
||||||
|
plugin.getConfig().set("kits.mace." + player.getUniqueId(), kit);
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.reloadConfig();
|
||||||
|
}
|
||||||
|
if (plugin.getConfig().getString("kits.axe." + player.getUniqueId()) == null) {
|
||||||
|
Map<String, Object> kit = new HashMap<>();
|
||||||
|
kit.put("axe", 0);
|
||||||
|
kit.put("sword", 1);
|
||||||
|
kit.put("crossbow", 2);
|
||||||
|
kit.put("bow", 3);
|
||||||
|
kit.put("arrow", 8);
|
||||||
|
kit.put("shield", 40);
|
||||||
|
plugin.getConfig().set("kits.axe." + player.getUniqueId(), kit);
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.reloadConfig();
|
||||||
|
}
|
||||||
|
if (plugin.getConfig().getString("kits.diasmp." + player.getUniqueId()) == null) {
|
||||||
|
Map<String, Object> kit = new HashMap<>();
|
||||||
|
int[] goldenapple = new int[]{5, 32};
|
||||||
|
int[] strength = new int[]{7, 12, 13, 14, 15, 19, 20, 21, 22, 23, 24, 29, 30, 31, 33};
|
||||||
|
int[] speed = new int[]{16, 25, 34};
|
||||||
|
int[] fireresistance = new int[]{17, 26, 35};
|
||||||
|
int[] water = new int[]{4, 10, 11};
|
||||||
|
int[] xp = new int[]{18, 27};
|
||||||
|
kit.put("axe", 0);
|
||||||
|
kit.put("sword", 1);
|
||||||
|
kit.put("enderpearl", 2);
|
||||||
|
kit.put("log", 3);
|
||||||
|
kit.put("water", water);
|
||||||
|
kit.put("goldenapple", goldenapple);
|
||||||
|
kit.put("cobweb", 6);
|
||||||
|
kit.put("strength", strength);
|
||||||
|
kit.put("totem", 8);
|
||||||
|
kit.put("pickaxe", 9);
|
||||||
|
kit.put("speed", speed);
|
||||||
|
kit.put("fireresistance", fireresistance);
|
||||||
|
kit.put("xp", xp);
|
||||||
|
kit.put("chorusfruit", 28);
|
||||||
|
kit.put("shield", 40);
|
||||||
|
plugin.getConfig().set("kits.diasmp." + player.getUniqueId(), kit);
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.reloadConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/main/java/lnmpro/Main.java
Normal file
24
src/main/java/lnmpro/Main.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package lnmpro;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import lnmpro.Commands.*;
|
||||||
|
import lnmpro.Listeners.*;
|
||||||
|
|
||||||
|
public final class Main extends JavaPlugin {
|
||||||
|
|
||||||
|
private static Main instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
instance = this;
|
||||||
|
getCommand("duel").setExecutor(new DuelsCommand(this));
|
||||||
|
getCommand("acceptduel").setExecutor(new AcceptDuelCommand(this));
|
||||||
|
getCommand("denyduel").setExecutor(new DenyDuelCommand(this));
|
||||||
|
Bukkit.getPluginManager().registerEvents(new DuelRequestListener(this), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Main getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
344
src/main/java/lnmpro/Utils/Kits.java
Normal file
344
src/main/java/lnmpro/Utils/Kits.java
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
package lnmpro.Utils;
|
||||||
|
|
||||||
|
import lnmpro.Main;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.ShulkerBox;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||||
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Kits {
|
||||||
|
|
||||||
|
private final Main plugin;
|
||||||
|
|
||||||
|
public Kits(Main plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getItemSlot(String key, String kit, Player player) {
|
||||||
|
String path = "kits." + kit + "." + player.getUniqueId() + "." + key;
|
||||||
|
|
||||||
|
if (plugin.getConfig().contains(path)) {
|
||||||
|
try {
|
||||||
|
return plugin.getConfig().getInt(path);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
plugin.getLogger().warning("Invalid slot number in config for " + path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private @NotNull List<Integer> getItemSlotArray(String key, String kit, Player player) {
|
||||||
|
String path = "kits." + kit + "." + player.getUniqueId() + "." + key;
|
||||||
|
|
||||||
|
if (plugin.getConfig().contains(path)) {
|
||||||
|
List<Integer> slots = plugin.getConfig().getIntegerList(path);
|
||||||
|
|
||||||
|
if (!slots.isEmpty()) {
|
||||||
|
return slots;
|
||||||
|
} else {
|
||||||
|
plugin.getLogger().warning("Invalid or empty slot numbers in config for " + path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Collections.singletonList(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerInventory getSwordKit(Player player) {
|
||||||
|
|
||||||
|
PlayerInventory inv = player.getInventory();
|
||||||
|
|
||||||
|
ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
|
||||||
|
ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
|
||||||
|
ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
|
||||||
|
ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
|
||||||
|
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
|
|
||||||
|
helmet.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
chestplate.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
leggings.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
boots.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
sword.addEnchantment(Enchantment.SWEEPING_EDGE, 3);
|
||||||
|
|
||||||
|
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
|
inv.setItem(getItemSlot("sword", "sword", player), sword);
|
||||||
|
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerInventory getUhcKit(Player player) {
|
||||||
|
|
||||||
|
PlayerInventory inv = player.getInventory();
|
||||||
|
|
||||||
|
ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
|
||||||
|
ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
|
||||||
|
ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
|
||||||
|
ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
|
||||||
|
ItemStack axe = new ItemStack(Material.DIAMOND_AXE);
|
||||||
|
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
|
ItemStack lava = new ItemStack(Material.LAVA_BUCKET);
|
||||||
|
ItemStack cobweb = new ItemStack(Material.COBWEB, 8);
|
||||||
|
ItemStack cobblestone = new ItemStack(Material.COBBLESTONE, 64);
|
||||||
|
ItemStack goldenapple = new ItemStack(Material.GOLDEN_APPLE, 13);
|
||||||
|
ItemStack water = new ItemStack(Material.WATER_BUCKET);
|
||||||
|
ItemStack crossbow = new ItemStack(Material.CROSSBOW);
|
||||||
|
ItemStack bow = new ItemStack(Material.BOW);
|
||||||
|
ItemStack arrow = new ItemStack(Material.ARROW, 16);
|
||||||
|
ItemStack shield = new ItemStack(Material.SHIELD);
|
||||||
|
ItemStack planks = new ItemStack(Material.OAK_PLANKS, 64);
|
||||||
|
ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
|
||||||
|
|
||||||
|
helmet.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
chestplate.addEnchantment(Enchantment.PROTECTION, 2);
|
||||||
|
leggings.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
boots.addEnchantment(Enchantment.PROTECTION, 3);
|
||||||
|
axe.addEnchantment(Enchantment.SHARPNESS, 1);
|
||||||
|
axe.addEnchantment(Enchantment.EFFICIENCY, 3);
|
||||||
|
sword.addEnchantment(Enchantment.SHARPNESS, 4);
|
||||||
|
crossbow.addEnchantment(Enchantment.PIERCING, 1);
|
||||||
|
bow.addEnchantment(Enchantment.POWER, 1);
|
||||||
|
pickaxe.addEnchantment(Enchantment.UNBREAKING,3);
|
||||||
|
pickaxe.addEnchantment(Enchantment.EFFICIENCY, 3);
|
||||||
|
|
||||||
|
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
|
inv.setItem(getItemSlot("axe", "uhc", player), axe);
|
||||||
|
inv.setItem(getItemSlot("sword", "uhc", player), sword);
|
||||||
|
for (int slot : getItemSlotArray("lava", "uhc", player)) {
|
||||||
|
inv.setItem(slot, lava);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("cobweb", "uhc", player), cobweb);
|
||||||
|
inv.setItem(getItemSlot("cobblestone", "uhc", player), cobblestone);
|
||||||
|
inv.setItem(getItemSlot("goldenapple", "uhc", player), goldenapple);
|
||||||
|
for (int slot : getItemSlotArray("water", "uhc", player)) {
|
||||||
|
inv.setItem(slot, water);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("crossbow", "uhc", player), crossbow);
|
||||||
|
inv.setItem(getItemSlot("bow", "uhc", player), bow);
|
||||||
|
inv.setItem(getItemSlot("arrow", "uhc", player), arrow);
|
||||||
|
for (int slot : getItemSlotArray("shield", "uhc", player)) {
|
||||||
|
inv.setItem(slot, shield);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("planks", "uhc", player), planks);
|
||||||
|
inv.setItem(getItemSlot("pickaxe", "uhc", player), pickaxe);
|
||||||
|
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerInventory getMaceKit(Player player) {
|
||||||
|
|
||||||
|
PlayerInventory inv = player.getInventory();
|
||||||
|
|
||||||
|
ItemStack helmet = new ItemStack(Material.NETHERITE_HELMET);
|
||||||
|
ItemStack chestplate = new ItemStack(Material.NETHERITE_CHESTPLATE);
|
||||||
|
ItemStack leggings = new ItemStack(Material.NETHERITE_LEGGINGS);
|
||||||
|
ItemStack boots = new ItemStack(Material.NETHERITE_BOOTS);
|
||||||
|
ItemStack axe = new ItemStack(Material.NETHERITE_AXE);
|
||||||
|
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
|
||||||
|
ItemStack enderpearl = new ItemStack(Material.ENDER_PEARL, 16);
|
||||||
|
ItemStack shield = new ItemStack(Material.SHIELD);
|
||||||
|
ItemStack density = new ItemStack(Material.MACE);
|
||||||
|
ItemStack goldenapple = new ItemStack(Material.GOLDEN_APPLE, 64);
|
||||||
|
ItemStack breach = new ItemStack(Material.MACE);
|
||||||
|
ItemStack windchare = new ItemStack(Material.WIND_CHARGE, 64);
|
||||||
|
ItemStack elytra = new ItemStack(Material.ELYTRA);
|
||||||
|
ItemStack totem = new ItemStack(Material.TOTEM_OF_UNDYING);
|
||||||
|
ItemStack shulker = new ItemStack(Material.SHULKER_BOX);
|
||||||
|
ItemStack strength = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack speed = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
|
||||||
|
helmet.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
chestplate.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
leggings.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
boots.addEnchantment(Enchantment.FEATHER_FALLING, 4);
|
||||||
|
boots.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
sword.addEnchantment(Enchantment.SHARPNESS, 5);
|
||||||
|
sword.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
axe.addEnchantment(Enchantment.SHARPNESS, 5);
|
||||||
|
axe.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
shield.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
density.addEnchantment(Enchantment.WIND_BURST, 1);
|
||||||
|
density.addEnchantment(Enchantment.DENSITY, 5);
|
||||||
|
density.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
breach.addEnchantment(Enchantment.BREACH, 4);
|
||||||
|
breach.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
|
||||||
|
PotionMeta strengthmeta = (PotionMeta) strength.getItemMeta();
|
||||||
|
strengthmeta.addCustomEffect(new PotionEffect(PotionEffectType.STRENGTH, 1800, 1), true);
|
||||||
|
strengthmeta.setMainEffect(PotionEffectType.STRENGTH);
|
||||||
|
strength.setItemMeta(strengthmeta);
|
||||||
|
PotionMeta speedmeta = (PotionMeta) speed.getItemMeta();
|
||||||
|
speedmeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 1800, 1), true);
|
||||||
|
speedmeta.setMainEffect(PotionEffectType.SPEED);
|
||||||
|
speed.setItemMeta(speedmeta);
|
||||||
|
|
||||||
|
BlockStateMeta shulkermeta = (BlockStateMeta) shulker.getItemMeta();
|
||||||
|
ShulkerBox shulkerbox = (ShulkerBox) shulkermeta.getBlockState();
|
||||||
|
Inventory shulkerinv = shulkerbox.getInventory();
|
||||||
|
for (int i = 0; i < 14; i++) {
|
||||||
|
shulkerinv.setItem(i, strength);
|
||||||
|
}
|
||||||
|
for (int i = 14; i < 27; i++) {
|
||||||
|
shulkerinv.setItem(i, speed);
|
||||||
|
}
|
||||||
|
shulkermeta.setBlockState(shulkerbox);
|
||||||
|
shulker.setItemMeta(shulkermeta);
|
||||||
|
|
||||||
|
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
|
inv.setItem(getItemSlot("axe", "mace", player), axe);
|
||||||
|
inv.setItem(getItemSlot("sword", "mace", player), sword);
|
||||||
|
for (int slot : getItemSlotArray("enderpearl", "mace", player)) {
|
||||||
|
inv.setItem(slot, enderpearl);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("shield", "mace", player), shield);
|
||||||
|
inv.setItem(getItemSlot("density", "mace", player), density);
|
||||||
|
for (int slot : getItemSlotArray("goldenapple", "mace", player)) {
|
||||||
|
inv.setItem(slot, goldenapple);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("breach", "mace", player), breach);
|
||||||
|
for (int slot : getItemSlotArray("windcharge", "mace", player)) {
|
||||||
|
inv.setItem(slot, windchare);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("elytra", "mace", player), elytra);
|
||||||
|
inv.setItem(getItemSlot("shulker", "mace", player), shulker);
|
||||||
|
for (int slot : getItemSlotArray("strength", "mace", player)) {
|
||||||
|
inv.setItem(slot, strength);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("speed", "mace", player)) {
|
||||||
|
inv.setItem(slot, speed);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("totem", "mace", player)) {
|
||||||
|
inv.setItem(slot, totem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerInventory getAxeKit(Player player) {
|
||||||
|
|
||||||
|
PlayerInventory inv = player.getInventory();
|
||||||
|
|
||||||
|
ItemStack axe = new ItemStack(Material.DIAMOND_AXE);
|
||||||
|
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
|
ItemStack crossbow = new ItemStack(Material.CROSSBOW);
|
||||||
|
ItemStack bow = new ItemStack(Material.BOW);
|
||||||
|
ItemStack arrow = new ItemStack(Material.ARROW, 6);
|
||||||
|
ItemStack shield = new ItemStack(Material.SHIELD);
|
||||||
|
|
||||||
|
inv.setItem(getItemSlot("axe", "axe", player), axe);
|
||||||
|
inv.setItem(getItemSlot("sword", "axe", player), sword);
|
||||||
|
inv.setItem(getItemSlot("crossbow", "axe", player), crossbow);
|
||||||
|
inv.setItem(getItemSlot("bow", "axe", player), bow);
|
||||||
|
inv.setItem(getItemSlot("arrow", "axe", player), arrow);
|
||||||
|
inv.setItem(getItemSlot("shield", "axe", player), shield);
|
||||||
|
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerInventory getDiaSMPKit(Player player) {
|
||||||
|
|
||||||
|
PlayerInventory inv = player.getInventory();
|
||||||
|
|
||||||
|
ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
|
||||||
|
ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
|
||||||
|
ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
|
||||||
|
ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
|
||||||
|
ItemStack axe = new ItemStack(Material.DIAMOND_AXE);
|
||||||
|
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
|
ItemStack enderpearl = new ItemStack(Material.ENDER_PEARL, 16);
|
||||||
|
ItemStack log = new ItemStack(Material.OAK_LOG, 64);
|
||||||
|
ItemStack water = new ItemStack(Material.WATER_BUCKET);
|
||||||
|
ItemStack goldenapple = new ItemStack(Material.GOLDEN_APPLE, 64);
|
||||||
|
ItemStack cobweb = new ItemStack(Material.COBWEB, 64);
|
||||||
|
ItemStack strength = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack totem = new ItemStack(Material.TOTEM_OF_UNDYING);
|
||||||
|
ItemStack pickaxe = new ItemStack(Material.NETHERITE_PICKAXE);
|
||||||
|
ItemStack speed = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack fireresistance = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack xp = new ItemStack(Material.EXPERIENCE_BOTTLE, 64);
|
||||||
|
ItemStack chorusfruit = new ItemStack(Material.CHORUS_FRUIT, 64);
|
||||||
|
ItemStack shield = new ItemStack(Material.SHIELD);
|
||||||
|
|
||||||
|
helmet.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
helmet.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
helmet.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
chestplate.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
chestplate.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
chestplate.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
leggings.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
leggings.addEnchantment(Enchantment.SWIFT_SNEAK, 3);
|
||||||
|
leggings.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
leggings.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
boots.addEnchantment(Enchantment.PROTECTION, 4);
|
||||||
|
boots.addEnchantment(Enchantment.FEATHER_FALLING, 4);
|
||||||
|
boots.addEnchantment(Enchantment.DEPTH_STRIDER, 3);
|
||||||
|
boots.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
boots.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
axe.addEnchantment(Enchantment.SHARPNESS, 5);
|
||||||
|
axe.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
sword.addEnchantment(Enchantment.SHARPNESS, 5);
|
||||||
|
sword.addEnchantment(Enchantment.FIRE_ASPECT, 2);
|
||||||
|
sword.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
pickaxe.addEnchantment(Enchantment.SILK_TOUCH, 1);
|
||||||
|
pickaxe.addEnchantment(Enchantment.EFFICIENCY, 5);
|
||||||
|
pickaxe.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
pickaxe.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
shield.addEnchantment(Enchantment.UNBREAKING, 3);
|
||||||
|
shield.addEnchantment(Enchantment.MENDING, 1);
|
||||||
|
|
||||||
|
PotionMeta fireresistancemeta = (PotionMeta) fireresistance.getItemMeta();
|
||||||
|
fireresistancemeta.addCustomEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 9600, 0), true);
|
||||||
|
fireresistancemeta.setMainEffect(PotionEffectType.FIRE_RESISTANCE);
|
||||||
|
fireresistance.setItemMeta(fireresistancemeta);
|
||||||
|
PotionMeta strengthmeta = (PotionMeta) strength.getItemMeta();
|
||||||
|
strengthmeta.addCustomEffect(new PotionEffect(PotionEffectType.STRENGTH, 1800, 1), true);
|
||||||
|
strengthmeta.setMainEffect(PotionEffectType.STRENGTH);
|
||||||
|
strength.setItemMeta(strengthmeta);
|
||||||
|
PotionMeta speedmeta = (PotionMeta) speed.getItemMeta();
|
||||||
|
speedmeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 9600, 0), true);
|
||||||
|
speedmeta.setMainEffect(PotionEffectType.SPEED);
|
||||||
|
speed.setItemMeta(speedmeta);
|
||||||
|
|
||||||
|
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
|
inv.setItem(getItemSlot("axe", "diasmp", player), axe);
|
||||||
|
inv.setItem(getItemSlot("sword", "diasmp", player), sword);
|
||||||
|
inv.setItem(getItemSlot("enderpearl", "diasmp", player), enderpearl);
|
||||||
|
inv.setItem(getItemSlot("log", "diasmp", player), log);
|
||||||
|
for (int slot : getItemSlotArray("water", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, water);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("goldenapple", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, goldenapple);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("cobweb", "diasmp", player), cobweb);
|
||||||
|
for (int slot : getItemSlotArray("strength", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, strength);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("totem", "diasmp", player), totem);
|
||||||
|
inv.setItem(getItemSlot("pickaxe", "diasmp", player), pickaxe);
|
||||||
|
for (int slot : getItemSlotArray("speed", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, speed);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("fireresistance", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, fireresistance);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("xp", "diasmp", player)) {
|
||||||
|
inv.setItem(slot, xp);
|
||||||
|
}
|
||||||
|
inv.setItem(getItemSlot("chorusfruit", "diasmp", player), chorusfruit);
|
||||||
|
inv.setItem(getItemSlot("shield", "diasmp", player), shield);
|
||||||
|
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
src/main/resources/plugin.yml
Normal file
9
src/main/resources/plugin.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: InsaneDuels
|
||||||
|
version: '1.0'
|
||||||
|
main: lnmpro.Main
|
||||||
|
api-version: '1.21'
|
||||||
|
authors: [ LnmPro, JGJ52 ]
|
||||||
|
commands:
|
||||||
|
duel:
|
||||||
|
acceptduel:
|
||||||
|
denyduel:
|
||||||
BIN
target/InsaneDuels-1.0-SNAPSHOT-shaded.jar
Normal file
BIN
target/InsaneDuels-1.0-SNAPSHOT-shaded.jar
Normal file
Binary file not shown.
BIN
target/InsaneDuels-1.0-SNAPSHOT.jar
Normal file
BIN
target/InsaneDuels-1.0-SNAPSHOT.jar
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Commands/AcceptDuelCommand.class
Normal file
BIN
target/classes/lnmpro/Commands/AcceptDuelCommand.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Commands/DenyDuelCommand.class
Normal file
BIN
target/classes/lnmpro/Commands/DenyDuelCommand.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Commands/DuelsCommand.class
Normal file
BIN
target/classes/lnmpro/Commands/DuelsCommand.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Listeners/DuelRequestListener.class
Normal file
BIN
target/classes/lnmpro/Listeners/DuelRequestListener.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Listeners/KitListener.class
Normal file
BIN
target/classes/lnmpro/Listeners/KitListener.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Main.class
Normal file
BIN
target/classes/lnmpro/Main.class
Normal file
Binary file not shown.
BIN
target/classes/lnmpro/Utils/Kits.class
Normal file
BIN
target/classes/lnmpro/Utils/Kits.class
Normal file
Binary file not shown.
9
target/classes/plugin.yml
Normal file
9
target/classes/plugin.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: InsaneDuels
|
||||||
|
version: '1.0'
|
||||||
|
main: lnmpro.Main
|
||||||
|
api-version: '1.21'
|
||||||
|
authors: [ LnmPro, JGJ52 ]
|
||||||
|
commands:
|
||||||
|
duel:
|
||||||
|
acceptduel:
|
||||||
|
denyduel:
|
||||||
3
target/maven-archiver/pom.properties
Normal file
3
target/maven-archiver/pom.properties
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
artifactId=InsaneDuels
|
||||||
|
groupId=lnmpro
|
||||||
|
version=1.0-SNAPSHOT
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
lnmpro\Main.class
|
||||||
|
lnmpro\Commands\AcceptDuelCommand.class
|
||||||
|
lnmpro\Listeners\DuelRequestListener.class
|
||||||
|
lnmpro\Commands\DenyDuelCommand.class
|
||||||
|
lnmpro\Listeners\KitListener.class
|
||||||
|
lnmpro\Commands\DuelsCommand.class
|
||||||
|
lnmpro\Utils\Kits.class
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Commands\AcceptDuelCommand.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Commands\DenyDuelCommand.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Commands\DuelsCommand.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Listeners\DuelRequestListener.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Listeners\KitListener.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Main.java
|
||||||
|
E:\InsaneDuels\InsaneDuels\src\main\java\lnmpro\Utils\Kits.java
|
||||||
BIN
target/original-InsaneDuels-1.0-SNAPSHOT.jar
Normal file
BIN
target/original-InsaneDuels-1.0-SNAPSHOT.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user