Quality Update (Final Update) P1
This commit is contained in:
parent
8b15690879
commit
b401cf2d47
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,6 @@
|
||||||
package net.PeytonPlayz585;
|
package net.PeytonPlayz585;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
@ -14,17 +15,16 @@ import org.teavm.jso.dom.html.HTMLElement;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.Session;
|
import net.minecraft.client.Session;
|
||||||
import net.minecraft.client.gui.GuiErrorScreen;
|
import net.minecraft.client.gui.GuiErrorScreen;
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
import net.PeytonPlayz585.storage.LocalStorageManager;
|
import net.PeytonPlayz585.storage.LocalStorageManager;
|
||||||
|
|
||||||
public class MinecraftMain {
|
public class MinecraftMain {
|
||||||
public static Thread thread = null;
|
|
||||||
|
|
||||||
public static class AbortedLaunchException extends RuntimeException {
|
public static class AbortedLaunchException extends RuntimeException {
|
||||||
// yee
|
// yee
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HTMLElement rootElement = null;
|
public static HTMLElement rootElement = null;
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) throws IOException {
|
||||||
registerErrorHandler();
|
registerErrorHandler();
|
||||||
String[] e = getOpts();
|
String[] e = getOpts();
|
||||||
try {
|
try {
|
||||||
|
@ -41,18 +41,17 @@ public class MinecraftMain {
|
||||||
run0();
|
run0();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void run0() {
|
private static void run0() throws IOException {
|
||||||
System.out.println(" -------- starting minecraft -------- ");
|
System.out.println(" -------- starting minecraft -------- ");
|
||||||
LocalStorageManager.loadStorage();
|
LocalStorageManager.loadStorage();
|
||||||
|
LevelStorageManager.loadLevelData();
|
||||||
run1();
|
run1();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void run1() {
|
private static void run1() {
|
||||||
Minecraft minecraft = new Minecraft(GL11.getCanvasWidth(), GL11.getCanvasHeight());
|
Minecraft minecraft = new Minecraft(GL11.getCanvasWidth(), GL11.getCanvasHeight());
|
||||||
//minecraft.minecraftUri = "127.0.0.1:25565";
|
minecraft.session = new Session("PeytonPlayz595", "Indev-WebGL");
|
||||||
minecraft.session = new Session("PeytonPlayz595", "WebGL-Emulator");
|
minecraft.run();
|
||||||
Thread thread = new Thread (minecraft, "Minecraft main Thread");
|
|
||||||
thread.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { }, script = "return window.classicConfig;")
|
@JSBody(params = { }, script = "return window.classicConfig;")
|
||||||
|
|
|
@ -39,11 +39,12 @@ public abstract class NBTBase {
|
||||||
|
|
||||||
public static void writeTag(NBTBase var0, DataOutput var1) throws IOException {
|
public static void writeTag(NBTBase var0, DataOutput var1) throws IOException {
|
||||||
var1.writeByte(var0.getType());
|
var1.writeByte(var0.getType());
|
||||||
if(var0.getType() != 0) {
|
if (var0.getType() == 0) {
|
||||||
byte[] var2 = var0.getKey().getBytes("UTF-8");
|
return;
|
||||||
var1.writeShort(var2.length);
|
} else {
|
||||||
var1.write(var2);
|
var1.writeUTF(var0.getKey());
|
||||||
var0.writeTagContents(var1);
|
var0.writeTagContents(var1);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public final class NBTTagCompound extends NBTBase {
|
public final class NBTTagCompound extends NBTBase {
|
||||||
private Map tagMap = new HashMap();
|
public Map tagMap = new HashMap();
|
||||||
|
|
||||||
final void writeTagContents(DataOutput var1) throws IOException {
|
final void writeTagContents(DataOutput var1) throws IOException {
|
||||||
Iterator var2 = this.tagMap.values().iterator();
|
Iterator var2 = this.tagMap.values().iterator();
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package net.PeytonPlayz585.storage;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSBody;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.core.JSString;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCountRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCursorRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCursorSource;
|
||||||
|
import org.teavm.jso.indexeddb.IDBDatabase;
|
||||||
|
import org.teavm.jso.indexeddb.IDBGetRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBIndex;
|
||||||
|
import org.teavm.jso.indexeddb.IDBKeyRange;
|
||||||
|
import org.teavm.jso.indexeddb.IDBObjectStoreParameters;
|
||||||
|
import org.teavm.jso.indexeddb.IDBRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBTransaction;
|
||||||
|
|
||||||
|
public abstract class IDBObjectStorePatched implements JSObject, IDBCursorSource {
|
||||||
|
|
||||||
|
@JSBody(params = { "db", "name", "optionalParameters" }, script = "return db.createObjectStore(name, optionalParameters);")
|
||||||
|
public static native IDBObjectStorePatched createObjectStorePatch(IDBDatabase db, String name, IDBObjectStoreParameters optionalParameters);
|
||||||
|
|
||||||
|
@JSBody(params = { "tx", "name" }, script = "return tx.objectStore(name);")
|
||||||
|
public static native IDBObjectStorePatched objectStorePatch(IDBTransaction tx, String name);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract String getName();
|
||||||
|
|
||||||
|
@JSProperty("keyPath")
|
||||||
|
abstract JSObject getKeyPathImpl();
|
||||||
|
|
||||||
|
public final String[] getKeyPath() {
|
||||||
|
JSObject result = getKeyPathImpl();
|
||||||
|
if (JSString.isInstance(result)) {
|
||||||
|
return new String[] { result.<JSString>cast().stringValue() };
|
||||||
|
} else {
|
||||||
|
return unwrapStringArray(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSBody(params = { "obj" }, script = "return this;")
|
||||||
|
private static native String[] unwrapStringArray(JSObject obj);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract String[] getIndexNames();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract boolean isAutoIncrement();
|
||||||
|
|
||||||
|
public abstract IDBRequest put(JSObject value, JSObject key);
|
||||||
|
|
||||||
|
public abstract IDBRequest put(JSObject value);
|
||||||
|
|
||||||
|
public abstract IDBRequest add(JSObject value, JSObject key);
|
||||||
|
|
||||||
|
public abstract IDBRequest add(JSObject value);
|
||||||
|
|
||||||
|
public abstract IDBRequest delete(JSObject key);
|
||||||
|
|
||||||
|
public abstract IDBGetRequest get(JSObject key);
|
||||||
|
|
||||||
|
public abstract IDBRequest clear();
|
||||||
|
|
||||||
|
public abstract IDBCursorRequest openCursor();
|
||||||
|
|
||||||
|
public abstract IDBCursorRequest openCursor(IDBKeyRange range);
|
||||||
|
|
||||||
|
public abstract IDBIndex createIndex(String name, String key);
|
||||||
|
|
||||||
|
public abstract IDBIndex createIndex(String name, String[] keys);
|
||||||
|
|
||||||
|
public abstract IDBIndex index(String name);
|
||||||
|
|
||||||
|
public abstract void deleteIndex(String name);
|
||||||
|
|
||||||
|
public abstract IDBCountRequest count();
|
||||||
|
|
||||||
|
public abstract IDBCountRequest count(JSObject key);
|
||||||
|
}
|
|
@ -0,0 +1,425 @@
|
||||||
|
package net.PeytonPlayz585.storage;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.WebGL;
|
||||||
|
import org.teavm.interop.Async;
|
||||||
|
import org.teavm.interop.AsyncCallback;
|
||||||
|
import org.teavm.jso.JSBody;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
import org.teavm.jso.indexeddb.EventHandler;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCountRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCursor;
|
||||||
|
import org.teavm.jso.indexeddb.IDBCursorRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBDatabase;
|
||||||
|
import org.teavm.jso.indexeddb.IDBFactory;
|
||||||
|
import org.teavm.jso.indexeddb.IDBGetRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBObjectStoreParameters;
|
||||||
|
import org.teavm.jso.indexeddb.IDBOpenDBRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBRequest;
|
||||||
|
import org.teavm.jso.indexeddb.IDBTransaction;
|
||||||
|
import org.teavm.jso.indexeddb.IDBVersionChangeEvent;
|
||||||
|
import org.teavm.jso.typedarrays.ArrayBuffer;
|
||||||
|
import org.teavm.jso.typedarrays.Uint8Array;
|
||||||
|
|
||||||
|
public class IndexedDBFilesystem {
|
||||||
|
|
||||||
|
public static enum OpenState {
|
||||||
|
OPENED, LOCKED, ERROR
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String err = "";
|
||||||
|
private static IDBDatabase db = null;
|
||||||
|
|
||||||
|
public static final OpenState initialize() {
|
||||||
|
DatabaseOpen dbo = AsyncHandlers.openDB("_net_peytonplayz585_minecraft_indev_IndexedDBFilesystem");
|
||||||
|
if(dbo == null) {
|
||||||
|
err = "Unknown Error";
|
||||||
|
return OpenState.ERROR;
|
||||||
|
}
|
||||||
|
if(dbo.failedLocked) {
|
||||||
|
return OpenState.LOCKED;
|
||||||
|
}
|
||||||
|
if(dbo.failedInit || dbo.database == null) {
|
||||||
|
err = dbo.failedError == null ? "Initialization Failed" : dbo.failedError;
|
||||||
|
return OpenState.ERROR;
|
||||||
|
}
|
||||||
|
db = dbo.database;
|
||||||
|
return OpenState.OPENED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String errorDetail() {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final boolean fileExists(String path) {
|
||||||
|
return AsyncHandlers.fileGetType(db, path) == FileExists.FILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final boolean directoryExists(String path) {
|
||||||
|
return AsyncHandlers.fileGetType(db, path) == FileExists.DIRECTORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final boolean pathExists(String path) {
|
||||||
|
return AsyncHandlers.fileExists(db, path).bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final void mkdir(String dir) {
|
||||||
|
if(directoryExists(dir)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int i = dir.lastIndexOf('/');
|
||||||
|
if(i > 0) {
|
||||||
|
mkdir(dir.substring(0, i));
|
||||||
|
}
|
||||||
|
AsyncHandlers.writeWholeFile(db, dir, true, ArrayBuffer.create(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void writeFile(String path, byte[] data) {
|
||||||
|
int i = path.lastIndexOf('/');
|
||||||
|
if(i > 0) {
|
||||||
|
mkdir(path.substring(0, i));
|
||||||
|
}
|
||||||
|
Uint8Array arr = Uint8Array.create(data.length);
|
||||||
|
arr.set(data);
|
||||||
|
AsyncHandlers.writeWholeFile(db, path, false, arr.getBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final byte[] readFile(String path) {
|
||||||
|
ArrayBuffer arr = AsyncHandlers.readWholeFile(db, path);
|
||||||
|
if(arr == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
byte[] data = new byte[arr.getByteLength()];
|
||||||
|
Uint8Array arrr = Uint8Array.create(arr);
|
||||||
|
for(int i = 0; i < data.length; ++i) {
|
||||||
|
data[i] = (byte) arrr.get(i);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final long getLastModified(String path) {
|
||||||
|
int lm = AsyncHandlers.fileGetLastModified(db, path);
|
||||||
|
return lm == -1 ? -1l : AsyncHandlers.Epoch + lm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int getFileSize(String path) {
|
||||||
|
ArrayBuffer arr = AsyncHandlers.readWholeFile(db, path);
|
||||||
|
if(arr == null) {
|
||||||
|
return -1;
|
||||||
|
}else {
|
||||||
|
return arr.getByteLength();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void renameFile(String oldPath, String newPath) {
|
||||||
|
copyFile(oldPath, newPath);
|
||||||
|
AsyncHandlers.deleteFile(db, oldPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void copyFile(String oldPath, String newPath) {
|
||||||
|
ArrayBuffer arr = AsyncHandlers.readWholeFile(db, oldPath);
|
||||||
|
int i = newPath.lastIndexOf('/');
|
||||||
|
if(i > 0) {
|
||||||
|
mkdir(newPath.substring(0, i));
|
||||||
|
}
|
||||||
|
AsyncHandlers.writeWholeFile(db, newPath, false, arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void deleteFile(String path) {
|
||||||
|
AsyncHandlers.deleteFile(db, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Collection<WebGL.FileEntry> listFiles(String path, boolean listDirs, boolean recursiveDirs) {
|
||||||
|
LinkedList<WebGL.FileEntry> lst = new LinkedList<>();
|
||||||
|
AsyncHandlers.iterateFiles(db, path, listDirs, recursiveDirs, lst);
|
||||||
|
return lst;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static class BooleanResult {
|
||||||
|
|
||||||
|
protected static final BooleanResult TRUE = new BooleanResult(true);
|
||||||
|
protected static final BooleanResult FALSE = new BooleanResult(false);
|
||||||
|
|
||||||
|
protected final boolean bool;
|
||||||
|
|
||||||
|
private BooleanResult(boolean b) {
|
||||||
|
bool = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static BooleanResult _new(boolean b) {
|
||||||
|
return b ? TRUE : FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static class DatabaseOpen {
|
||||||
|
|
||||||
|
protected final boolean failedInit;
|
||||||
|
protected final boolean failedLocked;
|
||||||
|
protected final String failedError;
|
||||||
|
|
||||||
|
protected final IDBDatabase database;
|
||||||
|
|
||||||
|
protected DatabaseOpen(boolean init, boolean locked, String error, IDBDatabase db) {
|
||||||
|
failedInit = init;
|
||||||
|
failedLocked = locked;
|
||||||
|
failedError = error;
|
||||||
|
database = db;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static enum FileExists {
|
||||||
|
FILE, DIRECTORY, FALSE
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSBody(script = "return ((typeof indexedDB) !== 'undefined') ? indexedDB : null;")
|
||||||
|
protected static native IDBFactory createIDBFactory();
|
||||||
|
|
||||||
|
protected static class AsyncHandlers {
|
||||||
|
|
||||||
|
protected static final long Epoch = 1645568542000l;
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native DatabaseOpen openDB(String name);
|
||||||
|
|
||||||
|
private static void openDB(String name, final AsyncCallback<DatabaseOpen> cb) {
|
||||||
|
IDBFactory i = createIDBFactory();
|
||||||
|
if(i == null) {
|
||||||
|
cb.complete(new DatabaseOpen(false, false, "window.indexedDB was null or undefined", null));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final IDBOpenDBRequest f = i.open(name, 1);
|
||||||
|
f.setOnBlocked(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(new DatabaseOpen(false, true, null, null));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
f.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(new DatabaseOpen(false, false, null, f.getResult()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
f.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(new DatabaseOpen(true, false, "open error", null));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
f.setOnUpgradeNeeded(new EventListener<IDBVersionChangeEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent(IDBVersionChangeEvent evt) {
|
||||||
|
IDBObjectStorePatched.createObjectStorePatch(f.getResult(), "filesystem", IDBObjectStoreParameters.create().keyPath("path"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native BooleanResult deleteFile(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void deleteFile(IDBDatabase db, String name, final AsyncCallback<BooleanResult> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readwrite");
|
||||||
|
final IDBRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").delete(makeTheFuckingKeyWork(name));
|
||||||
|
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(false));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSBody(params = { "obj" }, script = "return (typeof obj === 'undefined') ? null : ((typeof obj.data === 'undefined') ? null : obj.data);")
|
||||||
|
protected static native ArrayBuffer readRow(JSObject obj);
|
||||||
|
|
||||||
|
@JSBody(params = { "obj" }, script = "return (typeof obj === 'undefined') ? false : ((typeof obj.directory === 'undefined') ? false : obj.directory);")
|
||||||
|
protected static native boolean isRowDirectory(JSObject obj);
|
||||||
|
|
||||||
|
@JSBody(params = { "obj" }, script = "return (typeof obj === 'undefined') ? -1 : ((typeof obj.lastModified === 'undefined') ? -1 : obj.lastModified);")
|
||||||
|
protected static native int readLastModified(JSObject obj);
|
||||||
|
|
||||||
|
@JSBody(params = { "obj" }, script = "return [obj];")
|
||||||
|
private static native JSObject makeTheFuckingKeyWork(String k);
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native ArrayBuffer readWholeFile(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void readWholeFile(IDBDatabase db, String name, final AsyncCallback<ArrayBuffer> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBGetRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").get(makeTheFuckingKeyWork(name));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(isRowDirectory(r.getResult()) ? null : readRow(r.getResult()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native Integer readLastModified(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void readLastModified(IDBDatabase db, String name, final AsyncCallback<Integer> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBGetRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").get(makeTheFuckingKeyWork(name));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(readLastModified(r.getResult()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSBody(params = { "k" }, script = "return ((typeof k) === \"string\") ? k : (((typeof k) === \"undefined\") ? null : (((typeof k[0]) === \"string\") ? k[0] : null));")
|
||||||
|
private static native String readKey(JSObject k);
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native Integer iterateFiles(IDBDatabase db, final String prefix, final boolean listDirs, final boolean recursiveDirs, final Collection<WebGL.FileEntry> lst);
|
||||||
|
|
||||||
|
private static void iterateFiles(IDBDatabase db, final String prefix, final boolean listDirs, final boolean recursiveDirs, final Collection<WebGL.FileEntry> lst, final AsyncCallback<Integer> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBCursorRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").openCursor();
|
||||||
|
final int[] res = new int[1];
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
IDBCursor c = r.getResult();
|
||||||
|
if(c == null || c.getKey() == null || c.getValue() == null) {
|
||||||
|
cb.complete(res[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String k = readKey(c.getKey());
|
||||||
|
if(k != null) {
|
||||||
|
if(k.startsWith(prefix)) {
|
||||||
|
if(recursiveDirs || k.indexOf('/', prefix.length() + 1) == -1) {
|
||||||
|
boolean dir = isRowDirectory(c.getValue());
|
||||||
|
if(dir) {
|
||||||
|
if(listDirs) {
|
||||||
|
lst.add(new WebGL.FileEntry(k, true, -1));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
lst.add(new WebGL.FileEntry(k, false, Epoch + readLastModified(c.getValue())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.doContinue();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(res[0] > 0 ? res[0] : -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native BooleanResult fileExists(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void fileExists(IDBDatabase db, String name, final AsyncCallback<BooleanResult> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBCountRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").count(makeTheFuckingKeyWork(name));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(r.getResult() > 0));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(false));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native Integer fileGetLastModified(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void fileGetLastModified(IDBDatabase db, String name, final AsyncCallback<Integer> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBGetRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").get(makeTheFuckingKeyWork(name));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(readLastModified(r.getResult()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native FileExists fileGetType(IDBDatabase db, String name);
|
||||||
|
|
||||||
|
private static void fileGetType(IDBDatabase db, String name, final AsyncCallback<FileExists> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readonly");
|
||||||
|
final IDBGetRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").get(makeTheFuckingKeyWork(name));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(r.getResult() == null ? FileExists.FALSE : (isRowDirectory(r.getResult()) ? FileExists.DIRECTORY : FileExists.FILE));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(FileExists.FALSE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSBody(params = { "pat", "dir", "lm", "dat" }, script = "return { path: pat, directory: dir, lastModified: lm, data: dat };")
|
||||||
|
protected static native JSObject writeRow(String name, boolean directory, int lm, ArrayBuffer data);
|
||||||
|
|
||||||
|
@Async
|
||||||
|
protected static native BooleanResult writeWholeFile(IDBDatabase db, String name, boolean directory, ArrayBuffer data);
|
||||||
|
|
||||||
|
private static void writeWholeFile(IDBDatabase db, String name, boolean directory, ArrayBuffer data, final AsyncCallback<BooleanResult> cb) {
|
||||||
|
IDBTransaction tx = db.transaction("filesystem", "readwrite");
|
||||||
|
final IDBRequest r = IDBObjectStorePatched.objectStorePatch(tx, "filesystem").put(writeRow(name, directory, (int)(System.currentTimeMillis() - Epoch), data));
|
||||||
|
r.setOnSuccess(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
r.setOnError(new EventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent() {
|
||||||
|
cb.complete(BooleanResult._new(false));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package net.PeytonPlayz585.storage;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import net.PeytonPlayz585.nbt.NBTBase;
|
||||||
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
public class LevelStorageManager {
|
||||||
|
|
||||||
|
public static NBTTagCompound levelStorage = null;
|
||||||
|
|
||||||
|
public static void loadLevelData() throws IOException {
|
||||||
|
byte[] levelData = GL11.readFile("/saves/level1.dat");
|
||||||
|
|
||||||
|
if(levelData != null) {
|
||||||
|
NBTBase nbtBase = NBTBase.readTag(new DataInputStream(new ByteArrayInputStream(levelData)));
|
||||||
|
if(nbtBase != null && nbtBase instanceof NBTTagCompound) {
|
||||||
|
levelStorage = (NBTTagCompound)nbtBase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(levelStorage.tagMap.size() == 0) {
|
||||||
|
levelStorage = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveLevelData() throws IOException {
|
||||||
|
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||||
|
NBTBase.writeTag(levelStorage, new DataOutputStream(s));
|
||||||
|
GL11.writeFile("/saves/level1.dat", s.toByteArray());
|
||||||
|
if(levelStorage.tagMap.size() == 0) {
|
||||||
|
levelStorage = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.WebGL;
|
import org.lwjgl.opengl.WebGL;
|
||||||
|
|
||||||
import net.PeytonPlayz585.minecraft.Base64;
|
import net.PeytonPlayz585.minecraft.Base64;
|
||||||
|
@ -48,24 +49,16 @@ public class LocalStorageManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveStorageG() {
|
public static void saveStorageG() throws IOException {
|
||||||
try {
|
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
NBTBase.writeTag(gameSettingsStorage, new DataOutputStream(s));
|
||||||
NBTBase.writeTag(gameSettingsStorage, new DataOutputStream(s));
|
WebGL.saveLocalStorage("g", s.toByteArray());
|
||||||
WebGL.saveLocalStorage("g", s.toByteArray());
|
|
||||||
} catch (IOException e) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveStorageP() {
|
public static void saveStorageP() throws IOException {
|
||||||
try {
|
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
NBTBase.writeTag(profileSettingsStorage, new DataOutputStream(s));
|
||||||
NBTBase.writeTag(profileSettingsStorage, new DataOutputStream(s));
|
WebGL.saveLocalStorage("p", s.toByteArray());
|
||||||
WebGL.saveLocalStorage("p", s.toByteArray());
|
|
||||||
} catch (IOException e) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String dumpConfiguration() {
|
public static String dumpConfiguration() {
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package net.minecraft.client;
|
package net.minecraft.client;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
|
import net.PeytonPlayz585.storage.LocalStorageManager;
|
||||||
|
|
||||||
public final class GameSettings {
|
public final class GameSettings {
|
||||||
private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"};
|
private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"};
|
||||||
private static final String[] DIFFICULTIES = new String[]{"Peaceful", "Easy", "Normal", "Hard"};
|
private static final String[] DIFFICULTIES = new String[]{"Peaceful", "Easy", "Normal", "Hard"};
|
||||||
|
@ -25,15 +30,11 @@ public final class GameSettings {
|
||||||
public KeyBinding keyBindSave = new KeyBinding("Save location", 28);
|
public KeyBinding keyBindSave = new KeyBinding("Save location", 28);
|
||||||
public KeyBinding keyBindLoad = new KeyBinding("Load location", 19);
|
public KeyBinding keyBindLoad = new KeyBinding("Load location", 19);
|
||||||
public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindSave, this.keyBindLoad};
|
public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindSave, this.keyBindLoad};
|
||||||
private Minecraft mc;
|
|
||||||
// private File optionsFile;
|
|
||||||
public int numberOfOptions = 9;
|
public int numberOfOptions = 9;
|
||||||
public int difficulty = 2;
|
public int difficulty = 2;
|
||||||
public boolean thirdPersonView = false;
|
public boolean thirdPersonView = false;
|
||||||
|
|
||||||
public GameSettings(Minecraft var1) {
|
public GameSettings() {
|
||||||
this.mc = var1;
|
|
||||||
// this.optionsFile = new File(var2, "options.txt");
|
|
||||||
this.loadOptions();
|
this.loadOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,88 +92,73 @@ public final class GameSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadOptions() {
|
private void loadOptions() {
|
||||||
// try {
|
NBTTagCompound settingsFile = LocalStorageManager.gameSettingsStorage;
|
||||||
// if(this.optionsFile.exists()) {
|
|
||||||
// BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile));
|
if(settingsFile.tagMap.size() == 0) {
|
||||||
//
|
return;
|
||||||
// while(true) {
|
} else {
|
||||||
// String var2 = var1.readLine();
|
if(settingsFile.hasKey("music")) {
|
||||||
// if(var2 == null) {
|
this.music = settingsFile.getBoolean("music");
|
||||||
// var1.close();
|
}
|
||||||
// return;
|
|
||||||
// }
|
if(settingsFile.hasKey("sound")) {
|
||||||
//
|
this.sound = settingsFile.getBoolean("sound");
|
||||||
// String[] var5 = var2.split(":");
|
}
|
||||||
// if(var5[0].equals("music")) {
|
|
||||||
// this.music = var5[1].equals("true");
|
if(settingsFile.hasKey("invertYMouse")) {
|
||||||
// }
|
this.invertMouse = settingsFile.getBoolean("invertYMouse");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("sound")) {
|
|
||||||
// this.sound = var5[1].equals("true");
|
if(settingsFile.hasKey("showFrameRate")) {
|
||||||
// }
|
this.showFPS = settingsFile.getBoolean("showFrameRate");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("invertYMouse")) {
|
|
||||||
// this.invertMouse = var5[1].equals("true");
|
if(settingsFile.hasKey("viewDistance")) {
|
||||||
// }
|
this.renderDistance = settingsFile.getInteger("viewDistance");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("showFrameRate")) {
|
|
||||||
// this.showFPS = var5[1].equals("true");
|
if(settingsFile.hasKey("bobView")) {
|
||||||
// }
|
this.fancyGraphics = settingsFile.getBoolean("bobView");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("viewDistance")) {
|
|
||||||
// this.renderDistance = Integer.parseInt(var5[1]);
|
if(settingsFile.hasKey("anaglyph3d")) {
|
||||||
// }
|
this.anaglyph = settingsFile.getBoolean("anaglyph3d");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("bobView")) {
|
|
||||||
// this.fancyGraphics = var5[1].equals("true");
|
if(settingsFile.hasKey("limitFramerate")) {
|
||||||
// }
|
this.limitFramerate = settingsFile.getBoolean("music");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("anaglyph3d")) {
|
|
||||||
// this.anaglyph = var5[1].equals("true");
|
if(settingsFile.hasKey("difficulty")) {
|
||||||
// }
|
this.difficulty = settingsFile.getInteger("difficulty");
|
||||||
//
|
}
|
||||||
// if(var5[0].equals("limitFramerate")) {
|
|
||||||
// this.limitFramerate = var5[1].equals("true");
|
for(int i = 0; i < keyBindings.length; ++i) {
|
||||||
// }
|
String k = "key_" + keyBindings[i].keyDescription;
|
||||||
//
|
if(settingsFile.hasKey(k)) keyBindings[i].keyCode = (int)settingsFile.getShort(k) & 0xFFFF;
|
||||||
// if(var5[0].equals("difficulty")) {
|
}
|
||||||
// this.difficulty = Integer.parseInt(var5[1]);
|
}
|
||||||
// }
|
|
||||||
//
|
|
||||||
// for(int var3 = 0; var3 < this.keyBindings.length; ++var3) {
|
|
||||||
// if(var5[0].equals("key_" + this.keyBindings[var3].keyDescription)) {
|
|
||||||
// this.keyBindings[var3].keyCode = Integer.parseInt(var5[1]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (Exception var4) {
|
|
||||||
// System.out.println("Failed to load options");
|
|
||||||
// var4.printStackTrace();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void saveOptions() {
|
public final void saveOptions() {
|
||||||
// try {
|
NBTTagCompound settingsFile = LocalStorageManager.gameSettingsStorage;
|
||||||
// PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile));
|
settingsFile.setBoolean("music", this.music);
|
||||||
// var1.println("music:" + this.music);
|
settingsFile.setBoolean("sound", this.sound);
|
||||||
// var1.println("sound:" + this.sound);
|
settingsFile.setBoolean("invertYMouse", this.invertMouse);
|
||||||
// var1.println("invertYMouse:" + this.invertMouse);
|
settingsFile.setBoolean("showFrameRate", this.showFPS);
|
||||||
// var1.println("showFrameRate:" + this.showFPS);
|
settingsFile.setInteger("viewDistance", this.renderDistance);
|
||||||
// var1.println("viewDistance:" + this.renderDistance);
|
settingsFile.setBoolean("bobView", this.fancyGraphics);
|
||||||
// var1.println("bobView:" + this.fancyGraphics);
|
settingsFile.setBoolean("anaglyph3d", this.anaglyph);
|
||||||
// var1.println("anaglyph3d:" + this.anaglyph);
|
settingsFile.setBoolean("limitFramerate", this.limitFramerate);
|
||||||
// var1.println("limitFramerate:" + this.limitFramerate);
|
settingsFile.setInteger("difficulty", this.difficulty);
|
||||||
// var1.println("difficulty:" + this.difficulty);
|
for(int i = 0; i < keyBindings.length; ++i) {
|
||||||
//
|
String k = "key_" + keyBindings[i].keyDescription;
|
||||||
// for(int var2 = 0; var2 < this.keyBindings.length; ++var2) {
|
settingsFile.setShort(k, (short)keyBindings[i].keyCode);
|
||||||
// var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode);
|
}
|
||||||
// }
|
try {
|
||||||
//
|
LocalStorageManager.saveStorageG();
|
||||||
// var1.close();
|
} catch (IOException e) {
|
||||||
// } catch (Exception var3) {
|
e.printStackTrace();
|
||||||
// System.out.println("Failed to save options");
|
}
|
||||||
// var3.printStackTrace();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,39 @@
|
||||||
package net.minecraft.client;
|
package net.minecraft.client;
|
||||||
|
|
||||||
import net.PeytonPlayz585.math.MathHelper;
|
import net.PeytonPlayz585.math.MathHelper;
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiLoadLevel;
|
|
||||||
import net.minecraft.client.gui.GuiNewLevel;
|
import net.minecraft.client.gui.GuiNewLevel;
|
||||||
import net.minecraft.client.gui.GuiOptions;
|
import net.minecraft.client.gui.GuiOptions;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.render.Tessellator;
|
import net.minecraft.client.render.Tessellator;
|
||||||
|
import net.minecraft.game.item.ItemStack;
|
||||||
|
import net.minecraft.game.level.LevelLoader;
|
||||||
|
import util.IProgressUpdate;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public final class GuiMainMenu extends GuiScreen {
|
public final class GuiMainMenu extends GuiScreen {
|
||||||
private float updateCounter = 0.0F;
|
//private float updateCounter = 0.0F;
|
||||||
private String[] splashes = new String[]{"Pre-beta!", "As seen on TV!", "Awesome!", "100% pure!", "May contain nuts!", "Better than Prey!", "More polygons!", "Sexy!", "Limited edition!", "Flashing letters!", "Made by Notch!", "Coming soon!", "Best in class!", "When it\'s finished!", "Absolutely dragon free!", "Excitement!", "More than 5000 sold!", "One of a kind!", "700+ hits on YouTube!", "Indev!", "Spiders everywhere!", "Check it out!", "Holy cow, man!", "It\'s a game!", "Made in Sweden!", "Uses LWJGL!", "Reticulating splines!", "Minecraft!", "Yaaay!", "Alpha version!", "Singleplayer!", "Keyboard compatible!", "Undocumented!", "Ingots!", "Exploding creepers!", "That\'s not a moon!", "l33t!", "Create!", "Survive!", "Dungeon!", "Exclusive!", "The bee\'s knees!", "Down with O.P.P.!", "Closed source!", "Classy!", "Wow!", "Not on steam!", "9.95 euro!", "Half price!", "Oh man!", "Check it out!", "Awesome community!", "Pixels!", "Teetsuuuuoooo!", "Kaaneeeedaaaa!", "Now with difficulty!", "Enhanced!", "90% bug free!", "Pretty!", "12 herbs and spices!", "Fat free!", "Absolutely no memes!", "Free dental!", "Ask your doctor!", "Minors welcome!", "Cloud computing!", "Legal in Finland!", "Hard to label!", "Technically good!", "Bringing home the bacon!", "Indie!", "GOTY!", "Ceci n\'est pas une title screen!", "Euclidian!", "Now in 3D!", "Inspirational!", "Herregud!", "Complex cellular automata!", "Yes, sir!", "Played by cowboys!", "OpenGL 1.1!", "Thousands of colors!", "Try it!", "Age of Wonders is better!", "Try the mushroom stew!", "Sensational!", "Hot tamale, hot hot tamale!", "Play him off, keyboard cat!", "Guaranteed!", "Macroscopic!", "Bring it on!", "Random splash!", "Call your mother!", "Monster infighting!", "Loved by millions!", "Ultimate edition!", "Freaky!", "You\'ve got a brand new key!", "Water proof!", "Uninflammable!", "Whoa, dude!", "All inclusive!", "Tell your friends!", "NP is not in P!", "Notch <3 Ez!", "Music by C418!"};
|
//private String[] splashes = new String[]{"Pre-beta!", "As seen on TV!", "Awesome!", "100% pure!", "May contain nuts!", "Better than Prey!", "More polygons!", "Sexy!", "Limited edition!", "Flashing letters!", "Made by Notch!", "Coming soon!", "Best in class!", "When it\'s finished!", "Absolutely dragon free!", "Excitement!", "More than 5000 sold!", "One of a kind!", "700+ hits on YouTube!", "Indev!", "Spiders everywhere!", "Check it out!", "Holy cow, man!", "It\'s a game!", "Made in Sweden!", "Uses WebGL!", "Reticulating splines!", "Minecraft!", "Yaaay!", "Indev version!", "Singleplayer!", "Keyboard compatible!", "Undocumented!", "Ingots!", "Exploding creepers!", "That\'s not a moon!", "l33t!", "Create!", "Survive!", "Dungeon!", "Exclusive!", "The bee\'s knees!", "Down with O.P.P.!", "Open source!", "Classy!", "Wow!", "Not on steam!", "9.95 euro!", "Half price!", "Oh man!", "Check it out!", "Awesome community!", "Pixels!", "Teetsuuuuoooo!", "Kaaneeeedaaaa!", "Now with difficulty!", "Enhanced!", "90% bug free!", "Pretty!", "12 herbs and spices!", "Fat free!", "Absolutely no memes!", "Free dental!", "Ask your doctor!", "Minors welcome!", "Cloud computing!", "Legal in Finland!", "Hard to label!", "Technically good!", "Bringing home the bacon!", "Indie!", "GOTY!", "Ceci n\'est pas une title screen!", "Euclidian!", "Now in 3D!", "Inspirational!", "Herregud!", "Complex cellular automata!", "Yes, sir!", "Played by cowboys!", "WebGL 2.0!", "Thousands of colors!", "Try it!", "Age of Wonders is better!", "Try the mushroom stew!", "Sensational!", "Hot tamale, hot hot tamale!", "Play him off, keyboard cat!", "Guaranteed!", "Macroscopic!", "Bring it on!", "Random splash!", "Call your mother!", "Monster infighting!", "Loved by millions!", "Ultimate edition!", "Freaky!", "You\'ve got a brand new key!", "Water proof!", "Uninflammable!", "Whoa, dude!", "All inclusive!", "Tell your friends!", "NP is not in P!", "Notch <3 Ez!", "Music by C418!"};
|
||||||
private String currentSplash = this.splashes[(int)(Math.random() * (double)this.splashes.length)];
|
private String currentSplash = "Made by PeytonPlayz585!";
|
||||||
|
|
||||||
public final void updateScreen() {
|
//public final void updateScreen() {
|
||||||
this.updateCounter += 0.01F;
|
//this.updateCounter += 0.01F;
|
||||||
}
|
//}
|
||||||
|
|
||||||
protected final void keyTyped(char var1, int var2) {
|
protected final void keyTyped(char var1, int var2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void initGui() {
|
public final void initGui() {
|
||||||
this.controlList.clear();
|
this.controlList.clear();
|
||||||
this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 48, "Generate new level..."));
|
this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, "Generate new level..."));
|
||||||
this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, "Load level.."));
|
this.controlList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 48, "Load level.."));
|
||||||
this.controlList.add(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 96, "Play tutorial level"));
|
this.controlList.add(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 96, "Play tutorial level"));
|
||||||
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Options..."));
|
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Options..."));
|
||||||
((GuiButton)this.controlList.get(1)).enabled = false;
|
if(LevelStorageManager.levelStorage == null) {
|
||||||
|
((GuiButton)this.controlList.get(1)).enabled = false;
|
||||||
|
}
|
||||||
((GuiButton)this.controlList.get(2)).enabled = false;
|
((GuiButton)this.controlList.get(2)).enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,8 +46,10 @@ public final class GuiMainMenu extends GuiScreen {
|
||||||
this.mc.displayGuiScreen(new GuiNewLevel(this));
|
this.mc.displayGuiScreen(new GuiNewLevel(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.mc.session != null && var1.id == 2) {
|
if(var1.id == 2) {
|
||||||
this.mc.displayGuiScreen(new GuiLoadLevel(this));
|
LevelLoader loader = new LevelLoader();
|
||||||
|
Minecraft.getMinecraft().setLevel(loader.load());
|
||||||
|
this.mc.displayGuiScreen((GuiScreen)null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,7 +69,7 @@ public final class GuiMainMenu extends GuiScreen {
|
||||||
GL11.glScalef(var15, var15, var15);
|
GL11.glScalef(var15, var15, var15);
|
||||||
drawCenteredString(this.fontRenderer, this.currentSplash, 0, -8, 16776960);
|
drawCenteredString(this.fontRenderer, this.currentSplash, 0, -8, 16776960);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
String var16 = "Copyright Mojang Specifications. Do not distribute.";
|
String var16 = "Fuck Mojang, Distribute to everyone!";
|
||||||
drawString(this.fontRenderer, var16, this.width - this.fontRenderer.getStringWidth(var16) - 2, this.height - 10, 16777215);
|
drawString(this.fontRenderer, var16, this.width - this.fontRenderer.getStringWidth(var16) - 2, this.height - 10, 16777215);
|
||||||
long var7 = GL11.maxMemory();
|
long var7 = GL11.maxMemory();
|
||||||
long var9 = GL11.totalMemory();
|
long var9 = GL11.totalMemory();
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package net.minecraft.client;
|
package net.minecraft.client;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.IntBuffer;
|
import java.nio.IntBuffer;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
import net.minecraft.client.controller.PlayerController;
|
import net.minecraft.client.controller.PlayerController;
|
||||||
import net.minecraft.client.controller.PlayerControllerCreative;
|
import net.minecraft.client.controller.PlayerControllerCreative;
|
||||||
import net.minecraft.client.controller.PlayerControllerSP;
|
import net.minecraft.client.controller.PlayerControllerSP;
|
||||||
|
@ -15,6 +14,7 @@ import net.minecraft.client.gui.GuiIngame;
|
||||||
import net.minecraft.client.gui.GuiIngameMenu;
|
import net.minecraft.client.gui.GuiIngameMenu;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.client.gui.container.GuiContainer;
|
||||||
import net.minecraft.client.gui.container.GuiInventory;
|
import net.minecraft.client.gui.container.GuiInventory;
|
||||||
import net.minecraft.client.model.ModelBiped;
|
import net.minecraft.client.model.ModelBiped;
|
||||||
import net.minecraft.client.player.EntityPlayerSP;
|
import net.minecraft.client.player.EntityPlayerSP;
|
||||||
|
@ -30,10 +30,13 @@ import net.minecraft.game.entity.EntityLiving;
|
||||||
import net.minecraft.game.entity.player.InventoryPlayer;
|
import net.minecraft.game.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.game.item.Item;
|
import net.minecraft.game.item.Item;
|
||||||
import net.minecraft.game.item.ItemStack;
|
import net.minecraft.game.item.ItemStack;
|
||||||
|
import net.minecraft.game.level.LevelLoader;
|
||||||
import net.minecraft.game.level.World;
|
import net.minecraft.game.level.World;
|
||||||
import net.minecraft.game.level.block.Block;
|
import net.minecraft.game.level.block.Block;
|
||||||
import net.minecraft.game.level.generator.LevelGenerator;
|
import net.minecraft.game.level.generator.LevelGenerator;
|
||||||
import net.minecraft.game.physics.MovingObjectPosition;
|
import net.minecraft.game.physics.MovingObjectPosition;
|
||||||
|
import util.IProgressUpdate;
|
||||||
|
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@ -42,7 +45,7 @@ public final class Minecraft implements Runnable {
|
||||||
private boolean fullscreen = false;
|
private boolean fullscreen = false;
|
||||||
public int displayWidth;
|
public int displayWidth;
|
||||||
public int displayHeight;
|
public int displayHeight;
|
||||||
private Timer timer = new Timer(20.0F);
|
public Timer timer = new Timer(20.0F);
|
||||||
public World theWorld;
|
public World theWorld;
|
||||||
public RenderGlobal renderGlobal;
|
public RenderGlobal renderGlobal;
|
||||||
public EntityPlayerSP thePlayer;
|
public EntityPlayerSP thePlayer;
|
||||||
|
@ -55,7 +58,7 @@ public final class Minecraft implements Runnable {
|
||||||
public GuiScreen currentScreen = null;
|
public GuiScreen currentScreen = null;
|
||||||
public LoadingScreenRenderer loadingScreen = new LoadingScreenRenderer(this);
|
public LoadingScreenRenderer loadingScreen = new LoadingScreenRenderer(this);
|
||||||
public EntityRenderer entityRenderer = new EntityRenderer(this);
|
public EntityRenderer entityRenderer = new EntityRenderer(this);
|
||||||
private int ticksRan = 0;
|
public int ticksRan = 0;
|
||||||
private int leftClickCounter = 0;
|
private int leftClickCounter = 0;
|
||||||
private int tempDisplayWidth;
|
private int tempDisplayWidth;
|
||||||
private int tempDisplayHeight;
|
private int tempDisplayHeight;
|
||||||
|
@ -69,7 +72,7 @@ public final class Minecraft implements Runnable {
|
||||||
private String server;
|
private String server;
|
||||||
private TextureWaterFX textureWaterFX;
|
private TextureWaterFX textureWaterFX;
|
||||||
private TextureLavaFX textureLavaFX;
|
private TextureLavaFX textureLavaFX;
|
||||||
volatile boolean running;
|
public boolean running;
|
||||||
public String debug;
|
public String debug;
|
||||||
public boolean inventoryScreen;
|
public boolean inventoryScreen;
|
||||||
private int prevFrameTime;
|
private int prevFrameTime;
|
||||||
|
@ -149,7 +152,7 @@ public final class Minecraft implements Runnable {
|
||||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||||
this.options = new GameSettings(this);
|
this.options = new GameSettings();
|
||||||
this.renderEngine = new RenderEngine(this.options);
|
this.renderEngine = new RenderEngine(this.options);
|
||||||
this.fontRenderer = new FontRenderer(this.options, "/default.png", this.renderEngine);
|
this.fontRenderer = new FontRenderer(this.options, "/default.png", this.renderEngine);
|
||||||
var24 = BufferUtils.createIntBuffer(256);
|
var24 = BufferUtils.createIntBuffer(256);
|
||||||
|
@ -210,7 +213,7 @@ public final class Minecraft implements Runnable {
|
||||||
this.isGamePaused = this.currentScreen != null && this.currentScreen.doesGuiPauseGame();
|
this.isGamePaused = this.currentScreen != null && this.currentScreen.doesGuiPauseGame();
|
||||||
|
|
||||||
while(System.currentTimeMillis() >= var23 + 1000L) {
|
while(System.currentTimeMillis() >= var23 + 1000L) {
|
||||||
this.debug = var28 + " fps, " + WorldRenderer.chunksUpdated + " chunk updates";
|
this.debug = "FPS: " + var28 + ", Chunk Updates: " + WorldRenderer.chunksUpdated;
|
||||||
WorldRenderer.chunksUpdated = 0;
|
WorldRenderer.chunksUpdated = 0;
|
||||||
var23 += 1000L;
|
var23 += 1000L;
|
||||||
var28 = 0;
|
var28 = 0;
|
||||||
|
@ -358,6 +361,15 @@ public final class Minecraft implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runTick() {
|
private void runTick() {
|
||||||
|
mc = this;
|
||||||
|
|
||||||
|
this.levelSave();
|
||||||
|
|
||||||
|
if(this.playerController instanceof PlayerControllerCreative) {
|
||||||
|
for(int var1 = 0; var1 < 9; var1++) {
|
||||||
|
this.thePlayer.inventory.mainInventory[var1].stackSize = 64;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!this.inventoryScreen) {
|
if(!this.inventoryScreen) {
|
||||||
this.mouseHelper.ungrabMouse();
|
this.mouseHelper.ungrabMouse();
|
||||||
|
@ -506,7 +518,7 @@ public final class Minecraft implements Runnable {
|
||||||
this.options.thirdPersonView = !this.options.thirdPersonView;
|
this.options.thirdPersonView = !this.options.thirdPersonView;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GL11.getEventKey() == this.options.keyBindInventory.keyCode) {
|
if(GL11.getEventKey() == this.options.keyBindInventory.keyCode && !(this.playerController instanceof PlayerControllerCreative)) {
|
||||||
this.displayGuiScreen(new GuiInventory(this.thePlayer.inventory));
|
this.displayGuiScreen(new GuiInventory(this.thePlayer.inventory));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,6 +590,29 @@ public final class Minecraft implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ticksUntilSave = 6000;
|
||||||
|
public int ticksUntilSave2 = 100;
|
||||||
|
public static int inventoryTicks = 0;
|
||||||
|
|
||||||
|
private void levelSave() {
|
||||||
|
if(this.theWorld == null) {
|
||||||
|
ticksUntilSave = this.ticksRan + 6000;
|
||||||
|
this.ticksUntilSave2 = this.ticksRan + 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.ticksRan >= this.ticksUntilSave2 && this.theWorld != null && this.currentScreen instanceof GuiContainer) {
|
||||||
|
this.ticksUntilSave2 = this.ticksRan + 100;
|
||||||
|
LevelLoader loader = new LevelLoader();
|
||||||
|
loader.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.ticksRan >= this.ticksUntilSave) {
|
||||||
|
LevelLoader loader = new LevelLoader();
|
||||||
|
loader.save();
|
||||||
|
ticksUntilSave = this.ticksRan + 6000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final void generateLevel(int var1, int var2, int var3, int var4) {
|
public final void generateLevel(int var1, int var2, int var3, int var4) {
|
||||||
this.setLevel((World)null);
|
this.setLevel((World)null);
|
||||||
|
@ -614,6 +649,9 @@ public final class Minecraft implements Runnable {
|
||||||
|
|
||||||
if(var1 != null) {
|
if(var1 != null) {
|
||||||
var1.load();
|
var1.load();
|
||||||
|
//PlayerControllerCreative creative = new PlayerControllerCreative(this);
|
||||||
|
//creative.onWorldChange(var1);
|
||||||
|
this.playerController = new PlayerControllerSP(this);
|
||||||
this.playerController.onWorldChange(var1);
|
this.playerController.onWorldChange(var1);
|
||||||
this.thePlayer = (EntityPlayerSP)var1.findSubclassOf(EntityPlayerSP.class);
|
this.thePlayer = (EntityPlayerSP)var1.findSubclassOf(EntityPlayerSP.class);
|
||||||
var1.playerEntity = this.thePlayer;
|
var1.playerEntity = this.thePlayer;
|
||||||
|
@ -648,6 +686,10 @@ public final class Minecraft implements Runnable {
|
||||||
this.textureLavaFX.textureId = var4;
|
this.textureLavaFX.textureId = var4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.thePlayer != null && LevelStorageManager.levelStorage != null) {
|
||||||
|
this.thePlayer.readEntityFromNBT(LevelStorageManager.levelStorage);
|
||||||
|
}
|
||||||
|
|
||||||
System.gc();
|
System.gc();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ import util.IProgressUpdate;
|
||||||
public final class PlayerLoader extends LevelLoader {
|
public final class PlayerLoader extends LevelLoader {
|
||||||
private Minecraft mc;
|
private Minecraft mc;
|
||||||
|
|
||||||
public PlayerLoader(Minecraft var1, IProgressUpdate var2) {
|
public PlayerLoader(Minecraft var1) {
|
||||||
super(var2);
|
super();
|
||||||
this.mc = var1;
|
this.mc = var1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
import net.minecraft.game.level.block.Block;
|
import net.minecraft.game.level.block.Block;
|
||||||
|
|
||||||
public final class Session {
|
public final class Session {
|
||||||
public static List registeredBlocksList;
|
public static List<Block> registeredBlocksList;
|
||||||
public String username;
|
public String username;
|
||||||
public String sessionId;
|
public String sessionId;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public final class Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
(registeredBlocksList = new ArrayList()).add(Block.stone);
|
(registeredBlocksList = new ArrayList<Block>()).add(Block.stone);
|
||||||
registeredBlocksList.add(Block.cobblestone);
|
registeredBlocksList.add(Block.cobblestone);
|
||||||
registeredBlocksList.add(Block.brick);
|
registeredBlocksList.add(Block.brick);
|
||||||
registeredBlocksList.add(Block.dirt);
|
registeredBlocksList.add(Block.dirt);
|
||||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.game.level.block.Block;
|
||||||
public final class PlayerControllerCreative extends PlayerController {
|
public final class PlayerControllerCreative extends PlayerController {
|
||||||
private MobSpawner mobSpawner;
|
private MobSpawner mobSpawner;
|
||||||
|
|
||||||
private PlayerControllerCreative(Minecraft var1) {
|
public PlayerControllerCreative(Minecraft var1) {
|
||||||
super(var1);
|
super(var1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,24 @@
|
||||||
package net.minecraft.client.gui;
|
package net.minecraft.client.gui;
|
||||||
|
|
||||||
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
import net.minecraft.client.player.EntityPlayerSP;
|
import net.minecraft.client.player.EntityPlayerSP;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public final class GuiGameOver extends GuiScreen {
|
public final class GuiGameOver extends GuiScreen {
|
||||||
|
|
||||||
|
public GuiGameOver() {
|
||||||
|
LevelStorageManager.levelStorage = new NBTTagCompound();
|
||||||
|
try {
|
||||||
|
LevelStorageManager.saveLevelData();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final void initGui() {
|
public final void initGui() {
|
||||||
this.controlList.clear();
|
this.controlList.clear();
|
||||||
this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, "Generate new level..."));
|
this.controlList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, "Generate new level..."));
|
||||||
|
|
|
@ -151,13 +151,15 @@ public final class GuiIngame extends Gui {
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glDisable(GL11.GL_NORMALIZE);
|
GL11.glDisable(GL11.GL_NORMALIZE);
|
||||||
if(this.mc.options.showFPS) {
|
if(this.mc.options.showFPS) {
|
||||||
var4.drawStringWithShadow("Minecraft Indev (" + this.mc.debug + ")", 2, 2, 16777215);
|
var4.drawStringWithShadow("Minecraft Indev (Made by PeytonPlayz585)", 2, 2, 16777215);
|
||||||
Minecraft var23 = this.mc;
|
Minecraft var23 = this.mc;
|
||||||
var4.drawStringWithShadow(var23.renderGlobal.getDebugInfoRenders(), 2, 12, 16777215);
|
var4.drawStringWithShadow(this.mc.debug, 2, 12, 16777215);
|
||||||
var23 = this.mc;
|
var23 = this.mc;
|
||||||
var4.drawStringWithShadow(var23.renderGlobal.getDebugInfoEntities(), 2, 22, 16777215);
|
var4.drawStringWithShadow(var23.renderGlobal.getDebugInfoRenders(), 2, 22, 16777215);
|
||||||
var23 = this.mc;
|
var23 = this.mc;
|
||||||
var4.drawStringWithShadow("P: " + var23.effectRenderer.getStatistics() + ". T: " + var23.theWorld.debugSkylightUpdates(), 2, 32, 16777215);
|
var4.drawStringWithShadow(var23.renderGlobal.getDebugInfoEntities(), 2, 32, 16777215);
|
||||||
|
var23 = this.mc;
|
||||||
|
var4.drawStringWithShadow("P: " + var23.effectRenderer.getStatistics() + ". T: " + var23.theWorld.debugSkylightUpdates(), 2, 42, 16777215);
|
||||||
long var24 = GL11.maxMemory();
|
long var24 = GL11.maxMemory();
|
||||||
long var27 = GL11.totalMemory();
|
long var27 = GL11.totalMemory();
|
||||||
long var28 = GL11.freeMemory();
|
long var28 = GL11.freeMemory();
|
||||||
|
@ -167,7 +169,7 @@ public final class GuiIngame extends Gui {
|
||||||
var18 = "Allocated memory: " + var27 * 100L / var24 + "% (" + var27 / 1024L / 1024L + "MB)";
|
var18 = "Allocated memory: " + var27 * 100L / var24 + "% (" + var27 / 1024L / 1024L + "MB)";
|
||||||
drawString(var4, var18, var3 - var4.getStringWidth(var18) - 2, 12, 14737632);
|
drawString(var4, var18, var3 - var4.getStringWidth(var18) - 2, 12, 14737632);
|
||||||
} else {
|
} else {
|
||||||
var4.drawStringWithShadow("Minecraft Indev", 2, 2, 16777215);
|
var4.drawStringWithShadow("Minecraft Indev (Made by PeytonPlayz585)", 2, 2, 16777215);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var12 = 0; var12 < this.chatMessageList.size() && var12 < 10; ++var12) {
|
for(var12 = 0; var12 < this.chatMessageList.size() && var12 < 10; ++var12) {
|
||||||
|
|
|
@ -2,7 +2,15 @@ package net.minecraft.client.gui;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import net.minecraft.game.level.LevelLoader;
|
||||||
|
|
||||||
public final class GuiIngameMenu extends GuiScreen {
|
public final class GuiIngameMenu extends GuiScreen {
|
||||||
|
|
||||||
|
public GuiIngameMenu() {
|
||||||
|
LevelLoader loader = new LevelLoader();
|
||||||
|
loader.save();
|
||||||
|
}
|
||||||
|
|
||||||
public final void initGui() {
|
public final void initGui() {
|
||||||
this.controlList.clear();
|
this.controlList.clear();
|
||||||
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4, "Options..."));
|
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4, "Options..."));
|
||||||
|
|
|
@ -127,9 +127,9 @@ public class GuiLoadLevel extends GuiScreen implements Runnable {
|
||||||
protected void openLevel(File var1) {
|
protected void openLevel(File var1) {
|
||||||
try {
|
try {
|
||||||
FileInputStream var4 = new FileInputStream(var1);
|
FileInputStream var4 = new FileInputStream(var1);
|
||||||
World var2 = (new PlayerLoader(this.mc, this.mc.loadingScreen)).load(var4);
|
//World var2 = (new PlayerLoader(this.mc, this.mc.loadingScreen)).load(var4);
|
||||||
var4.close();
|
var4.close();
|
||||||
this.mc.setLevel(var2);
|
//this.mc.setLevel(var2);
|
||||||
} catch (IOException var3) {
|
} catch (IOException var3) {
|
||||||
var3.printStackTrace();
|
var3.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
package net.minecraft.client.gui;
|
package net.minecraft.client.gui;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
|
|
||||||
public final class GuiNewLevel extends GuiScreen {
|
public final class GuiNewLevel extends GuiScreen {
|
||||||
private GuiScreen prevGui;
|
private GuiScreen prevGui;
|
||||||
private String[] worldType = new String[]{"Inland", "Island", "Floating", "Flat"};
|
private String[] worldType = new String[]{"Inland", "Island", "Floating", "Flat"};
|
||||||
|
@ -37,6 +42,13 @@ public final class GuiNewLevel extends GuiScreen {
|
||||||
if(var1.id == 5) {
|
if(var1.id == 5) {
|
||||||
this.mc.displayGuiScreen(this.prevGui);
|
this.mc.displayGuiScreen(this.prevGui);
|
||||||
} else if(var1.id == 4) {
|
} else if(var1.id == 4) {
|
||||||
|
LevelStorageManager.levelStorage = new NBTTagCompound();
|
||||||
|
try {
|
||||||
|
LevelStorageManager.saveLevelData();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
this.mc.ticksUntilSave = this.mc.ticksRan + 6000;
|
||||||
this.mc.generateLevel(this.selectedWorldSize, this.selectedWorldShape, this.selectedWorldType, this.selectedWorldTheme);
|
this.mc.generateLevel(this.selectedWorldSize, this.selectedWorldShape, this.selectedWorldType, this.selectedWorldTheme);
|
||||||
this.mc.displayGuiScreen((GuiScreen)null);
|
this.mc.displayGuiScreen((GuiScreen)null);
|
||||||
} else if(var1.id == 0) {
|
} else if(var1.id == 0) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ public final class GuiSaveLevel extends GuiLoadLevel {
|
||||||
protected final void openLevel(File var1) {
|
protected final void openLevel(File var1) {
|
||||||
try {
|
try {
|
||||||
FileOutputStream var3 = new FileOutputStream(var1);
|
FileOutputStream var3 = new FileOutputStream(var1);
|
||||||
(new PlayerLoader(this.mc, this.mc.loadingScreen)).save(this.mc.theWorld, var3);
|
//(new PlayerLoader(this.mc, this.mc.loadingScreen)).save(this.mc.theWorld, var3);
|
||||||
var3.close();
|
var3.close();
|
||||||
} catch (IOException var2) {
|
} catch (IOException var2) {
|
||||||
var2.printStackTrace();
|
var2.printStackTrace();
|
||||||
|
|
5
src/teavm/java/net/minecraft/client/gui/GuiYesNo.java
Normal file
5
src/teavm/java/net/minecraft/client/gui/GuiYesNo.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package net.minecraft.client.gui;
|
||||||
|
|
||||||
|
public class GuiYesNo extends GuiScreen {
|
||||||
|
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ public class EntityPlayerSP extends EntityPlayer {
|
||||||
super.onLivingUpdate();
|
super.onLivingUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void writeEntityToNBT(NBTTagCompound var1) {
|
public final void writeEntityToNBT(NBTTagCompound var1) {
|
||||||
super.writeEntityToNBT(var1);
|
super.writeEntityToNBT(var1);
|
||||||
var1.setInteger("Score", this.getScore);
|
var1.setInteger("Score", this.getScore);
|
||||||
InventoryPlayer var10002 = this.inventory;
|
InventoryPlayer var10002 = this.inventory;
|
||||||
|
@ -69,7 +69,7 @@ public class EntityPlayerSP extends EntityPlayer {
|
||||||
var1.setTag("Inventory", var2);
|
var1.setTag("Inventory", var2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void readEntityFromNBT(NBTTagCompound var1) {
|
public final void readEntityFromNBT(NBTTagCompound var1) {
|
||||||
super.readEntityFromNBT(var1);
|
super.readEntityFromNBT(var1);
|
||||||
this.getScore = var1.getInteger("Score");
|
this.getScore = var1.getInteger("Score");
|
||||||
NBTTagList var6 = var1.getTagList("Inventory");
|
NBTTagList var6 = var1.getTagList("Inventory");
|
||||||
|
|
|
@ -30,16 +30,16 @@ public final class EntityRenderer {
|
||||||
private boolean anaglyphEnable = false;
|
private boolean anaglyphEnable = false;
|
||||||
private float farPlaneDistance = 0.0F;
|
private float farPlaneDistance = 0.0F;
|
||||||
public ItemRenderer itemRenderer;
|
public ItemRenderer itemRenderer;
|
||||||
private int rendererUpdateCount;
|
//private int rendererUpdateCount;
|
||||||
private Entity pointedEntity = null;
|
private Entity pointedEntity = null;
|
||||||
private int entityRendererInt1;
|
//private int entityRendererInt1;
|
||||||
private int entityRendererInt2;
|
//private int entityRendererInt2;
|
||||||
private DecimalFormat entityDecimalFormat = new DecimalFormat("0000");
|
//private DecimalFormat entityDecimalFormat = new DecimalFormat("0000");
|
||||||
private ByteBuffer entityByteBuffer;
|
//private ByteBuffer entityByteBuffer;
|
||||||
private FloatBuffer entityFloatBuffer = BufferUtils.createFloatBuffer(16);
|
//private FloatBuffer entityFloatBuffer = BufferUtils.createFloatBuffer(16);
|
||||||
private Random random = new Random();
|
//private Random random = new Random();
|
||||||
private volatile int unusedInt0 = 0;
|
//private volatile int unusedInt0 = 0;
|
||||||
private volatile int unusedInt1 = 0;
|
//private volatile int unusedInt1 = 0;
|
||||||
private FloatBuffer fogColorBuffer = BufferUtils.createFloatBuffer(16);
|
private FloatBuffer fogColorBuffer = BufferUtils.createFloatBuffer(16);
|
||||||
private float fogColorRed;
|
private float fogColorRed;
|
||||||
private float fogColorGreen;
|
private float fogColorGreen;
|
||||||
|
@ -58,7 +58,7 @@ public final class EntityRenderer {
|
||||||
float var2 = (float)(3 - this.mc.options.renderDistance) / 3.0F;
|
float var2 = (float)(3 - this.mc.options.renderDistance) / 3.0F;
|
||||||
var1 = var1 * (1.0F - var2) + var2;
|
var1 = var1 * (1.0F - var2) + var2;
|
||||||
this.fogColor += (var1 - this.fogColor) * 0.1F;
|
this.fogColor += (var1 - this.fogColor) * 0.1F;
|
||||||
++this.rendererUpdateCount;
|
//++this.rendererUpdateCount;
|
||||||
this.itemRenderer.updateEquippedItem();
|
this.itemRenderer.updateEquippedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,12 +376,16 @@ public final class EntityRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.mc.options.thirdPersonView) {
|
if(!this.mc.options.thirdPersonView) {
|
||||||
|
GL11.flipLightMatrix();
|
||||||
this.itemRenderer.renderItemInFirstPerson(var1);
|
this.itemRenderer.renderItemInFirstPerson(var1);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
if(!this.mc.options.thirdPersonView) {
|
if(!this.mc.options.thirdPersonView) {
|
||||||
|
GL11.flipLightMatrix();
|
||||||
this.itemRenderer.renderOverlays(var1);
|
this.itemRenderer.renderOverlays(var1);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
this.hurtCameraEffect(var1);
|
this.hurtCameraEffect(var1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,9 @@ public final class ItemRenderer {
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glRotatef(var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F);
|
||||||
GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
float var9 = this.mc.theWorld.getLightBrightness((int)var3.posX, (int)var3.posY, (int)var3.posZ);
|
float var9 = this.mc.theWorld.getLightBrightness((int)var3.posX, (int)var3.posY, (int)var3.posZ);
|
||||||
GL11.glColor4f(var9, var9, var9, 1.0F);
|
GL11.glColor4f(var9, var9, var9, 1.0F);
|
||||||
|
@ -155,7 +157,9 @@ public final class ItemRenderer {
|
||||||
var11.addVertexWithUV(1.0F, var7, -(1.0F / 16.0F), var5, var8);
|
var11.addVertexWithUV(1.0F, var7, -(1.0F / 16.0F), var5, var8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var11.draw();
|
var11.draw();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glDisable(GL11.GL_NORMALIZE);
|
GL11.glDisable(GL11.GL_NORMALIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,12 +193,16 @@ public final class ItemRenderer {
|
||||||
GL11.glTranslatef(6.0F, 0.0F, 0.0F);
|
GL11.glTranslatef(6.0F, 0.0F, 0.0F);
|
||||||
Render var13 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
|
Render var13 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
|
||||||
RenderPlayer var12 = (RenderPlayer)var13;
|
RenderPlayer var12 = (RenderPlayer)var13;
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var12.drawFirstPersonHand();
|
var12.drawFirstPersonHand();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_NORMALIZE);
|
GL11.glDisable(GL11.GL_NORMALIZE);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void renderOverlays(float var1) {
|
public final void renderOverlays(float var1) {
|
||||||
|
@ -227,7 +235,9 @@ public final class ItemRenderer {
|
||||||
var3.addVertexWithUV(0.5F, -0.5F, -0.5F, var6, var9);
|
var3.addVertexWithUV(0.5F, -0.5F, -0.5F, var6, var9);
|
||||||
var3.addVertexWithUV(0.5F, 0.5F, -0.5F, var6, var7);
|
var3.addVertexWithUV(0.5F, 0.5F, -0.5F, var6, var7);
|
||||||
var3.addVertexWithUV(-0.5F, 0.5F, -0.5F, var10, var7);
|
var3.addVertexWithUV(-0.5F, 0.5F, -0.5F, var10, var7);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var3.draw();
|
var3.draw();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +261,9 @@ public final class ItemRenderer {
|
||||||
var3.addVertexWithUV(1.0F, -1.0F, -0.5F, var7 + 0.0F, var9 + 4.0F);
|
var3.addVertexWithUV(1.0F, -1.0F, -0.5F, var7 + 0.0F, var9 + 4.0F);
|
||||||
var3.addVertexWithUV(1.0F, 1.0F, -0.5F, var7 + 0.0F, var9 + 0.0F);
|
var3.addVertexWithUV(1.0F, 1.0F, -0.5F, var7 + 0.0F, var9 + 0.0F);
|
||||||
var3.addVertexWithUV(-1.0F, 1.0F, -0.5F, var7 + 4.0F, var9 + 0.0F);
|
var3.addVertexWithUV(-1.0F, 1.0F, -0.5F, var7 + 4.0F, var9 + 0.0F);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var3.draw();
|
var3.draw();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
|
@ -18,7 +18,6 @@ public class RenderEngine {
|
||||||
textureNameToImageMap = new HashMap<Integer, MinecraftImage>();
|
textureNameToImageMap = new HashMap<Integer, MinecraftImage>();
|
||||||
singleIntBuffer = BufferUtils.createIntBuffer(1);
|
singleIntBuffer = BufferUtils.createIntBuffer(1);
|
||||||
imageDataB1 = BufferUtils.createByteBuffer(0x100000);
|
imageDataB1 = BufferUtils.createByteBuffer(0x100000);
|
||||||
imageDataB2 = BufferUtils.createByteBuffer(0x100000);
|
|
||||||
clampTexture = false;
|
clampTexture = false;
|
||||||
blurTexture = false;
|
blurTexture = false;
|
||||||
options = gamesettings;
|
options = gamesettings;
|
||||||
|
@ -36,17 +35,13 @@ public class RenderEngine {
|
||||||
if (s.startsWith("%clamp%")) {
|
if (s.startsWith("%clamp%")) {
|
||||||
clampTexture = true;
|
clampTexture = true;
|
||||||
setupTexture(readTextureImage(GL11.loadResourceBytes(s.substring(7))), i);
|
setupTexture(readTextureImage(GL11.loadResourceBytes(s.substring(7))), i);
|
||||||
clampTexture = false;
|
clampTexture = false;
|
||||||
} else if (s.startsWith("%blur%")) {
|
} else if (s.startsWith("%blur%")) {
|
||||||
blurTexture = true;
|
blurTexture = true;
|
||||||
setupTexture(readTextureImage(GL11.loadResourceBytes(s.substring(6))), i);
|
setupTexture(readTextureImage(GL11.loadResourceBytes(s.substring(6))), i);
|
||||||
blurTexture = false;
|
blurTexture = false;
|
||||||
} else {
|
} else {
|
||||||
if(s.equals("/terrain.png")) {
|
|
||||||
useMipmaps = true;
|
|
||||||
}
|
|
||||||
setupTexture(readTextureImage(GL11.loadResourceBytes(s)), i);
|
setupTexture(readTextureImage(GL11.loadResourceBytes(s)), i);
|
||||||
useMipmaps = false;
|
|
||||||
}
|
}
|
||||||
textureMap.put(s, Integer.valueOf(i));
|
textureMap.put(s, Integer.valueOf(i));
|
||||||
return i;
|
return i;
|
||||||
|
@ -81,14 +76,8 @@ public class RenderEngine {
|
||||||
|
|
||||||
public void setupTexture(MinecraftImage bufferedimage, int i) {
|
public void setupTexture(MinecraftImage bufferedimage, int i) {
|
||||||
bindTexture(i);
|
bindTexture(i);
|
||||||
if (useMipmaps) {
|
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9728 /* GL_NEAREST */);
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, GL11.GL_NEAREST_MIPMAP_LINEAR);
|
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9728 /* GL_NEAREST */);
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, GL11.GL_NEAREST /* GL_LINEAR */);
|
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, GL11.GL_TEXTURE_MAX_LEVEL, 4);
|
|
||||||
} else {
|
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9728 /* GL_NEAREST */);
|
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9728 /* GL_NEAREST */);
|
|
||||||
}
|
|
||||||
if (blurTexture) {
|
if (blurTexture) {
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9729 /* GL_LINEAR */);
|
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10241 /* GL_TEXTURE_MIN_FILTER */, 9729 /* GL_LINEAR */);
|
||||||
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9729 /* GL_LINEAR */);
|
GL11.glTexParameteri(3553 /* GL_TEXTURE_2D */, 10240 /* GL_TEXTURE_MAG_FILTER */, 9729 /* GL_LINEAR */);
|
||||||
|
@ -127,32 +116,6 @@ public class RenderEngine {
|
||||||
imageDataB1.position(0).limit(abyte0.length);
|
imageDataB1.position(0).limit(abyte0.length);
|
||||||
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, 0, 6408 /* GL_RGBA */, j, k, 0, 6408 /* GL_RGBA */,
|
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, 0, 6408 /* GL_RGBA */, j, k, 0, 6408 /* GL_RGBA */,
|
||||||
5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
||||||
if (useMipmaps) {
|
|
||||||
for (int i1 = 1; i1 <= 4; i1++) {
|
|
||||||
int k1 = j >> i1 - 1;
|
|
||||||
int i2 = j >> i1;
|
|
||||||
int k2 = k >> i1;
|
|
||||||
imageDataB2.clear();
|
|
||||||
for (int i3 = 0; i3 < i2; i3++) {
|
|
||||||
for (int k3 = 0; k3 < k2; k3++) {
|
|
||||||
int i4 = imageDataB1.getInt((i3 * 2 + 0 + (k3 * 2 + 0) * k1) * 4);
|
|
||||||
int k4 = imageDataB1.getInt((i3 * 2 + 1 + (k3 * 2 + 0) * k1) * 4);
|
|
||||||
int l4 = imageDataB1.getInt((i3 * 2 + 1 + (k3 * 2 + 1) * k1) * 4);
|
|
||||||
int i5 = imageDataB1.getInt((i3 * 2 + 0 + (k3 * 2 + 1) * k1) * 4);
|
|
||||||
int j5 = averageColor(averageColor(i4, k4), averageColor(l4, i5));
|
|
||||||
imageDataB2.putInt((i3 + k3 * i2) * 4, j5);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glTexImage2D(3553 /* GL_TEXTURE_2D */, i1, 6408 /* GL_RGBA */, i2, k2, 0, 6408 /* GL_RGBA */,
|
|
||||||
5121 /* GL_UNSIGNED_BYTE */, imageDataB2);
|
|
||||||
ByteBuffer tmp = imageDataB1;
|
|
||||||
imageDataB1 = imageDataB2;
|
|
||||||
imageDataB2 = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteTexture(int i) {
|
public void deleteTexture(int i) {
|
||||||
|
@ -160,23 +123,9 @@ public class RenderEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTextureForDownloadableImage(String s) {
|
public int getTextureForDownloadableImage(String s) {
|
||||||
// if(s.contains("creeper")) {
|
|
||||||
// return getTexture("/mob/creeper.png");
|
|
||||||
// } else if(s.contains("pig")) {
|
|
||||||
// return getTexture("/mob/pig.png");
|
|
||||||
// } else if(s.contains("sheep")) {
|
|
||||||
// return getTexture("/mob/sheep.png");
|
|
||||||
// }
|
|
||||||
return getTexture(s);
|
return getTexture(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int averageColor(int i, int j) {
|
|
||||||
int k = (i & 0xff000000) >> 24 & 0xff;
|
|
||||||
int l = (j & 0xff000000) >> 24 & 0xff;
|
|
||||||
return ((k + l >> 1) << 24) + ((i & 0xfefefe) + (j & 0xfefefe) >> 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private MinecraftImage readTextureImage(byte[] inputstream) throws IOException {
|
private MinecraftImage readTextureImage(byte[] inputstream) throws IOException {
|
||||||
return GL11.loadPNG(inputstream);
|
return GL11.loadPNG(inputstream);
|
||||||
}
|
}
|
||||||
|
@ -190,12 +139,10 @@ public class RenderEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean useMipmaps = false;
|
|
||||||
private HashMap<String, Integer> textureMap;
|
private HashMap<String, Integer> textureMap;
|
||||||
private HashMap<Integer, MinecraftImage> textureNameToImageMap;
|
private HashMap<Integer, MinecraftImage> textureNameToImageMap;
|
||||||
private IntBuffer singleIntBuffer;
|
private IntBuffer singleIntBuffer;
|
||||||
private ByteBuffer imageDataB1;
|
private ByteBuffer imageDataB1;
|
||||||
private ByteBuffer imageDataB2;
|
|
||||||
private GameSettings options;
|
private GameSettings options;
|
||||||
private boolean clampTexture;
|
private boolean clampTexture;
|
||||||
private boolean blurTexture;
|
private boolean blurTexture;
|
||||||
|
|
|
@ -137,9 +137,9 @@ public final class RenderGlobal implements IWorldAccess {
|
||||||
for(int var4 = 0; var4 < this.renderChunksTall; ++var4) {
|
for(int var4 = 0; var4 < this.renderChunksTall; ++var4) {
|
||||||
for(int var5 = 0; var5 < this.renderChunksDeep; ++var5) {
|
for(int var5 = 0; var5 < this.renderChunksDeep; ++var5) {
|
||||||
this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3] = new WorldRenderer(this.worldObj, var3 << 4, var4 << 4, var5 << 4, 16, this.glRenderListBase + var1);
|
this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3] = new WorldRenderer(this.worldObj, var3 << 4, var4 << 4, var5 << 4, 16, this.glRenderListBase + var1);
|
||||||
if(this.occlusionEnabled) {
|
//if(this.occlusionEnabled) {
|
||||||
this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3].glOcclusionQuery = this.glOcclusionQueryBase.get(var2);
|
//this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3].glOcclusionQuery = this.glOcclusionQueryBase.get(var2);
|
||||||
}
|
//}
|
||||||
|
|
||||||
++var2;
|
++var2;
|
||||||
this.sortedWorldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3] = this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3];
|
this.sortedWorldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3] = this.worldRenderers[(var5 * this.renderChunksTall + var4) * this.renderChunksWide + var3];
|
||||||
|
@ -251,7 +251,7 @@ public final class RenderGlobal implements IWorldAccess {
|
||||||
int var8;
|
int var8;
|
||||||
if(this.occlusionEnabled && var2 == 0) {
|
if(this.occlusionEnabled && var2 == 0) {
|
||||||
int var10 = 8;
|
int var10 = 8;
|
||||||
this.checkOcclusionQueryResult(0, 8);
|
//this.checkOcclusionQueryResult(0, 8);
|
||||||
|
|
||||||
int var6;
|
int var6;
|
||||||
for(var6 = 0; var6 < 8; ++var6) {
|
for(var6 = 0; var6 < 8; ++var6) {
|
||||||
|
@ -272,21 +272,21 @@ public final class RenderGlobal implements IWorldAccess {
|
||||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
GL11.glColorMask(false, false, false, false);
|
GL11.glColorMask(false, false, false, false);
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
this.checkOcclusionQueryResult(var9, var10);
|
//this.checkOcclusionQueryResult(var9, var10);
|
||||||
|
|
||||||
for(var6 = var9; var6 < var10; ++var6) {
|
for(var6 = var9; var6 < var10; ++var6) {
|
||||||
if(!this.sortedWorldRenderers[var6].isInFrustrum) {
|
if(!this.sortedWorldRenderers[var6].isInFrustrum) {
|
||||||
this.sortedWorldRenderers[var6].isVisible = true;
|
this.sortedWorldRenderers[var6].isVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.sortedWorldRenderers[var6].isInFrustrum && !this.sortedWorldRenderers[var6].isWaitingOnOcclusionQuery) {
|
//if(this.sortedWorldRenderers[var6].isInFrustrum && !this.sortedWorldRenderers[var6].isWaitingOnOcclusionQuery) {
|
||||||
float var7 = MathHelper.sqrt_float(this.sortedWorldRenderers[var6].distanceToEntitySquared(var1));
|
//float var7 = MathHelper.sqrt_float(this.sortedWorldRenderers[var6].distanceToEntitySquared(var1));
|
||||||
int var11 = (int)(1.0F + var7 / 64.0F);
|
//int var11 = (int)(1.0F + var7 / 64.0F);
|
||||||
if(this.cloudOffsetX % var11 == var6 % var11) {
|
//if(this.cloudOffsetX % var11 == var6 % var11) {
|
||||||
this.sortedWorldRenderers[var6].callOcclusionQueryList();
|
//this.sortedWorldRenderers[var6].callOcclusionQueryList();
|
||||||
this.sortedWorldRenderers[var6].isWaitingOnOcclusionQuery = true;
|
//this.sortedWorldRenderers[var6].isWaitingOnOcclusionQuery = true;
|
||||||
}
|
//}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glColorMask(true, true, true, true);
|
GL11.glColorMask(true, true, true, true);
|
||||||
|
@ -302,19 +302,19 @@ public final class RenderGlobal implements IWorldAccess {
|
||||||
return var8;
|
return var8;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkOcclusionQueryResult(int var1, int var2) {
|
// private void checkOcclusionQueryResult(int var1, int var2) {
|
||||||
for(var1 = var1; var1 < var2; ++var1) {
|
// for(var1 = var1; var1 < var2; ++var1) {
|
||||||
if(this.sortedWorldRenderers[var1].isWaitingOnOcclusionQuery) {
|
// if(this.sortedWorldRenderers[var1].isWaitingOnOcclusionQuery) {
|
||||||
this.occlusionResult.clear();
|
// this.occlusionResult.clear();
|
||||||
if(this.occlusionResult.get(0) != 0) {
|
// if(this.occlusionResult.get(0) != 0) {
|
||||||
this.sortedWorldRenderers[var1].isWaitingOnOcclusionQuery = false;
|
// this.sortedWorldRenderers[var1].isWaitingOnOcclusionQuery = false;
|
||||||
this.occlusionResult.clear();
|
// this.occlusionResult.clear();
|
||||||
this.sortedWorldRenderers[var1].isVisible = this.occlusionResult.get(0) != 0;
|
// this.sortedWorldRenderers[var1].isVisible = this.occlusionResult.get(0) != 0;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
private int renderSortedRenderers(int var1, int var2, int var3) {
|
private int renderSortedRenderers(int var1, int var2, int var3) {
|
||||||
int var4 = 0;
|
int var4 = 0;
|
||||||
|
@ -595,7 +595,9 @@ public final class RenderGlobal implements IWorldAccess {
|
||||||
var6 = Block.stone;
|
var6 = Block.stone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.flipLightMatrix();
|
||||||
this.globalRenderBlocks.renderBlockUsingTexture(var6, var1.blockX, var1.blockY, var1.blockZ, 240 + (int)(this.damagePartialTime * 10.0F));
|
this.globalRenderBlocks.renderBlockUsingTexture(var6, var1.blockX, var1.blockY, var1.blockZ, 240 + (int)(this.damagePartialTime * 10.0F));
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var4.draw();
|
var4.draw();
|
||||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
|
|
|
@ -24,6 +24,8 @@ public class Tessellator {
|
||||||
private double zOffset;
|
private double zOffset;
|
||||||
public static final Tessellator instance = new Tessellator(285000);
|
public static final Tessellator instance = new Tessellator(285000);
|
||||||
private boolean isDrawing = false;
|
private boolean isDrawing = false;
|
||||||
|
private boolean hasNormals = false;
|
||||||
|
private int normal;
|
||||||
|
|
||||||
private Tessellator(int par1) {
|
private Tessellator(int par1) {
|
||||||
ArrayBuffer a = ArrayBuffer.create(par1 * 4);
|
ArrayBuffer a = ArrayBuffer.create(par1 * 4);
|
||||||
|
@ -51,6 +53,10 @@ public class Tessellator {
|
||||||
GL11.glEnableVertexAttrib(GL11.GL_COLOR_ARRAY);
|
GL11.glEnableVertexAttrib(GL11.GL_COLOR_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.hasNormals) {
|
||||||
|
GL11.glEnableVertexAttrib(GL11.GL_NORMAL_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
GL11.glDrawArrays(this.drawMode, 0, this.vertexCount, Int32Array.create(intBuffer.getBuffer(), 0, this.vertexCount * 7));
|
GL11.glDrawArrays(this.drawMode, 0, this.vertexCount, Int32Array.create(intBuffer.getBuffer(), 0, this.vertexCount * 7));
|
||||||
|
|
||||||
if (this.hasTexture) {
|
if (this.hasTexture) {
|
||||||
|
@ -60,6 +66,10 @@ public class Tessellator {
|
||||||
if (this.hasColor) {
|
if (this.hasColor) {
|
||||||
GL11.glDisableVertexAttrib(GL11.GL_COLOR_ARRAY);
|
GL11.glDisableVertexAttrib(GL11.GL_COLOR_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.hasNormals) {
|
||||||
|
GL11.glDisableVertexAttrib(GL11.GL_NORMAL_ARRAY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int var1 = this.rawBufferIndex * 4;
|
int var1 = this.rawBufferIndex * 4;
|
||||||
|
@ -95,6 +105,7 @@ public class Tessellator {
|
||||||
this.isDrawing = true;
|
this.isDrawing = true;
|
||||||
this.reset();
|
this.reset();
|
||||||
this.drawMode = par1;
|
this.drawMode = par1;
|
||||||
|
this.hasNormals = false;
|
||||||
this.hasColor = false;
|
this.hasColor = false;
|
||||||
this.hasTexture = false;
|
this.hasTexture = false;
|
||||||
this.isColorDisabled = false;
|
this.isColorDisabled = false;
|
||||||
|
@ -207,6 +218,10 @@ public class Tessellator {
|
||||||
if (this.hasColor) {
|
if (this.hasColor) {
|
||||||
intBuffer0.set(bufferIndex + 5, this.color);
|
intBuffer0.set(bufferIndex + 5, this.color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.hasNormals) {
|
||||||
|
intBuffer0.set(bufferIndex + 6, this.normal);
|
||||||
|
}
|
||||||
|
|
||||||
this.rawBufferIndex += 7;
|
this.rawBufferIndex += 7;
|
||||||
}
|
}
|
||||||
|
@ -244,6 +259,11 @@ public class Tessellator {
|
||||||
* Sets the normal for the current draw call.
|
* Sets the normal for the current draw call.
|
||||||
*/
|
*/
|
||||||
public void setNormal(float par1, float par2, float par3) {
|
public void setNormal(float par1, float par2, float par3) {
|
||||||
GL11.glNormal3f(par1, par2, par3);
|
this.hasNormals = true;
|
||||||
|
float len = (float) Math.sqrt(par1 * par1 + par2 * par2 + par3 * par3);
|
||||||
|
int var4 = (int)((par1 / len) * 125.0F) + 125;
|
||||||
|
int var5 = (int)((par2 / len) * 125.0F) + 125;
|
||||||
|
int var6 = (int)((par3 / len) * 125.0F) + 125;
|
||||||
|
this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,8 +29,6 @@ public final class WorldRenderer {
|
||||||
private AxisAlignedBB rendererBoundingBox;
|
private AxisAlignedBB rendererBoundingBox;
|
||||||
private RenderBlocks renderBlocks;
|
private RenderBlocks renderBlocks;
|
||||||
public boolean isVisible = true;
|
public boolean isVisible = true;
|
||||||
public boolean isWaitingOnOcclusionQuery;
|
|
||||||
public int glOcclusionQuery;
|
|
||||||
|
|
||||||
public WorldRenderer(World var1, int var2, int var3, int var4, int var5, int var6) {
|
public WorldRenderer(World var1, int var2, int var3, int var4, int var5, int var6) {
|
||||||
this.renderBlocks = new RenderBlocks(var1);
|
this.renderBlocks = new RenderBlocks(var1);
|
||||||
|
@ -140,8 +138,4 @@ public final class WorldRenderer {
|
||||||
public final void updateInFrustrum(ICamera var1) {
|
public final void updateInFrustrum(ICamera var1) {
|
||||||
this.isInFrustrum = var1.isBoundingBoxInFrustrum(this.rendererBoundingBox);
|
this.isInFrustrum = var1.isBoundingBoxInFrustrum(this.rendererBoundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void callOcclusionQueryList() {
|
|
||||||
GL11.glCallList(this.glRenderList + 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public abstract class Render {
|
||||||
float var7 = var3;
|
float var7 = var3;
|
||||||
float var6 = var2;
|
float var6 = var2;
|
||||||
Render var27 = this;
|
Render var27 = this;
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glAlphaFunc(516, 0.1F);
|
||||||
RenderEngine var10 = this.renderManager.renderEngine;
|
RenderEngine var10 = this.renderManager.renderEngine;
|
||||||
RenderEngine.bindTexture(var10.getTexture("%clamp%/shadow.png"));
|
RenderEngine.bindTexture(var10.getTexture("%clamp%/shadow.png"));
|
||||||
World var11 = this.renderManager.worldObj;
|
World var11 = this.renderManager.worldObj;
|
||||||
|
@ -172,7 +172,9 @@ public abstract class Render {
|
||||||
}
|
}
|
||||||
|
|
||||||
var35.draw();
|
var35.draw();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@ public final class RenderArrow extends Render {
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_NORMALIZE);
|
GL11.glDisable(GL11.GL_NORMALIZE);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@ public final class RenderEntity extends Render {
|
||||||
public final void doRender(Entity var1, float var2, float var3, float var4, float var5, float var6) {
|
public final void doRender(Entity var1, float var2, float var3, float var4, float var5, float var6) {
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef(var2 - var1.lastTickPosX, var3 - var1.lastTickPosY, var4 - var1.lastTickPosZ);
|
GL11.glTranslatef(var2 - var1.lastTickPosX, var3 - var1.lastTickPosY, var4 - var1.lastTickPosZ);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
renderOffsetAABB(var1.boundingBox);
|
renderOffsetAABB(var1.boundingBox);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,9 @@ public final class RenderItem extends Render {
|
||||||
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
||||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
this.renderBlocks.renderBlockOnInventory(var8);
|
this.renderBlocks.renderBlockOnInventory(var8);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
} else {
|
} else {
|
||||||
if(var2.getItem().getIconIndex() >= 0) {
|
if(var2.getItem().getIconIndex() >= 0) {
|
||||||
|
@ -155,7 +157,9 @@ public final class RenderItem extends Render {
|
||||||
GL11.glTranslatef(var4, var5, var6);
|
GL11.glTranslatef(var4, var5, var6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var12.renderBlocks.renderBlockOnInventory(Block.blocksList[var7.itemID]);
|
var12.renderBlocks.renderBlockOnInventory(Block.blocksList[var7.itemID]);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -189,7 +193,9 @@ public final class RenderItem extends Render {
|
||||||
var15.addVertexWithUV(0.5F, -0.25F, 0.0F, var5, var2);
|
var15.addVertexWithUV(0.5F, -0.25F, 0.0F, var5, var2);
|
||||||
var15.addVertexWithUV(0.5F, 12.0F / 16.0F, 0.0F, var5, var6);
|
var15.addVertexWithUV(0.5F, 12.0F / 16.0F, 0.0F, var5, var6);
|
||||||
var15.addVertexWithUV(-0.5F, 12.0F / 16.0F, 0.0F, var4, var6);
|
var15.addVertexWithUV(-0.5F, 12.0F / 16.0F, 0.0F, var4, var6);
|
||||||
|
GL11.flipLightMatrix();
|
||||||
var15.draw();
|
var15.draw();
|
||||||
|
GL11.flipLightMatrix();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.PeytonPlayz585.math.MathHelper;
|
||||||
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
import net.PeytonPlayz585.nbt.NBTTagFloat;
|
import net.PeytonPlayz585.nbt.NBTTagFloat;
|
||||||
import net.PeytonPlayz585.nbt.NBTTagList;
|
import net.PeytonPlayz585.nbt.NBTTagList;
|
||||||
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
import net.minecraft.game.entity.misc.EntityItem;
|
import net.minecraft.game.entity.misc.EntityItem;
|
||||||
import net.minecraft.game.entity.player.EntityPlayer;
|
import net.minecraft.game.entity.player.EntityPlayer;
|
||||||
import net.minecraft.game.item.ItemStack;
|
import net.minecraft.game.item.ItemStack;
|
||||||
|
@ -65,7 +66,11 @@ public abstract class Entity {
|
||||||
|
|
||||||
public Entity(World var1) {
|
public Entity(World var1) {
|
||||||
this.worldObj = var1;
|
this.worldObj = var1;
|
||||||
this.setPosition(0.0F, 0.0F, 0.0F);
|
if(this instanceof EntityPlayer && LevelStorageManager.levelStorage != null) {
|
||||||
|
this.setPosition(LevelStorageManager.levelStorage.getFloat("player-x"), LevelStorageManager.levelStorage.getFloat("player-y"), LevelStorageManager.levelStorage.getFloat("player-z"));
|
||||||
|
} else {
|
||||||
|
this.setPosition(0.0F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void preparePlayerToSpawn() {
|
protected void preparePlayerToSpawn() {
|
||||||
|
@ -74,7 +79,11 @@ public abstract class Entity {
|
||||||
float var2 = (float)this.worldObj.ySpawn;
|
float var2 = (float)this.worldObj.ySpawn;
|
||||||
|
|
||||||
for(float var3 = (float)this.worldObj.zSpawn + 0.5F; var2 > 0.0F; ++var2) {
|
for(float var3 = (float)this.worldObj.zSpawn + 0.5F; var2 > 0.0F; ++var2) {
|
||||||
this.setPosition(var1, var2, var3);
|
if(this instanceof EntityPlayer && LevelStorageManager.levelStorage != null) {
|
||||||
|
this.setPosition(LevelStorageManager.levelStorage.getFloat("player-x"), LevelStorageManager.levelStorage.getFloat("player-y"), LevelStorageManager.levelStorage.getFloat("player-z"));
|
||||||
|
} else {
|
||||||
|
this.setPosition(var1, var2, var3);
|
||||||
|
}
|
||||||
if(this.worldObj.getCollidingBoundingBoxes(this.boundingBox).size() == 0) {
|
if(this.worldObj.getCollidingBoundingBoxes(this.boundingBox).size() == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
package net.minecraft.game.level;
|
package net.minecraft.game.level;
|
||||||
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.PeytonPlayz585.nbt.NBTBase;
|
|
||||||
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
import net.PeytonPlayz585.nbt.NBTTagCompound;
|
||||||
import net.PeytonPlayz585.nbt.NBTTagList;
|
import net.PeytonPlayz585.nbt.NBTTagList;
|
||||||
import net.PeytonPlayz585.nbt.NBTTagShort;
|
import net.PeytonPlayz585.nbt.NBTTagShort;
|
||||||
import net.minecraft.client.LoadingScreenRenderer;
|
import net.PeytonPlayz585.storage.LevelStorageManager;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.game.entity.Entity;
|
import net.minecraft.game.entity.Entity;
|
||||||
import net.minecraft.game.entity.EntityPainting;
|
import net.minecraft.game.entity.EntityPainting;
|
||||||
import net.minecraft.game.entity.animal.EntityPig;
|
import net.minecraft.game.entity.animal.EntityPig;
|
||||||
|
@ -26,25 +23,31 @@ import net.minecraft.game.level.block.Block;
|
||||||
import net.minecraft.game.level.block.tileentity.TileEntity;
|
import net.minecraft.game.level.block.tileentity.TileEntity;
|
||||||
import net.minecraft.game.level.block.tileentity.TileEntityChest;
|
import net.minecraft.game.level.block.tileentity.TileEntityChest;
|
||||||
import net.minecraft.game.level.block.tileentity.TileEntityFurnace;
|
import net.minecraft.game.level.block.tileentity.TileEntityFurnace;
|
||||||
import util.IProgressUpdate;
|
|
||||||
|
|
||||||
public abstract class LevelLoader {
|
public class LevelLoader {
|
||||||
private IProgressUpdate guiLoading;
|
|
||||||
|
|
||||||
public LevelLoader(IProgressUpdate var1) {
|
public final World load() {
|
||||||
this.guiLoading = var1;
|
String[] randomText = new String[]{"Hi from PeytonPlayz585", "You Eagler!", "Setting up World", ":)", "Isn't Indev the best version?", "I hate Microsoft!", "Notch is the best!", "PeytonPlayz585!", "Random text lol...", "Spam ping Winix!", "Ghost ping Winix!", "DM Winix for no reason!", "Spam ping Winix lol!", "Ghost ping Winix!", "DM Winix for no reason!", "PeytonPlayz585's Birthday is 10/11", "Yee!", "WebGL 2.0!", "ShadowCraft!"};
|
||||||
}
|
Minecraft.getMinecraft().loadingScreen.displayProgressMessage("Loading level");
|
||||||
|
Minecraft.getMinecraft().loadingScreen.displayLoadingString(randomText[(int)(Math.random() * (double)randomText.length)]);
|
||||||
public final World load(InputStream var1) throws IOException {
|
Minecraft.getMinecraft().loadingScreen.setLoadingProgress(25);
|
||||||
if(this.guiLoading != null) {
|
|
||||||
this.guiLoading.displayProgressMessage("Loading level");
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.guiLoading != null) {
|
Minecraft.getMinecraft().loadingScreen.displayLoadingString("Reading..");
|
||||||
this.guiLoading.displayLoadingString("Reading..");
|
Minecraft.getMinecraft().loadingScreen.setLoadingProgress(50);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound var13 = LoadingScreenRenderer.writeLevelTags(var1);
|
NBTTagCompound var13 = LevelStorageManager.levelStorage;
|
||||||
NBTTagCompound var2 = var13.getCompoundTag("About");
|
NBTTagCompound var2 = var13.getCompoundTag("About");
|
||||||
NBTTagCompound var3 = var13.getCompoundTag("Map");
|
NBTTagCompound var3 = var13.getCompoundTag("Map");
|
||||||
NBTTagCompound var4 = var13.getCompoundTag("Environment");
|
NBTTagCompound var4 = var13.getCompoundTag("Environment");
|
||||||
|
@ -53,10 +56,15 @@ public abstract class LevelLoader {
|
||||||
short var7 = var3.getShort("Length");
|
short var7 = var3.getShort("Length");
|
||||||
short var8 = var3.getShort("Height");
|
short var8 = var3.getShort("Height");
|
||||||
World var9 = new World();
|
World var9 = new World();
|
||||||
if(this.guiLoading != null) {
|
Minecraft.getMinecraft().loadingScreen.displayLoadingString("Preparing level..");
|
||||||
this.guiLoading.displayLoadingString("Preparing level..");
|
Minecraft.getMinecraft().loadingScreen.setLoadingProgress(75);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagList var10 = var3.getTagList("Spawn");
|
NBTTagList var10 = var3.getTagList("Spawn");
|
||||||
var9.xSpawn = ((NBTTagShort)var10.tagAt(0)).shortValue;
|
var9.xSpawn = ((NBTTagShort)var10.tagAt(0)).shortValue;
|
||||||
var9.ySpawn = ((NBTTagShort)var10.tagAt(1)).shortValue;
|
var9.ySpawn = ((NBTTagShort)var10.tagAt(1)).shortValue;
|
||||||
|
@ -83,10 +91,15 @@ public abstract class LevelLoader {
|
||||||
var9.worldTime = var4.getShort("TimeOfDay");
|
var9.worldTime = var4.getShort("TimeOfDay");
|
||||||
var9.skylightSubtracted = var9.getSkyBrightness();
|
var9.skylightSubtracted = var9.getSkyBrightness();
|
||||||
var9.generate(var6, var8, var7, var3.getByteArray("Blocks"), var3.getByteArray("Data"));
|
var9.generate(var6, var8, var7, var3.getByteArray("Blocks"), var3.getByteArray("Data"));
|
||||||
if(this.guiLoading != null) {
|
Minecraft.getMinecraft().loadingScreen.displayLoadingString("Preparing entities..");
|
||||||
this.guiLoading.displayLoadingString("Preparing entities..");
|
Minecraft.getMinecraft().loadingScreen.setLoadingProgress(100);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int var16 = 0; var16 < var5.tagCount(); ++var16) {
|
for(int var16 = 0; var16 < var5.tagCount(); ++var16) {
|
||||||
try {
|
try {
|
||||||
var3 = (NBTTagCompound)var5.tagAt(var16);
|
var3 = (NBTTagCompound)var5.tagAt(var16);
|
||||||
|
@ -134,14 +147,16 @@ public abstract class LevelLoader {
|
||||||
return (Entity)(var2.equals("Pig") ? new EntityPig(var1) : (var2.equals("Sheep") ? new EntitySheep(var1) : (var2.equals("Creeper") ? new EntityCreeper(var1) : (var2.equals("Skeleton") ? new EntitySkeleton(var1) : (var2.equals("Spider") ? new EntitySpider(var1) : (var2.equals("Zombie") ? new EntityZombie(var1) : (var2.equals("Giant") ? new EntityGiantZombie(var1) : (var2.equals("Item") ? new EntityItem(var1) : (var2.equals("Painting") ? new EntityPainting(var1) : null)))))))));
|
return (Entity)(var2.equals("Pig") ? new EntityPig(var1) : (var2.equals("Sheep") ? new EntitySheep(var1) : (var2.equals("Creeper") ? new EntityCreeper(var1) : (var2.equals("Skeleton") ? new EntitySkeleton(var1) : (var2.equals("Spider") ? new EntitySpider(var1) : (var2.equals("Zombie") ? new EntityZombie(var1) : (var2.equals("Giant") ? new EntityGiantZombie(var1) : (var2.equals("Item") ? new EntityItem(var1) : (var2.equals("Painting") ? new EntityPainting(var1) : null)))))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void save(World var1, OutputStream var2) throws IOException {
|
public final void save() {
|
||||||
if(this.guiLoading != null) {
|
// if(this.guiLoading != null) {
|
||||||
this.guiLoading.displayProgressMessage("Saving level");
|
// this.guiLoading.displayProgressMessage("Saving level");
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(this.guiLoading != null) {
|
// if(this.guiLoading != null) {
|
||||||
this.guiLoading.displayLoadingString("Preparing level..");
|
// this.guiLoading.displayLoadingString("Preparing level..");
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
World var1 = Minecraft.getMinecraft().theWorld;
|
||||||
|
|
||||||
NBTTagCompound var3 = new NBTTagCompound();
|
NBTTagCompound var3 = new NBTTagCompound();
|
||||||
var3.setInteger("CloudColor", var1.cloudColor);
|
var3.setInteger("CloudColor", var1.cloudColor);
|
||||||
|
@ -169,12 +184,12 @@ public abstract class LevelLoader {
|
||||||
var15.setString("Author", var1.authorName);
|
var15.setString("Author", var1.authorName);
|
||||||
var15.setString("Name", var1.name);
|
var15.setString("Name", var1.name);
|
||||||
var15.setLong("CreatedOn", var1.createTime);
|
var15.setLong("CreatedOn", var1.createTime);
|
||||||
if(this.guiLoading != null) {
|
// if(this.guiLoading != null) {
|
||||||
this.guiLoading.displayLoadingString("Preparing entities..");
|
// this.guiLoading.displayLoadingString("Preparing entities..");
|
||||||
}
|
// }
|
||||||
|
|
||||||
NBTTagList var6 = new NBTTagList();
|
NBTTagList var6 = new NBTTagList();
|
||||||
Iterator var7 = var1.entityMap.entities.iterator();
|
Iterator<?> var7 = var1.entityMap.entities.iterator();
|
||||||
|
|
||||||
while(var7.hasNext()) {
|
while(var7.hasNext()) {
|
||||||
Entity var8 = (Entity)var7.next();
|
Entity var8 = (Entity)var7.next();
|
||||||
|
@ -186,7 +201,7 @@ public abstract class LevelLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagList var16 = new NBTTagList();
|
NBTTagList var16 = new NBTTagList();
|
||||||
Iterator var17 = var1.map.keySet().iterator();
|
Iterator<?> var17 = var1.map.keySet().iterator();
|
||||||
|
|
||||||
while(var17.hasNext()) {
|
while(var17.hasNext()) {
|
||||||
int var19 = ((Integer)var17.next()).intValue();
|
int var19 = ((Integer)var17.next()).intValue();
|
||||||
|
@ -204,18 +219,27 @@ public abstract class LevelLoader {
|
||||||
var18.setCompoundTag("Environment", var3);
|
var18.setCompoundTag("Environment", var3);
|
||||||
var18.setTag("Entities", var6);
|
var18.setTag("Entities", var6);
|
||||||
var18.setTag("TileEntities", var16);
|
var18.setTag("TileEntities", var16);
|
||||||
if(this.guiLoading != null) {
|
|
||||||
this.guiLoading.displayLoadingString("Writing..");
|
var18.setFloat("player-x", Minecraft.getMinecraft().thePlayer.posX);
|
||||||
}
|
var18.setFloat("player-y", Minecraft.getMinecraft().thePlayer.posY);
|
||||||
|
var18.setFloat("player-z", Minecraft.getMinecraft().thePlayer.posZ);
|
||||||
NBTTagCompound var13 = var18;
|
|
||||||
DataOutputStream var14 = new DataOutputStream(new GZIPOutputStream(var2));
|
Minecraft.getMinecraft().thePlayer.writeEntityToNBT(var18);
|
||||||
|
|
||||||
try {
|
// if(this.guiLoading != null) {
|
||||||
NBTBase.writeTag(var13, var14);
|
// this.guiLoading.displayLoadingString("Writing..");
|
||||||
} finally {
|
// }
|
||||||
var14.close();
|
|
||||||
}
|
LevelStorageManager.levelStorage = var18;
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
LevelStorageManager.saveLevelData();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package net.minecraft.game.level.block;
|
package net.minecraft.game.level.block;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiErrorScreen;
|
||||||
import net.minecraft.game.level.World;
|
import net.minecraft.game.level.World;
|
||||||
import net.minecraft.game.level.material.Material;
|
import net.minecraft.game.level.material.Material;
|
||||||
import net.minecraft.game.physics.AxisAlignedBB;
|
import net.minecraft.game.physics.AxisAlignedBB;
|
||||||
|
@ -93,19 +96,29 @@ public final class BlockFarmland extends Block {
|
||||||
|
|
||||||
++var10;
|
++var10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There is no way to obtain water in this version
|
||||||
|
* And it's really annoying to have to walk back and forth between your base and where you planted your crops
|
||||||
|
* So I removed it :)
|
||||||
|
*/
|
||||||
|
|
||||||
if(!var10000) {
|
// if(!var10000) {
|
||||||
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
|
// var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void onEntityWalking(World var1, int var2, int var3, int var4) {
|
public final void onEntityWalking(World var1, int var2, int var3, int var4) {
|
||||||
if(var1.random.nextInt(4) == 0) {
|
/*
|
||||||
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
|
* This is bugged and really annoying
|
||||||
}
|
* So I also removed this too :)
|
||||||
|
*/
|
||||||
|
|
||||||
|
//if(var1.random.nextInt(4) == 0) {
|
||||||
|
//var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
|
public final void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
|
||||||
|
|
|
@ -65,9 +65,8 @@ import net.PeytonPlayz585.math.MathHelper;
|
||||||
import net.PeytonPlayz585.minecraft.AssetRepository;
|
import net.PeytonPlayz585.minecraft.AssetRepository;
|
||||||
import net.PeytonPlayz585.minecraft.Base64;
|
import net.PeytonPlayz585.minecraft.Base64;
|
||||||
import net.PeytonPlayz585.minecraft.MinecraftImage;
|
import net.PeytonPlayz585.minecraft.MinecraftImage;
|
||||||
|
import net.PeytonPlayz585.storage.IndexedDBFilesystem;
|
||||||
import net.PeytonPlayz585.storage.LocalStorageManager;
|
import net.PeytonPlayz585.storage.LocalStorageManager;
|
||||||
//import net.PeytonPlayz585.teavm.IndexedDBFilesystem;
|
|
||||||
//import net.PeytonPlayz585.teavm.IndexedDBFilesystem.OpenState;
|
|
||||||
import net.PeytonPlayz585.teavm.WebGL2RenderingContext;
|
import net.PeytonPlayz585.teavm.WebGL2RenderingContext;
|
||||||
import net.PeytonPlayz585.teavm.WebGLQuery;
|
import net.PeytonPlayz585.teavm.WebGLQuery;
|
||||||
import net.PeytonPlayz585.teavm.WebGLVertexArray;
|
import net.PeytonPlayz585.teavm.WebGLVertexArray;
|
||||||
|
@ -116,7 +115,7 @@ public class WebGL {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onWindowUnload() {
|
public static void onWindowUnload() throws IOException {
|
||||||
LocalStorageManager.saveStorageG();
|
LocalStorageManager.saveStorageG();
|
||||||
LocalStorageManager.saveStorageP();
|
LocalStorageManager.saveStorageP();
|
||||||
}
|
}
|
||||||
|
@ -319,15 +318,15 @@ public class WebGL {
|
||||||
onBeforeCloseRegister();
|
onBeforeCloseRegister();
|
||||||
initFileChooser();
|
initFileChooser();
|
||||||
|
|
||||||
// OpenState st = IndexedDBFilesystem.initialize();
|
IndexedDBFilesystem.OpenState st = IndexedDBFilesystem.initialize();
|
||||||
// if(st != OpenState.OPENED) {
|
if(st != IndexedDBFilesystem.OpenState.OPENED) {
|
||||||
// if(st == OpenState.LOCKED) {
|
if(st == IndexedDBFilesystem.OpenState.LOCKED) {
|
||||||
// MinecraftMain.showDatabaseLockedScreen("\nError: World folder is locked!\n\nYou are already playing Minecraft in a different Window.\nClose all other Minecraft instances and reload");
|
MinecraftMain.showDatabaseLockedScreen("\nError: World folder is locked!\n\nYou are already playing Minecraft in a different Window.\nClose all other Minecraft instances and reload");
|
||||||
// }else {
|
}else {
|
||||||
// MinecraftMain.showDatabaseLockedScreen("\nError: World folder could not be loaded!\n\n" + IndexedDBFilesystem.errorDetail());
|
MinecraftMain.showDatabaseLockedScreen("\nError: World folder could not be loaded!\n\n" + IndexedDBFilesystem.errorDetail());
|
||||||
// }
|
}
|
||||||
// throw new MinecraftMain.AbortedLaunchException();
|
throw new MinecraftMain.AbortedLaunchException();
|
||||||
// }
|
}
|
||||||
|
|
||||||
downloadAssetPack(assetPackageURI);
|
downloadAssetPack(assetPackageURI);
|
||||||
|
|
||||||
|
@ -1887,57 +1886,57 @@ public class WebGL {
|
||||||
@JSBody(params = { "obj" }, script = "return typeof obj === \"string\";")
|
@JSBody(params = { "obj" }, script = "return typeof obj === \"string\";")
|
||||||
private static native boolean isString(JSObject obj);
|
private static native boolean isString(JSObject obj);
|
||||||
|
|
||||||
// public static final boolean fileExists(String path) {
|
public static final boolean fileExists(String path) {
|
||||||
// return IndexedDBFilesystem.fileExists(path);
|
return IndexedDBFilesystem.fileExists(path);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public static final boolean directoryExists(String path) {
|
|
||||||
// return IndexedDBFilesystem.directoryExists(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final boolean pathExists(String path) {
|
|
||||||
// return IndexedDBFilesystem.pathExists(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final void writeFile(String path, byte[] data) {
|
|
||||||
// IndexedDBFilesystem.writeFile(path, data);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final byte[] readFile(String path) {
|
|
||||||
// return IndexedDBFilesystem.readFile(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final long getLastModified(String path) {
|
|
||||||
// return IndexedDBFilesystem.getLastModified(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final int getFileSize(String path) {
|
|
||||||
// return IndexedDBFilesystem.getFileSize(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final void renameFile(String oldPath, String newPath) {
|
|
||||||
// IndexedDBFilesystem.renameFile(oldPath, newPath);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final void copyFile(String oldPath, String newPath) {
|
|
||||||
// IndexedDBFilesystem.copyFile(oldPath, newPath);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final void deleteFile(String path) {
|
|
||||||
// IndexedDBFilesystem.deleteFile(path);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static final Collection<FileEntry> listFiles(String path, boolean listDirs, boolean recursiveDirs) {
|
|
||||||
// return IndexedDBFilesystem.listFiles(path, listDirs, recursiveDirs);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public static final Collection<FileEntry> listFilesAndDirectories(String path) {
|
public static final boolean directoryExists(String path) {
|
||||||
// return listFiles(path, true, false);
|
return IndexedDBFilesystem.directoryExists(path);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public static final Collection<FileEntry> listFilesRecursive(String path) {
|
public static final boolean pathExists(String path) {
|
||||||
// return listFiles(path, false, true);
|
return IndexedDBFilesystem.pathExists(path);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
public static final void writeFile(String path, byte[] data) {
|
||||||
|
IndexedDBFilesystem.writeFile(path, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final byte[] readFile(String path) {
|
||||||
|
return IndexedDBFilesystem.readFile(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final long getLastModified(String path) {
|
||||||
|
return IndexedDBFilesystem.getLastModified(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int getFileSize(String path) {
|
||||||
|
return IndexedDBFilesystem.getFileSize(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void renameFile(String oldPath, String newPath) {
|
||||||
|
IndexedDBFilesystem.renameFile(oldPath, newPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void copyFile(String oldPath, String newPath) {
|
||||||
|
IndexedDBFilesystem.copyFile(oldPath, newPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final void deleteFile(String path) {
|
||||||
|
IndexedDBFilesystem.deleteFile(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Collection<FileEntry> listFiles(String path, boolean listDirs, boolean recursiveDirs) {
|
||||||
|
return IndexedDBFilesystem.listFiles(path, listDirs, recursiveDirs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Collection<FileEntry> listFilesAndDirectories(String path) {
|
||||||
|
return listFiles(path, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Collection<FileEntry> listFilesRecursive(String path) {
|
||||||
|
return listFiles(path, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
public static class FileEntry {
|
public static class FileEntry {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user