Skip to content

Commit

Permalink
Port to 1.21.4
Browse files Browse the repository at this point in the history
Co-authored-by: coehlrich <[email protected]>
Co-authored-by: Marc Hermans <[email protected]>
Co-authored-by: Matyrobbrt <[email protected]>
Co-authored-by: Minecraftschurli <[email protected]>
Co-authored-by: Technici4n <[email protected]>
Co-authored-by: XFactHD <[email protected]>
  • Loading branch information
6 people committed Dec 3, 2024
1 parent 8e9be9f commit 2c7c3f2
Show file tree
Hide file tree
Showing 345 changed files with 3,904 additions and 4,667 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ build
**/eclipse/
**/runs/

**/out/
**/out/
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ public void writeUserDevConfig() throws IOException {

for (var runType : RunType.values()) {
var launchTarget = switch (runType) {
case CLIENT -> "forgeclientdev";
case DATA -> "forgedatadev";
case GAME_TEST_SERVER, SERVER -> "forgeserverdev";
case JUNIT -> "forgejunitdev";
case CLIENT -> "neoforgeclientdev";
case CLIENT_DATA -> "neoforgeclientdatadev";
case SERVER_DATA -> "neoforgeserverdatadev";
case GAME_TEST_SERVER, SERVER -> "neoforgeserverdev";
case JUNIT -> "neoforgejunitdev";
};

List<String> args = new ArrayList<>();
Expand All @@ -95,7 +96,7 @@ public void writeUserDevConfig() throws IOException {
"--version", getNeoForgeVersion().get());
}

if (runType == RunType.CLIENT || runType == RunType.DATA || runType == RunType.JUNIT) {
if (runType == RunType.CLIENT || runType == RunType.CLIENT_DATA || runType == RunType.JUNIT) {
Collections.addAll(args,
"--assetIndex", "{asset_index}",
"--assetsDir", "{assets_root}");
Expand Down Expand Up @@ -132,9 +133,9 @@ public void writeUserDevConfig() throws IOException {
"--add-opens", "java.base/java.lang.invoke=cpw.mods.securejarhandler",
"--add-exports", "java.base/sun.security.util=cpw.mods.securejarhandler",
"--add-exports", "jdk.naming.dns/com.sun.jndi.dns=java.naming"),
runType == RunType.CLIENT || runType == RunType.JUNIT,
runType == RunType.GAME_TEST_SERVER || runType == RunType.SERVER,
runType == RunType.DATA,
runType == RunType.CLIENT || runType == RunType.JUNIT || runType == RunType.CLIENT_DATA,
runType == RunType.GAME_TEST_SERVER || runType == RunType.SERVER || runType == RunType.SERVER_DATA,
runType == RunType.CLIENT_DATA || runType == RunType.SERVER_DATA,
runType == RunType.CLIENT || runType == RunType.GAME_TEST_SERVER,
runType == RunType.JUNIT,
Map.of(
Expand All @@ -152,7 +153,8 @@ public void writeUserDevConfig() throws IOException {

private enum RunType {
CLIENT("client"),
DATA("data"),
CLIENT_DATA("clientData"),
SERVER_DATA("serverData"),
GAME_TEST_SERVER("gameTestServer"),
SERVER("server"),
JUNIT("junit");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public void apply(Project project) {
var tasks = project.getTasks();
var neoDevBuildDir = project.getLayout().getBuildDirectory().dir("neodev");

var rawNeoFormVersion = project.getProviders().gradleProperty("neoform_version");
var minecraftVersion = project.getProviders().gradleProperty("minecraft_version");
var mcAndNeoFormVersion = minecraftVersion.zip(rawNeoFormVersion, (mc, nf) -> mc + "-" + nf);

var extension = project.getExtensions().create(NeoDevExtension.NAME, NeoDevExtension.class);

var createSources = NeoDevPlugin.configureMinecraftDecompilation(project);
Expand Down Expand Up @@ -54,7 +58,8 @@ public void apply(Project project) {
project.files(),
modulePath -> {},
legacyClasspath -> {},
downloadAssets.flatMap(DownloadAssets::getAssetPropertiesFile)
downloadAssets.flatMap(DownloadAssets::getAssetPropertiesFile),
mcAndNeoFormVersion
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void createArgsFile() throws IOException {
replacements.put("@PLUGIN_LAYER_LIBRARIES@", "");
replacements.put("@GAME_LAYER_LIBRARIES@", "");
replacements.put("@CLASS_PATH@", resolveClasspath());
replacements.put("@TASK@", "forgeserver");
replacements.put("@TASK@", "neoforgeserver");
replacements.put("@FORGE_VERSION@", getNeoForgeVersion().get());
replacements.put("@FML_VERSION@", getFmlVersion().get());
replacements.put("@MC_VERSION@", getMinecraftVersion().get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void createLauncherProfile() throws IOException {
"--fml.fmlVersion", getFmlVersion().get(),
"--fml.mcVersion", getMinecraftVersion().get(),
"--fml.neoFormVersion", getRawNeoFormVersion().get(),
"--launchTarget", "forgeclient"));
"--launchTarget", "neoforgeclient"));

var jvmArguments = new ArrayList<>(List.of(
"-Djava.net.preferIPv6Addresses=system",
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ org.gradle.debug=false
#org.gradle.warning.mode=fail

# renovate: net.neoforged:moddev-gradle
moddevgradle_plugin_version=2.0.47-beta
moddevgradle_plugin_version=2.0.48-beta
# renovate: io.codechicken:DiffPatch
diffpatch_version=2.0.0.35

java_version=21

minecraft_version=1.21.3
neoform_version=20241023.131943
minecraft_version=1.21.4
neoform_version=20241203.161809
# on snapshot versions, used to prefix the version
neoforge_snapshot_next_stable=21.4
neoforge_snapshot_next_stable=21.5

# renovate: net.neoforged.jst:jst-cli-bundle
jst_version=1.0.45
Expand All @@ -43,7 +43,7 @@ jetbrains_annotations_version=24.0.1
slf4j_api_version=2.0.7
apache_maven_artifact_version=3.8.5
jarjar_version=0.4.1
fancy_mod_loader_version=5.0.6
fancy_mod_loader_version=6.0.4
mojang_logging_version=1.1.1
log4j_version=2.22.1
guava_version=31.1.2-jre
Expand Down
6 changes: 3 additions & 3 deletions patches/com/mojang/blaze3d/platform/Window.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/Window.java
+++ b/com/mojang/blaze3d/platform/Window.java
@@ -90,7 +_,8 @@
@@ -91,7 +_,8 @@
GLFW.glfwWindowHint(139267, 2);
GLFW.glfwWindowHint(139272, 204801);
GLFW.glfwWindowHint(139270, 1);
Expand All @@ -10,15 +10,15 @@
if (monitor != null) {
VideoMode videomode = monitor.getPreferredVidMode(this.fullscreen ? this.preferredFullscreenVideoMode : Optional.empty());
this.windowedX = this.x = monitor.getX() + videomode.getWidth() / 2 - this.width / 2;
@@ -102,6 +_,7 @@
@@ -103,6 +_,7 @@
this.windowedX = this.x = aint1[0];
this.windowedY = this.y = aint[0];
}
+ }

GLFW.glfwMakeContextCurrent(this.window);
GL.createCapabilities();
@@ -269,6 +_,7 @@
@@ -273,6 +_,7 @@
GLFW.glfwGetFramebufferSize(this.window, aint, aint1);
this.framebufferWidth = aint[0] > 0 ? aint[0] : 1;
this.framebufferHeight = aint1[0] > 0 ? aint1[0] : 1;
Expand Down
2 changes: 1 addition & 1 deletion patches/com/mojang/blaze3d/systems/RenderSystem.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/systems/RenderSystem.java
+++ b/com/mojang/blaze3d/systems/RenderSystem.java
@@ -822,4 +_,14 @@
@@ -818,4 +_,14 @@
void accept(it.unimi.dsi.fastutil.ints.IntConsumer p_157488_, int p_157489_);
}
}
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/Util.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
@@ -264,8 +_,8 @@
@@ -268,8 +_,8 @@
.getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion()))
.getChoiceType(p_137552_, p_137553_);
} catch (IllegalArgumentException illegalargumentexception) {
Expand All @@ -11,7 +11,7 @@
throw illegalargumentexception;
}
}
@@ -630,20 +_,20 @@
@@ -634,20 +_,20 @@

public static void logAndPauseIfInIde(String p_143786_) {
LOGGER.error(p_143786_);
Expand Down
20 changes: 10 additions & 10 deletions patches/net/minecraft/client/KeyMapping.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/KeyMapping.java
+++ b/net/minecraft/client/KeyMapping.java
@@ -14,9 +_,9 @@
@@ -15,9 +_,9 @@
import net.neoforged.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
Expand All @@ -12,7 +12,7 @@
private static final Set<String> CATEGORIES = Sets.newHashSet();
public static final String CATEGORY_MOVEMENT = "key.categories.movement";
public static final String CATEGORY_MISC = "key.categories.misc";
@@ -42,17 +_,17 @@
@@ -43,17 +_,17 @@
private int clickCount;

public static void click(InputConstants.Key p_90836_) {
Expand All @@ -35,7 +35,7 @@
}

public static void setAll() {
@@ -100,7 +_,7 @@
@@ -101,7 +_,7 @@
}

public boolean isDown() {
Expand All @@ -44,7 +44,7 @@
}

public String getCategory() {
@@ -134,9 +_,13 @@
@@ -135,9 +_,13 @@
}

public int compareTo(KeyMapping p_90841_) {
Expand All @@ -61,7 +61,7 @@
}

public static Supplier<Component> createNameSupplier(String p_90843_) {
@@ -145,6 +_,20 @@
@@ -146,6 +_,20 @@
}

public boolean same(KeyMapping p_90851_) {
Expand All @@ -82,7 +82,7 @@
return this.key.equals(p_90851_.key);
}

@@ -163,11 +_,13 @@
@@ -164,11 +_,13 @@
}

public Component getTranslatedKeyMessage() {
Expand All @@ -97,10 +97,10 @@
}

public String saveString() {
@@ -176,5 +_,86 @@

public void setDown(boolean p_90846_) {
this.isDown = p_90846_;
@@ -182,5 +_,86 @@
@Nullable
public static KeyMapping get(String p_389468_) {
return ALL.get(p_389468_);
+ }
+
+ // Neo: Injected Key Mapping controls
Expand Down
Loading

0 comments on commit 2c7c3f2

Please sign in to comment.