huh
parent
6a812bf257
commit
49b1663153
|
@ -52,7 +52,7 @@ public class Minecraft implements Runnable, LevelLoaderListener
|
|||
private FloatBuffer fogColor0;
|
||||
private FloatBuffer fogColor1;
|
||||
private Timer timer;
|
||||
private Level level;
|
||||
public static Level level;
|
||||
private LevelRenderer levelRenderer;
|
||||
private Player player;
|
||||
private int paintTexture;
|
||||
|
@ -68,7 +68,7 @@ public class Minecraft implements Runnable, LevelLoaderListener
|
|||
public Font font;
|
||||
private int editMode;
|
||||
private Screen screen;
|
||||
private LevelIO levelIo;
|
||||
public static LevelIO levelIo;
|
||||
private LevelGen levelGen;
|
||||
private volatile boolean running;
|
||||
private String fpsString;
|
||||
|
@ -215,7 +215,7 @@ public class Minecraft implements Runnable, LevelLoaderListener
|
|||
}
|
||||
}
|
||||
|
||||
protected void attemptSaveLevel() {
|
||||
public void attemptSaveLevel() {
|
||||
try {
|
||||
this.levelIo.save(this.level, new FileOutputStream(new File("level.dat")));
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ public class Minecraft implements Runnable, LevelLoaderListener
|
|||
else {
|
||||
Mouse.setGrabbed(false);
|
||||
}
|
||||
this.setScreen(new MenuScreen());
|
||||
this.setScreen(new PauseScreen());
|
||||
}
|
||||
|
||||
private void handleMouseClick() {
|
||||
|
|
|
@ -4,9 +4,14 @@
|
|||
|
||||
package com.mojang.minecraft.gui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.minecraft.Minecraft;
|
||||
import com.mojang.minecraft.level.LevelIO;
|
||||
|
||||
public class PauseScreen extends Screen
|
||||
{
|
||||
private List<Button> buttons;
|
||||
|
@ -46,9 +51,8 @@ public class PauseScreen extends Screen
|
|||
this.minecraft.setScreen(null);
|
||||
this.minecraft.grabMouse();
|
||||
}
|
||||
if (button.id == 2) {
|
||||
this.minecraft.setScreen(null);
|
||||
this.minecraft.grabMouse();
|
||||
if (button.id == 1) {
|
||||
attemptSaveLevel();
|
||||
}
|
||||
if (button.id == 3) {
|
||||
this.minecraft.setScreen(null);
|
||||
|
@ -59,6 +63,15 @@ public class PauseScreen extends Screen
|
|||
}
|
||||
}
|
||||
|
||||
public void attemptSaveLevel() {
|
||||
try {
|
||||
Minecraft.levelIo.save(Minecraft.level, new FileOutputStream(new File("level.dat")));
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(final int xm, final int ym) {
|
||||
this.fillGradient(0, 0, this.width, this.height, 537199872, -1607454624);
|
||||
|
|
Loading…
Reference in New Issue