Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to 1.21.1 #240

Open
wants to merge 76 commits into
base: 1.20/dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
56b0fce
Port to 1.20.4
IThundxr May 5, 2024
8c61f3f
Obfuscated Obfuscation
IThundxr May 12, 2024
cbdc318
fixme fixedme fixed...
IThundxr May 12, 2024
68d40b9
port rebase fixes
IThundxr May 13, 2024
25a5522
fix deps
IThundxr Jun 4, 2024
4190ac7
fix issues here and there
IThundxr Jun 7, 2024
52d99e3
fix param name
IThundxr Jun 7, 2024
47e80a6
optimize imports
IThundxr Jun 7, 2024
349e7b3
fix mixin
IThundxr Jun 7, 2024
045771d
fix param names
IThundxr Jun 7, 2024
a9127be
fix instance textures
IThundxr Jun 7, 2024
a9c4e5c
Merge branch 'refs/heads/1.20/dev' into feat/multi-loader-1.20.4
IThundxr Jul 3, 2024
eccbfbc
build: update dependencies
IThundxr Jul 10, 2024
d587ec0
1.21 Port I
IThundxr Jul 10, 2024
d092417
1.21 Port II
IThundxr Jul 10, 2024
e374365
1.21 Port III
IThundxr Jul 10, 2024
10d032c
1.21 Port IV
IThundxr Jul 10, 2024
dfbd451
1.21 Port V
IThundxr Jul 10, 2024
1cce5da
Mixin Fixin'
IThundxr Jul 15, 2024
eeb6e0f
style: javadoc fixes
IThundxr Jul 15, 2024
1d9f96a
string substitution fixes
IThundxr Jul 15, 2024
6533723
feat(api): Make PartialModel's use RL's instead of MRL's
IThundxr Jul 15, 2024
246939b
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into fe…
IThundxr Jul 19, 2024
5e64224
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into fe…
IThundxr Jul 28, 2024
44c2f78
merge: post merge fixes & porting
IThundxr Jul 28, 2024
b55afc9
Merge remote-tracking branch 'refs/remotes/upstream/1.20/dev' into fe…
IThundxr Jul 28, 2024
68393d1
fix(mixins): broken LevelRenderer injector
IThundxr Jul 29, 2024
475b1d8
fix view -IMS
IThundxr Aug 10, 2024
f2c0b79
uncomment the comments
IThundxr Aug 10, 2024
5313585
update neoforge & fix mixins
IThundxr Aug 11, 2024
44f045b
Fix lighting
IThundxr Aug 15, 2024
4e1a4b6
fix jittery visual animations
IThundxr Aug 17, 2024
c32fccc
Sodium 0.6
IThundxr Aug 22, 2024
6cf9f36
iris support
IThundxr Aug 23, 2024
a932d5d
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Aug 23, 2024
0919c0f
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Aug 23, 2024
3453715
forge porting
IThundxr Aug 23, 2024
42290b2
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Sep 14, 2024
fc61ff1
Add sodium 0.6 compat
IThundxr Sep 14, 2024
3176f1d
Fix issues
IThundxr Sep 14, 2024
9365011
fix remapping
IThundxr Sep 14, 2024
e7e3579
Merge branch '1.20/dev' into feat/multi-loader-1.21
IThundxr Sep 20, 2024
556e11a
Fix compile errors
IThundxr Sep 20, 2024
a3bb585
Merge branch '1.20/dev' into feat/multi-loader-1.21
IThundxr Sep 22, 2024
42bdd36
port changes to 1.21
IThundxr Sep 22, 2024
08866ed
Merge branch '1.20/dev' into feat/multi-loader-1.21
IThundxr Oct 2, 2024
ae4e4e7
post merge fixes
IThundxr Oct 2, 2024
05b82b5
Fix sprite UVs being messed up
IThundxr Oct 6, 2024
6cc2b74
Fix iris compat
IThundxr Oct 6, 2024
b408191
Build against 1.21.1
IThundxr Oct 10, 2024
93c1163
Last fixes
IThundxr Oct 11, 2024
178dd6c
address review
IThundxr Oct 12, 2024
6f946fc
Rename class
IThundxr Oct 12, 2024
dc3e264
post to correct bus
IThundxr Oct 12, 2024
e39554e
fix breaks formatting
IThundxr Oct 12, 2024
f6ca19c
bring back comment
IThundxr Oct 12, 2024
68e545b
forgeEventBus -> gameEventBus
IThundxr Oct 12, 2024
aeb9781
Remove unused check
IThundxr Oct 12, 2024
008b098
fix meshemitter
IThundxr Oct 14, 2024
fa57f34
formatting changes
IThundxr Oct 14, 2024
c705fdf
address requested changes
IThundxr Oct 14, 2024
68d1504
address requested changes
IThundxr Oct 14, 2024
07e66bb
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Oct 29, 2024
ad93839
post merge fixes
IThundxr Oct 29, 2024
d881ba5
Twas a snowy night full of scripting the builds
IThundxr Nov 1, 2024
ad2f3c8
Stubborn stubs
IThundxr Nov 3, 2024
69f4899
VertexConsumer-related clean up
PepperCode1 Nov 4, 2024
fd786b0
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Nov 13, 2024
c95bd4c
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Nov 13, 2024
e59b741
Mining the errors away'
IThundxr Nov 13, 2024
0d29710
Fix VertexWriter
PepperCode1 Nov 13, 2024
e359558
Update test mod for neoforge
IThundxr Nov 13, 2024
b2476c2
Work on fixing testmod
IThundxr Nov 13, 2024
cc21fd2
Rename subproject to neoforge
IThundxr Nov 13, 2024
c726d7c
Misc renames
IThundxr Nov 13, 2024
89d8755
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
IThundxr Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on: [ workflow_dispatch, pull_request, push ]

env:
JAVA_VERSION: 17
JAVA_VERSION: 21

jobs:
build:
Expand Down Expand Up @@ -43,13 +43,13 @@ jobs:
path: |
common/build/libs/
fabric/build/libs/
forge/build/libs/
neoforge/build/libs/

test:
strategy:
fail-fast: false
matrix:
loader: [ forge, fabric ]
loader: [ neoforge, fabric ]
needs: build
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.minecraftforge.net/") {
name = "MinecraftForge"
maven("https://maven.neoforged.net/releases/") {
name = "NeoForged"
}
maven("https://maven.architectury.dev/") {
name = "Architectury"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class SubprojectPlugin: Plugin<Project> {
}
}

val processResourcesExpandFiles = listOf("pack.mcmeta", "fabric.mod.json", "META-INF/mods.toml")
val processResourcesExpandFiles = listOf("pack.mcmeta", "fabric.mod.json", "META-INF/neoforge.mods.toml")

val processResourcesExpandProperties = listOf(
"mod_id",
Expand All @@ -180,6 +180,6 @@ val processResourcesExpandProperties = listOf(
"minecraft_semver_version_range",
"minecraft_maven_version_range",
"fabric_api_version_range",
"forge_version_range",
"neoforge_version_range",
)

10 changes: 4 additions & 6 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
val api = sourceSets.create("api")
val lib = sourceSets.create("lib")
val backend = sourceSets.create("backend")
val stubs = sourceSets.create("stubs")
val main = sourceSets.getByName("main")

transitiveSourceSets {
Expand All @@ -26,11 +25,8 @@ transitiveSourceSets {
rootCompile()
compile(api, lib)
}
sourceSet(stubs) {
rootCompile()
}
sourceSet(main) {
compile(api, lib, backend, stubs)
compile(api, lib, backend)
}
sourceSet(sourceSets.getByName("test")) {
implementation(api, lib, backend)
Expand All @@ -46,7 +42,6 @@ jarSets {
outgoing("commonApiOnly", api)
outgoing("commonLib", lib)
outgoing("commonBackend", backend)
outgoing("commonStubs", stubs)
outgoing("commonImpl", main)

// For publishing.
Expand Down Expand Up @@ -77,6 +72,9 @@ jarSets {
dependencies {
modCompileOnly("net.fabricmc:fabric-loader:${property("fabric_loader_version")}")

modCompileOnly("maven.modrinth:sodium:${property("sodium_version")}-fabric")
modCompileOnly("maven.modrinth:iris:${property("iris_version")}-fabric")

testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ private Flywheel() {
}

public static ResourceLocation rl(String path) {
return new ResourceLocation(ID, path);
return ResourceLocation.fromNamespaceAndPath(ID, path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface RenderContext {

RenderBuffers buffers();

PoseStack stack();
Matrix4fc modelView();

Matrix4fc projection();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void update(RenderContext context) {
var camY = (float) (cameraPos.y - renderOrigin.getY());
var camZ = (float) (cameraPos.z - renderOrigin.getZ());

VIEW.set(context.stack().last().pose());
VIEW.set(context.modelView());
VIEW.translate(-camX, -camY, -camZ);
PROJECTION.set(context.projection());
VIEW_PROJECTION.set(context.viewProjection());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ShaderSources(ResourceManager manager) {
}

private static ResourceLocation locationWithoutFlywheelPrefix(ResourceLocation loc) {
return new ResourceLocation(loc.getNamespace(), loc.getPath()
return ResourceLocation.fromNamespaceAndPath(loc.getNamespace(), loc.getPath()
.substring(SHADER_DIR.length()));
}

Expand Down
2 changes: 1 addition & 1 deletion common/src/backend/resources/flywheel.backend.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "dev.engine_room.flywheel.backend.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"refmap": "backend-flywheel.refmap.json",
"client": [
"AbstractClientPlayerAccessor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface FlwLibLink {

Map<String, ModelPart> getModelPartChildren(ModelPart part);

void compileModelPart(ModelPart part, PoseStack.Pose pose, VertexConsumer consumer, int light, int overlay, float red, float green, float blue, float alpha);
void compileModelPart(ModelPart part, PoseStack.Pose pose, VertexConsumer consumer, int light, int overlay, int color);

Deque<PoseStack.Pose> getPoseStack(PoseStack stack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static Material getItemMaterial(RenderType renderType) {
if (renderType == Sheets.translucentCullBlockSheet() || renderType == Sheets.translucentItemSheet()) {
return Materials.CUTOUT_BLOCK;
}
if (renderType == RenderType.glint() || renderType == RenderType.glintDirect()) {
if (renderType == RenderType.glint() || renderType == RenderType.glintTranslucent()) {
return Materials.GLINT;
}
if (renderType == RenderType.entityGlint() || renderType == RenderType.entityGlintDirect()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.jetbrains.annotations.Nullable;
import org.lwjgl.system.MemoryUtil;

import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.MeshData;

import dev.engine_room.flywheel.lib.memory.MemoryBlock;
import dev.engine_room.flywheel.lib.model.SimpleQuadMesh;
Expand All @@ -16,15 +16,15 @@ final class MeshHelper {
private MeshHelper() {
}

public static SimpleQuadMesh blockVerticesToMesh(BufferBuilder.RenderedBuffer buffer, @Nullable String meshDescriptor) {
BufferBuilder.DrawState drawState = buffer.drawState();
public static SimpleQuadMesh blockVerticesToMesh(MeshData data, @Nullable String meshDescriptor) {
MeshData.DrawState drawState = data.drawState();
int vertexCount = drawState.vertexCount();
long srcStride = drawState.format().getVertexSize();

VertexView vertexView = new NoOverlayVertexView();
long dstStride = vertexView.stride();

ByteBuffer src = buffer.vertexBuffer();
ByteBuffer src = data.vertexBuffer();
MemoryBlock dst = MemoryBlock.mallocTracked((long) vertexCount * dstStride);
long srcPtr = MemoryUtil.memAddress(src);
long dstPtr = dst.ptr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,67 +26,46 @@ public void clear() {
}

@Override
public VertexConsumer vertex(double x, double y, double z) {
public VertexConsumer addVertex(float x, float y, float z) {
Matrix4f matrix = poseStack.last().pose();
float fx = (float) x;
float fy = (float) y;
float fz = (float) z;
delegate.vertex(
MatrixMath.transformPositionX(matrix, fx, fy, fz),
MatrixMath.transformPositionY(matrix, fx, fy, fz),
MatrixMath.transformPositionZ(matrix, fx, fy, fz));
delegate.addVertex(
MatrixMath.transformPositionX(matrix, x, y, z),
MatrixMath.transformPositionY(matrix, x, y, z),
MatrixMath.transformPositionZ(matrix, x, y, z));
return this;
}

@Override
public VertexConsumer color(int red, int green, int blue, int alpha) {
delegate.color(red, green, blue, alpha);
public VertexConsumer setColor(int red, int green, int blue, int alpha) {
delegate.setColor(red, green, blue, alpha);
return this;
}

@Override
public VertexConsumer uv(float u, float v) {
delegate.uv(u, v);
public VertexConsumer setUv(float u, float v) {
delegate.setUv(u, v);
return this;
}

@Override
public VertexConsumer overlayCoords(int u, int v) {
delegate.overlayCoords(u, v);
public VertexConsumer setUv1(int u, int v) {
delegate.setUv1(u, v);
return this;
}

@Override
public VertexConsumer uv2(int u, int v) {
delegate.uv2(u, v);
public VertexConsumer setUv2(int u, int v) {
delegate.setUv2(u, v);
return this;
}

@Override
public VertexConsumer normal(float x, float y, float z) {
public VertexConsumer setNormal(float x, float y, float z) {
Matrix3f matrix = poseStack.last().normal();
float fx = (float) x;
float fy = (float) y;
float fz = (float) z;
delegate.normal(
MatrixMath.transformNormalX(matrix, fx, fy, fz),
MatrixMath.transformNormalY(matrix, fx, fy, fz),
MatrixMath.transformNormalZ(matrix, fx, fy, fz));
delegate.setNormal(
MatrixMath.transformNormalX(matrix, x, y, z),
MatrixMath.transformNormalY(matrix, x, y, z),
MatrixMath.transformNormalZ(matrix, x, y, z));
return this;
}

@Override
public void endVertex() {
delegate.endVertex();
}

@Override
public void defaultColor(int red, int green, int blue, int alpha) {
delegate.defaultColor(red, green, blue, alpha);
}

@Override
public void unsetDefaultColor() {
delegate.unsetDefaultColor();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static Mesh compile(ModelPart modelPart, ThreadLocalObjects objects) {
}

VertexWriter vertexWriter = objects.vertexWriter;
FlwLibLink.INSTANCE.compileModelPart(modelPart, IDENTITY_POSE, vertexWriter, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
FlwLibLink.INSTANCE.compileModelPart(modelPart, IDENTITY_POSE, vertexWriter, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, 0xFFFFFFFF);
MemoryBlock data = vertexWriter.copyDataAndReset();

VertexView vertexView = new PosTexNormalVertexView();
Expand Down
Loading
Loading