Skip to content

Commit

Permalink
1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
MrButtersDEV committed Jun 8, 2023
1 parent 8fac2e8 commit 398ca40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/us/thezircon/play/autopickup/AutoPickup.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public void onEnable() {
getServer().getPluginManager().registerEvents(new PlayerDropItemEventListener(), this);
getServer().getPluginManager().registerEvents(new ItemSpawnEventListener(), this);



if (usingMythicMobs) {
getServer().getPluginManager().registerEvents(new MythicMobListener(), this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ public static ItemStack smelt(ItemStack itemStack, Player player) {

if (((FurnaceRecipe) recipe).getInput().getType() != itemStack.getType()) continue;
result = recipe.getResult();
player.giveExp((int) ((FurnaceRecipe) recipe).getExperience());
player.giveExp(((int) ((FurnaceRecipe) recipe).getExperience())*itemStack.getAmount());
break;
}

result.setAmount(itemStack.getAmount());

return result;
}

Expand Down
10 changes: 9 additions & 1 deletion src/main/java/us/thezircon/play/autopickup/utils/HexFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ public class HexFormat {

private static final Pattern pattern = Pattern.compile("&#[a-fA-F0-9]{6}");

public static boolean isAboveMinor(int version) {
String[] split = Bukkit.getBukkitVersion().split("-")[0].split("\\.");
String minorVer = split[1];
return Integer.parseInt(minorVer) >= version;
}

public static String format(String msg) {
if (Bukkit.getVersion().contains("1.17") || Bukkit.getVersion().contains("1.16") || Bukkit.getVersion().contains("1.18") || Bukkit.getVersion().contains("1.19")) {
String[] split = Bukkit.getBukkitVersion().split("-")[0].split("\\.");
String minorVer = split[1];
if (Integer.parseInt(minorVer) >= 16) {
Matcher match = pattern.matcher(msg);
while (match.find()) {
String color = msg.substring(match.start(), match.end());
Expand Down

0 comments on commit 398ca40

Please sign in to comment.