Skip to content

Commit

Permalink
Unify tag namespace and conventions between Neoforge and Fabric for 1…
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt authored and shartte committed Apr 16, 2024
1 parent e9e465c commit 87f815d
Show file tree
Hide file tree
Showing 1,865 changed files with 17,499 additions and 15,003 deletions.
36 changes: 22 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,36 @@ plugins {

apply plugin: 'net.neoforged.gradleutils'

gradleutils.version {
minecraftVersion project.minecraft_version
versionPrefix = null // Reset version prefix, which is set by prev. line
tags {
label = 'beta'
cleanMarkerLabel = 'stable'
ext.isPreReleaseVersion = project.minecraft_version.contains("w") || project.minecraft_version.contains("-")

if (isPreReleaseVersion) {
project.version = "${project.neoforge_snapshot_next_stable}.0-alpha.${project.minecraft_version}.${(new Date()).format('yyyyMMdd.HHmmss', TimeZone.getTimeZone('UTC'))}"
} else {
gradleutils.version {
minecraftVersion project.minecraft_version
versionPrefix = null // Reset version prefix, which is set by prev. line
tags {
label = 'beta'
cleanMarkerLabel = 'stable'
}
branches {
suffixBranch = true
}
}
branches {
suffixBranch = true

changelog {
from '20.4'
disableAutomaticPublicationRegistration()
}
}

changelog {
from '20.4'
disableAutomaticPublicationRegistration()
project.version = gradleutils.getTagOffsetVersion()
}

// Print version, generally useful to know - also appears on CI
System.out.println("NeoForge version ${gradleutils.version.toString()}")
System.out.println("NeoForge version ${project.version}")

allprojects {
version gradleutils.version.toString()
version rootProject.version
group 'net.neoforged'
repositories {
mavenLocal()
Expand Down
14 changes: 8 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ org.gradle.caching=true
org.gradle.configuration-cache=false
org.gradle.debug=false

java_version=17
java_version=21

minecraft_version=1.20.4
neoform_version=20231207.154220
minecraft_version=1.20.5-pre1
neoform_version=20240410.221336
# on snapshot versions, used to prefix the version
neoforge_snapshot_next_stable=20.5

mergetool_version=2.0.0
accesstransformers_version=10.0.1
coremods_version=6.0.4
eventbus_version=7.2.0
modlauncher_version=10.0.9
modlauncher_version=10.1.10
securejarhandler_version=2.1.24
bootstraplauncher_version=1.1.2
asm_version=9.5
Expand All @@ -29,9 +31,9 @@ jetbrains_annotations_version=24.0.1
slf4j_api_version=2.0.7
apache_maven_artifact_version=3.8.5
jarjar_version=0.4.0
fancy_mod_loader_version=2.0.17
fancy_mod_loader_version=3.0.10
mojang_logging_version=1.1.1
log4j_version=2.19.0
log4j_version=2.22.1
guava_version=31.1.2-jre
gson_version=2.10.1
apache_commons_lang3_version=3.13.0
Expand Down
4 changes: 2 additions & 2 deletions patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
+ GlStateManager._texImage2D(3553, 0, org.lwjgl.opengl.GL30.GL_DEPTH32F_STENCIL8, this.width, this.height, 0, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL, org.lwjgl.opengl.GL30.GL_FLOAT_32_UNSIGNED_INT_24_8_REV, null);
}

this.setFilterMode(9728);
this.setFilterMode(9728, true);
@@ -117,7 +_,14 @@
GlStateManager._glBindFramebuffer(36160, this.frameBufferId);
GlStateManager._glFramebufferTexture2D(36160, 36064, 3553, this.colorTextureId, 0);
Expand All @@ -26,7 +26,7 @@
}

this.checkStatus();
@@ -275,4 +_,27 @@
@@ -281,4 +_,27 @@
public int getDepthTextureId() {
return this.depthBufferId;
}
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
@@ -1030,4 +_,14 @@
@@ -1014,4 +_,14 @@
void accept(it.unimi.dsi.fastutil.ints.IntConsumer p_157488_, int p_157489_);
}
}
Expand Down
2 changes: 1 addition & 1 deletion patches/com/mojang/blaze3d/vertex/BufferBuilder.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/BufferBuilder.java
+++ b/com/mojang/blaze3d/vertex/BufferBuilder.java
@@ -495,4 +_,14 @@
@@ -496,4 +_,14 @@
this.sorting = p_277855_;
}
}
Expand Down
4 changes: 2 additions & 2 deletions patches/com/mojang/blaze3d/vertex/PoseStack.java.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- a/com/mojang/blaze3d/vertex/PoseStack.java
+++ b/com/mojang/blaze3d/vertex/PoseStack.java
@@ -12,7 +_,7 @@
import org.joml.Quaternionf;
@@ -13,7 +_,7 @@
import org.joml.Vector3f;

@OnlyIn(Dist.CLIENT)
-public class PoseStack {
Expand Down

This file was deleted.

28 changes: 9 additions & 19 deletions patches/com/mojang/blaze3d/vertex/VertexConsumer.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/VertexConsumer.java
+++ b/com/mojang/blaze3d/vertex/VertexConsumer.java
@@ -14,7 +_,7 @@
@@ -13,7 +_,7 @@
import org.lwjgl.system.MemoryStack;

@OnlyIn(Dist.CLIENT)
Expand All @@ -9,30 +9,20 @@
VertexConsumer vertex(double p_85945_, double p_85946_, double p_85947_);

VertexConsumer color(int p_85973_, int p_85974_, int p_85975_, int p_85976_);
@@ -101,6 +_,10 @@
int p_86003_,
boolean p_86004_
) {
+ putBulkData(p_85996_, p_85997_, p_85998_, p_85999_, p_86000_, p_86001_, 1, p_86002_, p_86003_, p_86004_);
+ }
+
+ default void putBulkData(PoseStack.Pose p_85996_, BakedQuad p_85997_, float[] p_85998_, float p_85999_, float p_86000_, float p_86001_, float alpha, int[] p_86002_, int p_86003_, boolean p_86004_) {
float[] afloat = new float[]{p_85998_[0], p_85998_[1], p_85998_[2], p_85998_[3]};
int[] aint = new int[]{p_86002_[0], p_86002_[1], p_86002_[2], p_86002_[3]};
int[] aint1 = p_85997_.getVertices();
@@ -136,11 +_,13 @@
f5 = afloat[k] * p_86001_;
@@ -139,11 +_,14 @@
f5 = afloat[k] * p_85992_;
}

- int l = aint[k];
+ int l = applyBakedLighting(p_86002_[k], bytebuffer);
+ int l = applyBakedLighting(p_331378_[k], bytebuffer);
float f9 = bytebuffer.getFloat(16);
float f10 = bytebuffer.getFloat(20);
Vector4f vector4f = matrix4f.transform(new Vector4f(f, f1, f2, 1.0F));
- this.vertex(vector4f.x(), vector4f.y(), vector4f.z(), f3, f4, f5, 1.0F, f9, f10, p_86003_, l, vector3f.x(), vector3f.y(), vector3f.z());
+ applyBakedNormals(vector3f, bytebuffer, p_85996_.normal());
+ float vertexAlpha = p_86004_ ? alpha * (float) (bytebuffer.get(15) & 255) / 255.0F : alpha;
+ this.vertex(vector4f.x(), vector4f.y(), vector4f.z(), f3, f4, f5, vertexAlpha, f9, f10, p_86003_, l, vector3f.x(), vector3f.y(), vector3f.z());
- this.vertex(vector4f.x(), vector4f.y(), vector4f.z(), f3, f4, f5, p_331416_, f9, f10, p_85993_, l, vector3f.x(), vector3f.y(), vector3f.z());
+ applyBakedNormals(vector3f, bytebuffer, p_85988_.normal());
+ // Neo: also apply alpha that's coming from the baked quad
+ float vertexAlpha = p_331268_ ? p_331416_ * (float) (bytebuffer.get(15) & 255) / 255.0F : p_331416_;
+ this.vertex(vector4f.x(), vector4f.y(), vector4f.z(), f3, f4, f5, vertexAlpha, f9, f10, p_85993_, l, vector3f.x(), vector3f.y(), vector3f.z());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/VertexFormatElement.java
+++ b/com/mojang/blaze3d/vertex/VertexFormatElement.java
@@ -93,6 +_,10 @@
@@ -91,6 +_,10 @@
this.usage.clearBufferState(this.index, p_166964_);
}

Expand All @@ -11,7 +11,7 @@
@OnlyIn(Dist.CLIENT)
public static enum Type {
FLOAT(4, "Float", 5126),
@@ -127,7 +_,7 @@
@@ -125,7 +_,7 @@
}

