Skip to content

Commit

Permalink
Merge neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfudge committed Jan 21, 2025
2 parents 7846662 + 0930254 commit e0e6bc2
Show file tree
Hide file tree
Showing 59 changed files with 304,857 additions and 535 deletions.

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions TestFabricMod/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,6 @@ jar {
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

java {
toolchain {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"mappings": {
"io/github/natanfudge/nectest/mixin/ExampleMixin": {
"init()V": "Lnet/minecraft/class_442;method_25426()V"
},
"io/github/natanfudge/nectest/mixin/MixinMinecraftServer": {
"Lnet/minecraft/server/MinecraftServer;endTickMetrics()V": "Lnet/minecraft/server/MinecraftServer;method_24490()V",
"runServer": "Lnet/minecraft/server/MinecraftServer;method_29741()V"
}
},
"data": {
"named:intermediary": {
"io/github/natanfudge/nectest/mixin/ExampleMixin": {
"init()V": "Lnet/minecraft/class_442;method_25426()V"
},
"io/github/natanfudge/nectest/mixin/MixinMinecraftServer": {
"Lnet/minecraft/server/MinecraftServer;endTickMetrics()V": "Lnet/minecraft/server/MinecraftServer;method_24490()V",
"runServer": "Lnet/minecraft/server/MinecraftServer;method_29741()V"
}
}
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions TestFabricMod/build/resources/main/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"schemaVersion": 1,
"id": "nec_testmod",
"version": "1.0.0",

"name": "Not Enough Crashes Test Mod",
"description": "Tests Not Enough Crashes",
"authors": [
"Fudge"
],
"contact": {
"sources": "https://github.com/natanfudge/Not-Enough-Crashes"
},

"license": "MIT",

"environment": "*",
"entrypoints": {
"main": [
"io.github.natanfudge.nectest.NecTestMod"
],
"client": [
"io.github.natanfudge.nectest.NecTestModClient"
]
},
"mixins": [
"nec_testmod.mixins.json"
],

"depends": {
"fabricloader": ">=0.11.3",
"java": ">=16"
},
"suggests": {
"another-mod": "*"
}
}
15 changes: 15 additions & 0 deletions TestFabricMod/build/resources/main/nec_testmod.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"required": true,
"minVersion": "0.8",
"package": "io.github.natanfudge.nectest.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"MixinMinecraftServer"
],
"client": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
}

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
76 changes: 38 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
alias libs.plugins.architectury.loom apply false
// alias libs.plugins.loom.quiltflower apply false
alias libs.plugins.minotaur apply false
alias libs.plugins.architectury.plugin
alias libs.plugins.cursegradle
Expand All @@ -11,41 +10,43 @@ architectury {
minecraft = libs.versions.minecraft.get()
}



subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: 'dev.architectury.loom'
apply plugin: 'architectury-plugin'
apply plugin: 'maven-publish'
apply plugin: "com.modrinth.minotaur"
apply plugin: 'com.matthewprenger.cursegradle'
// apply plugin: "com.modrinth.minotaur"
// apply plugin: "io.github.juuxel.loom-quiltflower"

dependencies {
minecraft libs.minecraft
// The following line declares the mojmap mappings, you may use other mappings as well
mappings "net.fabricmc:yarn:${libs.versions.yarn.mappings.get()}:v2"
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"

ext.mod_version = libs.versions.mod.version.get()
ext.minecraft_version = libs.versions.minecraft.get()
ext.total_version = "$mod_version+$minecraft_version"
def modVersion = libs.versions.mod.version.get()
def minecraftVersion = libs.versions.minecraft.get()
def total_version = "$modVersion+$minecraftVersion"
ext.total_version = total_version

def cf = libs.versions.overrides.curseforge.get()
def mr = libs.versions.overrides.modrinth.get()

ext.curseforge_mc_version = cf == 'mc' ? minecraft_version : cf
ext.modrinth_mc_version = mr == 'mc' ? minecraft_version : mr
ext.curseforge_mc_version = cf == 'mc' ? minecraftVersion : cf
ext.modrinth_mc_version = mr == 'mc' ? minecraftVersion : mr
ext.release_type = libs.versions.release.type.get()

archivesBaseName = rootProject.archives_base_name
version = ext.total_version
group = rootProject.maven_group

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
base {
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
archivesName = "$rootProject.archives_base_name-$project.name"
}

dependencies {
minecraft libs.minecraft
mappings loom.layered {
it.mappings("net.fabricmc:yarn:${libs.versions.yarn.mappings.version.get()}:v2")
it.mappings libs.yarn.mappings.patch.neoforge
}
}

java {
Expand All @@ -56,26 +57,25 @@ allprojects {
}

}

task publishAll {
group = "upload"
dependsOn("fabric:publishFabric")
// dependsOn("forge:publishForge")
dependsOn("forge:publishForge")
}

task addTestFabricMod(type: Copy) {
dependsOn project(":TestFabricMod").tasks.build
from "TestFabricMod/build/libs/nec_testmod-1.0.0.jar"
into "fabric/run/mods"
}

task addTestForgeMod(type: Copy) {
//task addTestFabricMod(type: Copy) {
// dependsOn project(":TestFabricMod").tasks.build
// from "TestFabricMod/build/libs/nec_testmod-1.0.0.jar"
// into "fabric/run/mods"
//}
//
//task addTestForgeMod(type: Copy) {
// dependsOn project(":TestForgeMod").tasks.build
// Copy dev jar because there is no support for automatic remapping
from "TestForgeMod/build/libs/nec_testmod-1.0.0-dev-shadow.jar"
into "forge/run/mods"
}

task addTestMods {
dependsOn addTestFabricMod, addTestForgeMod
}
//// Copy dev jar because there is no support for automatic remapping
// from "TestForgeMod/build/libs/nec_testmod-1.0.0-dev-shadow.jar"
// into "forge/run/mods"
//}
//
//task addTestMods {
// dependsOn addTestFabricMod, addTestForgeMod
//}
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 4.4.8
- Removed a fringe feature that was eating away at the computer's memory
# Minecraft 1.20.6
- Starting from Minecraft 1.20.6, NEC supports **only** NeoForge, and not Forge.
### 4.4.7
- Fixed crash in certain cases
### 4.4.6
Expand Down
24 changes: 7 additions & 17 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations
// Do NOT use other classes from fabric loader
modImplementation libs.fabric.loader
}

configurations {
dev
}

artifacts {
dev(jar)
}

architectury {
common("fabric"/*,"forge"*/)
common("fabric","neoforge")
}
repositories {
mavenCentral()

dependencies {
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
// which get remapped to the correct annotations on each platform.
// Do NOT use other classes from Fabric Loader.
modImplementation libs.fabric.loader
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//package fudge.notenoughcrashes.api;
package fudge.notenoughcrashes.api;//package fudge.notenoughcrashes.api;
//
//import java.util.ArrayList;
//import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;

import java.awt.Color;
import java.awt.*;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -38,8 +38,8 @@
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.List;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextWidget;
import net.minecraft.text.Text;
import net.minecraft.util.crash.CrashReport;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import fudge.notenoughcrashes.utils.NecLocalization;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.*;
import net.minecraft.text.ClickEvent;
import net.minecraft.text.MutableText;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.ReportType;
Expand All @@ -33,7 +34,7 @@ public abstract class ProblemScreen extends Screen {
private static final int GREEN = 0x00FF00;
private static final int GRAY = 0x9a9a9a;
private static final Text uploadToCrashyText = NecLocalization.translatedText("notenoughcrashes.gui.uploadToCrashy")
.copy().setStyle(Style.EMPTY.withColor(GREEN));
.copy()/*.setStyle(Style.EMPTY.withColor(GREEN))*/;
private static final Text uploadToCrashyLoadingText = NecLocalization.translatedText("notenoughcrashes.gui.loadingCrashyUpload");

private List<Widget> widgets = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.MessageScreen;
import net.minecraft.text.Text;
import net.minecraft.util.crash.CrashException;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.profiler.DummyRecorder;
import org.apache.logging.log4j.LogManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package fudge.notenoughcrashes.mixins.client;

import net.minecraft.server.MinecraftServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
//
///**
// * Mixin to stop the integrated server from ticking when the game has crashed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package fudge.notenoughcrashes.platform;

import fudge.notenoughcrashes.config.NecConfig;
import org.jetbrains.annotations.Nullable;

import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fudge.notenoughcrashes.stacktrace;

import fudge.notenoughcrashes.config.NecConfig;
import fudge.notenoughcrashes.NotEnoughCrashes;
import fudge.notenoughcrashes.config.NecConfig;
import fudge.notenoughcrashes.platform.CommonModMetadata;
import fudge.notenoughcrashes.platform.ModsByLocation;
import fudge.notenoughcrashes.platform.NecPlatform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import fudge.notenoughcrashes.config.NecConfig;
import fudge.notenoughcrashes.NotEnoughCrashes;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.Arrays;
import java.util.Map;

public final class LegacyCrashLogUpload {
private static String GIST_ACCESS_TOKEN_PART_1() {
Expand Down
7 changes: 4 additions & 3 deletions common/src/main/java/fudge/notenoughcrashes/utils/GlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.BackgroundRenderer;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.*;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL14;


public class GlUtil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//package fudge.notenoughcrashes.utils;
package fudge.notenoughcrashes.utils;//package fudge.notenoughcrashes.utils;
//
//import fudge.notenoughcrashes.config.NecConfig;
//
Expand Down
Loading

0 comments on commit e0e6bc2

Please sign in to comment.