Skip to content

Commit cdf2461

Browse files
committed
v1.4.0.2
1 parent 8f9cabc commit cdf2461

3 files changed

Lines changed: 33 additions & 27 deletions

File tree

.run/Build.run.xml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="Build" type="GradleRunConfiguration" factoryName="Gradle">
3-
<ExternalSystemSettings>
4-
<option name="executionName"/>
5-
<option name="externalProjectPath" value="$PROJECT_DIR$"/>
6-
<option name="externalSystemIdString" value="GRADLE"/>
7-
<option name="scriptParameters" value=""/>
8-
<option name="taskDescriptions">
9-
<list/>
10-
</option>
11-
<option name="taskNames">
12-
<list>
13-
<option value="clean"/>
14-
<option value="build"/>
15-
<option value="shadowJar"/>
16-
<option value="publishMavenPublicationToMavenLocal"/>
17-
</list>
18-
</option>
19-
<option name="vmOptions"/>
20-
</ExternalSystemSettings>
21-
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
22-
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
23-
<DebugAllEnabled>false</DebugAllEnabled>
24-
<method v="2"/>
25-
</configuration>
2+
<configuration default="false" name="Build" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="shadowJar" />
14+
<option value="publishMavenPublicationToMavenLocal" />
15+
</list>
16+
</option>
17+
<option name="vmOptions" />
18+
</ExternalSystemSettings>
19+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
20+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
21+
<DebugAllEnabled>false</DebugAllEnabled>
22+
<RunAsTest>false</RunAsTest>
23+
<method v="2" />
24+
</configuration>
2625
</component>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies {
4040
implementation 'de.tr7zw:item-nbt-api:2.13.1'
4141
implementation 'com.github.Redempt:RedLib:6.6.1'
4242
implementation 'com.github.Redempt:Crunch:2.0.3'
43-
implementation 'com.github.cryptomorin:XSeries:11.1.0'
43+
implementation 'com.github.cryptomorin:XSeries:11.2.0'
4444
implementation 'com.github.Revxrsal.Lamp:common:3.2.1'
4545
implementation 'com.github.Revxrsal.Lamp:bukkit:3.2.1'
4646
implementation 'com.github.Sven65:Item-Names:1.0.2'
@@ -55,7 +55,7 @@ dependencies {
5555
}
5656

5757
group = 'me.byteful.plugin'
58-
version = '1.4.0.1'
58+
version = '1.4.0.2'
5959
description = 'LevelTools'
6060
java.sourceCompatibility = JavaVersion.VERSION_17
6161

src/main/java/me/byteful/plugin/leveltools/api/block/impl/FileBlockDataManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
import java.nio.charset.StandardCharsets;
55
import java.nio.file.Files;
66
import java.nio.file.Path;
7+
import java.util.Collections;
78
import java.util.HashSet;
9+
import java.util.Map;
810
import java.util.Set;
11+
import java.util.concurrent.ConcurrentHashMap;
912
import java.util.stream.Collectors;
13+
14+
import com.google.common.collect.Sets;
1015
import me.byteful.plugin.leveltools.api.block.BlockDataManager;
1116
import me.byteful.plugin.leveltools.api.block.BlockPosition;
1217
import me.byteful.plugin.leveltools.api.scheduler.ScheduledTask;
1318
import me.byteful.plugin.leveltools.api.scheduler.Scheduler;
1419
import me.byteful.plugin.leveltools.util.Text;
1520

1621
public class FileBlockDataManager implements BlockDataManager {
17-
private final Set<BlockPosition> cache = new HashSet<>();
22+
private static final int MAX_CACHE_SIZE = 10_000;
23+
private final Set<BlockPosition> cache = ConcurrentHashMap.newKeySet();
1824
private final Path file;
1925
private final ScheduledTask saveTask;
2026

@@ -45,6 +51,7 @@ public boolean isPlacedBlock(BlockPosition pos) {
4551

4652
@Override
4753
public void addPlacedBlock(BlockPosition pos) {
54+
if (cache.size() >= MAX_CACHE_SIZE) return;
4855
cache.add(pos);
4956
}
5057

0 commit comments

Comments
 (0)