Skip to content

Commit 398ca40

Browse files
committed
1.20
1 parent 8fac2e8 commit 398ca40

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<dependency>
8484
<groupId>org.spigotmc</groupId>
8585
<artifactId>spigot-api</artifactId>
86-
<version>1.18-R0.1-SNAPSHOT</version>
86+
<version>1.20-R0.1-SNAPSHOT</version>
8787
<scope>provided</scope>
8888
</dependency>
8989
<dependency>

src/main/java/us/thezircon/play/autopickup/AutoPickup.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public void onEnable() {
129129
getServer().getPluginManager().registerEvents(new PlayerDropItemEventListener(), this);
130130
getServer().getPluginManager().registerEvents(new ItemSpawnEventListener(), this);
131131

132+
133+
132134
if (usingMythicMobs) {
133135
getServer().getPluginManager().registerEvents(new MythicMobListener(), this);
134136
}

src/main/java/us/thezircon/play/autopickup/utils/AutoSmelt.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ public static ItemStack smelt(ItemStack itemStack, Player player) {
3838

3939
if (((FurnaceRecipe) recipe).getInput().getType() != itemStack.getType()) continue;
4040
result = recipe.getResult();
41-
player.giveExp((int) ((FurnaceRecipe) recipe).getExperience());
41+
player.giveExp(((int) ((FurnaceRecipe) recipe).getExperience())*itemStack.getAmount());
4242
break;
4343
}
4444

45+
result.setAmount(itemStack.getAmount());
46+
4547
return result;
4648
}
4749

src/main/java/us/thezircon/play/autopickup/utils/HexFormat.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ public class HexFormat {
1010

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

13+
public static boolean isAboveMinor(int version) {
14+
String[] split = Bukkit.getBukkitVersion().split("-")[0].split("\\.");
15+
String minorVer = split[1];
16+
return Integer.parseInt(minorVer) >= version;
17+
}
18+
1319
public static String format(String msg) {
14-
if (Bukkit.getVersion().contains("1.17") || Bukkit.getVersion().contains("1.16") || Bukkit.getVersion().contains("1.18") || Bukkit.getVersion().contains("1.19")) {
20+
String[] split = Bukkit.getBukkitVersion().split("-")[0].split("\\.");
21+
String minorVer = split[1];
22+
if (Integer.parseInt(minorVer) >= 16) {
1523
Matcher match = pattern.matcher(msg);
1624
while (match.find()) {
1725
String color = msg.substring(match.start(), match.end());

0 commit comments

Comments
 (0)