Skip to content

Commit

Permalink
update mafglib version, neonetwork -> badpackets
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jul 14, 2024
1 parent 6424ae0 commit fda1e67
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
## Change
- sync from `sakura-ryoko/litematica`
- update mafglib version
- `neonetwork` -> `badpackets`
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Forgematica

**This mod requires [BadPackets](https://modrinth.com/mod/badpackets) in 1.20.4 and above.**

Litematica unofficial (Neo)Forge port.

**Require [MaLiLib-Forge](https://github.com/ThinkingStudios/MaLiLib-Forge).**
Expand Down
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ repositories {
maven { url "https://www.jitpack.io" }
maven { url "https://maven.neoforged.net/releases/" }
maven { url 'https://api.modrinth.com/maven' }
maven {
url "https://maven2.bai.lol"
content {
includeGroup "lol.bai"
}
}
}

dependencies {
Expand All @@ -23,7 +29,7 @@ dependencies {
neoForge libs.neoforge

modImplementation libs.mafglib
modImplementation libs.neonetwork
modImplementation libs.badpackets

implementation libs.jsr305
}
Expand Down Expand Up @@ -82,6 +88,6 @@ publisher {
setCurseEnvironment("client")
setArtifact(remapJar)
addAdditionalFile(sourcesJar)
curseDepends { required("mafglib") }
modrinthDepends { required("mafglib") }
curseDepends.required("mafglib", "badpackets")
modrinthDepends.required("mafglib", "badpackets")
}
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mappings_patch="1.21+build.4"
neoforge="21.0.60-beta"

# Mod properties
version="0.1.6"
version="0.1.7"
maven-group="org.thinkingstudio.forgematica"
archives-name="Forgematica"

Expand All @@ -18,8 +18,8 @@ id-modrinth="dCKRaeBC"
id-curseforge="912441"

# Mod dependencies
mafglib="0.1.14-mc1.21"
neonetwork="0.1.5+mc1.21"
mafglib="0.1.16-mc1.21"
badpackets="neo-0.8.1"

# Libraries
jsr305="3.0.2"
Expand All @@ -34,7 +34,7 @@ yarn-mappings = { group = "net.fabricmc", name = "yarn", version.ref = "yarn_map
yarn-mappings-patch = { group = "dev.architectury", name = "yarn-mappings-patch-neoforge", version.ref = "mappings_patch"}

neoforge = { group = "net.neoforged", name = "neoforge", version.ref = "neoforge" }
neonetwork = { group = "maven.modrinth", name = "neonetwork", version.ref = "neonetwork" }
badpackets = { group = "lol.bai", name = "badpackets", version.ref = "badpackets" }
mafglib = { group = "maven.modrinth", name = "mafglib", version.ref = "mafglib"}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fi.dy.masa.litematica.network;

import io.netty.buffer.Unpooled;
import lol.bai.badpackets.api.play.ClientPlayContext;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.PacketByteBuf;
Expand All @@ -15,16 +16,16 @@
import fi.dy.masa.litematica.data.EntitiesDataStorage;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.thinkingstudio.fabric.api.client.networking.v1.ClientPlayNetworking;
//import org.thinkingstudio.fabric.api.client.networking.v1.ClientPlayNetworking;

@OnlyIn(Dist.CLIENT)
public abstract class ServuxLitematicaHandler<T extends CustomPayload> implements IPluginClientPlayHandler<T>
{
private final static ServuxLitematicaHandler<ServuxLitematicaPacket.Payload> INSTANCE = new ServuxLitematicaHandler<>()
{
@Override
public void receive(ServuxLitematicaPacket.Payload payload, ClientPlayNetworking.Context context) {
ServuxLitematicaHandler.INSTANCE.receivePlayPayload(payload, context);
public void receive(ClientPlayContext context, ServuxLitematicaPacket.Payload payload) {
ServuxLitematicaHandler.INSTANCE.receivePlayPayload(context, payload);
}
};
public static ServuxLitematicaHandler<ServuxLitematicaPacket.Payload> getInstance() { return INSTANCE; }
Expand Down Expand Up @@ -127,7 +128,7 @@ public void resetFailures(Identifier channel)
}

@Override
public void receivePlayPayload(T payload, ClientPlayNetworking.Context ctx)
public void receivePlayPayload(ClientPlayContext ctx, T payload)
{
if (payload.getId().id().equals(CHANNEL_ID))
{
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

[[dependencies.forgematica]]
modId = "badpackets"
type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

0 comments on commit fda1e67

Please sign in to comment.