Skip to content

Commit 778be07

Browse files
committed
Remove build.gradle (unsupported)
1 parent 56f5c04 commit 778be07

File tree

6 files changed

+59
-101
lines changed

6 files changed

+59
-101
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ Desktop.ini
174174

175175
.cursorrules
176176
.windsurfrules
177+
context.json
178+
run.sh
177179

178180
# Compiled class file
179181
*.class

build.gradle

Lines changed: 0 additions & 95 deletions
This file was deleted.

pom.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<properties>
77
<project.branch></project.branch>
88
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9+
<skipTests>true</skipTests>
910
</properties>
1011
<build>
1112
<resources>
@@ -28,6 +29,18 @@
2829
<source>11</source>
2930
<target>11</target>
3031
</configuration>
32+
<executions>
33+
<execution>
34+
<id>default-testCompile</id>
35+
<phase>test-compile</phase>
36+
<goals>
37+
<goal>testCompile</goal>
38+
</goals>
39+
<configuration>
40+
<skip>${skipTests}</skip>
41+
</configuration>
42+
</execution>
43+
</executions>
3144
</plugin>
3245
<plugin>
3346
<groupId>org.apache.maven.plugins</groupId>
@@ -87,6 +100,17 @@
87100
</execution>
88101
</executions>
89102
</plugin>
103+
<plugin>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-surefire-plugin</artifactId>
106+
<version>3.2.3</version>
107+
<configuration>
108+
<systemPropertyVariables>
109+
<plugin.version>${project.version}</plugin.version>
110+
</systemPropertyVariables>
111+
<skipTests>${skipTests}</skipTests>
112+
</configuration>
113+
</plugin>
90114
</plugins>
91115
</build>
92116
<repositories>
@@ -174,5 +198,30 @@
174198
<version>3.2-BETA</version>
175199
<scope>provided</scope>
176200
</dependency>
201+
<!-- Test dependencies -->
202+
<dependency>
203+
<groupId>org.junit.jupiter</groupId>
204+
<artifactId>junit-jupiter-api</artifactId>
205+
<version>5.10.1</version>
206+
<scope>test</scope>
207+
</dependency>
208+
<dependency>
209+
<groupId>org.junit.jupiter</groupId>
210+
<artifactId>junit-jupiter-engine</artifactId>
211+
<version>5.10.1</version>
212+
<scope>test</scope>
213+
</dependency>
214+
<dependency>
215+
<groupId>org.mockito</groupId>
216+
<artifactId>mockito-core</artifactId>
217+
<version>5.10.0</version>
218+
<scope>test</scope>
219+
</dependency>
220+
<dependency>
221+
<groupId>org.mockito</groupId>
222+
<artifactId>mockito-junit-jupiter</artifactId>
223+
<version>5.10.0</version>
224+
<scope>test</scope>
225+
</dependency>
177226
</dependencies>
178227
</project>

src/main/java/net/coreprotect/CoreProtect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void onDisable() {
6060
ShutdownService.safeShutdown(this);
6161
}
6262

63-
public boolean isAdvancedChestsEnabled(){
63+
public boolean isAdvancedChestsEnabled() {
6464
return advancedChestsEnabled;
6565
}
6666
}

src/main/java/net/coreprotect/CoreProtectAPI.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@
2828
import net.coreprotect.database.rollback.Rollback;
2929
import net.coreprotect.language.Phrase;
3030
import net.coreprotect.listener.player.InventoryChangeListener;
31-
import net.coreprotect.utility.BlockUtils;
3231
import net.coreprotect.utility.Chat;
3332
import net.coreprotect.utility.EntityUtils;
3433
import net.coreprotect.utility.MaterialUtils;
3534
import net.coreprotect.utility.StringUtils;
36-
import net.coreprotect.utility.Util;
3735
import net.coreprotect.utility.WorldUtils;
3836

3937
public class CoreProtectAPI extends Queue {
@@ -196,7 +194,7 @@ public boolean hasPlaced(String user, Block block, int time, int offset) {
196194
boolean match = false;
197195

198196
if (Config.getGlobal().API_ENABLED) {
199-
long timestamp = System.currentTimeMillis();
197+
long timestamp = getCurrentTimeMillis();
200198
long offsetTime = timestamp - offset * 1000L;
201199
List<String[]> check = blockLookup(block, time);
202200

@@ -217,7 +215,7 @@ public boolean hasRemoved(String user, Block block, int time, int offset) {
217215
boolean match = false;
218216

219217
if (Config.getGlobal().API_ENABLED) {
220-
long timestamp = System.currentTimeMillis();
218+
long timestamp = getCurrentTimeMillis();
221219
long offsetTime = timestamp - offset * 1000L;
222220
List<String[]> check = blockLookup(block, time);
223221

@@ -233,6 +231,10 @@ public boolean hasRemoved(String user, Block block, int time, int offset) {
233231
return match;
234232
}
235233

234+
protected long getCurrentTimeMillis() {
235+
return System.currentTimeMillis();
236+
}
237+
236238
public boolean isEnabled() {
237239
return Config.getGlobal().API_ENABLED;
238240
}

src/main/java/net/coreprotect/database/rollback/RollbackProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static boolean processChunk(int finalChunkX, int finalChunkZ, long chunkK
9494

9595
List<Object> meta = null;
9696
if (rowMeta != null) {
97-
meta = Rollback.deserializeMetadata(rowMeta);
97+
meta = RollbackUtil.deserializeMetadata(rowMeta);
9898
}
9999

100100
BlockData blockData = null;

0 commit comments

Comments
 (0)