Skip to content

Commit

Permalink
Panamax Interior
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeryn99 committed Jan 8, 2025
1 parent 68d61d6 commit d6d9cc3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.minecraft.world.level.block.state.BlockState;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL30;
import org.lwjgl.opengl.GL30C;
Expand Down Expand Up @@ -65,7 +66,7 @@ public static void renderVortex(GlobalDoorBlockEntity blockEntity, float partial
VORTEX.vortexType = VortexRegistry.VORTEX_DEFERRED_REGISTRY.get(tardisClientData.getVortex());

if (tardisClientData.isFlying() && !TRConfig.CLIENT.SKIP_FANCY_RENDERING.get()) {
renderDoorOpen(blockEntity, stack, packedLight, rotation, currentModel, isOpen, tardisClientData);
renderDoorOpen(blockEntity, stack, bufferSource, packedLight, rotation, currentModel, isOpen, tardisClientData);
} else {
renderNoVortex(blockEntity, stack, bufferSource, packedLight, rotation, currentModel, isOpen);
}
Expand Down Expand Up @@ -127,7 +128,7 @@ public static void copyRenderTarget(RenderTarget src, RenderTarget dest) {

private static ResourceLocation BLACK = new ResourceLocation(TardisRefined.MODID, "textures/black_portal.png");

private static void renderDoorOpen(GlobalDoorBlockEntity blockEntity, PoseStack stack, int packedLight, float rotation, ShellDoorModel currentModel, boolean isOpen, TardisClientData tardisClientData) {
private static void renderDoorOpen(GlobalDoorBlockEntity blockEntity, PoseStack stack, MultiBufferSource bufferSource, int packedLight, float rotation, ShellDoorModel currentModel, boolean isOpen, TardisClientData tardisClientData) {
if (ModCompatChecker.immersivePortals()) {
if (ImmersivePortalsClient.shouldStopRenderingInPortal()) {
return;
Expand All @@ -153,6 +154,8 @@ private static void renderDoorOpen(GlobalDoorBlockEntity blockEntity, PoseStack
MultiBufferSource.BufferSource imBuffer = stencilBufferStorage.getVertexConsumer();
currentModel.setDoorPosition(isOpen);
currentModel.renderFrame(blockEntity, isOpen, true, stack, imBuffer.getBuffer(RenderType.entityCutout(currentModel.getInteriorDoorTexture(blockEntity))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f);

// Finalize the current batch before changing rendering state
imBuffer.endBatch();

// Enable and configure stencil buffer
Expand Down Expand Up @@ -207,6 +210,7 @@ private static void renderDoorOpen(GlobalDoorBlockEntity blockEntity, PoseStack
stack.popPose();
}


public static void checkGLError(String msg) {
int error;
while ((error = GL11.glGetError()) != GL11.GL_NO_ERROR) {
Expand Down Expand Up @@ -242,17 +246,24 @@ public static void setIsStencilEnabled(RenderTarget renderTarget, boolean cond)
}

public void start() {

GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_DEBUG, GLFW.GLFW_TRUE);

Window window = Minecraft.getInstance().getWindow();
int width = window.getWidth();
int height = window.getHeight();

if (renderTarget == null || renderTarget.width != width || renderTarget.height != height)
// Check if renderTarget needs to be reinitialized
if (renderTarget == null || renderTarget.width != width || renderTarget.height != height) {
renderTarget = new TextureTarget(width, height, true, Minecraft.ON_OSX);
}

renderTarget.bindWrite(false);
renderTarget.checkStatus();
if (!getIsStencilEnabled(renderTarget))

if (!getIsStencilEnabled(renderTarget)) {
setIsStencilEnabled(renderTarget, true);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static Map<ResourceLocation, DesktopTheme> registerDefaultDesktops() {
addDefaultDesktop(new DesktopTheme("watchface", "desktop/watchface"));
addDefaultDesktop(new DesktopTheme("classic", "desktop/classic"));
addDefaultDesktop(new DesktopTheme("terraformed", "desktop/terraformed_useable"));
addDefaultDesktop(new DesktopTheme("panamax", "desktop/panamax"));

return DEFAULT_DESKTOPS;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit d6d9cc3

Please sign in to comment.