Virtual rendering fixes

- Fix blocks in schematic renders being too dark
- Fix shafts and cogs fired from a schematicannon not rendering
This commit is contained in:
PepperCode1 2022-01-11 20:15:33 -08:00
parent 541e5bd6ae
commit d0a660c0ae
4 changed files with 5 additions and 4 deletions

View file

@ -142,7 +142,7 @@ public class SchematicWorld extends WrappedWorld implements ServerLevelAccessor
@Override @Override
public int getBrightness(LightLayer p_226658_1_, BlockPos p_226658_2_) { public int getBrightness(LightLayer p_226658_1_, BlockPos p_226658_2_) {
return 10; return 15;
} }
@Override @Override

View file

@ -3,6 +3,7 @@ package com.simibubi.create.content.schematics.block;
import java.util.Random; import java.util.Random;
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.virtual.VirtualEmptyModelData;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
@ -24,7 +25,6 @@ import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.client.model.data.EmptyModelData;
public class SchematicannonRenderer extends SafeTileEntityRenderer<SchematicannonTileEntity> { public class SchematicannonRenderer extends SafeTileEntityRenderer<SchematicannonTileEntity> {
@ -172,7 +172,7 @@ public class SchematicannonRenderer extends SafeTileEntityRenderer<Schematicanno
Minecraft.getInstance() Minecraft.getInstance()
.getBlockRenderer() .getBlockRenderer()
.renderSingleBlock(((ForBlockState) launched).state, ms, buffer, light, overlay, .renderSingleBlock(((ForBlockState) launched).state, ms, buffer, light, overlay,
EmptyModelData.INSTANCE); VirtualEmptyModelData.INSTANCE);
} }
// Render the item // Render the item

View file

@ -76,6 +76,7 @@ public class SchematicRenderer {
if (!usedBlockRenderLayers.contains(layer)) if (!usedBlockRenderLayers.contains(layer))
continue; continue;
SuperByteBuffer superByteBuffer = bufferCache.get(layer); SuperByteBuffer superByteBuffer = bufferCache.get(layer);
superByteBuffer.disableDiffuseMult();
superByteBuffer.renderInto(ms, buffer.getBuffer(layer)); superByteBuffer.renderInto(ms, buffer.getBuffer(layer));
} }
TileEntityRenderHelper.renderTileEntities(schematic, schematic.getRenderedTileEntities(), ms, buffer); TileEntityRenderHelper.renderTileEntities(schematic, schematic.getRenderedTileEntities(), ms, buffer);

View file

@ -344,7 +344,7 @@ public class WorldSectionElement extends AnimatedSceneElement {
.normal()); .normal());
Minecraft.getInstance() Minecraft.getInstance()
.getBlockRenderer() .getBlockRenderer()
.renderBatched(world.getBlockState(pos), pos, world, ms, builder, true, world.random, .renderBatched(world.getBlockState(pos), pos, world, ms, builder, true, new Random(),
EmptyModelData.INSTANCE); EmptyModelData.INSTANCE);
ms.popPose(); ms.popPose();
} }