Skip to content

Commit

Permalink
1.20.1 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Feb 19, 2025
1 parent 6981943 commit 2e86e23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 0 additions & 14 deletions common/src/main/java/org/vivecraft/client_vr/ReloadListener.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package org.vivecraft.client_vr;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.server.packs.PackResources;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.mod_compat_vr.optifine.OptifineHelper;

import java.io.IOException;
import java.util.List;

/**
Expand All @@ -25,16 +21,6 @@ public void onResourceManagerReload(ResourceManager resourceManager) {
if (this.resourcePacks == null) {
// first load
this.resourcePacks = resourceManager.listPacks().map(PackResources::packId).toList();

if (OptifineHelper.isOptifineLoaded()) {
// with optifine this texture somehow fails to load, so manually reload it
try {
Minecraft.getInstance().getTextureManager().getTexture(Gui.CROSSHAIR_SPRITE).load(resourceManager);
} catch (IOException e) {
// if there was an error, just reload everything
Minecraft.getInstance().reloadResourcePacks();
}
}
} else if (!this.resourcePacks.equals(newPacks) &&
ClientDataHolderVR.getInstance().menuWorldRenderer != null &&
ClientDataHolderVR.getInstance().menuWorldRenderer.isReady())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.RenderBuffers;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.server.IntegratedServer;
import net.minecraft.client.sounds.SoundManager;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -177,6 +178,10 @@ public abstract class MinecraftVRMixin implements MinecraftExtension {
@Final
private RenderBuffers renderBuffers;

@Shadow
@Final
private TextureManager textureManager;

@WrapOperation(method = "<init>", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderTarget;clear(Z)V"))
private void vivecraft$initVivecraft(RenderTarget instance, boolean onOSX, Operation<Void> original) {
RenderPassManager.INSTANCE = new RenderPassManager((MainTarget) this.mainRenderTarget);
Expand Down

0 comments on commit 2e86e23

Please sign in to comment.