From 5e0d3f09de9ada37d4b325b06deb9e2b728df3c1 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Sun, 11 Jan 2015 15:08:40 -0800 Subject: [PATCH] Added API to find a claim by its ID. --- src/me/ryanhamshire/GriefPrevention/DataStore.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/me/ryanhamshire/GriefPrevention/DataStore.java b/src/me/ryanhamshire/GriefPrevention/DataStore.java index 4f52988..6f19c3c 100644 --- a/src/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DataStore.java @@ -582,6 +582,17 @@ public abstract class DataStore return null; } + //finds a claim by ID + public synchronized Claim getClaim(long id) + { + for(Claim claim : this.claims) + { + if(claim.getID() == id) return claim; + } + + return null; + } + //gets a unique, persistent identifier string for a chunk private String getChunkString(Location location) {