Skip to content

Commit

Permalink
Fix minor issue with predictive audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Oct 17, 2020
1 parent 418002a commit 8e2d700
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugin/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.craftmend.openaudiomc</groupId>
<artifactId>OpenAudioMc</artifactId>
<name>OpenAudioMc</name>
<version>6.3.7</version>
<version>6.3.7.2</version>
<description>The OpenAudioMc Java plugin and Api</description>
<url>https://craftmend.com/</url>
<build>
Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.craftmend.openaudiomc</groupId>
<artifactId>OpenAudioMc</artifactId>
<version>6.3.7</version>
<version>6.3.7.2</version>
<packaging>jar</packaging>

<name>OpenAudioMc</name>
Expand Down
2 changes: 1 addition & 1 deletion plugin/protocol/static-resources/project_status.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"versioning": {
"version_tag": "6.3.7",
"version_tag": "6.3.7.2",
"version_importance": "&2Highly recommended",
"version_update_message": "This update contains some important bug fixes, api methods and nice extra features."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,28 @@ public List<Value> getTop(int count) {

public void clean() {
int elements = 0;
List<T> removals = new ArrayList<>();
for (Value value : sortedValues()) {
if (value.getAge() > maxAgeInSeconds) {
data.remove(value.getValue());
removals.add(value.getValue());
continue;
}

elements++;
if (elements > maxElements) {
data.remove(value.getValue());
removals.add(value.getValue());
}
}

for (T removal : removals) {
data.remove(removal);
}
}

private List<Value> sortedValues() {
return data.values()
if (data.isEmpty()) return new ArrayList<>();

return new ArrayList<>(data.values())
.stream()
.sorted(
Comparator
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OpenAudioMc
version: 6.3.7
version: 6.3.7.2
main: com.craftmend.openaudiomc.bungee.OpenAudioMcBungee
author: Mindgamesnl
authors: [Mindgamesnl]
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OpenAudioMc
version: 6.3.7
version: 6.3.7.2
softdepend: [WorldGuard, Train_Carts]
main: com.craftmend.openaudiomc.spigot.OpenAudioMcSpigot
api-version: 1.13
Expand Down

0 comments on commit 8e2d700

Please sign in to comment.