diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-06-17 00:07:02 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-06-17 00:07:02 +0900 |
| commit | 667c7993dcea8b09bdffcad9956b353f054ad6e2 (patch) | |
| tree | a8952cd4dd6465919805f159dee66434dc008e22 | |
| parent | de36cf8cbce35d6fc5f879651c057fa143e72d89 (diff) | |
| download | RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.tar.gz RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.tar.bz2 RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.zip | |
Update to 1.21
84 files changed, 342 insertions, 381 deletions
diff --git a/.github/workflows/curseforge.yml b/.github/workflows/curseforge.yml index f29befc32..9619f7892 100644 --- a/.github/workflows/curseforge.yml +++ b/.github/workflows/curseforge.yml @@ -19,6 +19,7 @@ on: - 13.x-1.20.2 - 14.x-1.20.4 - 15.x-1.20.5 + - 16.x-1.21 jobs: build: diff --git a/api/src/main/java/me/shedaniel/rei/api/client/entry/type/BuiltinClientEntryTypes.java b/api/src/main/java/me/shedaniel/rei/api/client/entry/type/BuiltinClientEntryTypes.java index 96c6b860d..3b2d45225 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/entry/type/BuiltinClientEntryTypes.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/entry/type/BuiltinClientEntryTypes.java @@ -33,7 +33,7 @@ import org.jetbrains.annotations.ApiStatus; @ApiStatus.NonExtendable @Environment(EnvType.CLIENT) public interface BuiltinClientEntryTypes { - ResourceLocation RENDERING_ID = new ResourceLocation("rendering"); + ResourceLocation RENDERING_ID = ResourceLocation.withDefaultNamespace("rendering"); EntryType<Renderer> RENDERING = EntryType.deferred(RENDERING_ID); } diff --git a/api/src/main/java/me/shedaniel/rei/api/client/favorites/FavoriteEntryType.java b/api/src/main/java/me/shedaniel/rei/api/client/favorites/FavoriteEntryType.java index 62236f22c..87738b156 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/favorites/FavoriteEntryType.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/favorites/FavoriteEntryType.java @@ -44,12 +44,12 @@ public interface FavoriteEntryType<T extends FavoriteEntry> { /** * A builtin type of favorites, wrapping a {@link EntryStack}. */ - ResourceLocation ENTRY_STACK = new ResourceLocation("roughlyenoughitems", "entry_stack"); + ResourceLocation ENTRY_STACK = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "entry_stack"); /** * A builtin type of favorites, wrapping a {@link Display}. */ @ApiStatus.Experimental - ResourceLocation DISPLAY = new ResourceLocation("roughlyenoughitems", "display"); + ResourceLocation DISPLAY = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "display"); static Registry registry() { return PluginManager.getClientInstance().get(FavoriteEntryType.Registry.class); diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java index f62ec2491..c3963ec93 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/SimpleDisplayRenderer.java @@ -47,7 +47,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; public class SimpleDisplayRenderer extends DisplayRenderer implements WidgetHolder { - protected static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/recipecontainer.png"); + protected static final ResourceLocation CHEST_GUI_TEXTURE = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/recipecontainer.png"); protected List<Slot> inputWidgets; protected List<Slot> outputWidgets; protected List<GuiEventListener> widgets; diff --git a/api/src/main/java/me/shedaniel/rei/api/client/util/SpriteRenderer.java b/api/src/main/java/me/shedaniel/rei/api/client/util/SpriteRenderer.java index ceaee76e6..5c9e3c92f 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/util/SpriteRenderer.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/util/SpriteRenderer.java @@ -197,6 +197,11 @@ public class SpriteRenderer { next(sprite.contents().name()); } + private static VertexConsumer normal(VertexConsumer consumer, Matrix3f var1, float var2, float var3, float var4) { + Vector3f var5 = var1.transform(new Vector3f(var2, var3, var4)); + return consumer.setNormal(var5.x(), var5.y(), var5.z()); + } + public void next(ResourceLocation texture) { if (this.consumer == null) { throw new RuntimeException("Invalid VertexConsumer!"); @@ -241,38 +246,29 @@ public class SpriteRenderer { this.consumer = consumers.getBuffer(layer); - normal(this.consumer.vertex(this.model, x, y + nSY, z1) - .color(this.r, this.g, this.b, this.a) - .uv(this.uStart, this.vEnd - dY) - .overlayCoords(this.u, this.v) - .uv2(this.l), this.normal, this.nX, this.nY, this.nZ) - .endVertex(); - normal(this.consumer.vertex(this.model, x + nSX, y + nSY, z1) - .color(this.r, this.g, this.b, this.a) - .uv(this.uEnd - dX, this.vEnd - dY) - .overlayCoords(this.u, this.v) - .uv2(this.l), this.normal, this.nX, this.nY, this.nZ) - .endVertex(); - normal(this.consumer.vertex(this.model, x + nSX, y, z1) - .color(this.r, this.g, this.b, this.a) - .uv(this.uEnd - dX, this.vStart) - .overlayCoords(this.u, this.v) - .uv2(this.l), this.normal, this.nX, this.nY, this.nZ) - .endVertex(); - normal(this.consumer.vertex(this.model, x, y, z1) - .color(this.r, this.g, this.b, this.a) - .uv(this.uStart, this.vStart) - .overlayCoords(this.u, this.v) - .uv2(this.l), this.normal, this.nX, this.nY, this.nZ) - .endVertex(); + normal(this.consumer.addVertex(this.model, x, y + nSY, z1) + .setColor(this.r, this.g, this.b, this.a) + .setUv(this.uStart, this.vEnd - dY) + .setUv2(this.u, this.v) + .setOverlay(this.l), this.normal, this.nX, this.nY, this.nZ); + normal(this.consumer.addVertex(this.model, x + nSX, y + nSY, z1) + .setColor(this.r, this.g, this.b, this.a) + .setUv(this.uEnd - dX, this.vEnd - dY) + .setUv2(this.u, this.v) + .setOverlay(this.l), this.normal, this.nX, this.nY, this.nZ); + normal(this.consumer.addVertex(this.model, x + nSX, y, z1) + .setColor(this.r, this.g, this.b, this.a) + .setUv(this.uEnd - dX, this.vStart) |
