-
-
Save Spottedleaf/dec40400015df81ad2081df35905e3a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private RegionFile a(ChunkCoordIntPair chunkcoordintpair) throws IOException { | |
long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); | |
RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i); | |
if (regionfile != null) { | |
return regionfile; | |
} else { | |
if (this.cache.size() >= 256) { | |
this.cache.removeLast(); // The relevant line. | |
} | |
if (!this.a.exists()) { | |
this.a.mkdirs(); | |
} | |
File file = new File(this.a, "r." + chunkcoordintpair.getRegionX() + "." + chunkcoordintpair.getRegionZ() + ".mca"); | |
RegionFile regionfile1 = new RegionFile(file); | |
this.cache.putAndMoveToFirst(i, regionfile1); | |
return regionfile1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment