fabric-renderer-api-v1-7.2.3+9be2a36e6f.jar
Download file
package net.fabricmc.fabric.mixin.renderer.client.block.render;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.impl.renderer.BatchingRenderCommandQueueExtension;
import net.fabricmc.fabric.impl.renderer.ExtendedBlockCommand;
import net.fabricmc.fabric.impl.renderer.ExtendedBlockStateModelCommand;
import net.minecraft.class_10418;
import net.minecraft.class_1087;
import net.minecraft.class_11515;
import net.minecraft.class_11661;
import net.minecraft.class_11785;
import net.minecraft.class_11788;
import net.minecraft.class_1920;
import net.minecraft.class_1921;
import net.minecraft.class_2338;
import net.minecraft.class_2680;
import net.minecraft.class_310;
import net.minecraft.class_4587;
import net.minecraft.class_811;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Environment(EnvType.CLIENT)
@Mixin({class_11788.class})
abstract class BatchingRenderCommandQueueMixin implements class_11785, BatchingRenderCommandQueueExtension {
@Shadow
@Final
private class_11661 field_62242;
@Shadow
private boolean field_62243;
@Unique
private final List<ExtendedBlockCommand> extendedBlockCommands = new ArrayList();
@Unique
private final List<ExtendedBlockStateModelCommand> extendedBlockStateModelCommands = new ArrayList();
public void submitBlock(class_4587 matrices, class_2680 state, int light, int overlay, int outlineColor, class_1920 blockView, class_2338 pos) {
this.field_62243 = true;
this.extendedBlockCommands.add(new ExtendedBlockCommand(matrices.method_23760().method_56822(), state, light, overlay, outlineColor, blockView, pos));
((class_10418)class_310.method_1551().method_1554().method_65756().get()).method_65535(state.method_26204(), class_811.field_4315, matrices, this.field_62242, light, overlay, outlineColor);
}
public void submitBlockStateModel(class_4587 matrices, Function<class_11515, class_1921> renderLayerFunction, class_1087 model, float r, float g, float b, int light, int overlay, int outlineColor, class_1920 blockView, class_2338 pos, class_2680 state) {
this.field_62243 = true;
this.extendedBlockStateModelCommands.add(new ExtendedBlockStateModelCommand(matrices.method_23760().method_56822(), renderLayerFunction, model, r, g, b, light, overlay, outlineColor, blockView, pos, state));
}
public List<ExtendedBlockCommand> fabric_getExtendedBlockCommands() {
return this.extendedBlockCommands;
}
public List<ExtendedBlockStateModelCommand> fabric_getExtendedBlockStateModelCommands() {
return this.extendedBlockStateModelCommands;
}
@Inject(
method = {"method_73527()V"},
at = {@At("RETURN")}
)
private void onReturnClear(CallbackInfo ci) {
this.extendedBlockCommands.clear();
this.extendedBlockStateModelCommands.clear();
}
}
Download file