Skip to content

Commit

Permalink
maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Jul 12, 2024
1 parent 8092c07 commit b1f7d84
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ publisher {

versionType.set("release")
projectVersion.set(project.version.toString())
gameVersions.set(listOf("1.20.5", "1.20.6"))
gameVersions.set(listOf("1.21"))
loaders.set(listOf("fabric", "quilt"))
curseEnvironment.set("client")

Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ archives-name = "flash"
mod = "2.1.0"
loader = "fabric"

minecraft = "1.20.5"
yarn = "1.20.5+build.1"
minecraft = "1.21"
yarn = "1.21+build.9"
fabric-loader = "0.16.0"
fabric-api = "0.97.8+1.20.5"
fabric-api = "0.100.6+1.21"
fabric-loom = "1.6-SNAPSHOT"
modpublisher = "2.1.0"

Expand All @@ -20,7 +20,7 @@ id-curseforge = "998416"
# display
display-name = "Flash"
display-loader = "Fabric"
display-version = "1.20.5~1.20.6"
display-version = "1.21+"

[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/band/kessokuteatime/flash/Flash.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void listenInput(MinecraftClient client) {
}

public static class Sounds {
public static final SoundEvent CAMERA_SHUTTER = SoundEvent.of(new Identifier(ID, "camera_shutter"));
public static final SoundEvent CAMERA_SHUTTER = SoundEvent.of(Identifier.of(ID, "camera_shutter"));

static void register() {
Registry.register(Registries.SOUND_EVENT, CAMERA_SHUTTER.getId(), CAMERA_SHUTTER);
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/band/kessokuteatime/flash/FlashRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ public static void render(DrawContext context, IntBuffer intBuffer) {
context.getMatrices().translate(0, height * Flash.drop(), 0);
context.getMatrices().scale(scalar, scalar, scalar);

BufferBuilder builder = Tessellator.getInstance().getBuffer();
Matrix4f matrix = context.getMatrices().peek().getPositionMatrix();

// Background
RenderSystem.setShader(GameRenderer::getPositionColorProgram);

builder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
BufferBuilder builder = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);

color(builder, matrix, -(width / 2 + Flash.BORDER), -(minHeight / 2 + Flash.BORDER), borderColor); // Top left
color(builder, matrix, -(minWidth / 2 + Flash.BORDER), height / 2 + Flash.BORDER, borderColor); // Bottom left
Expand All @@ -53,7 +52,7 @@ public static void render(DrawContext context, IntBuffer intBuffer) {
RenderSystem.setShader(GameRenderer::getPositionTexColorProgram);
RenderSystem.setShaderTexture(0, textureId);

builder.begin(VertexFormat.DrawMode.TRIANGLE_STRIP, VertexFormats.POSITION_TEXTURE_COLOR);
builder = Tessellator.getInstance().begin(VertexFormat.DrawMode.TRIANGLE_STRIP, VertexFormats.POSITION_TEXTURE_COLOR);

for (int y = 0; y < height; y++) {
textureColor(
Expand All @@ -78,10 +77,10 @@ public static void render(DrawContext context, IntBuffer intBuffer) {
}

private static void textureColor(BufferBuilder builder, Matrix4f matrix, float x, float y, float u, float v, AccurateColor color) {
builder.vertex(matrix, x, y, 0).texture(u, v).color(color.redAsFloat(), color.greenAsFloat(), color.blueAsFloat(), color.opacityAsFloat()).next();
builder.vertex(matrix, x, y, 0).texture(u, v).color(color.redAsFloat(), color.greenAsFloat(), color.blueAsFloat(), color.opacityAsFloat());
}

private static void color(BufferBuilder builder, Matrix4f matrix, float x, float y, AccurateColor color) {
builder.vertex(matrix, x, y, 0).color(color.redAsFloat(), color.greenAsFloat(), color.blueAsFloat(), color.opacityAsFloat()).next();
builder.vertex(matrix, x, y, 0).color(color.redAsFloat(), color.greenAsFloat(), color.blueAsFloat(), color.opacityAsFloat());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -37,7 +38,7 @@ private DrawContext getMatrixStack(DrawContext context) {
shift = At.Shift.AFTER
)
)
private void renderScreenshotFlash(float tickDelta, long startTime, boolean tick, CallbackInfo ci) {
private void renderScreenshotFlash(RenderTickCounter renderTickCounter, boolean bl, CallbackInfo ci) {
if (
MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().currentScreen == null
&& !MinecraftClient.getInstance().skipGameRender
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fabricloader": "*",
"fabric-api": "*",
"fabric-key-binding-api-v1": "*",
"minecraft": ["~1.20.5", "~1.20.6"]
"minecraft": "1.21.x"
},
"suggests": {
}
Expand Down

0 comments on commit b1f7d84

Please sign in to comment.