Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e6144fcea | ||
|
|
440d43ed09 |
No files matched your search
@@ -1 +0,0 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -1,3 +0,0 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
+10
-3
@@ -49,7 +49,7 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<outputDirectory>F:\Minecraft\Servers\MC 1.20.4 Server\plugins</outputDirectory>
|
||||
<outputDirectory>F:\Minecraft\Servers\MC 1.20.6 Server\plugins</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -74,7 +74,6 @@
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@@ -88,7 +87,8 @@
|
||||
<dependency>
|
||||
<groupId>me.catcoder</groupId>
|
||||
<artifactId>bukkit-sidebar</artifactId>
|
||||
<version>6.2.6-SNAPSHOT</version>
|
||||
<version>6.2.7-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-jdbc -->
|
||||
<dependency>
|
||||
@@ -96,6 +96,13 @@
|
||||
<artifactId>ormlite-jdbc</artifactId>
|
||||
<version>6.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.github.steveice10/opennbt -->
|
||||
<dependency>
|
||||
<groupId>com.github.steveice10</groupId>
|
||||
<artifactId>opennbt</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -94,6 +94,7 @@ public final class PureKitPvP extends JavaPlugin {
|
||||
LanguageConfig.save();
|
||||
LanguageConfig.loadLanguage();
|
||||
|
||||
|
||||
SidebarScoreboard scoreboard = new SidebarScoreboard(this);
|
||||
|
||||
getCommand("getkit").setExecutor(new GetKit(this));
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ import me.lifelessnerd.purekitpvp.utils.ComponentUtils;
|
||||
import me.lifelessnerd.purekitpvp.utils.DoubleUtils;
|
||||
import me.lifelessnerd.purekitpvp.utils.PlayerUtils;
|
||||
|
||||
import me.lifelessnerd.purekitpvp.versioning.MinecraftVersion;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -28,6 +29,7 @@ public class SidebarScoreboard implements Listener {
|
||||
if (plugin.getConfig().getBoolean("scoreboard-enabled")){
|
||||
refreshLeaderboard();
|
||||
}
|
||||
System.out.println(MinecraftVersion.getVersion());
|
||||
|
||||
}
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package me.lifelessnerd.purekitpvp.versioning;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MinecraftVersion {
|
||||
|
||||
public static String getVersion(){
|
||||
return extractVersion(Bukkit.getVersion());
|
||||
}
|
||||
|
||||
public static String extractVersion(String input) {
|
||||
// Define a regular expression pattern to match the version number
|
||||
Pattern pattern = Pattern.compile("\\b(\\d+\\.\\d+\\.\\d+)\\b");
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
} else {
|
||||
throw new IllegalArgumentException("No version number found in the input string");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package me.lifelessnerd.purekitpvp.versioning;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static java.lang.Integer.parseInt;
|
||||
|
||||
public class Version implements Comparable<Version> {
|
||||
|
||||
int major;
|
||||
int minor;
|
||||
int build;
|
||||
|
||||
public Version(int major, int minor, int build) {
|
||||
this.major = major;
|
||||
this.minor = minor;
|
||||
this.build = build;
|
||||
}
|
||||
|
||||
public Version(String versionString){
|
||||
// versionString: 1.20.6
|
||||
String[] split = versionString.split("\\.");
|
||||
this.major = parseInt(split[0]);
|
||||
this.minor = parseInt(split[1]);
|
||||
this.build = parseInt(split[2]);
|
||||
}
|
||||
|
||||
public int getVersionNumber(){
|
||||
String versionNumber = major + String.valueOf(minor) + build; // hacky
|
||||
return parseInt(versionNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull Version o) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -118,7 +118,7 @@ If you have any questions please reach out via Discord (see #Support).
|
||||
## How to create a kit
|
||||
*Also see the video that covers this topic below.*
|
||||
|
||||
Have all the items you want to be in your kit in your inventory, and type the command /purekitpvp kit create \<name> . A kit will be created with the arguments and automatically added to the kit menu (/kit). You either provide a kill item in the base command, or, if you want the kill item to be a special item (i.e. a golden head or a random loot chest), use the /purekitpvp getcustomitem command to get that item, and run the command /purekitpvp kit setkillitem \<kitName> while holding that item.
|
||||
Have all the items you want to be in your kit in your inventory, and type the command /purekitpvp createkit \<name> . A kit will be created with the arguments and automatically added to the kit menu (/kit). You either provide a kill item in the base command, or, if you want the kill item to be a special item (i.e. a golden head or a random loot chest), use the /purekitpvp getcustomitem command to get that item, and run the command /purekitpvp setkillitem \<kitName> while holding that item.
|
||||
The contents of the kit will be shown in a clean hoverbox when choosing the kit, which will categorize the first 3 items in your hotbar as weapons, the rest of the inventory as items, the armor as armor and the offhand as offhand. If the kit has no armor, it will tell you aswell. A piece of lore can be set in the kits.yml.
|
||||
Basic potions that can be found in the inventory are translated as well, although they do not show their potency and lenght, due to how these items work in spigot. Custom potions created with commands however do work perfectly and show potency and lenght, so I recommend to create your own potions with commands when working with them.
|
||||
|
||||
|
||||
Reference in new issue
Block a user