Add 360° screenshot feature when pressing Ctrl + Screenshot Keybind

This commit is contained in:
CrushedPixel
2017-09-27 00:16:39 +02:00
parent adfe6a2bfc
commit 9671ee605d
6 changed files with 168 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package com.replaymod.replay;
import com.replaymod.core.utils.WrappedTimer;
import com.replaymod.replay.camera.CameraController;
import com.replaymod.replay.camera.CameraEntity;
import com.replaymod.replay.events.ReplayDispatchKeypressesEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.settings.GameSettings;
@@ -11,6 +12,7 @@ import net.minecraft.crash.CrashReport;
import net.minecraft.util.ReportedException;
import net.minecraft.util.Timer;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@@ -122,7 +124,9 @@ public class InputReplayTimer extends WrappedTimer {
}
// Twitch, screenshot, fullscreen, etc. (stuff that works everywhere)
mc.dispatchKeypresses();
if (!MinecraftForge.EVENT_BUS.post(new ReplayDispatchKeypressesEvent.Pre())) {
mc.dispatchKeypresses();
}
if (pressed) {
// This might be subject to change as vanilla shaders are still kinda unused in 1.8

View File

@@ -0,0 +1,9 @@
package com.replaymod.replay.events;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public abstract class ReplayDispatchKeypressesEvent extends Event {
public static class Pre extends ReplayDispatchKeypressesEvent {}
}