Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
update neoforge version, code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed May 3, 2024
1 parent ff2cee3 commit 8790388
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 68 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
plugins {
id "dev.architectury.loom" version "1.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5-SNAPSHOT"
id "maven-publish"
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
base.archivesName = project.archives_base_name
version = "${project.mod_version}+mc${project.minecraft_version}"
group = project.maven_group

Expand Down Expand Up @@ -39,6 +37,9 @@ tasks.withType(JavaCompile) {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withSourcesJar()
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ loom.platform=neoforge

# Base properties
minecraft_version=1.20.4
neoforge_version=20.4.169
neoforge_version=20.4.234
yarn_mappings=1.20.4+build.3

# Mod Properties
mod_version=0.1.1
mod_version=0.1.2
maven_group=org.thinkingstudio.forged_networking
archives_base_name=ForgedNetworking
mod_id=forged_networking
Expand Down
55 changes: 0 additions & 55 deletions src/main/java/net/fabricmc/fabric/api/event/AutoInvokingEvent.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package net.fabricmc.fabric.impl.networking;

import net.neoforged.fml.loading.FMLLoader;
import org.slf4j.Logger;

import net.minecraft.util.Identifier;
Expand All @@ -35,7 +36,7 @@ public final class NetworkingImpl {
*/
public static final boolean FORCE_PACKET_SERIALIZATION = Boolean.parseBoolean(System.getProperty(
"fabric-api.networking.force-packet-serialization",
Boolean.toString(ForgedNetworkingAPI.isDevelopmentEnvironment())));
Boolean.toString(!FMLLoader.isProduction())));

/**
* Id of packet used to register supported channels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public ForgedNetworkingAPI() {
ClientNetworkingImpl.clientInit();
}

if (ForgedNetworkingAPI.isDevelopmentEnvironment()) {
if (!FMLLoader.isProduction()) {
NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, RegisterCommandsEvent.class, event -> {
if (SharedConstants.isDevelopment) {
// Command is registered when isDevelopment is set.
return;
}

if (!ForgedNetworkingAPI.isDevelopmentEnvironment()) {
if (FMLLoader.isProduction()) {
// Only register this command in a dev env
return;
}
Expand All @@ -43,8 +43,4 @@ public ForgedNetworkingAPI() {
});
}
}

public static boolean isDevelopmentEnvironment() {
return !FMLLoader.isProduction();
}
}

0 comments on commit 8790388

Please sign in to comment.