Skip to content

Commit 20ceb8a

Browse files
committed
Add unit test dependencies, remove unnecessary RegistryFriendlyByteBuf usage
1 parent c77d90b commit 20ceb8a

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ dependencies {
2121
runtimeOnly(libs.ae2wtlib)
2222

2323
implementation(libs.teampe)
24+
25+
testImplementation(testlibs.junit.jupiter)
26+
testImplementation(testlibs.assertj)
27+
testImplementation(testlibs.neoforge.test)
28+
testRuntimeOnly(testlibs.junit.platform)
2429
}
2530

2631
neoForge {

settings.gradle.kts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ run {
3838
}
3939

4040
versionCatalogs {
41+
val mc = "1.21.1"
42+
val maj = mc.substringAfter('.')
43+
val nf = "${maj + (if (!maj.contains('.')) ".0" else "")}.119"
44+
4145
create("libs") {
42-
val mc = "1.21.1"
4346
version("minecraft", mc)
44-
45-
val nf = mc.substringAfter('.')
46-
version("neoforge", "${nf + (if (!nf.contains('.')) ".0" else "")}.119")
47+
version("neoforge", nf)
4748
version("parchment", "2024.11.17")
4849

4950
library("ae2", "org.appliedenergistics", "appliedenergistics2").version("19.2.9")
@@ -55,6 +56,13 @@ run {
5556

5657
library("teampe", "curse.maven", "team-projecte-689273").version("5402805")
5758
}
59+
60+
create("testlibs") {
61+
library("neoforge-test", "net.neoforged", "testframework").version(nf)
62+
library("junit-jupiter", "org.junit.jupiter", "junit-jupiter").version("5.7.1")
63+
library("junit-platform", "org.junit.platform", "junit-platform-launcher").version("1.11.4")
64+
library("assertj", "org.assertj", "assertj-core").version("3.26.0")
65+
}
5866
}
5967
}
6068
}

src/main/java/gripe/_90/appliede/me/misc/LearnAllItemsPacket.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.jetbrains.annotations.NotNull;
44

5-
import net.minecraft.network.RegistryFriendlyByteBuf;
65
import net.minecraft.network.codec.StreamCodec;
76
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
87
import net.neoforged.neoforge.network.handling.IPayloadContext;
@@ -15,12 +14,13 @@
1514
import gripe._90.appliede.api.KnowledgeService;
1615
import gripe._90.appliede.menu.TransmutationTerminalMenu;
1716

17+
import io.netty.buffer.ByteBuf;
18+
1819
public class LearnAllItemsPacket implements CustomPacketPayload {
1920
public static final LearnAllItemsPacket INSTANCE = new LearnAllItemsPacket();
2021

2122
public static final Type<LearnAllItemsPacket> TYPE = new CustomPacketPayload.Type<>(AppliedE.id("learn_all"));
22-
public static final StreamCodec<RegistryFriendlyByteBuf, LearnAllItemsPacket> STREAM_CODEC =
23-
StreamCodec.unit(INSTANCE);
23+
public static final StreamCodec<ByteBuf, LearnAllItemsPacket> STREAM_CODEC = StreamCodec.unit(INSTANCE);
2424

2525
private LearnAllItemsPacket() {}
2626

0 commit comments

Comments
 (0)