@OnlyIn(Dist.CLIENT)
Expand All @@ -20,7 +20,7 @@
POSITION("Position", (p_167043_, p_167044_, p_167045_, p_167046_, p_167047_, p_167048_) -> {
GlStateManager._enableVertexAttribArray(p_167048_);
GlStateManager._vertexAttribPointer(p_167048_, p_167043_, p_167044_, false, p_167045_, p_167046_);
@@ -188,6 +_,10 @@
@@ -186,6 +_,10 @@
@OnlyIn(Dist.CLIENT)
public interface SetupState {
void setupBufferState(int p_167053_, int p_167054_, int p_167055_, long p_167056_, int p_167057_, int p_167058_);
Expand Down
15 changes: 0 additions & 15 deletions patches/com/mojang/realmsclient/RealmsAvailability.java.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
@@ -66,6 +_,15 @@
@@ -69,6 +_,15 @@
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/CrashReport.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
p_127520_.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
- p_127520_.append("Stacktrace:\n");
-
- for(StackTraceElement stacktraceelement : this.uncategorizedStackTrace) {
- for (StackTraceElement stacktraceelement : this.uncategorizedStackTrace) {
- p_127520_.append("\t").append("at ").append(stacktraceelement);
- p_127520_.append("\n");
- }
Expand All @@ -16,7 +16,7 @@
+ p_127520_.append(net.neoforged.neoforge.logging.CrashReportExtender.generateEnhancedStackTrace(this.uncategorizedStackTrace));
}

for(CrashReportCategory crashreportcategory : this.details) {
for (CrashReportCategory crashreportcategory : this.details) {
@@ -74,6 +_,7 @@
p_127520_.append("\n\n");
}
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/CrashReportCategory.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if (this.stackTrace != null && this.stackTrace.length > 0) {
p_128169_.append("\nStacktrace:");
-
- for(StackTraceElement stacktraceelement : this.stackTrace) {
- for (StackTraceElement stacktraceelement : this.stackTrace) {
- p_128169_.append("\n\tat ");
- p_128169_.append(stacktraceelement);
- }
Expand Down
6 changes: 3 additions & 3 deletions patches/net/minecraft/SharedConstants.java.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
@@ -122,7 +_,8 @@
public static final long MAXIMUM_TICK_TIME_NANOS = Duration.ofMillis(300L).toNanos();
@@ -123,7 +_,8 @@
public static final boolean USE_WORKFLOWS_HOOKS = false;
public static final boolean USE_DEVONLY = false;
public static boolean CHECK_DATA_FIXER_SCHEMA = true;
- public static boolean IS_RUNNING_IN_IDE;
+ public static boolean IS_RUNNING_IN_IDE = !net.neoforged.fml.loading.FMLLoader.isProduction();
+ public static final boolean IS_RUNNING_WITH_JDWP = java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().stream().anyMatch(str -> str.startsWith("-agentlib:jdwp"));
public static Set<TypeReference> DATA_FIX_TYPES_TO_OPTIMIZE = Set.of();
public static final int WORLD_RESOLUTION = 16;
public static final int MAX_CHAT_LENGTH = 256;
@@ -204,6 +_,7 @@
@@ -181,6 +_,7 @@
}

static {
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
@@ -261,8 +_,8 @@
@@ -267,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;
}
}
@@ -438,20 +_,20 @@
@@ -488,20 +_,20 @@

public static void logAndPauseIfInIde(String p_143786_) {
LOGGER.error(p_143786_);
Expand Down
10 changes: 5 additions & 5 deletions patches/net/minecraft/advancements/Advancement.java.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/advancements/Advancement.java
+++ b/net/minecraft/advancements/Advancement.java
@@ -54,6 +_,7 @@
),
Advancement::validate
);
@@ -52,6 +_,7 @@
)
.validate(Advancement::validate);
public static final StreamCodec<RegistryFriendlyByteBuf, Advancement> STREAM_CODEC = StreamCodec.ofMember(Advancement::write, Advancement::read);
+ public static final Codec<Optional<net.neoforged.neoforge.common.conditions.WithConditions<Advancement>>> CONDITIONAL_CODEC = net.neoforged.neoforge.common.conditions.ConditionalOps.createConditionalCodecWithConditions(CODEC);

public Advancement(
Optional<ResourceLocation> p_300893_,
@@ -113,7 +_,7 @@
@@ -111,7 +_,7 @@
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java
@@ -37,6 +_,7 @@
@@ -40,6 +_,7 @@
LootParams lootparams = new LootParams.Builder(p_9990_.serverLevel())
.withParameter(LootContextParams.THIS_ENTITY, p_9990_)
.withParameter(LootContextParams.ORIGIN, p_9990_.position())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/net/minecraft/advancements/critereon/ItemEnchantmentsPredicate.java
+++ b/net/minecraft/advancements/critereon/ItemEnchantmentsPredicate.java
@@ -23,6 +_,11 @@
return this.enchantments;
}

+ @Override // NEO: use getAllEnchantments for enchantments
+ public boolean matches(ItemStack p_333958_) {
+ return matches(p_333958_, p_333958_.getAllEnchantments());
+ }
+
public boolean matches(ItemStack p_333811_, ItemEnchantments p_334059_) {
for (EnchantmentPredicate enchantmentpredicate : this.enchantments) {
if (!enchantmentpredicate.containedIn(p_334059_)) {
Loading

0 comments on commit 87f815d

Please sign in to comment.