Skip to content

Commit

Permalink
I broke the goddamn wheel.
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 6, 2024
1 parent 70a2f60 commit f7ddc99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public VertexConsumer addVertex(float x, float y, float z) {
MemoryUtil.memPutFloat(ptr + 8, z);
filledPosition = true;
}
return this.endVertex();
return this;
}

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

@Override
Expand All @@ -66,19 +66,19 @@ public VertexConsumer setUv(float u, float v) {
MemoryUtil.memPutFloat(ptr + 16, v);
filledTexture = true;
}
return this.endVertex();
return this;
}

@Override
public VertexConsumer setUv1(int u, int v) {
// ignore overlay
return this.endVertex();
return this;
}

@Override
public VertexConsumer setUv2(int u, int v) {
// ignore light
return this.endVertex();
return this;
}

@Override
Expand All @@ -90,7 +90,7 @@ public VertexConsumer setNormal(float x, float y, float z) {
MemoryUtil.memPutByte(ptr + 22, RenderMath.nb(z));
filledNormal = true;
}
return this.endVertex();
return this;
}

public VertexConsumer endVertex() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.engine_room.flywheel.impl.mixin.visualmanage;

import net.minecraft.client.renderer.chunk.SectionCompiler;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Coerce;
Expand All @@ -9,10 +11,10 @@
import dev.engine_room.flywheel.lib.visual.VisualizationHelper;
import net.minecraft.world.level.block.entity.BlockEntity;

@Mixin(targets = "net.minecraft.client.renderer.chunk.SectionRenderDispatcher$RenderSection$RebuildTask")
abstract class RebuildTaskMixin {
@Inject(method = "handleBlockEntity(Lnet/minecraft/client/renderer/chunk/SectionRenderDispatcher$RenderSection$RebuildTask$CompileResults;Lnet/minecraft/world/level/block/entity/BlockEntity;)V", at = @At("HEAD"), cancellable = true)
private void flywheel$tryAddBlockEntity(@Coerce Object compileResults, BlockEntity blockEntity, CallbackInfo ci) {
@Mixin(SectionCompiler.class)
abstract class SectionCompilerMixin {
@Inject(method = "handleBlockEntity", at = @At("HEAD"), cancellable = true)
private void flywheel$tryAddBlockEntity(SectionCompiler.Results results, BlockEntity blockEntity, CallbackInfo ci) {
if (VisualizationHelper.tryAddBlockEntity(blockEntity)) {
ci.cancel();
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/flywheel.impl.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"visualmanage.BlockEntityMixin",
"visualmanage.LevelChunkMixin",
"visualmanage.LevelRendererMixin",
"visualmanage.RebuildTaskMixin"
"visualmanage.SectionCompilerMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit f7ddc99

Please sign in to comment.