Adds a limit to the number of positions in the back cache
This commit is contained in:
parent
f0dec14b80
commit
ed20b4f5fb
2 changed files with 6 additions and 1 deletions
|
@ -49,7 +49,7 @@ mod_name=Aria's Essentials
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GPLv3
|
mod_license=GPLv3
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.2.011524.2032
|
mod_version=1.2.011524.2039
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -25,6 +25,11 @@ public class BackPositionCaches
|
||||||
ListTag backCaches = prof.NBT.getList("back_positions", CompoundTag.TAG_COMPOUND);
|
ListTag backCaches = prof.NBT.getList("back_positions", CompoundTag.TAG_COMPOUND);
|
||||||
backCaches.add(pos.serialize());
|
backCaches.add(pos.serialize());
|
||||||
|
|
||||||
|
while(backCaches.size()>10)
|
||||||
|
{
|
||||||
|
backCaches.remove(backCaches.size()-1);
|
||||||
|
}
|
||||||
|
|
||||||
prof.commit();
|
prof.commit();
|
||||||
} else {
|
} else {
|
||||||
ListTag backCaches = new ListTag();
|
ListTag backCaches = new ListTag();
|
||||||
|
|
Loading…
Reference in a new issue