diff --git a/EAGLERCRAFTX_README.md b/EAGLERCRAFTX_README.md index ea27c32..350eae8 100755 --- a/EAGLERCRAFTX_README.md +++ b/EAGLERCRAFTX_README.md @@ -55,7 +55,7 @@ If you would like to invite other players to join your singleplayer world and pl Once you press "Start Shared World", EaglercraftX 1.8 will give you a "join code" (usually 5 letters) to share with your friends. On a different device, go the "Multiplayer" screen and press "Direct Connect" and press "Join Shared World", enter the join code given to you when you started the shared world and press "Join World". Given a few seconds, the client should successfully be able to join your shared world from any other device on the internet that also has unrestricted internet access. If it does not work, check the "Network Settings" screen and make sure you and your friends all have the same set of shared world relay URLs configured or your clients will not be able to find each other. -If you would like to host your own relay, the JAR file and instructions can be downloaded from the "Network Settings" screen in the client. EaglercraftX 1.8 uses the same "LAN world" relay server that is used by Eaglercraft 1.5.2, if you would like the relay source code find a random copy of the Eaglercraft 1.5.2 source code and it should be located in the "sp-relay" folder. The relay has not been updated since then, it has only been renamed from "LAN world relay" to "Shared world relay". +If you would like to host your own relay, the JAR file and instructions can be downloaded from the "Network Settings" screen in the client. EaglercraftX 1.8 uses the same "LAN world" relay server that is used by Eaglercraft 1.5.2, however there have been several bug fixes. The current version is available in the `sp-relay/SharedWorldRelay` folder. ## PBR Shaders @@ -77,6 +77,8 @@ To make a server for EaglercraftX 1.8 the recommended software to use is Eaglerc There is an experimental velocity plugin available in `gateway/EaglercraftXVelocity` but it is still in development and not recommended for public servers, so be sure to check for updates regularly if you use it. Configuration files are basically identical to EaglercraftXBungee so its safe to just directy copy in your old EaglercraftXBungee config files to the `plugins/eaglerxvelocity` folder and they should work with a minimal number of edits if you are migrating your network from BungeeCord to Velocity. +**Warning:** Both EaglerXBungee and EaglerXVelocity perform a lot of reflection that will inevitably break after a while when BungeeCord or Velocity is updated upstream. Both plugins will display the precise build number of BungeeCord and Velocity that has been tested by the developers and known to be compatible with EaglerXBungee and EaglerXVelocity when the proxy first starts up. If you are experiencing issues, try checking the BungeeCord or Velocity website for old versions and find the closest version number to whatever the current compatible version number is that is printed by EaglerXBungee/EaglerXVelocity, it will probably fix whatever missing functions the error messages are complaining about. + ### Detailed READMEs - [**EaglerXBungee README**](README_EAGLERXBUNGEE.md) diff --git a/desktopRuntime/resources/EPKVersionIdentifier.txt b/desktopRuntime/resources/EPKVersionIdentifier.txt index 0388712..dc93039 100755 --- a/desktopRuntime/resources/EPKVersionIdentifier.txt +++ b/desktopRuntime/resources/EPKVersionIdentifier.txt @@ -1 +1 @@ -u40 \ No newline at end of file +u41 \ No newline at end of file diff --git a/desktopRuntime/resources/assets/minecraft/lang/en_US.lang b/desktopRuntime/resources/assets/minecraft/lang/en_US.lang index ebef363..8b8fd2f 100755 --- a/desktopRuntime/resources/assets/minecraft/lang/en_US.lang +++ b/desktopRuntime/resources/assets/minecraft/lang/en_US.lang @@ -807,6 +807,22 @@ eaglercraft.options.recordingNote.text1=try opening the file in your browser eaglercraft.touch.interact.entity=Interact +eaglercraft.options.badVideoSettingsDetected.title=Issues Detected +eaglercraft.options.badVideoSettingsDetected.0=Some of your video settings may be causing +eaglercraft.options.badVideoSettingsDetected.1=the game to lag excessively +eaglercraft.options.badVideoSettingsDetected.vsync.0=VSync is disabled, some browsers require +eaglercraft.options.badVideoSettingsDetected.vsync.1=VSync to be enabled to hint when the +eaglercraft.options.badVideoSettingsDetected.vsync.2=framebuffer has updated. If the game feels +eaglercraft.options.badVideoSettingsDetected.vsync.3=significantly slower than is indicated by +eaglercraft.options.badVideoSettingsDetected.vsync.4=the FPS counter, you should enable VSync. +eaglercraft.options.badVideoSettingsDetected.renderDistance.0=Render distance is %d chunks, most devices +eaglercraft.options.badVideoSettingsDetected.renderDistance.1=lag when the render distance is greater +eaglercraft.options.badVideoSettingsDetected.renderDistance.2=than 4 chunks +eaglercraft.options.badVideoSettingsDetected.frameLimit.0=Framerate limit is set to %d +eaglercraft.options.badVideoSettingsDetected.fixSettings=Fix Settings +eaglercraft.options.badVideoSettingsDetected.continueAnyway=Continue Anyway +eaglercraft.options.badVideoSettingsDetected.doNotShowAgain=Do Not Show Again + selectServer.title=Select Server selectServer.empty=empty selectServer.select=Join Server diff --git a/desktopRuntime/resources/plugin_download.zip b/desktopRuntime/resources/plugin_download.zip index 42d0bf7..f6df894 100755 Binary files a/desktopRuntime/resources/plugin_download.zip and b/desktopRuntime/resources/plugin_download.zip differ diff --git a/desktopRuntime/resources/relay_download.zip b/desktopRuntime/resources/relay_download.zip index 82fc9f6..ab0c491 100755 Binary files a/desktopRuntime/resources/relay_download.zip and b/desktopRuntime/resources/relay_download.zip differ diff --git a/javascript/ES6ShimScript.txt b/javascript/ES6ShimScript.txt index 5ff5384..729e6cd 100755 --- a/javascript/ES6ShimScript.txt +++ b/javascript/ES6ShimScript.txt @@ -1,31 +1,41 @@ -(function(E){try {(function(){var x=function(e,t){if(typeof t==="function"){try {$rt_globals.Object.defineProperty(t,"name",{configurable:true,enumerable:false,writable:false,value:e});}catch(r){}}return t;};var g;var m;var t=[];var e=function(){var r;g="zbG9jYXRpb24e=";var e=function(e,t){var r=x("Collection",function(e){if(!this||this.constructor!==r)return new r(e);$rt_globals.Object.defineProperty(this,"_keys",{value:[]});$rt_globals.Object.defineProperty(this,"_values",{value:[]});$rt_globals.Object.defineProperty(this, -"_itp",{value:[]});$rt_globals.Object.defineProperty(this,"objectOnly",{value:t});if(e)i.call(this,e);});if(!t){$rt_globals.Object.defineProperty(e,"size",{get:b});}e.constructor=r;for(var n in e){$rt_globals.Object.defineProperty(r.prototype,n,{value:e[n]});}return r;};g=(g.substring(1)).replace("e","");var i=function(e){if(this.add)e.forEach(this.add,this);else e.forEach(function(e){this.set(e[0],e[1]);},this);};var t=function(e){if(this.has(e)){this._keys.splice(r,1);this._values.splice(r,1);this._itp.forEach(function(e) -{if(r>10;var i=function(){if(typeof $rt_globals.Set==="undefined"||typeof (new $rt_globals.Set()).values!=="function"||!((new $rt_globals.Set()).values()).next){$rt_globals.Object.defineProperty(E,"Set",{value:x("Set",e.createCollection({has:e.setHas,add:e.sharedAdd,"delete":e.sharedDelete,clear:e.sharedClear,keys:e.sharedValues,values:e.sharedValues,entries:e.setEntries,forEach:e.sharedForEach -}))});return true;}else {return false;}};var o=function(){if(typeof $rt_globals.WeakSet==="undefined"){$rt_globals.Object.defineProperty(E,"WeakSet",{value:x("WeakSet",e.createCollection({"delete":e.sharedDelete,add:e.sharedAdd,clear:e.sharedClear,has:e.setHas}))});return true;}else {return false;}};if(e.dk>(1647762<<10)){var a=e.init.gl;if(a.k===a.v||a.k.endsWith&&a.k.endsWith("."+a.v)){e.z(e.init.op,327680);}}var s=function(){var a="[["+(($rt_globals.Math.random()).toString(36)).substring(2)+"]]";var f=void 0;var l -=1;var c=2;var n=0;var i=null;var o=false;var s=false;var u=new $rt_globals.Array(1e3);var h=function(){};var e=function(e){if(typeof $rt_globals.MessageChannel==="undefined"){o=true;$rt_globals.setTimeout(e,0);return;}s=true;try {i=new $rt_globals.MessageChannel();var t=false;var r=function(){t=true;};i.port1.addEventListener("message",r);i.port1.start();i.port2.start();i.port2.postMessage("");if(t){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}$rt_globals.setTimeout(function(){i.port1.removeEventListener("message", -r);if(!t){i=null;o=true;}else {i.port1.addEventListener("message",e);}s=false;e();},10);}catch(n){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}};var r=function(){if(o||s){$rt_globals.setTimeout(t,0);}else {if(i===null){e(t);return;}i.port2.postMessage("");}};var t=function(){for(var e=0;e1114111){throw new $rt_globals.RangeError("Invalid code point "+r);}if(r<65536){t.push($rt_globals.String.fromCharCode(r));}else {r -=65536;t.push($rt_globals.String.fromCharCode((r>>10)+55296));t.push($rt_globals.String.fromCharCode(r%1024+56320));}}return t.join("");})});return true;} -else {return false;}};var l=function(){if(typeof $rt_globals.String.prototype.codePointAt==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"codePointAt",{value:x("codePointAt",function(e){e=e|0;var t=this.length;if(e>=0&&e56319||n){return r;}var i=this.charCodeAt(e+1);if(i<56320||i>57343){return r;}return (r -55296)*1024+i -56320+65536;}})});return true;}else {return false;}};var c=function(){if(typeof $rt_globals.String.prototype.startsWith -==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"startsWith",{value:x("startsWith",function(e){var t=0;if(arguments.length>1){t=arguments[1];}var r=$rt_globals.Math.max(t,0)|0;return this.slice(r,r+e.length)===e;})});return true;}else {return false;}};var h=function(){if(typeof $rt_globals.String.prototype.endsWith==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"endsWith",{value:x("endsWith",function(e){var t=this.length;var r;if(arguments.length ->1){r=arguments[1];}var n=typeof r==="undefined"?t:r|0;var i=$rt_globals.Math.min($rt_globals.Math.max(n,0)|0,t);return this.slice(i -e.length,i)===e;})});return true;}else {return false;}};var v=function(){if(typeof $rt_globals.String.prototype.includes==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"includes",{value:x("includes",function(e){var t;if(arguments.length>1){t=arguments[1];}return this.indexOf(e,t)!== -1;})});return true;}else {return false;}};var d;d=function(e,t) -{if(t<1){return "";}if(t%2){return d(e,t -1)+e;}var r=d(e,t/2);return r+r;};var p=function(){if(typeof $rt_globals.String.prototype.repeat==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"repeat",{value:x("repeat",function(e){if(e>=$rt_globals.Infinity||(e|=0)<0){throw new $rt_globals.RangeError("repeat count must be less than infinity and not overflow maximum string size");}return d(this,e);})});return true;}else {return false;}};var y=function(){if(typeof $rt_globals.Object.is -==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Object,"is",{value:x("is",function(e,t){return e===t||e!==e&&t!==t;})});return true;}else {return false;}};var b=function(){if(typeof $rt_globals.Object.setPrototypeOf==="undefined"){var e=function(e,t){var r;var n=function(e,t){if(typeof e!=="object"||e===null){throw new $rt_globals.TypeError("can not set prototype on a non-object");}if(typeof t!=="object"&&t!==null){throw new $rt_globals.TypeError("can only set prototype to an object or null");}};var i -=function(e,t){n(e,t);r.call(e,t);return e;};try {r=(e.getOwnPropertyDescriptor(e.prototype,t)).set;r.call({},null);}catch(o){if(e.prototype!=={}[t]||{__proto__:null}.__proto__===void 0){$rt_globals.console.error("ES6Shims: Can not shim Object.setPrototypeOf on this browser! Ignoring for now");return false;}r=function(e){this[t]=e;};}return i;}($rt_globals.Object,"__proto__");if(e){$rt_globals.Object.defineProperty($rt_globals.Object,"setPrototypeOf",{value:x("setPrototypeOf",e)});return true;}else {return false;}} -else {return false;}};var _=function(){if($rt_globals.Math.max.name!=="max"){$rt_globals.Object.defineProperty($rt_globals.Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===$rt_globals.Function.prototype){return "";}var e=$rt_globals.Function.prototype.toString.call(this);var t=e.match(/\s*function\s+([^(\s]*)\s*/);var r=t&&t[1];$rt_globals.Object.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:r});return r;}});return true;}else {return false;}};var S -=function(){if(typeof $rt_globals.Math.sign==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Math,"sign",{value:x("sign",function(e){var t=$rt_globals.Number(e);if(t===0){return t;}if($rt_globals.isNaN(t)){return t;}return t<0? -1:1;})});return true;}else {return false;}};var w=function(){if(typeof $rt_globals.Symbol==="undefined"){$rt_globals.Object.defineProperty(E,"Symbol",{value:function(){var e=x("Symbol",function(){return "[[ShimbolR_"+(($rt_globals.Math.random()).toString(36)).substring(2) -+"]]";});e["for"]=x("for",function(e){if(!(typeof e==="string"))return $rt_globals.undefined;return "[[ShimbolN_"+e+"]]";});e.keyFor=x("keyFor",function(e){return typeof e==="string"&&e.startsWith("[[ShimbolN_")&&e.endsWith("]]")?e.substring(11,e.length -2):$rt_globals.undefined;});return e;}()});return true;}else {return false;}};var j=false;var O=function(e,t){try {return t();}catch(r){j=true;$rt_globals.console.error('ES6Shims: Failed to detect and enable shim "'+e+'" for this browser! (Continuing anyway)');$rt_globals.console.error(r);return false;}};if -(O("Map",r))t.push(0);if(O("WeakMap",n))t.push(1);if(O("Set",i))t.push(2);if(O("WeakSet",o))t.push(3);if(O("Promise",u))t.push(4);if(O("String_fromCodePoint",f))t.push(5);if(O("String_proto_codePointAt",l))t.push(6);if(O("String_proto_startsWith",c))t.push(7);if(O("String_proto_endsWith",h))t.push(8);if(O("String_proto_includes",v))t.push(9);if(O("String_proto_repeat",p))t.push(10);if(O("Object_is",y))t.push(12);if(O("Object_setPrototypeOf",b))t.push(13);if(O("Function_proto_name",_))t.push(14);if(O("Math_sign", -S))t.push(15);if(O("Symbol",w))t.push(16);var P=t.length;E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return (P>0?1:0)|(j?2:0);},getEnabledShimCount:function(){return P;},getEnabledShimID:function(e){return t[e];}};})();}catch(e){$rt_globals.console.error("ES6Shims: Failed to detect and enable shims for this browser! (Continuing anyway)");$rt_globals.console.error(e);E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return -1;},getEnabledShimCount:function(){return 0;},getEnabledShimID -:function(e){return $rt_globals.undefined;}};}})($rt_globals); \ No newline at end of file +(function(_jsGlobal){try {(function(){var namedFunction=function(name,body){if(typeof body==="function"){try {Object.defineProperty(body,"name",{configurable:true,enumerable:false,writable:false,value:name});}catch(ex){}}return body;};var enabledShims=[];var collectionsShimImpl=function(){var i;var createCollection=function(proto,objectOnly){var Collection=namedFunction("Collection",function(a){if(!this||this.constructor!==Collection)return new Collection(a);Object.defineProperty(this, +"_keys",{value:[]});Object.defineProperty(this,"_values",{value:[]});Object.defineProperty(this,"_itp",{value:[]});Object.defineProperty(this,"objectOnly",{value:objectOnly});if(a)init.call(this,a);});if(!objectOnly){Object.defineProperty(proto,"size",{get:sharedSize});}proto.constructor=Collection;for(var k in proto){Object.defineProperty(Collection.prototype,k,{value:proto[k]});}return Collection;};var init=function(a){if(this.add)a.forEach(this.add,this);else a.forEach(function(a){this.set(a[0],a[1]);},this);};var sharedDelete +=function(key){if(this.has(key)){this._keys.splice(i,1);this._values.splice(i,1);this._itp.forEach(function(p){if(i0x10FFFF){throw new $rt_globals.RangeError("Invalid code point "+next);}if(next<0x10000){result.push($rt_globals.String.fromCharCode(next));}else {next -=0x10000;result.push($rt_globals.String.fromCharCode((next>>10)+0xD800));result.push($rt_globals.String.fromCharCode(next%0x400+0xDC00));}}return result.join("");})});return true;}else {return false;}};var shim_String_proto_codePointAt +=function(){if(typeof $rt_globals.String.prototype.codePointAt==="undefined"){Object.defineProperty($rt_globals.String.prototype,"codePointAt",{value:namedFunction("codePointAt",function(pos){pos=pos|0;var leng=this.length;if(pos>=0&&pos0xDBFF||isEnd){return first;}var second=this.charCodeAt(pos+1);if(second<0xDC00||second>0xDFFF){return first;}return (first -0xD800)*1024+second -0xDC00+0x10000;}})});return true;}else {return false;}};var shim_String_proto_startsWith +=function(){if(typeof $rt_globals.String.prototype.startsWith==="undefined"){Object.defineProperty($rt_globals.String.prototype,"startsWith",{value:namedFunction("startsWith",function(str){var position=0;if(arguments.length>1){position=arguments[1];}var start=$rt_globals.Math.max(position,0)|0;return this.slice(start,start+str.length)===str;})});return true;}else {return false;}};var shim_String_proto_endsWith=function(){if(typeof $rt_globals.String.prototype.endsWith==="undefined"){Object.defineProperty($rt_globals.String.prototype, +"endsWith",{value:namedFunction("endsWith",function(str){var len=this.length;var endPosition;if(arguments.length>1){endPosition=arguments[1];}var pos=typeof endPosition==="undefined"?len:endPosition|0;var end=$rt_globals.Math.min($rt_globals.Math.max(pos,0)|0,len);return this.slice(end -str.length,end)===str;})});return true;}else {return false;}};var shim_String_proto_includes=function(){if(typeof $rt_globals.String.prototype.includes==="undefined"){Object.defineProperty($rt_globals.String.prototype,"includes", +{value:namedFunction("includes",function(str){var position;if(arguments.length>1){position=arguments[1];}return this.indexOf(str,position)!== -1;})});return true;}else {return false;}};var stringRepeatHelper;stringRepeatHelper=function(s,times){if(times<1){return '';}if(times%2){return stringRepeatHelper(s,times -1)+s;}var half=stringRepeatHelper(s,times/2);return half+half;};var shim_String_proto_repeat=function(){if(typeof $rt_globals.String.prototype.repeat==="undefined"){Object.defineProperty($rt_globals.String.prototype, +"repeat",{value:namedFunction("repeat",function(numTimes){if(numTimes>=$rt_globals.Infinity||(numTimes|=0)<0){throw new $rt_globals.RangeError("repeat count must be less than infinity and not overflow maximum string size");}return stringRepeatHelper(this,numTimes);})});return true;}else {return false;}};var shim_Object_is=function(){if(typeof Object.is==="undefined"){Object.defineProperty(Object,"is",{value:namedFunction("is",function(a,b){return a===b||a!==a&&b!==b;})});return true;}else {return false;}};var shim_Object_setPrototypeOf +=function(){if(typeof Object.setPrototypeOf==="undefined"){var theShim=function(Object,magic){var set;var checkArgs=function(O,proto){if(typeof O!=="object"||O===null){throw new $rt_globals.TypeError("can not set prototype on a non-object");}if(typeof proto!=="object"&&proto!==null){throw new $rt_globals.TypeError("can only set prototype to an object or null");}};var setPrototypeOf=function(O,proto){checkArgs(O,proto);set.call(O,proto);return O;};try {set=(Object.getOwnPropertyDescriptor(Object.prototype,magic)).set;set.call({ +},null);}catch(o_O){if(Object.prototype!=={}[magic]||{__proto__:null}.__proto__===void 0){$rt_globals.console.error("ES6Shims: Can not shim Object.setPrototypeOf on this browser! Ignoring for now");return false;}set=function(proto){this[magic]=proto;};}return setPrototypeOf;}(Object,"__proto__");if(theShim){Object.defineProperty(Object,"setPrototypeOf",{value:namedFunction("setPrototypeOf",theShim)});return true;}else {return false;}}else {return false;}};var shim_Function_proto_name=function(){if($rt_globals.Math.max.name +!=="max"){Object.defineProperty($rt_globals.Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===$rt_globals.Function.prototype){return "";}var str=$rt_globals.Function.prototype.toString.call(this);var match=str.match(/\s*function\s+([^(\s]*)\s*/);var name=match&&match[1];Object.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:name});return name;}});return true;}else {return false;}};var shim_Math_sign=function(){if(typeof $rt_globals.Math.sign +==="undefined"){Object.defineProperty($rt_globals.Math,"sign",{value:namedFunction("sign",function(val){var number=$rt_globals.Number(val);if(number===0){return number;}if($rt_globals.isNaN(number)){return number;}return number<0? -1:1;})});return true;}else {return false;}};var shim_Symbol=function(){if(typeof $rt_globals.Symbol==="undefined"){Object.defineProperty(_jsGlobal,"Symbol",{value:function(){var symRet=namedFunction("Symbol",function(){return "[[ShimbolR_"+(($rt_globals.Math.random()).toString(36)).substring(2) ++"]]";});symRet.for=namedFunction("for",function(symName){if(!(typeof symName==="string"))return $rt_globals.undefined;return "[[ShimbolN_"+symName+"]]";});symRet.keyFor=namedFunction("keyFor",function(sym){return typeof sym==="string"&&sym.startsWith("[[ShimbolN_")&&sym.endsWith("]]")?sym.substring(11,sym.length -2):$rt_globals.undefined;});return symRet;}()});return true;}else {return false;}};var hasErrors=false;var shim_install=function(str,cb){try {return cb();}catch(_exx_){hasErrors=true;$rt_globals.console.error("ES6Shims: Failed to detect and enable shim \"" ++str+"\" for this browser! (Continuing anyway)");$rt_globals.console.error(_exx_);return false;}};if(shim_install("Map",shim_Map))enabledShims.push(0);if(shim_install("WeakMap",shim_WeakMap))enabledShims.push(1);if(shim_install("Set",shim_Set))enabledShims.push(2);if(shim_install("WeakSet",shim_WeakSet))enabledShims.push(3);if(shim_install("Promise",shim_Promise))enabledShims.push(4);if(shim_install("String_fromCodePoint",shim_String_fromCodePoint))enabledShims.push(5);if(shim_install("String_proto_codePointAt", +shim_String_proto_codePointAt))enabledShims.push(6);if(shim_install("String_proto_startsWith",shim_String_proto_startsWith))enabledShims.push(7);if(shim_install("String_proto_endsWith",shim_String_proto_endsWith))enabledShims.push(8);if(shim_install("String_proto_includes",shim_String_proto_includes))enabledShims.push(9);if(shim_install("String_proto_repeat",shim_String_proto_repeat))enabledShims.push(10);if(shim_install("Object_is",shim_Object_is))enabledShims.push(12);if(shim_install("Object_setPrototypeOf", +shim_Object_setPrototypeOf))enabledShims.push(13);if(shim_install("Function_proto_name",shim_Function_proto_name))enabledShims.push(14);if(shim_install("Math_sign",shim_Math_sign))enabledShims.push(15);if(shim_install("Symbol",shim_Symbol))enabledShims.push(16);var enCnt=enabledShims.length;_jsGlobal.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return (enCnt>0?1:0)|(hasErrors?2:0);},getEnabledShimCount:function(){return enCnt;},getEnabledShimID:function(idxIn){return enabledShims[idxIn];}};})();} +catch(_ex_){$rt_globals.console.error("ES6Shims: Failed to detect and enable shims for this browser! (Continuing anyway)");$rt_globals.console.error(_ex_);_jsGlobal.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return -1;},getEnabledShimCount:function(){return 0;},getEnabledShimID:function(idxIn){return $rt_globals.undefined;}};}})($rt_globals); \ No newline at end of file diff --git a/src/game/java/net/minecraft/client/Minecraft.java b/src/game/java/net/minecraft/client/Minecraft.java index 754e092..7567361 100755 --- a/src/game/java/net/minecraft/client/Minecraft.java +++ b/src/game/java/net/minecraft/client/Minecraft.java @@ -43,6 +43,7 @@ import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack; import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFontRenderer; import net.lax1dude.eaglercraft.v1_8.minecraft.EnumInputEvent; import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenVideoSettingsWarning; import net.lax1dude.eaglercraft.v1_8.notifications.ServerNotificationRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.EaglerMeshLoader; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; @@ -523,6 +524,11 @@ public class Minecraft implements IThreadListener { mainMenu = new GuiConnecting(mainMenu, this, this.serverName, this.serverPort); } + int vidIssues = gameSettings.checkBadVideoSettings(); + if (vidIssues != 0) { + mainMenu = new GuiScreenVideoSettingsWarning(mainMenu, vidIssues); + } + mainMenu = new GuiScreenEditProfile(mainMenu); if (!EagRuntime.getConfiguration().isForceProfanityFilter() && !gameSettings.hasShownProfanityFilter) { @@ -1547,8 +1553,9 @@ public class Minecraft implements IThreadListener { this.displayGuiScreen(new GuiChat("/")); } - boolean miningTouch = isMiningTouch(); - boolean useTouch = thePlayer.getItemShouldUseOnTouchEagler(); + boolean touchMode = PointerInputAbstraction.isTouchMode(); + boolean miningTouch = touchMode && isMiningTouch(); + boolean useTouch = touchMode && thePlayer.getItemShouldUseOnTouchEagler(); if (this.thePlayer.isUsingItem()) { if (!this.gameSettings.keyBindUseItem.isKeyDown() && !miningTouch) { this.playerController.onStoppedUsingItem(this.thePlayer); diff --git a/src/game/java/net/minecraft/client/gui/GuiVideoSettings.java b/src/game/java/net/minecraft/client/gui/GuiVideoSettings.java index c7c9ac1..28688e8 100755 --- a/src/game/java/net/minecraft/client/gui/GuiVideoSettings.java +++ b/src/game/java/net/minecraft/client/gui/GuiVideoSettings.java @@ -3,6 +3,7 @@ package net.minecraft.client.gui; import java.io.IOException; import net.lax1dude.eaglercraft.v1_8.Display; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenVideoSettingsWarning; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager; import net.lax1dude.eaglercraft.v1_8.recording.ScreenRecordingController; @@ -115,9 +116,13 @@ public class GuiVideoSettings extends GuiScreen { if (parGuiButton.enabled) { if (parGuiButton.id == 200) { this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(this.parentGuiScreen); + GuiScreen contScreen = parentGuiScreen; + int vidIssues = mc.gameSettings.checkBadVideoSettings(); + if (vidIssues != 0) { + contScreen = new GuiScreenVideoSettingsWarning(contScreen, vidIssues); + } + this.mc.displayGuiScreen(contScreen); } - } } diff --git a/src/game/java/net/minecraft/client/settings/GameSettings.java b/src/game/java/net/minecraft/client/settings/GameSettings.java index 4ad70df..76a4085 100755 --- a/src/game/java/net/minecraft/client/settings/GameSettings.java +++ b/src/game/java/net/minecraft/client/settings/GameSettings.java @@ -30,6 +30,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType; import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenVideoSettingsWarning; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredConfig; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline; import net.lax1dude.eaglercraft.v1_8.opengl.ext.dynamiclights.DynamicLightsStateManager; @@ -212,6 +213,7 @@ public class GameSettings { public boolean hasShownProfanityFilter = false; public float touchControlOpacity = 1.0f; public boolean hideDefaultUsernameWarning = false; + public boolean hideVideoSettingsWarning = false; public int voiceListenRadius = 16; public float voiceListenVolume = 0.5f; @@ -1077,6 +1079,10 @@ public class GameSettings { this.hideDefaultUsernameWarning = astring[1].equals("true"); } + if (astring[0].equals("hideVideoSettingsWarning")) { + hideVideoSettingsWarning = astring[1].equals("true"); + } + deferredShaderConf.readOption(astring[0], astring[1]); } catch (Exception var8) { logger.warn("Skipping bad option: " + s); @@ -1219,6 +1225,7 @@ public class GameSettings { printwriter.println("screenRecordMicVolume:" + this.screenRecordMicVolume); printwriter.println("touchControlOpacity:" + this.touchControlOpacity); printwriter.println("hideDefaultUsernameWarning:" + this.hideDefaultUsernameWarning); + printwriter.println("hideVideoSettingsWarning:" + this.hideVideoSettingsWarning); for (KeyBinding keybinding : this.keyBindings) { printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); @@ -1317,6 +1324,22 @@ public class GameSettings { return arr.toString(); } + public int checkBadVideoSettings() { + return hideVideoSettingsWarning ? 0 + : ((renderDistanceChunks > 6 ? GuiScreenVideoSettingsWarning.WARNING_RENDER_DISTANCE : 0) + | (!enableVsync ? GuiScreenVideoSettingsWarning.WARNING_VSYNC : 0) + | (limitFramerate < 30 ? GuiScreenVideoSettingsWarning.WARNING_FRAME_LIMIT : 0)); + } + + public void fixBadVideoSettings() { + if (renderDistanceChunks > 6) + renderDistanceChunks = 4; + if (!enableVsync) + enableVsync = true; + if (limitFramerate < 30) + limitFramerate = 260; + } + public static enum Options { INVERT_MOUSE("options.invertMouse", false, true), SENSITIVITY("options.sensitivity", true, false), FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), GAMMA("options.gamma", true, false), diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 4a4d5c0..1b5a8dd 100755 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -268,51 +268,53 @@ public class PlatformRuntime { glfwSwapInterval(0); - KHRDebug.glDebugMessageCallbackKHR(new GLDebugMessageKHRCallbackI() { - @Override - public void invoke(int source, int type, int id, int severity, int length, long message, long userParam) { - StringBuilder b = new StringBuilder(); - b.append("[KHR DEBUG #"); b.append(id); b.append("] "); - - switch(source) { - case KHRDebug.GL_DEBUG_SOURCE_API_KHR: b.append("[API - "); break; - case KHRDebug.GL_DEBUG_SOURCE_APPLICATION_KHR: b.append("[APPLICATION - "); break; - case KHRDebug.GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: b.append("[SHADER COMPILER - "); break; - case KHRDebug.GL_DEBUG_SOURCE_THIRD_PARTY_KHR: b.append("[THIRD PARTY - "); break; - case KHRDebug.GL_DEBUG_SOURCE_OTHER_KHR: default: b.append("[OTHER - "); break; + if(!requestedDisableKHRDebug) { + KHRDebug.glDebugMessageCallbackKHR(new GLDebugMessageKHRCallbackI() { + @Override + public void invoke(int source, int type, int id, int severity, int length, long message, long userParam) { + StringBuilder b = new StringBuilder(); + b.append("[KHR DEBUG #"); b.append(id); b.append("] "); + + switch(source) { + case KHRDebug.GL_DEBUG_SOURCE_API_KHR: b.append("[API - "); break; + case KHRDebug.GL_DEBUG_SOURCE_APPLICATION_KHR: b.append("[APPLICATION - "); break; + case KHRDebug.GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: b.append("[SHADER COMPILER - "); break; + case KHRDebug.GL_DEBUG_SOURCE_THIRD_PARTY_KHR: b.append("[THIRD PARTY - "); break; + case KHRDebug.GL_DEBUG_SOURCE_OTHER_KHR: default: b.append("[OTHER - "); break; + } + + switch(type) { + case KHRDebug.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: b.append("DEPRECATED BEHAVIOR] "); break; + case KHRDebug.GL_DEBUG_TYPE_ERROR_KHR: b.append("ERROR] "); break; + default: + case KHRDebug.GL_DEBUG_TYPE_OTHER_KHR: b.append("OTHER] "); break; + case KHRDebug.GL_DEBUG_TYPE_PERFORMANCE_KHR: b.append("PERFORMANCE] "); break; + case KHRDebug.GL_DEBUG_TYPE_PORTABILITY_KHR: b.append("PORTABILITY] "); break; + case KHRDebug.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: b.append("UNDEFINED BEHAVIOR] "); break; + } + + switch(severity) { + default: + case KHRDebug.GL_DEBUG_SEVERITY_LOW_KHR: b.append("[LOW Severity] "); break; + case KHRDebug.GL_DEBUG_SEVERITY_MEDIUM_KHR: b.append("[MEDIUM Severity] "); break; + case KHRDebug.GL_DEBUG_SEVERITY_HIGH_KHR: b.append("[SEVERE] "); break; + } + + String message2 = GLDebugMessageKHRCallback.getMessage(length, message); + if(message2.contains("GPU stall due to ReadPixels")) return; + b.append(message2); + logger.error(b.toString()); + + StackTraceElement[] ex = new RuntimeException().getStackTrace(); + for(int i = 0; i < ex.length; ++i) { + logger.error(" at {}", ex[i]); + } } - - switch(type) { - case KHRDebug.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: b.append("DEPRECATED BEHAVIOR] "); break; - case KHRDebug.GL_DEBUG_TYPE_ERROR_KHR: b.append("ERROR] "); break; - default: - case KHRDebug.GL_DEBUG_TYPE_OTHER_KHR: b.append("OTHER] "); break; - case KHRDebug.GL_DEBUG_TYPE_PERFORMANCE_KHR: b.append("PERFORMANCE] "); break; - case KHRDebug.GL_DEBUG_TYPE_PORTABILITY_KHR: b.append("PORTABILITY] "); break; - case KHRDebug.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: b.append("UNDEFINED BEHAVIOR] "); break; - } - - switch(severity) { - default: - case KHRDebug.GL_DEBUG_SEVERITY_LOW_KHR: b.append("[LOW Severity] "); break; - case KHRDebug.GL_DEBUG_SEVERITY_MEDIUM_KHR: b.append("[MEDIUM Severity] "); break; - case KHRDebug.GL_DEBUG_SEVERITY_HIGH_KHR: b.append("[SEVERE] "); break; - } - - String message2 = GLDebugMessageKHRCallback.getMessage(length, message); - if(message2.contains("GPU stall due to ReadPixels")) return; - b.append(message2); - logger.error(b.toString()); - - StackTraceElement[] ex = new RuntimeException().getStackTrace(); - for(int i = 0; i < ex.length; ++i) { - logger.error(" at {}", ex[i]); - } - } - }, 0l); - - GLES30.glEnable(KHRDebug.GL_DEBUG_OUTPUT_KHR); - GLES30.glEnable(KHRDebug.GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR); + }, 0l); + + GLES30.glEnable(KHRDebug.GL_DEBUG_OUTPUT_KHR); + GLES30.glEnable(KHRDebug.GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR); + } logger.info("Initializing Audio..."); PlatformAudio.platformInitialize(); @@ -361,6 +363,7 @@ public class PlatformRuntime { private static EnumPlatformANGLE requestedANGLEPlatform = EnumPlatformANGLE.DEFAULT; private static int requestedGLVersion = 300; + private static boolean requestedDisableKHRDebug = false; public static void requestANGLE(EnumPlatformANGLE plaf) { requestedANGLEPlatform = plaf; @@ -370,6 +373,10 @@ public class PlatformRuntime { requestedGLVersion = i; } + public static void requestDisableKHRDebug(boolean dis) { + requestedDisableKHRDebug = dis; + } + public static EnumPlatformANGLE getPlatformANGLE() { return rendererANGLEPlatform; } diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java index 3e803ae..cadc529 100755 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java @@ -3,7 +3,6 @@ package net.lax1dude.eaglercraft.v1_8.internal; import dev.onvoid.webrtc.*; import dev.onvoid.webrtc.internal.NativeLoader; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.EagUtils; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.sp.lan.LANPeerEvent; @@ -257,14 +256,19 @@ public class PlatformWebRTC { @Override public void onStateChange() { if (dataChannel != null && dataChannel.getState() == RTCDataChannelState.OPEN) { - scheduleTask(-1l, () -> { - while (true) { + final Runnable[] retry = new Runnable[1]; + final int[] loopCount = new int[1]; + scheduleTask(-1l, retry[0] = () -> { + f: { synchronized (lock1) { if (iceCandidates.isEmpty()) { - break; + break f; } } - EagUtils.sleep(1); + if(++loopCount[0] < 5) { + scheduleTask(1000l, retry[0]); + } + return; } synchronized (lock2) { clientDataChannelClosed = false; @@ -562,14 +566,20 @@ public class PlatformWebRTC { @Override public void onDataChannel(RTCDataChannel dataChannel) { - scheduleTask(-1l, () -> { - while (true) { + final Runnable[] retry = new Runnable[1]; + final int[] loopCount = new int[1]; + scheduleTask(-1l, retry[0] = () -> { + int i = 0; + f: { synchronized (lock3) { if (iceCandidates.isEmpty()) { - break; + break f; } } - EagUtils.sleep(1); + if(++loopCount[0] < 5) { + scheduleTask(1000l, retry[0]); + } + return; } if (dataChannel == null) return; synchronized (fuckTeaVM) { diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java index d3ce346..af21ddd 100755 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java @@ -87,6 +87,8 @@ public class LWJGLEntryPoint { PlatformRuntime.requestGL(300); }else if(args[i].equalsIgnoreCase("gles=310")) { PlatformRuntime.requestGL(310); + }else if(args[i].equalsIgnoreCase("disableKHRDebug")) { + PlatformRuntime.requestDisableKHRDebug(true); }else { EnumPlatformANGLE angle = EnumPlatformANGLE.fromId(args[i]); if(angle != EnumPlatformANGLE.DEFAULT) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 8ae6db6..c79d79d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -10,7 +10,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "EaglercraftX"; - public static final String projectForkVersion = "u40"; + public static final String projectForkVersion = "u41"; public static final String projectForkVendor = "lax1dude"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; @@ -20,20 +20,20 @@ public class EaglercraftVersion { public static final String projectOriginName = "EaglercraftX"; public static final String projectOriginAuthor = "lax1dude"; public static final String projectOriginRevision = "1.8"; - public static final String projectOriginVersion = "u40"; + public static final String projectOriginVersion = "u41"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace // EPK Version Identifier - public static final String EPKVersionIdentifier = "u40"; // Set to null to disable EPK version check + public static final String EPKVersionIdentifier = "u41"; // Set to null to disable EPK version check // Updating configuration public static final boolean enableUpdateService = true; public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client"; - public static final int updateBundlePackageVersionInt = 40; + public static final int updateBundlePackageVersionInt = 41; public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenVideoSettingsWarning.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenVideoSettingsWarning.java new file mode 100755 index 0000000..28b3a67 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenVideoSettingsWarning.java @@ -0,0 +1,114 @@ +package net.lax1dude.eaglercraft.v1_8.minecraft; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +/** + * Copyright (c) 2024 lax1dude. All Rights Reserved. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +public class GuiScreenVideoSettingsWarning extends GuiScreen { + + private final GuiScreen cont; + private final int mask; + private final List messages = new ArrayList<>(); + private int top = 0; + + public static final int WARNING_VSYNC = 1; + public static final int WARNING_RENDER_DISTANCE = 2; + public static final int WARNING_FRAME_LIMIT = 4; + + public GuiScreenVideoSettingsWarning(GuiScreen cont, int mask) { + this.cont = cont; + this.mask = mask; + } + + public void initGui() { + messages.clear(); + messages.add(EnumChatFormatting.RED + I18n.format("options.badVideoSettingsDetected.title")); + messages.add(null); + messages.add(EnumChatFormatting.GRAY + I18n.format("options.badVideoSettingsDetected.0")); + messages.add(EnumChatFormatting.GRAY + I18n.format("options.badVideoSettingsDetected.1")); + if((mask & WARNING_VSYNC) != 0) { + messages.add(null); + messages.add(I18n.format("options.badVideoSettingsDetected.vsync.0")); + messages.add(I18n.format("options.badVideoSettingsDetected.vsync.1")); + messages.add(I18n.format("options.badVideoSettingsDetected.vsync.2")); + messages.add(I18n.format("options.badVideoSettingsDetected.vsync.3")); + messages.add(I18n.format("options.badVideoSettingsDetected.vsync.4")); + } + if((mask & WARNING_RENDER_DISTANCE) != 0) { + messages.add(null); + messages.add(I18n.format("options.badVideoSettingsDetected.renderDistance.0", mc.gameSettings.renderDistanceChunks)); + messages.add(I18n.format("options.badVideoSettingsDetected.renderDistance.1")); + messages.add(I18n.format("options.badVideoSettingsDetected.renderDistance.2")); + } + if((mask & WARNING_FRAME_LIMIT) != 0) { + messages.add(null); + messages.add(I18n.format("options.badVideoSettingsDetected.frameLimit.0", mc.gameSettings.limitFramerate)); + } + int j = 0; + for(int i = 0, l = messages.size(); i < l; ++i) { + if(messages.get(i) != null) { + j += 9; + }else { + j += 5; + } + } + top = this.height / 6 + j / -12; + j += top; + buttonList.clear(); + buttonList.add(new GuiButton(0, this.width / 2 - 100, j + 16, I18n.format("options.badVideoSettingsDetected.fixSettings"))); + buttonList.add(new GuiButton(1, this.width / 2 - 100, j + 40, I18n.format("options.badVideoSettingsDetected.continueAnyway"))); + buttonList.add(new GuiButton(2, this.width / 2 - 100, j + 64, I18n.format("options.badVideoSettingsDetected.doNotShowAgain"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + int j = 0; + for(int i = 0, l = messages.size(); i < l; ++i) { + String str = messages.get(i); + if(str != null) { + this.drawCenteredString(fontRendererObj, str, this.width / 2, top + j, 16777215); + j += 9; + }else { + j += 5; + } + } + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + mc.gameSettings.fixBadVideoSettings(); + mc.gameSettings.saveOptions(); + if((mask & WARNING_RENDER_DISTANCE) != 0) { + mc.renderGlobal.loadRenderers(); + } + mc.displayGuiScreen(cont); + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(cont); + }else if(par1GuiButton.id == 2) { + mc.gameSettings.hideVideoSettingsWarning = true; + mc.gameSettings.saveOptions(); + mc.displayGuiScreen(cont); + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java index 73f435d..afdef78 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientPeer.java @@ -50,6 +50,7 @@ class LANClientPeer { PlatformWebRTC.serverLANPeerICECandidates(clientId, candidates); long millis = EagRuntime.steadyTimeMillis(); do { + PlatformWebRTC.runScheduledTasks(); LANPeerEvent evt; if((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null) { if(evt instanceof LANPeerEvent.LANPeerICECandidateEvent) { @@ -78,6 +79,7 @@ class LANClientPeer { PlatformWebRTC.serverLANPeerDescription(clientId, description); long millis = EagRuntime.steadyTimeMillis(); do { + PlatformWebRTC.runScheduledTasks(); LANPeerEvent evt; if((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null) { if(evt instanceof LANPeerEvent.LANPeerDescriptionEvent) { @@ -105,6 +107,7 @@ class LANClientPeer { if(state == SENT_ICE_CANDIDATE) { long millis = EagRuntime.steadyTimeMillis(); do { + PlatformWebRTC.runScheduledTasks(); LANPeerEvent evt; while((evt = PlatformWebRTC.serverLANGetEvent(clientId)) != null && evt instanceof LANPeerEvent.LANPeerICECandidateEvent) { // skip ice candidates diff --git a/src/teavm-boot-menu/java/net/lax1dude/eaglercraft/v1_8/boot_menu/teavm/BootMenuDatastore.java b/src/teavm-boot-menu/java/net/lax1dude/eaglercraft/v1_8/boot_menu/teavm/BootMenuDatastore.java index 1a82c64..19ecc95 100755 --- a/src/teavm-boot-menu/java/net/lax1dude/eaglercraft/v1_8/boot_menu/teavm/BootMenuDatastore.java +++ b/src/teavm-boot-menu/java/net/lax1dude/eaglercraft/v1_8/boot_menu/teavm/BootMenuDatastore.java @@ -314,7 +314,7 @@ public class BootMenuDatastore { @Override public void handleEvent() { IDBCursor c = r.getResult(); - if(c == null || c.getKey() == null || c.getValue() == null) { + if(c == null || c.getKey() == null) { cb.complete(res[0]); return; } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java index e28fa91..3625881 100755 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java @@ -68,29 +68,34 @@ public class PlatformApplication { } public static void setClipboard(String text) { + boolean b = false; try { - setClipboard0(text); + b = setClipboard0(text); }catch(Throwable t) { PlatformRuntime.logger.error("Exception setting clipboard data"); + } + if(!b) { try { Window.prompt("Here is the text you're trying to copy:", text); }catch(Throwable t2) { } } } - + public static String getClipboard() { + String ret = null; try { - return getClipboard0(); + ret = getClipboard0(); }catch(Throwable t) { PlatformRuntime.logger.error("Exception getting clipboard data"); + } + if(ret == null) { try { - String ret = Window.prompt("Please enter the text to paste:"); - return ret != null ? ret : ""; + ret = Window.prompt("Please enter the text to paste:"); }catch(Throwable t2) { - return ""; } } + return ret != null ? ret : ""; } @JSFunctor @@ -114,11 +119,11 @@ public class PlatformApplication { }); } - @JSBody(params = { "cb" }, script = "if(!navigator.clipboard) { cb(prompt(\"Please enter the text to paste:\") || \"\"); } else if (!navigator.clipboard.readText) cb(\"\"); else navigator.clipboard.readText().then(function(s) { cb(s); }, function(s) { cb(\"\"); });") + @JSBody(params = { "cb" }, script = "if(!navigator.clipboard) { cb(null); } else if (!navigator.clipboard.readText) cb(null); else navigator.clipboard.readText().then(function(s) { cb(s || null); }, function() { cb(null); });") private static native void getClipboard1(StupidFunctionResolveString cb); - @JSBody(params = { "str" }, script = "if(navigator.clipboard) navigator.clipboard.writeText(str);") - private static native void setClipboard0(String str); + @JSBody(params = { "str" }, script = "if(navigator.clipboard) { navigator.clipboard.writeText(str); return true; } else { return false; }") + private static native boolean setClipboard0(String str); public static void setLocalStorage(String name, byte[] data) { setLocalStorage(name, data, true); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index b0c704d..8a6cd75 100755 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -252,7 +252,7 @@ public class PlatformRuntime { } useVisualViewport = false; - if(isVisualViewportSupported(System.currentTimeMillis())) { + if(isVisualViewportSupported()) { if(isEmbeddedInBody) { useVisualViewport = true; }else { @@ -525,8 +525,8 @@ public class PlatformRuntime { return EnumPlatformOS.getFromUA(getUserAgentString()); } - @JSBody(params = { "ts" }, script = "if(ts > 1728322572561 && window[decodeURIComponent(\"%6C%6F%63%61%74%69%6F%6E\")][decodeURIComponent(\"%68%6F%73%74%6E%61%6D%65\")] === decodeURIComponent(\"%65%61%67%6C%65%72%63%72%61%66%74%2E%64%65%76\")) setTimeout(function() { var i = 1; while(i > 0) { ++i; } }, 353000); return (typeof visualViewport !== \"undefined\");") - private static native boolean isVisualViewportSupported(double ts); + @JSBody(params = { }, script = "return (typeof visualViewport !== \"undefined\");") + private static native boolean isVisualViewportSupported(); @JSBody(params = { }, script = "return visualViewport;") static native VisualViewport getVisualViewport(); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java index a86d8cc..6b793bc 100755 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/EarlyLoadScreen.java @@ -279,6 +279,10 @@ public class EarlyLoadScreen { } public static void loadFinal(byte[] image) { + ImageData img = PlatformAssets.loadImageFile(image); + if(img == null) { + return; + } finalTexture = _wglGenTextures(); _wglActiveTexture(GL_TEXTURE0); _wglBindTexture(GL_TEXTURE_2D, finalTexture); @@ -286,11 +290,10 @@ public class EarlyLoadScreen { _wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); _wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); _wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - ImageData img = PlatformAssets.loadImageFile(image); - IntBuffer upload = PlatformRuntime.allocateIntBuffer(256*256); + IntBuffer upload = PlatformRuntime.allocateIntBuffer(img.width * img.height); upload.put(img.pixels); upload.flip(); - _wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, upload); + _wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width, img.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, upload); PlatformRuntime.freeIntBuffer(upload); } diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/IndexedDBFilesystem.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/IndexedDBFilesystem.java index 3445065..b38ddf4 100755 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/IndexedDBFilesystem.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/internal/teavm/IndexedDBFilesystem.java @@ -290,7 +290,7 @@ public class IndexedDBFilesystem implements IEaglerFilesystem { @Override public void handleEvent() { IDBCursor c = r.getResult(); - if(c == null || c.getKey() == null || c.getValue() == null) { + if(c == null || c.getKey() == null) { cb.complete(res[0]); return; }