Skip to content

Commit

Permalink
Remove dep on CommonNetworks
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Nov 6, 2023
1 parent 92de40f commit ead950b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 77 deletions.
2 changes: 0 additions & 2 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ dependencies {

modCompileOnly("org.quiltmc:quilt-loader:${quilt_loader_version}")

implementation 'mysticdrew:common-networking-common:1.0.1-1.20.1'

implementation("com.github.llamalad7.mixinextras:mixinextras-common:0.2.0-beta.9")
annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:0.2.0-beta.9")

Expand Down
3 changes: 1 addition & 2 deletions Common/src/main/java/dhyces/trimmed/Trimmed.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dhyces.trimmed;

import dhyces.trimmed.impl.network.Networking;
import dhyces.trimmed.modhelper.services.Services;
import net.minecraft.resources.ResourceLocation;
import org.slf4j.Logger;
Expand All @@ -15,7 +14,7 @@ public static ResourceLocation id(String id) {
public static final Logger LOGGER = LoggerFactory.getLogger("Trimmed");

public static void init() {
Networking.init();
// Networking.init();
}

public static void logInDev(String str) {
Expand Down
14 changes: 6 additions & 8 deletions Common/src/main/java/dhyces/trimmed/TrimmedClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import dhyces.trimmed.impl.client.models.template.ModelTemplateManager;
import dhyces.trimmed.impl.client.tags.manager.ClientTagManager;
import dhyces.trimmed.impl.mixin.client.ReloadableResourceManagerImplAccessor;
import dhyces.trimmed.impl.network.Networking;
import dhyces.trimmed.modhelper.network.handler.SimplePacketHandler;
import net.minecraft.Util;
//import dhyces.trimmed.impl.network.Networking;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.RegistryAccess;
Expand All @@ -20,11 +18,11 @@

public class TrimmedClient {

public static final SimplePacketHandler CLIENT_HANDLER = Util.make(new SimplePacketHandler(), handler -> {
handler.registerPacketConsumer(Networking.SYNC_MAPS, context -> {
Minecraft.getInstance().player.displayClientMessage(context.message().stack.getDisplayName(), false);
});
});
// public static final SimplePacketHandler CLIENT_HANDLER = Util.make(new SimplePacketHandler(), handler -> {
// handler.registerPacketConsumer(Networking.SYNC_MAPS, context -> {
// Minecraft.getInstance().player.displayClientMessage(context.message().stack.getDisplayName(), false);
// });
// });

public static void init() {
TrimmedSpriteSourceTypes.bootstrap();
Expand Down
23 changes: 0 additions & 23 deletions Common/src/main/java/dhyces/trimmed/impl/network/Networking.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package dhyces.trimmed.modhelper.network.handler;

import commonnetwork.networking.data.PacketContext;
import dhyces.trimmed.modhelper.network.packet.CommonPacket;

@FunctionalInterface
//@FunctionalInterface
public interface PacketConsumer {
<T extends CommonPacket<T>> void handle(PacketContext<T> context);

// <T extends CommonPacket<T>> void handle(PacketContext<T> context);
//
interface Typed<T extends CommonPacket<T>> extends PacketConsumer {
@Override
default <T extends CommonPacket<T>> void handle(PacketContext<T> context) {
handleTyped(cast(context));
}

private <T> T cast(Object o) {
return (T) o;
}

void handleTyped(PacketContext<T> context);
// @Override
// default <T extends CommonPacket<T>> void handle(PacketContext<T> context) {
// handleTyped(cast(context));
// }
//
// private <T> T cast(Object o) {
// return (T) o;
// }
//
// void handleTyped(PacketContext<T> context);
}
}
2 changes: 0 additions & 2 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ dependencies {
exclude module: "fabric-models-v0"
}

include(modImplementation 'mysticdrew:common-networking-fabric:1.0.1-1.20.1')

include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9")))

implementation project(path: ":Common", configuration: "namedElements")
Expand Down
5 changes: 0 additions & 5 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

implementation fg.deobf('mysticdrew:common-networking-forge:1.0.1-1.20.1')
jarJar('mysticdrew:common-networking-forge:1.0.1-1.20.1') {
jarJar.ranged(it, "[1.0.0,2.0.0)")
}

implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:0.2.0-beta.9"))
implementation(jarJar("com.github.llamalad7.mixinextras:mixinextras-forge:0.2.0-beta.9")) {
jarJar.ranged(it, "[0.2.0-beta.9,)")
Expand Down

0 comments on commit ead950b

Please sign in to comment.