Skip to content

Commit eec2fd2

Browse files
committed
Update BigArrayList dependency
- Implement new iterable BigArrayList in various places - Fix formatting in build.gradle
1 parent 37b3f92 commit eec2fd2

File tree

4 files changed

+21
-56
lines changed

4 files changed

+21
-56
lines changed

build.gradle

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,34 @@ loom {
3131
// dependency repositories
3232
repositories {
3333
mavenCentral()
34+
maven { url = "https://maven.minecrafttas.com/main" }
3435
maven { url = 'https://raw.githubusercontent.com/BleachDev/cursed-mappings/main/' }
3536
maven { url = "https://jitpack.io" }
36-
maven { url = "https://maven.mgnet.work/main" }
3737
maven { url = 'https://repo.spongepowered.org/maven' }
3838
}
3939

4040
// dependency configurations
4141
configurations {
42-
// non-transitive download mod dependency
43-
downloadMod.transitive = false
4442
// embed dependency included in build
4543
implementation.extendsFrom(embed)
4644
}
4745

4846
// dependencies
4947
dependencies {
5048
// tasmod dependencies
51-
embed group: 'com.dselent', name: 'bigarraylist', version: '1.1'
52-
//compileOnly group: 'com.minecrafttas', name: 'killtherng', version: '2.0'
53-
//downloadMod group: 'com.minecrafttas', name: 'killtherng-full', version: '2.0' // for downloadKTRNG task
49+
embed "com.dselent:bigarraylist:1.5"
50+
embed "com.github.KaptainWutax:SeedUtils:b6a383113c"
5451

5552
// loom dependencies
5653
minecraft "com.mojang:minecraft:${project.minecraft_version}"
5754
mappings "net.legacyfabric:yarn:${project.minecraft_version}+build.mcp"
5855
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
56+
57+
// testing dependencies
5958
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.3'
6059
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
6160
}
6261

63-
// task for downloading KillTheRng
64-
//task downloadKTRNG(type: Copy) {
65-
//group 'tasmod'
66-
//description 'Download KillTheRNG to the run/mods/ folder of the project'
67-
//from configurations.downloadMod
68-
//into 'run/mods/'
69-
//}
7062

7163
compileJava {
7264
options.release = 8
@@ -104,11 +96,11 @@ tasks.named('test', Test) {
10496
}
10597

10698
spotless {
107-
encoding 'UTF-8'
108-
lineEndings 'UNIX'
109-
java {
110-
importOrderFile('formatter/TASmodImportorder.txt')
111-
eclipse().configFile('formatter/TASmodFormatter.xml')
112-
}
113-
enforceCheck false
99+
encoding 'UTF-8'
100+
lineEndings 'UNIX'
101+
java {
102+
importOrderFile('formatter/TASmodImportorder.txt')
103+
eclipse().configFile('formatter/TASmodFormatter.xml')
104+
}
105+
enforceCheck false
114106
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pluginManagement {
33
// add repositories for plugins
44
repositories {
5-
maven { url = 'https://maven.mgnet.work/main' }
5+
maven { url = "https://maven.minecrafttas.com/main" }
66
maven { url = 'https://maven.fabricmc.net/' }
77
maven { url = 'https://repo.legacyfabric.net/repository/legacyfabric/' }
88
mavenCentral()

src/test/java/tasmod/playback/tasfile/PlaybackSerialiserTest.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import static org.junit.jupiter.api.Assertions.fail;
88

99
import java.io.IOException;
10-
import java.io.Serializable;
1110
import java.nio.file.Files;
1211
import java.nio.file.Path;
1312
import java.nio.file.Paths;
@@ -200,7 +199,7 @@ void testSerialiser() {
200199

201200
try {
202201
BigArrayList<InputContainer> actual = PlaybackSerialiser.loadFromFile(file, testFlavor);
203-
assertBigArrayList(expected, actual);
202+
assertIterableEquals(expected, actual);
204203
assertEquals("testing", testMetadata.actual);
205204
} catch (PlaybackLoadException | IOException e) {
206205
fail(e);
@@ -267,7 +266,7 @@ void testDeserialiser() throws PlaybackLoadException, IOException {
267266

268267
expected.add(new InputContainer(new VirtualKeyboard(), mouse3, cameraAngle3));
269268

270-
assertBigArrayList(expected, actual);
269+
assertIterableEquals(expected, actual);
271270

272271
assertEquals("Wat", testMetadata.actual);
273272

@@ -278,7 +277,7 @@ void testDeserialiser() throws PlaybackLoadException, IOException {
278277
fclist.add(fccontainer);
279278
fclist.add(new SortedFileCommandContainer());
280279
fclist.add(new SortedFileCommandContainer());
281-
assertBigArrayList(fclist, testFileCommand.getInlineStorage());
280+
assertIterableEquals(fclist, testFileCommand.getInlineStorage());
282281

283282
BigArrayList<SortedFileCommandContainer> fclistEnd = new BigArrayList<>();
284283
SortedFileCommandContainer fccontainerEnd = new SortedFileCommandContainer();
@@ -290,7 +289,7 @@ void testDeserialiser() throws PlaybackLoadException, IOException {
290289
fclistEnd.add(fccontainerEnd);
291290
fclistEnd.add(new SortedFileCommandContainer());
292291
fclistEnd.add(new SortedFileCommandContainer());
293-
assertBigArrayList(fclistEnd, testFileCommand.getEndlineStorage());
292+
assertIterableEquals(fclistEnd, testFileCommand.getEndlineStorage());
294293
}
295294

296295
@Test
@@ -353,7 +352,7 @@ void testDeserialiserNoExtensions() throws PlaybackLoadException, IOException {
353352

354353
expected.add(new InputContainer(new VirtualKeyboard(), mouse3, cameraAngle3));
355354

356-
assertBigArrayList(expected, actual);
355+
assertIterableEquals(expected, actual);
357356

358357
assertEquals("e", testMetadata.actual);
359358

@@ -389,18 +388,5 @@ void testFlavorIsNull() {
389388
});
390389

391390
assertEquals("Flavor name NotAFlavor doesn't exist.", t.getMessage());
392-
393-
}
394-
395-
private <T extends Serializable> void assertBigArrayList(BigArrayList<T> expected, BigArrayList<T> actual) {
396-
assertIterableEquals(convertBigArrayListToArrayList(expected), convertBigArrayListToArrayList(actual));
397-
}
398-
399-
private <T extends Serializable> ArrayList<T> convertBigArrayListToArrayList(BigArrayList<T> list) {
400-
ArrayList<T> out = new ArrayList<>();
401-
for (long i = 0; i < list.size(); i++) {
402-
out.add(list.get(i));
403-
}
404-
return out;
405391
}
406392
}

src/test/java/tasmod/playback/tasfile/SerialiserFlavorBaseTest.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import static org.junit.jupiter.api.Assertions.assertThrows;
77
import static org.junit.jupiter.api.Assertions.assertTrue;
88

9-
import java.io.Serializable;
109
import java.util.ArrayList;
1110
import java.util.HashSet;
1211
import java.util.LinkedHashMap;
@@ -231,7 +230,7 @@ void testSerialiseContainer() {
231230
expected.add("\t3|||4.0;4.0");
232231

233232
// C o m p a r e
234-
assertBigArrayList(expected, actual);
233+
assertIterableEquals(expected, actual);
235234
}
236235

237236
/**
@@ -714,7 +713,7 @@ void testDeserialiseContainer() {
714713

715714
expected.add(new InputContainer(keyboard, mouse, cameraAngle));
716715

717-
assertBigArrayList(expected, actual);
716+
assertIterableEquals(expected, actual);
718717
}
719718

720719
/**
@@ -733,7 +732,7 @@ void testSplitInputs() {
733732
List<String> actualComment = new ArrayList<>();
734733
UnsortedFileCommandContainer actualFileCommand = new UnsortedFileCommandContainer();
735734

736-
splitInputs(tick, actualKeyboard, actualMouse, actualCameraAngle, actualComment, actualFileCommand);
735+
splitTickLines(tick, actualKeyboard, actualMouse, actualCameraAngle, actualComment, actualFileCommand);
737736

738737
List<String> expectedKeyboard = new ArrayList<>();
739738
List<String> expectedMouse = new ArrayList<>();
@@ -1078,18 +1077,6 @@ void testYawUnclamping() {
10781077
assertEquals(-190f, unclampYaw(170f, -170f));
10791078
}
10801079

1081-
private <T extends Serializable> void assertBigArrayList(BigArrayList<T> expected, BigArrayList<T> actual) {
1082-
assertIterableEquals(convertBigArrayListToArrayList(expected), convertBigArrayListToArrayList(actual));
1083-
}
1084-
1085-
private <T extends Serializable> ArrayList<T> convertBigArrayListToArrayList(BigArrayList<T> list) {
1086-
ArrayList<T> out = new ArrayList<>();
1087-
for (long i = 0; i < list.size(); i++) {
1088-
out.add(list.get(i));
1089-
}
1090-
return out;
1091-
}
1092-
10931080
@Override
10941081
public SerialiserFlavorBase clone() {
10951082
return new SerialiserFlavorBaseTest();

0 commit comments

Comments
 (0)