Removed not working Shutdown Hook Thread

Fixed Hunger Bar not properly rendering while Recording Indicator enabled
This commit is contained in:
Marius Metzger
2015-04-06 16:51:38 +02:00
parent 66e27a97a4
commit 4ed92c3739
3 changed files with 27 additions and 34 deletions

View File

@@ -25,6 +25,7 @@ import eu.crushedpixel.replaymod.events.GuiReplayOverlay;
import eu.crushedpixel.replaymod.events.KeyInputHandler; import eu.crushedpixel.replaymod.events.KeyInputHandler;
import eu.crushedpixel.replaymod.events.RecordingHandler; import eu.crushedpixel.replaymod.events.RecordingHandler;
import eu.crushedpixel.replaymod.events.TickAndRenderListener; import eu.crushedpixel.replaymod.events.TickAndRenderListener;
import eu.crushedpixel.replaymod.gui.GuiReplaySaving;
import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler; import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler;
import eu.crushedpixel.replaymod.recording.ConnectionEventHandler; import eu.crushedpixel.replaymod.recording.ConnectionEventHandler;
import eu.crushedpixel.replaymod.registry.KeybindRegistry; import eu.crushedpixel.replaymod.registry.KeybindRegistry;
@@ -130,15 +131,7 @@ public class ReplayMod
JOptionPane.showMessageDialog(null, "It seems like you didn't donate, so you can't use the Replay Mod yet."); JOptionPane.showMessageDialog(null, "It seems like you didn't donate, so you can't use the Replay Mod yet.");
FMLCommonHandler.instance().exitJava(0, false); FMLCommonHandler.instance().exitJava(0, false);
} }
*/ */
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
LightingHandler.setLighting(false);
}
}));
} }
private void removeTmcprFiles() { private void removeTmcprFiles() {
@@ -146,7 +139,7 @@ public class ReplayMod
folder.mkdirs(); folder.mkdirs();
for(File f : folder.listFiles()) { for(File f : folder.listFiles()) {
if("."+FilenameUtils.getExtension(f.getAbsolutePath()) == ConnectionEventHandler.TEMP_FILE_EXTENSION) { if(("."+FilenameUtils.getExtension(f.getAbsolutePath())).equals(ConnectionEventHandler.TEMP_FILE_EXTENSION)) {
f.delete(); f.delete();
} }
} }

View File

@@ -88,7 +88,7 @@ public class GuiReplayOverlay extends Gui {
} }
@SubscribeEvent @SubscribeEvent
public void renderRecordingIndicator(RenderGameOverlayEvent.Post event) { public void renderRecordingIndicator(RenderGameOverlayEvent.Text event) {
if(!ReplayHandler.isInReplay() && ReplayMod.replaySettings.showRecordingIndicator() && ConnectionEventHandler.isRecording()) { if(!ReplayHandler.isInReplay() && ReplayMod.replaySettings.showRecordingIndicator() && ConnectionEventHandler.isRecording()) {
GlStateManager.resetColor(); GlStateManager.resetColor();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();

View File

@@ -150,7 +150,7 @@ public abstract class DataListener extends ChannelInboundHandlerAdapter {
String[] pl = players.toArray(new String[players.size()]); String[] pl = players.toArray(new String[players.size()]);
ReplayMetaData metaData = new ReplayMetaData(singleplayer, worldName, (int) lastSentPacket, startTime, pl, mcversion); ReplayMetaData metaData = new ReplayMetaData(singleplayer, worldName, (int)lastSentPacket, startTime, pl, mcversion);
String json = gson.toJson(metaData); String json = gson.toJson(metaData);
File folder = new File("./replay_recordings/"); File folder = new File("./replay_recordings/");