Skip to content

Commit 9b5afd1

Browse files
committed
Allow removal from cooldown handler
1 parent 11d8e04 commit 9b5afd1

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>vg.civcraft.mc.civmodcore</groupId>
66
<artifactId>CivModCore</artifactId>
7-
<version>1.6.1</version>
7+
<version>1.6.2</version>
88

99
<name>CivModCore</name>
1010
<url>https://github.com/DevotedMC/CivModCore/</url>

src/main/java/vg/civcraft/mc/civmodcore/util/cooldowns/ICoolDownHandler.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,11 @@ public interface ICoolDownHandler<E> {
4545
*/
4646
long getTotalCoolDown();
4747

48+
/**
49+
* Removed the cooldown for the given object
50+
*
51+
* @param e
52+
* Object to check
53+
*/
54+
void removeCooldown(E e);
4855
}

src/main/java/vg/civcraft/mc/civmodcore/util/cooldowns/MilliSecCoolDownHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@ public long getRemainingCoolDown(E e) {
5353
public long getTotalCoolDown() {
5454
return cooldown;
5555
}
56+
57+
@Override
58+
public void removeCooldown(E e) {
59+
cds.remove(e);
60+
}
5661

5762
}

src/main/java/vg/civcraft/mc/civmodcore/util/cooldowns/TickCoolDownHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,10 @@ public long getRemainingCoolDown(E e) {
6565
public long getTotalCoolDown() {
6666
return cooldown;
6767
}
68+
69+
@Override
70+
public void removeCooldown(E e) {
71+
cds.remove(e);
72+
}
6873

6974
}

0 commit comments

Comments
 (0)