mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 22:16:01 +00:00
0.10.0
This commit is contained in:
1 parent
be99313e81
commit
63535e6b3d
79 files changed
+2007
-529
No files matched your search
@@ -43,6 +43,8 @@ public class ReplayVisuals {
|
||||
|
||||
public long overrideTimeOfDay = -1;
|
||||
|
||||
public boolean overrideNightVision = false;
|
||||
|
||||
public boolean ruleOfThirdsGuide = false;
|
||||
public boolean centerGuide = false;
|
||||
public boolean cameraPath = true;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.moulberry.flashback.visuals;
|
||||
|
||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.CoreShaderRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
|
||||
import net.fabricmc.fabric.impl.client.rendering.FabricShaderProgram;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -11,43 +12,22 @@ import net.minecraft.server.packs.resources.ResourceManager;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ShaderManager implements SimpleSynchronousResourceReloadListener {
|
||||
public class ShaderManager {
|
||||
|
||||
public static final ShaderManager INSTANCE = new ShaderManager();
|
||||
|
||||
public static ShaderInstance blitScreenRoundAlpha;
|
||||
public static ShaderInstance blitScreenFlip;
|
||||
|
||||
@Override
|
||||
public ResourceLocation getFabricId() {
|
||||
return ResourceLocation.parse("flashback:shaders");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(ResourceManager resourceManager) {
|
||||
Flashback.LOGGER.info("Reloading shaders...");
|
||||
|
||||
if (blitScreenRoundAlpha != null) {
|
||||
blitScreenRoundAlpha.close();
|
||||
blitScreenRoundAlpha = null;
|
||||
}
|
||||
if (blitScreenFlip != null) {
|
||||
blitScreenFlip.close();
|
||||
blitScreenFlip = null;
|
||||
}
|
||||
|
||||
try {
|
||||
blitScreenRoundAlpha = new FabricShaderProgram(Minecraft.getInstance().getResourceManager(),
|
||||
ResourceLocation.parse("flashback:blit_screen_round_alpha"), DefaultVertexFormat.BLIT_SCREEN);
|
||||
} catch (IOException e) {
|
||||
Flashback.LOGGER.error("Failed to load flashback:blit_screen_round_alpha shader", e);
|
||||
}
|
||||
try {
|
||||
blitScreenFlip = new FabricShaderProgram(Minecraft.getInstance().getResourceManager(),
|
||||
ResourceLocation.parse("flashback:blit_screen_flip"), DefaultVertexFormat.BLIT_SCREEN);
|
||||
} catch (IOException e) {
|
||||
Flashback.LOGGER.error("Failed to load flashback:blit_screen_flip shader", e);
|
||||
}
|
||||
public void register() {
|
||||
CoreShaderRegistrationCallback.EVENT.register(context -> {
|
||||
context.register(ResourceLocation.parse("flashback:blit_screen_round_alpha"), DefaultVertexFormat.BLIT_SCREEN, shaderInstance -> {
|
||||
blitScreenRoundAlpha = shaderInstance;
|
||||
});
|
||||
context.register(ResourceLocation.parse("flashback:blit_screen_flip"), DefaultVertexFormat.BLIT_SCREEN, shaderInstance -> {
|
||||
blitScreenFlip = shaderInstance;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user