#Storing block location and UUID pairs
1 messages · Page 1 of 1 (latest)
I created a cobweb class which has a UUID and Location
private ArrayList<SpiderSwordCobweb<UUID, Location>> SpiderSwordCobwebs = new ArrayList<>();
But now I don't know how to find a location from a UUID in it like I was doing before when it was a hashmap
spiderSwordCobwebs.containsKey(playerUuid)
SpiderSwordCobwebs.remove(playerUuid)
containsValue
basically you have a n-n relationship where each unique key has a value but like
what if you have multiple cobwebs in the same location 🤔
not strictly
also 2 locations may be different if any of the decimal values is marginally different
so you'll have some problems on that aspect
Storing block location and UUID pairs
What I really want is a hashmap that can have duplicate keys
I need to store a list of locations and UUIDs connect them in a way that I can easily find locations based on UUID
I can do this right?
private Map<UUID, ArrayList<Location>> SpiderSwordCobwebs = new HashMap<>();