Skip to content

Commit 259e89b

Browse files
committed
Updated Enums
1 parent 6ed97d4 commit 259e89b

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>us.thezircon.play</groupId>
88
<artifactId>AutoPickup</artifactId>
9-
<version>1.4.6-SNAPSHOT</version>
9+
<version>1.4.7-DEVBUILD.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>AutoPickup</name>
@@ -83,7 +83,7 @@
8383
<dependency>
8484
<groupId>org.spigotmc</groupId>
8585
<artifactId>spigot-api</artifactId>
86-
<version>1.20-R0.1-SNAPSHOT</version>
86+
<version>1.21.1-R0.1-SNAPSHOT</version>
8787
<scope>provided</scope>
8888
</dependency>
8989
<dependency>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
package us.thezircon.play.autopickup.api;
22

3+
import org.bukkit.Location;
34
import org.bukkit.entity.Item;
5+
import org.bukkit.entity.Player;
46
import us.thezircon.play.autopickup.AutoPickup;
7+
import us.thezircon.play.autopickup.utils.PickupObjective;
58

9+
import java.time.Instant;
610
import java.util.UUID;
711

812
public class AutoAPI {
913

14+
/**
15+
* @deprecated Experimental API; This api has not been tested & officially supported / may be removed.
16+
* @param itemEntity The Item Entity that should be ignored by AutoPickup
17+
*/
1018
public static void addIgnoredDrop(Item itemEntity) {
1119
UUID uuid = itemEntity.getUniqueId();
1220
addIgnoredDrop(uuid);
1321
}
1422

23+
/**
24+
* @deprecated Experimental API; This api has not been tested & officially supported / may be removed.
25+
* @param itemEntityUUID UUID of an item entity that should be ignored by AutoPickup
26+
*/
1527
public static void addIgnoredDrop(UUID itemEntityUUID) {
1628
AutoPickup.droppedItems.add(itemEntityUUID);
1729
}
1830

31+
/**
32+
* @param location The location that should be watched for possible custom drops.
33+
* @param player The player who broke said block.
34+
* @deprecated Experimental API; This api has not been tested & officially supported / may be removed.
35+
*
36+
* Blocks broken by players are already tagged for custom drops; this should be used for adjacent blocks that should be watched for additional custom drops.
37+
*/
38+
public static void tagCustomDropLocation(Location location, Player player) {
39+
String key = location.getBlockX()+";"+location.getBlockY()+";"+location.getBlockZ()+";"+location.getWorld();
40+
AutoPickup.customItemPatch.put(key, new PickupObjective(location, player, Instant.now()));
41+
}
42+
1943
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public Auto(){
3030
public ArrayList<CMDManager> getSubCommands(){
3131
return subcommands;
3232
}
33-
3433
@Override
3534
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
3635
boolean requirePermsAUTO = PLUGIN.getConfig().getBoolean("requirePerms.autopickup");

src/main/java/us/thezircon/play/autopickup/listeners/BlockBreakEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void run() {
324324
}
325325

326326
//deal with sugarcane
327-
if (e.getBlock().getType() == Material.SUGAR_CANE || e.getBlock().getType() == Material.GRASS || e.getBlock().getType() == Material.SAND) {
327+
if (e.getBlock().getType() == Material.SUGAR_CANE || e.getBlock().getType() == Material.GRASS_BLOCK || e.getBlock().getType() == Material.SAND) {
328328
Location lnew = l.clone();
329329
do {
330330
lnew.setY(lnew.getY() + 1);

src/main/java/us/thezircon/play/autopickup/listeners/PlayerInteractEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void onClick(PlayerInteractEvent e) {
4444
@Override
4545
public void run() {
4646
for (Entity entity : loc.getWorld().getNearbyEntities(loc, 1, 1, 1)) {
47-
if (entity.getType().equals(EntityType.DROPPED_ITEM)) {
47+
if (entity.getType().equals(EntityType.ITEM)) {
4848
Item item = (Item) entity;
4949
ItemStack items = item.getItemStack();
5050
if (items.getType().equals(Material.SWEET_BERRIES)) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.entity.Player;
77
import org.bukkit.inventory.*;
88
import us.thezircon.play.autopickup.AutoPickup;
9+
import us.thezircon.play.autopickup.api.AutoAPI;
910

1011
import java.util.*;
1112

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ public enum Mendable {
6464
NETHERITE_HELMET,
6565
NETHERITE_CHESTPLATE,
6666
NETHERITE_LEGGINGS,
67-
NETHERITE_BOOTS
67+
NETHERITE_BOOTS,
68+
MACE
6869
}

0 commit comments

Comments
 (0)